Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: runtime/vm/object.h

Issue 10579033: Fix type test elimination of function types using static type propagation in (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 8880)
+++ runtime/vm/object.h (working copy)
@@ -1468,8 +1468,27 @@
bool IsSubtypeOf(const AbstractTypeArguments& type_arguments,
const Function& other,
const AbstractTypeArguments& other_type_arguments,
- Error* malformed_error) const;
+ Error* malformed_error) const {
+ return TypeTest(kIsSubtypeOf,
+ type_arguments,
+ other,
+ other_type_arguments,
+ malformed_error);
+ }
+ // Returns true if the type of this function is more specific than the type of
+ // the other function.
+ bool IsMoreSpecificThan(const AbstractTypeArguments& type_arguments,
+ const Function& other,
+ const AbstractTypeArguments& other_type_arguments,
+ Error* malformed_error) const {
+ return TypeTest(kIsMoreSpecificThan,
+ type_arguments,
+ other,
+ other_type_arguments,
+ malformed_error);
+ }
+
// Returns true if this function represents a (possibly implicit) closure
// function.
bool IsClosureFunction() const {
@@ -1542,15 +1561,22 @@
RawString* BuildSignature(bool instantiate,
const AbstractTypeArguments& instantiator) const;
+ // Check the subtype or 'more specific' relationship.
+ bool TypeTest(TypeTestKind test_kind,
+ const AbstractTypeArguments& type_arguments,
+ const Function& other,
+ const AbstractTypeArguments& other_type_arguments,
+ Error* malformed_error) const;
+
// Checks the type of the formal parameter at the given position for
- // assignability relationship between the type of this function and the type
- // of the other function.
- bool TestParameterType(
- intptr_t parameter_position,
- const AbstractTypeArguments& type_arguments,
- const Function& other,
- const AbstractTypeArguments& other_type_arguments,
- Error* malformed_error) const;
+ // subtyping or 'more specific' relationship between the type of this function
+ // and the type of the other function.
+ bool TestParameterType(TypeTestKind test_kind,
+ intptr_t parameter_position,
+ const AbstractTypeArguments& type_arguments,
+ const Function& other,
+ const AbstractTypeArguments& other_type_arguments,
+ Error* malformed_error) const;
HEAP_OBJECT_IMPLEMENTATION(Function, Object);
friend class Class;
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698