| 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 30 matching lines...) Expand all Loading... |
| 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 _glue.registerUseInterceptorInCodegen(); | 45 _glue.registerUseInterceptorInCodegen(); |
| 46 return new InvokeStatic( | 46 return new InvokeStatic( |
| 47 getInterceptor, | 47 getInterceptor, |
| 48 new Selector.fromElement(getInterceptor), | 48 new Selector.fromElement(getInterceptor), |
| 49 <Expression>[getVariableReference(node.input)]); | 49 <Expression>[getVariableReference(node.input)]); |
| 50 } | 50 } |
| 51 |
| 52 Expression visitGetField(cps_ir.GetField node) { |
| 53 return new GetField(getVariableReference(node.object), node.field); |
| 54 } |
| 55 |
| 56 Statement visitSetField(cps_ir.SetField node) { |
| 57 return new SetField(getVariableReference(node.object), |
| 58 node.field, |
| 59 getVariableReference(node.value), |
| 60 visit(node.body)); |
| 61 } |
| 62 |
| 63 Expression visitCreateBox(cps_ir.CreateBox node) { |
| 64 return new CreateBox(); |
| 65 } |
| 66 |
| 67 Expression visitCreateClosureClass(cps_ir.CreateClosureClass node) { |
| 68 return new CreateClosureClass( |
| 69 node.classElement, |
| 70 node.arguments.map(getVariableReference).toList()); |
| 71 } |
| 51 } | 72 } |
| OLD | NEW |