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

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

Issue 1154353003: Update invariant for unresolved (static) get. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after
3291 /// Generate read access of an unresolved static or top level entity. 3291 /// Generate read access of an unresolved static or top level entity.
3292 void generateStaticUnresolvedGet(ast.Send node, Element element) { 3292 void generateStaticUnresolvedGet(ast.Send node, Element element) {
3293 if (element is ErroneousElement) { 3293 if (element is ErroneousElement) {
3294 // An erroneous element indicates an unresolved static getter. 3294 // An erroneous element indicates an unresolved static getter.
3295 generateThrowNoSuchMethod( 3295 generateThrowNoSuchMethod(
3296 node, 3296 node,
3297 noSuchMethodTargetSymbolString(element, 'get'), 3297 noSuchMethodTargetSymbolString(element, 'get'),
3298 argumentNodes: const Link<ast.Node>()); 3298 argumentNodes: const Link<ast.Node>());
3299 } else { 3299 } else {
3300 // This happens when [element] has parse errors. 3300 // This happens when [element] has parse errors.
3301 assert(invariant(node, element.isErroneous)); 3301 assert(invariant(node, element == null || element.isErroneous));
3302 // TODO(ahe): Do something like the above, that is, emit a runtime 3302 // TODO(ahe): Do something like the above, that is, emit a runtime
3303 // error. 3303 // error.
3304 stack.add(graph.addConstantNull(compiler)); 3304 stack.add(graph.addConstantNull(compiler));
3305 } 3305 }
3306 } 3306 }
3307 3307
3308 /// Read a static or top level [field] of constant value. 3308 /// Read a static or top level [field] of constant value.
3309 void generateStaticConstGet( 3309 void generateStaticConstGet(
3310 ast.Send node, 3310 ast.Send node,
3311 FieldElement field, 3311 FieldElement field,
(...skipping 4532 matching lines...) Expand 10 before | Expand all | Expand 10 after
7844 if (unaliased is TypedefType) throw 'unable to unalias $type'; 7844 if (unaliased is TypedefType) throw 'unable to unalias $type';
7845 unaliased.accept(this, builder); 7845 unaliased.accept(this, builder);
7846 } 7846 }
7847 7847
7848 void visitDynamicType(DynamicType type, SsaBuilder builder) { 7848 void visitDynamicType(DynamicType type, SsaBuilder builder) {
7849 JavaScriptBackend backend = builder.compiler.backend; 7849 JavaScriptBackend backend = builder.compiler.backend;
7850 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 7850 ClassElement cls = backend.findHelper('DynamicRuntimeType');
7851 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 7851 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
7852 } 7852 }
7853 } 7853 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698