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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_rti.dart

Issue 14015004: Remove call-indirections from type tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index b98650308afdb07683a88cd271a12ca3f51750cb..b8f4e7d3b618e939118ada736e7a661a3f595984 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -108,11 +108,8 @@ substitute(var substitution, var arguments) {
* - [asField]: the name of the function that transforms the type
* arguments of [objects] to an instance of the class that we check
* against.
- * - [native]: [:true:] if we need to use calls (for handling native
- * objects).
*/
-bool checkSubtype(Object object, String isField, List checks, String asField,
- bool native) {
+bool checkSubtype(Object object, String isField, List checks, String asField) {
if (object == null) return false;
var arguments = getRuntimeTypeInfo(object);
// Interceptor is needed for JSArray and native classes.
@@ -120,15 +117,11 @@ bool checkSubtype(Object object, String isField, List checks, String asField,
// `null` or a primitive.
// TODO(9586): Move type info for static functions onto an interceptor.
var interceptor = isJsFunction(object) ? object : getInterceptor(object);
- bool isSubclass = native
- ? call(interceptor, isField)
- : getField(interceptor, isField);
+ bool isSubclass = getField(interceptor, isField);
// When we read the field and it is not there, [isSubclass] will be [:null:].
if (isSubclass == null || !isSubclass) return false;
// Should the asField function be passed the receiver?
- var substitution = native
- ? call(interceptor, asField)
- : getField(interceptor, asField);
+ var substitution = getField(interceptor, asField);
return checkArguments(substitution, arguments, checks);
}

Powered by Google App Engine
This is Rietveld 408576698