OLD | NEW |
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 4147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4158 } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') { | 4158 } else if (name == 'JS_CURRENT_ISOLATE_CONTEXT') { |
4159 handleForeignJsCurrentIsolateContext(node); | 4159 handleForeignJsCurrentIsolateContext(node); |
4160 } else if (name == 'JS_CALL_IN_ISOLATE') { | 4160 } else if (name == 'JS_CALL_IN_ISOLATE') { |
4161 handleForeignJsCallInIsolate(node); | 4161 handleForeignJsCallInIsolate(node); |
4162 } else if (name == 'DART_CLOSURE_TO_JS') { | 4162 } else if (name == 'DART_CLOSURE_TO_JS') { |
4163 handleForeignDartClosureToJs(node, 'DART_CLOSURE_TO_JS'); | 4163 handleForeignDartClosureToJs(node, 'DART_CLOSURE_TO_JS'); |
4164 } else if (name == 'RAW_DART_FUNCTION_REF') { | 4164 } else if (name == 'RAW_DART_FUNCTION_REF') { |
4165 handleForeignRawFunctionRef(node, 'RAW_DART_FUNCTION_REF'); | 4165 handleForeignRawFunctionRef(node, 'RAW_DART_FUNCTION_REF'); |
4166 } else if (name == 'JS_SET_CURRENT_ISOLATE') { | 4166 } else if (name == 'JS_SET_CURRENT_ISOLATE') { |
4167 handleForeignSetCurrentIsolate(node); | 4167 handleForeignSetCurrentIsolate(node); |
4168 } else if (name == 'JS_OBJECT_CLASS_NAME') { | |
4169 // TODO(floitsch): this should be a JS_NAME. | |
4170 String name = backend.namer.runtimeTypeName(compiler.objectClass); | |
4171 stack.add(addConstantString(name)); | |
4172 } else if (name == 'JS_NULL_CLASS_NAME') { | |
4173 // TODO(floitsch): this should be a JS_NAME. | |
4174 String name = backend.namer.runtimeTypeName(compiler.nullClass); | |
4175 stack.add(addConstantString(name)); | |
4176 } else if (name == 'JS_OPERATOR_AS_PREFIX') { | 4168 } else if (name == 'JS_OPERATOR_AS_PREFIX') { |
4177 // TODO(floitsch): this should be a JS_NAME. | 4169 // TODO(floitsch): this should be a JS_NAME. |
4178 stack.add(addConstantString(backend.namer.operatorAsPrefix)); | 4170 stack.add(addConstantString(backend.namer.operatorAsPrefix)); |
4179 } else if (name == 'JS_SIGNATURE_NAME') { | 4171 } else if (name == 'JS_SIGNATURE_NAME') { |
4180 // TODO(floitsch): this should be a JS_NAME. | 4172 // TODO(floitsch): this should be a JS_NAME. |
4181 stack.add(addConstantString(backend.namer.operatorSignature)); | 4173 stack.add(addConstantString(backend.namer.operatorSignature)); |
4182 } else if (name == 'JS_TYPEDEF_TAG') { | 4174 } else if (name == 'JS_TYPEDEF_TAG') { |
4183 // TODO(floitsch): this should be a JS_NAME. | 4175 // TODO(floitsch): this should be a JS_NAME. |
4184 stack.add(addConstantString(backend.namer.typedefTag)); | 4176 stack.add(addConstantString(backend.namer.typedefTag)); |
4185 } else if (name == 'JS_FUNCTION_TYPE_VOID_RETURN_TAG') { | 4177 } else if (name == 'JS_FUNCTION_TYPE_VOID_RETURN_TAG') { |
(...skipping 3482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7668 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 7660 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
7669 unaliased.accept(this, builder); | 7661 unaliased.accept(this, builder); |
7670 } | 7662 } |
7671 | 7663 |
7672 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 7664 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
7673 JavaScriptBackend backend = builder.compiler.backend; | 7665 JavaScriptBackend backend = builder.compiler.backend; |
7674 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 7666 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
7675 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 7667 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
7676 } | 7668 } |
7677 } | 7669 } |
OLD | NEW |