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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 868283005: dart2js: make "CREATE_JS_ISOLATE" an embedded global. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 SsaCodeGeneratorTask generator; 8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder; 9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer; 10 SsaOptimizerTask optimizer;
(...skipping 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 visit(node.arguments.head); 3877 visit(node.arguments.head);
3878 String isolateName = backend.namer.currentIsolate; 3878 String isolateName = backend.namer.currentIsolate;
3879 SideEffects sideEffects = new SideEffects.empty(); 3879 SideEffects sideEffects = new SideEffects.empty();
3880 sideEffects.setAllSideEffects(); 3880 sideEffects.setAllSideEffects();
3881 push(new HForeign(js.js.parseForeignJS("$isolateName = #"), 3881 push(new HForeign(js.js.parseForeignJS("$isolateName = #"),
3882 backend.dynamicType, 3882 backend.dynamicType,
3883 <HInstruction>[pop()], 3883 <HInstruction>[pop()],
3884 effects: sideEffects)); 3884 effects: sideEffects));
3885 } 3885 }
3886 3886
3887 void handleForeignCreateIsolate(ast.Send node) {
3888 if (!node.arguments.isEmpty) {
3889 compiler.internalError(node.argumentsNode, 'Too many arguments.');
3890 }
3891 String constructorName = backend.namer.isolateName;
3892 push(new HForeign(js.js.parseForeignJS("new $constructorName()"),
3893 backend.dynamicType,
3894 <HInstruction>[]));
3895 }
3896
3897 void handleForeignDartObjectJsConstructorFunction(ast.Send node) { 3887 void handleForeignDartObjectJsConstructorFunction(ast.Send node) {
3898 if (!node.arguments.isEmpty) { 3888 if (!node.arguments.isEmpty) {
3899 compiler.internalError(node.argumentsNode, 'Too many arguments.'); 3889 compiler.internalError(node.argumentsNode, 'Too many arguments.');
3900 } 3890 }
3901 push(new HForeign(js.js.expressionTemplateYielding( 3891 push(new HForeign(js.js.expressionTemplateYielding(
3902 backend.emitter.typeAccess(compiler.objectClass)), 3892 backend.emitter.typeAccess(compiler.objectClass)),
3903 backend.dynamicType, 3893 backend.dynamicType,
3904 <HInstruction>[])); 3894 <HInstruction>[]));
3905 } 3895 }
3906 3896
(...skipping 14 matching lines...) Expand all
3921 } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') { 3911 } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') {
3922 handleForeignJsCurrentIsolateContext(node); 3912 handleForeignJsCurrentIsolateContext(node);
3923 } else if (name == 'JS_CALL_IN_ISOLATE') { 3913 } else if (name == 'JS_CALL_IN_ISOLATE') {
3924 handleForeignJsCallInIsolate(node); 3914 handleForeignJsCallInIsolate(node);
3925 } else if (name == 'DART_CLOSURE_TO_JS') { 3915 } else if (name == 'DART_CLOSURE_TO_JS') {
3926 handleForeignDartClosureToJs(node, 'DART_CLOSURE_TO_JS'); 3916 handleForeignDartClosureToJs(node, 'DART_CLOSURE_TO_JS');
3927 } else if (name == 'RAW_DART_FUNCTION_REF') { 3917 } else if (name == 'RAW_DART_FUNCTION_REF') {
3928 handleForeignRawFunctionRef(node, 'RAW_DART_FUNCTION_REF'); 3918 handleForeignRawFunctionRef(node, 'RAW_DART_FUNCTION_REF');
3929 } else if (name == 'JS_SET_CURRENT_ISOLATE') { 3919 } else if (name == 'JS_SET_CURRENT_ISOLATE') {
3930 handleForeignSetCurrentIsolate(node); 3920 handleForeignSetCurrentIsolate(node);
3931 } else if (name == 'JS_CREATE_ISOLATE') {
3932 handleForeignCreateIsolate(node);
3933 } else if (name == 'JS_OPERATOR_IS_PREFIX') { 3921 } else if (name == 'JS_OPERATOR_IS_PREFIX') {
3934 // TODO(floitsch): this should be a JS_NAME. 3922 // TODO(floitsch): this should be a JS_NAME.
3935 stack.add(addConstantString(backend.namer.operatorIsPrefix)); 3923 stack.add(addConstantString(backend.namer.operatorIsPrefix));
3936 } else if (name == 'JS_OBJECT_CLASS_NAME') { 3924 } else if (name == 'JS_OBJECT_CLASS_NAME') {
3937 // TODO(floitsch): this should be a JS_NAME. 3925 // TODO(floitsch): this should be a JS_NAME.
3938 String name = backend.namer.getRuntimeTypeName(compiler.objectClass); 3926 String name = backend.namer.getRuntimeTypeName(compiler.objectClass);
3939 stack.add(addConstantString(name)); 3927 stack.add(addConstantString(name));
3940 } else if (name == 'JS_NULL_CLASS_NAME') { 3928 } else if (name == 'JS_NULL_CLASS_NAME') {
3941 // TODO(floitsch): this should be a JS_NAME. 3929 // TODO(floitsch): this should be a JS_NAME.
3942 String name = backend.namer.getRuntimeTypeName(compiler.nullClass); 3930 String name = backend.namer.getRuntimeTypeName(compiler.nullClass);
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
6884 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6872 if (unaliased is TypedefType) throw 'unable to unalias $type';
6885 unaliased.accept(this, builder); 6873 unaliased.accept(this, builder);
6886 } 6874 }
6887 6875
6888 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6876 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6889 JavaScriptBackend backend = builder.compiler.backend; 6877 JavaScriptBackend backend = builder.compiler.backend;
6890 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6878 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6891 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 6879 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
6892 } 6880 }
6893 } 6881 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | sdk/lib/_internal/compiler/js_lib/foreign_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698