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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 23003031: Extract interceptor calls from raw is-checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix optimization of interceptors for HIs. Created 7 years, 4 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/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 7a809b704837a6196034428490b1419483c962a2..6bf39b4bc3d3749b1b4c4b0a2856ee5263d9368e 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1284,6 +1284,23 @@ class JavaScriptBackend extends Backend {
}
}
+ /**
+ * Returns [:true:] if the checking of [type] is performed directly on the
+ * object and not on an interceptor.
+ */
+ bool hasDirectCheckFor(DartType type) {
+ Element element = type.element;
+ return element == compiler.stringClass ||
+ element == compiler.boolClass ||
+ element == compiler.numClass ||
+ element == compiler.intClass ||
+ element == compiler.doubleClass ||
+ element == jsArrayClass ||
+ element == jsMutableArrayClass ||
+ element == jsExtendableArrayClass ||
+ element == jsFixedArrayClass;
+ }
+
Element getExceptionUnwrapper() {
return compiler.findHelper(const SourceString('unwrapException'));
}

Powered by Google App Engine
This is Rietveld 408576698