| 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 4460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4471 'Exactly one argument required.'); | 4471 'Exactly one argument required.'); |
| 4472 } | 4472 } |
| 4473 visit(node.arguments.head); | 4473 visit(node.arguments.head); |
| 4474 String isolateName = backend.namer.staticStateHolder; | 4474 String isolateName = backend.namer.staticStateHolder; |
| 4475 SideEffects sideEffects = new SideEffects.empty(); | 4475 SideEffects sideEffects = new SideEffects.empty(); |
| 4476 sideEffects.setAllSideEffects(); | 4476 sideEffects.setAllSideEffects(); |
| 4477 push(new HForeignCode( | 4477 push(new HForeignCode( |
| 4478 js.js.parseForeignJS("$isolateName = #"), | 4478 js.js.parseForeignJS("$isolateName = #"), |
| 4479 backend.dynamicType, | 4479 backend.dynamicType, |
| 4480 <HInstruction>[pop()], | 4480 <HInstruction>[pop()], |
| 4481 nativeBehavior: native.NativeBehavior.PURE, | 4481 nativeBehavior: native.NativeBehavior.CHANGES_STATIC_PROPERTY, |
| 4482 effects: sideEffects)); | 4482 effects: sideEffects)); |
| 4483 } | 4483 } |
| 4484 | 4484 |
| 4485 void handleForeignJsGetStaticState(ast.Send node) { | 4485 void handleForeignJsGetStaticState(ast.Send node) { |
| 4486 if (!node.arguments.isEmpty) { | 4486 if (!node.arguments.isEmpty) { |
| 4487 reporter.internalError(node.argumentsNode, 'Too many arguments.'); | 4487 reporter.internalError(node.argumentsNode, 'Too many arguments.'); |
| 4488 } | 4488 } |
| 4489 push(new HForeignCode(js.js.parseForeignJS(backend.namer.staticStateHolder), | 4489 push(new HForeignCode(js.js.parseForeignJS(backend.namer.staticStateHolder), |
| 4490 backend.dynamicType, | 4490 backend.dynamicType, |
| 4491 <HInstruction>[])); | 4491 <HInstruction>[])); |
| (...skipping 4691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9183 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 9183 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 9184 unaliased.accept(this, builder); | 9184 unaliased.accept(this, builder); |
| 9185 } | 9185 } |
| 9186 | 9186 |
| 9187 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9187 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 9188 JavaScriptBackend backend = builder.compiler.backend; | 9188 JavaScriptBackend backend = builder.compiler.backend; |
| 9189 ClassElement cls = backend.helpers.DynamicRuntimeType; | 9189 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 9190 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9190 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 9191 } | 9191 } |
| 9192 } | 9192 } |
| OLD | NEW |