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 final SsaCodeGeneratorTask generator; | 8 final SsaCodeGeneratorTask generator; |
9 final SsaBuilderTask builder; | 9 final SsaBuilderTask builder; |
10 final SsaOptimizerTask optimizer; | 10 final SsaOptimizerTask optimizer; |
(...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4304 {'text': 'Error: Extra argument to JS_EMBEDDED_GLOBAL.'}); | 4304 {'text': 'Error: Extra argument to JS_EMBEDDED_GLOBAL.'}); |
4305 } | 4305 } |
4306 return; | 4306 return; |
4307 } | 4307 } |
4308 visit(globalNameNode); | 4308 visit(globalNameNode); |
4309 HInstruction globalNameHNode = pop(); | 4309 HInstruction globalNameHNode = pop(); |
4310 if (!globalNameHNode.isConstantString()) { | 4310 if (!globalNameHNode.isConstantString()) { |
4311 reporter.reportErrorMessage( | 4311 reporter.reportErrorMessage( |
4312 arguments[1], MessageKind.GENERIC, | 4312 arguments[1], MessageKind.GENERIC, |
4313 {'text': 'Error: Expected String as second argument ' | 4313 {'text': 'Error: Expected String as second argument ' |
4314 'to JS_EMBEDDED_GLOBAL.'}); | 4314 'to JS_EMBEDDED_GLOBAL. Found: ${globalNameHNode}'}); |
4315 return; | 4315 return; |
4316 } | 4316 } |
4317 HConstant hConstant = globalNameHNode; | 4317 HConstant hConstant = globalNameHNode; |
4318 StringConstantValue constant = hConstant.constant; | 4318 StringConstantValue constant = hConstant.constant; |
4319 String globalName = constant.primitiveValue.slowToString(); | 4319 String globalName = constant.primitiveValue.slowToString(); |
4320 js.Template expr = js.js.expressionTemplateYielding( | 4320 js.Template expr = js.js.expressionTemplateYielding( |
4321 backend.emitter.generateEmbeddedGlobalAccess(globalName)); | 4321 backend.emitter.generateEmbeddedGlobalAccess(globalName)); |
4322 native.NativeBehavior nativeBehavior = | 4322 native.NativeBehavior nativeBehavior = |
4323 compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node); | 4323 compiler.enqueuer.resolution.nativeEnqueuer.getNativeBehaviorOf(node); |
4324 TypeMask ssaType = | 4324 TypeMask ssaType = |
(...skipping 4673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8998 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 8998 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
8999 unaliased.accept(this, builder); | 8999 unaliased.accept(this, builder); |
9000 } | 9000 } |
9001 | 9001 |
9002 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9002 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
9003 JavaScriptBackend backend = builder.compiler.backend; | 9003 JavaScriptBackend backend = builder.compiler.backend; |
9004 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 9004 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
9005 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9005 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
9006 } | 9006 } |
9007 } | 9007 } |
OLD | NEW |