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

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

Issue 23003031: Extract interceptor calls from raw is-checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index f1f7953b31ec098d928e1b9f4e819b9ed0ddde4f..f31212aaf4d8ca83b9d3d6a402bb07acaaf4aa22 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -3027,7 +3027,7 @@ class CodeEmitterTask extends CompilerTask {
void emitGetInterceptorMethod(CodeBuffer buffer,
String key,
- Iterable<ClassElement> classes) {
+ Set<ClassElement> classes) {
jsAst.Statement buildReturnInterceptor(ClassElement cls) {
return js.return_(js(namer.isolateAccess(cls))['prototype']);
}
@@ -3102,7 +3102,7 @@ class CodeEmitterTask extends CompilerTask {
}
if (hasInt) hasNumber = true;
- if (classes == backend.interceptedClasses) {
+ if (classes.containsAll(backend.interceptedClasses)) {
// I.e. this is the general interceptor.
hasNative = anyNativeClasses;
}
@@ -3192,9 +3192,10 @@ class CodeEmitterTask extends CompilerTask {
* Emit all versions of the [:getInterceptor:] method.
*/
void emitGetInterceptorMethods(CodeBuffer buffer) {
- var specializedGetInterceptors = backend.specializedGetInterceptors;
+ Map<String, Set<ClassElement>> specializedGetInterceptors =
+ backend.specializedGetInterceptors;
for (String name in specializedGetInterceptors.keys.toList()..sort()) {
- Iterable<ClassElement> classes = specializedGetInterceptors[name];
+ Set<ClassElement> classes = specializedGetInterceptors[name];
emitGetInterceptorMethod(buffer, name, classes);
}
}

Powered by Google App Engine
This is Rietveld 408576698