Chromium Code Reviews| 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); |