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

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

Issue 1335983004: Add ImportElement and ExportElement (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | pkg/compiler/lib/src/tree/unparser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | pkg/compiler/lib/src/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698