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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1222913003: dart2js cps: Support JS_CURRENT_ISOLATE. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Status file changes after change. Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after
3175 validateArgumentCount(exactly: 2); 3175 validateArgumentCount(exactly: 2);
3176 List<ir.Primitive> arguments = argumentNodes.mapToList(visit); 3176 List<ir.Primitive> arguments = argumentNodes.mapToList(visit);
3177 return irBuilder.buildStringConcatenation(arguments); 3177 return irBuilder.buildStringConcatenation(arguments);
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 continue GET_CURRENT_ISOLATE;
3186 return irBuilder.buildForeignCode(js.js.parseForeignJS(name),
3187 const <ir.Primitive>[], NativeBehavior.PURE);
3188 } 3186 }
3189 return buildIsolateHelperInvocation('_currentIsolate', 3187 return buildIsolateHelperInvocation('_currentIsolate',
3190 CallStructure.NO_ARGS); 3188 CallStructure.NO_ARGS);
3191 3189
3190 GET_CURRENT_ISOLATE: case 'JS_CURRENT_ISOLATE':
3191 validateArgumentCount(exactly: 0);
3192
3193 return irBuilder.buildForeignCode(
3194 js.js.parseForeignJS(backend.namer.currentIsolate),
3195 const <ir.Primitive>[],
3196 NativeBehavior.PURE);
3197
3192 case 'JS_CALL_IN_ISOLATE': 3198 case 'JS_CALL_IN_ISOLATE':
3193 validateArgumentCount(exactly: 2); 3199 validateArgumentCount(exactly: 2);
3194 3200
3195 if (!compiler.hasIsolateSupport) { 3201 if (!compiler.hasIsolateSupport) {
3196 ir.Primitive closure = visit(argumentNodes.tail.head); 3202 ir.Primitive closure = visit(argumentNodes.tail.head);
3197 return irBuilder.buildCallInvocation(closure, CallStructure.NO_ARGS, 3203 return irBuilder.buildCallInvocation(closure, CallStructure.NO_ARGS,
3198 const <ir.Primitive>[]); 3204 const <ir.Primitive>[]);
3199 } 3205 }
3200 return buildIsolateHelperInvocation('_callInIsolate', 3206 return buildIsolateHelperInvocation('_callInIsolate',
3201 CallStructure.TWO_ARGS); 3207 CallStructure.TWO_ARGS);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
3273 } 3279 }
3274 3280
3275 processSetStatic(ir.SetStatic node) { 3281 processSetStatic(ir.SetStatic node) {
3276 node.body = replacementFor(node.body); 3282 node.body = replacementFor(node.body);
3277 } 3283 }
3278 3284
3279 processContinuation(ir.Continuation node) { 3285 processContinuation(ir.Continuation node) {
3280 node.body = replacementFor(node.body); 3286 node.body = replacementFor(node.body);
3281 } 3287 }
3282 } 3288 }
OLDNEW
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698