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

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

Issue 1109393012: Allow use of deferred type-literals in non-constant contexts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/nodes.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 SsaCodeGeneratorTask generator; 8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder; 9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer; 10 SsaOptimizerTask optimizer;
(...skipping 5080 matching lines...) Expand 10 before | Expand all | Expand 10 after
5091 ConstantExpression constant, 5091 ConstantExpression constant,
5092 ast.NodeList arguments, 5092 ast.NodeList arguments,
5093 CallStructure callStructure, 5093 CallStructure callStructure,
5094 _) { 5094 _) {
5095 generateConstantTypeLiteral(node); 5095 generateConstantTypeLiteral(node);
5096 generateTypeLiteralCall(node); 5096 generateTypeLiteralCall(node);
5097 } 5097 }
5098 5098
5099 /// Generate the constant value for a constant type literal. 5099 /// Generate the constant value for a constant type literal.
5100 void generateConstantTypeLiteral(ast.Send node) { 5100 void generateConstantTypeLiteral(ast.Send node) {
5101 generateIsDeferredLoadedCheckIfNeeded(node);
5101 // TODO(karlklose): add type representation 5102 // TODO(karlklose): add type representation
5102 if (node.isCall) { 5103 if (node.isCall) {
5103 // The node itself is not a constant but we register the selector (the 5104 // The node itself is not a constant but we register the selector (the
5104 // identifier that refers to the class/typedef) as a constant. 5105 // identifier that refers to the class/typedef) as a constant.
5105 stack.add(addConstant(node.selector)); 5106 stack.add(addConstant(node.selector));
5106 } else { 5107 } else {
5107 stack.add(addConstant(node)); 5108 stack.add(addConstant(node));
5108 } 5109 }
5109 } 5110 }
5110 5111
(...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after
7587 if (unaliased is TypedefType) throw 'unable to unalias $type'; 7588 if (unaliased is TypedefType) throw 'unable to unalias $type';
7588 unaliased.accept(this, builder); 7589 unaliased.accept(this, builder);
7589 } 7590 }
7590 7591
7591 void visitDynamicType(DynamicType type, SsaBuilder builder) { 7592 void visitDynamicType(DynamicType type, SsaBuilder builder) {
7592 JavaScriptBackend backend = builder.compiler.backend; 7593 JavaScriptBackend backend = builder.compiler.backend;
7593 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 7594 ClassElement cls = backend.findHelper('DynamicRuntimeType');
7594 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 7595 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
7595 } 7596 }
7596 } 7597 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698