OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library js_tree_ir_builder; | 5 library js_tree_ir_builder; |
6 | 6 |
7 import '../../tree_ir/tree_ir_builder.dart' show Builder; | 7 import '../../tree_ir/tree_ir_builder.dart' show Builder; |
8 import 'glue.dart' show Glue; | 8 import 'glue.dart' show Glue; |
9 import '../../dart2jslib.dart' show Selector, InternalErrorFunction; | 9 import '../../dart2jslib.dart' show Selector, InternalErrorFunction; |
10 import '../../elements/elements.dart'; | 10 import '../../elements/elements.dart'; |
(...skipping 24 matching lines...) Expand all Loading... | |
35 Expression visitIdentical(cps_ir.Identical node) { | 35 Expression visitIdentical(cps_ir.Identical node) { |
36 return new InvokeStatic( | 36 return new InvokeStatic( |
37 identicalFunction, | 37 identicalFunction, |
38 identicalSelector, | 38 identicalSelector, |
39 <Expression>[getVariableUse(node.left), | 39 <Expression>[getVariableUse(node.left), |
40 getVariableUse(node.right)])..isEffectivelyConstant = true; | 40 getVariableUse(node.right)])..isEffectivelyConstant = true; |
41 } | 41 } |
42 | 42 |
43 Expression visitInterceptor(cps_ir.Interceptor node) { | 43 Expression visitInterceptor(cps_ir.Interceptor node) { |
44 Element getInterceptor = _glue.getInterceptorMethod; | 44 Element getInterceptor = _glue.getInterceptorMethod; |
45 String name = _glue.getInterceptorName(node.interceptedClasses); | 45 // TODO(asgerf): Do not use selectors here. |
46 Selector selector = new Selector.call(name, null, 1); | 46 Selector selector = new Selector.call("getInterceptor", null, 1); |
floitsch
2015/06/22 17:43:44
There should be a better way to get the name of th
herhut
2015/06/23 13:26:30
You can ask the namer for a backend-name but that
| |
47 _glue.registerUseInterceptorInCodegen(); | 47 _glue.registerUseInterceptorInCodegen(); |
48 return new InvokeStatic( | 48 return new InvokeStatic( |
49 getInterceptor, | 49 getInterceptor, |
50 selector, | 50 selector, |
51 <Expression>[getVariableUse(node.input)])..isEffectivelyConstant = true; | 51 <Expression>[getVariableUse(node.input)])..isEffectivelyConstant = true; |
52 } | 52 } |
53 | 53 |
54 Expression visitGetField(cps_ir.GetField node) { | 54 Expression visitGetField(cps_ir.GetField node) { |
55 return new GetField(getVariableUse(node.object), node.field); | 55 return new GetField(getVariableUse(node.object), node.field); |
56 } | 56 } |
(...skipping 15 matching lines...) Expand all Loading... | |
72 node.classElement, | 72 node.classElement, |
73 node.arguments.map(getVariableUse).toList(growable: false), | 73 node.arguments.map(getVariableUse).toList(growable: false), |
74 node.typeInformation.map(getVariableUse).toList(growable: false)); | 74 node.typeInformation.map(getVariableUse).toList(growable: false)); |
75 } | 75 } |
76 | 76 |
77 Expression visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { | 77 Expression visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { |
78 return new CreateInvocationMirror(node.selector, | 78 return new CreateInvocationMirror(node.selector, |
79 node.arguments.map(getVariableUse).toList(growable: false)); | 79 node.arguments.map(getVariableUse).toList(growable: false)); |
80 } | 80 } |
81 } | 81 } |
OLD | NEW |