| 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 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3333 } | 3333 } |
| 3334 | 3334 |
| 3335 /// Inserts a call to checkDeferredIsLoaded for [prefixElement]. | 3335 /// Inserts a call to checkDeferredIsLoaded for [prefixElement]. |
| 3336 /// If [prefixElement] is [null] ndo nothing. | 3336 /// If [prefixElement] is [null] ndo nothing. |
| 3337 void generateIsDeferredLoadedCheckIfNeeded(PrefixElement prefixElement, | 3337 void generateIsDeferredLoadedCheckIfNeeded(PrefixElement prefixElement, |
| 3338 ast.Node location) { | 3338 ast.Node location) { |
| 3339 if (prefixElement == null) return; | 3339 if (prefixElement == null) return; |
| 3340 String loadId = | 3340 String loadId = |
| 3341 compiler.deferredLoadTask.getImportDeferName(location, prefixElement); | 3341 compiler.deferredLoadTask.getImportDeferName(location, prefixElement); |
| 3342 HInstruction loadIdConstant = addConstantString(loadId); | 3342 HInstruction loadIdConstant = addConstantString(loadId); |
| 3343 String uri = prefixElement.deferredImport.uri.dartString.slowToString(); | 3343 String uri = prefixElement.deferredImport.uri.toString(); |
| 3344 HInstruction uriConstant = addConstantString(uri); | 3344 HInstruction uriConstant = addConstantString(uri); |
| 3345 Element helper = backend.getCheckDeferredIsLoaded(); | 3345 Element helper = backend.getCheckDeferredIsLoaded(); |
| 3346 pushInvokeStatic(location, helper, [loadIdConstant, uriConstant]); | 3346 pushInvokeStatic(location, helper, [loadIdConstant, uriConstant]); |
| 3347 pop(); | 3347 pop(); |
| 3348 } | 3348 } |
| 3349 | 3349 |
| 3350 /// Inserts a call to checkDeferredIsLoaded if the send has a prefix that | 3350 /// Inserts a call to checkDeferredIsLoaded if the send has a prefix that |
| 3351 /// resolves to a deferred library. | 3351 /// resolves to a deferred library. |
| 3352 void generateIsDeferredLoadedCheckOfSend(ast.Send node) { | 3352 void generateIsDeferredLoadedCheckOfSend(ast.Send node) { |
| 3353 generateIsDeferredLoadedCheckIfNeeded( | 3353 generateIsDeferredLoadedCheckIfNeeded( |
| (...skipping 5585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8939 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 8939 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 8940 unaliased.accept(this, builder); | 8940 unaliased.accept(this, builder); |
| 8941 } | 8941 } |
| 8942 | 8942 |
| 8943 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 8943 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 8944 JavaScriptBackend backend = builder.compiler.backend; | 8944 JavaScriptBackend backend = builder.compiler.backend; |
| 8945 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 8945 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 8946 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 8946 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 8947 } | 8947 } |
| 8948 } | 8948 } |
| OLD | NEW |