| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.ir_builder_task; | 5 library dart2js.ir_builder_task; |
| 6 | 6 |
| 7 import '../closure.dart' as closurelib; | 7 import '../closure.dart' as closurelib; |
| 8 import '../closure.dart' hide ClosureScope; | 8 import '../closure.dart' hide ClosureScope; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 | 3178 |
| 3179 case 'JS_CURRENT_ISOLATE_CONTEXT': | 3179 case 'JS_CURRENT_ISOLATE_CONTEXT': |
| 3180 validateArgumentCount(exactly: 0); | 3180 validateArgumentCount(exactly: 0); |
| 3181 | 3181 |
| 3182 if (!compiler.hasIsolateSupport) { | 3182 if (!compiler.hasIsolateSupport) { |
| 3183 // If the isolate library is not used, we just generate code | 3183 // If the isolate library is not used, we just generate code |
| 3184 // to fetch the current isolate. | 3184 // to fetch the current isolate. |
| 3185 String name = backend.namer.currentIsolate; | 3185 String name = backend.namer.currentIsolate; |
| 3186 return irBuilder.buildForeignCode(js.js.parseForeignJS(name), | 3186 return irBuilder.buildForeignCode(js.js.parseForeignJS(name), |
| 3187 const <ir.Primitive>[], NativeBehavior.PURE); | 3187 const <ir.Primitive>[], NativeBehavior.PURE); |
| 3188 } else { | |
| 3189 return buildIsolateHelperInvocation('_currentIsolate', | |
| 3190 CallStructure.NO_ARGS); | |
| 3191 } | 3188 } |
| 3192 break; | 3189 return buildIsolateHelperInvocation('_currentIsolate', |
| 3190 CallStructure.NO_ARGS); |
| 3193 | 3191 |
| 3194 case 'JS_CALL_IN_ISOLATE': | 3192 case 'JS_CALL_IN_ISOLATE': |
| 3195 validateArgumentCount(exactly: 2); | 3193 validateArgumentCount(exactly: 2); |
| 3196 | 3194 |
| 3197 if (!compiler.hasIsolateSupport) { | 3195 if (!compiler.hasIsolateSupport) { |
| 3198 ir.Primitive closure = visit(argumentNodes.tail.head); | 3196 ir.Primitive closure = visit(argumentNodes.tail.head); |
| 3199 return irBuilder.buildCallInvocation(closure, CallStructure.NO_ARGS, | 3197 return irBuilder.buildCallInvocation(closure, CallStructure.NO_ARGS, |
| 3200 const <ir.Primitive>[]); | 3198 const <ir.Primitive>[]); |
| 3201 } else { | |
| 3202 return buildIsolateHelperInvocation('_callInIsolate', | |
| 3203 CallStructure.TWO_ARGS); | |
| 3204 } | 3199 } |
| 3205 break; | 3200 return buildIsolateHelperInvocation('_callInIsolate', |
| 3201 CallStructure.TWO_ARGS); |
| 3206 | 3202 |
| 3207 default: | 3203 default: |
| 3208 giveup(node, 'unplemented native construct: ${function.name}'); | 3204 giveup(node, 'unplemented native construct: ${function.name}'); |
| 3209 break; | 3205 break; |
| 3210 } | 3206 } |
| 3211 } | 3207 } |
| 3212 | 3208 |
| 3213 @override | 3209 @override |
| 3214 ir.Primitive handleStaticFunctionInvoke(ast.Send node, | 3210 ir.Primitive handleStaticFunctionInvoke(ast.Send node, |
| 3215 MethodElement function, | 3211 MethodElement function, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3277 } | 3273 } |
| 3278 | 3274 |
| 3279 processSetStatic(ir.SetStatic node) { | 3275 processSetStatic(ir.SetStatic node) { |
| 3280 node.body = replacementFor(node.body); | 3276 node.body = replacementFor(node.body); |
| 3281 } | 3277 } |
| 3282 | 3278 |
| 3283 processContinuation(ir.Continuation node) { | 3279 processContinuation(ir.Continuation node) { |
| 3284 node.body = replacementFor(node.body); | 3280 node.body = replacementFor(node.body); |
| 3285 } | 3281 } |
| 3286 } | 3282 } |
| OLD | NEW |