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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9355031: Improve List implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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: dart/frog/leg/ssa/builder.dart
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
index c74c887a0f4ef499225484b326e0b25dc78ff54e..2e5edca6404bbd67bb004c86bb8b87b6865f340b 100644
--- a/dart/frog/leg/ssa/builder.dart
+++ b/dart/frog/leg/ssa/builder.dart
@@ -55,6 +55,12 @@ class Interceptors {
return result;
}
+ Element getStaticSetInterceptor(SourceString name) {
+ String mangledName = "builtin\$set\$${name}";
+ Element result = compiler.findHelper(new SourceString(mangledName));
+ return result;
+ }
+
Element getOperatorInterceptor(Operator op) {
SourceString name = mapOperatorToMethodName(op);
Element result = compiler.findHelper(name);
@@ -1293,8 +1299,20 @@ class SsaBuilder implements Visitor {
visit(send.receiver);
receiver = pop();
}
- add(new HInvokeDynamicSetter(
- selector, null, dartSetterName, receiver, value));
+ Element staticInterceptor = null;
+ if (methodInterceptionEnabled) {
kasperl 2012/02/21 07:16:43 Would it make sense to move the methodInterception
ngeoffray 2012/02/21 10:41:45 I decided to put it on the compiler because the in
ahe 2012/02/21 23:03:25 I'll stay out of this discussion. It seems to me t
ngeoffray 2012/02/22 08:52:04 Why do you think it's temporary? The flag is for i
ahe 2012/02/22 08:58:30 I see. Another reason for me to stay out of this d
+ staticInterceptor =
+ interceptors.getStaticSetInterceptor(dartSetterName);
+ }
+ if (staticInterceptor != null) {
+ HStatic target = new HStatic(staticInterceptor);
+ add(target);
+ List<HInstruction> inputs = <HInstruction>[target, receiver, value];
+ add(new HInvokeInterceptor(selector, dartSetterName, true, inputs));
+ } else {
+ add(new HInvokeDynamicSetter(selector, null, dartSetterName,
+ receiver, value));
+ }
stack.add(value);
} else {
localsHandler.updateLocal(element, value);

Powered by Google App Engine
This is Rietveld 408576698