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

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

Issue 1238783003: Handle deferred access as pre-step in SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
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 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 TypeMask type = 3410 TypeMask type =
3411 TypeMaskFactory.inferredTypeForElement(field, compiler); 3411 TypeMaskFactory.inferredTypeForElement(field, compiler);
3412 if (!type.containsAll(compiler.world) && 3412 if (!type.containsAll(compiler.world) &&
3413 !instruction.isConstantNull()) { 3413 !instruction.isConstantNull()) {
3414 // TODO(13429): The inferrer should know that an element 3414 // TODO(13429): The inferrer should know that an element
3415 // cannot be null. 3415 // cannot be null.
3416 instruction.instructionType = type.nonNullable(); 3416 instruction.instructionType = type.nonNullable();
3417 } 3417 }
3418 } 3418 }
3419 3419
3420 @override
3421 void visitDeferredAccess(ast.Send node, PrefixElement prefix, _) {
3422 generateIsDeferredLoadedCheckIfNeeded(prefix, node);
sigurdm 2015/07/20 07:52:21 Remove the check from all covered cases.
Johnni Winther 2015/07/20 08:53:53 Done.
3423 }
3424
3420 /// Read a static or top level [field]. 3425 /// Read a static or top level [field].
3421 void generateStaticFieldGet(ast.Send node, FieldElement field) { 3426 void generateStaticFieldGet(ast.Send node, FieldElement field) {
3422 generateIsDeferredLoadedCheckOfSend(node); 3427 generateIsDeferredLoadedCheckOfSend(node);
3423 3428
3424 ConstantExpression constant = 3429 ConstantExpression constant =
3425 backend.constants.getConstantForVariable(field); 3430 backend.constants.getConstantForVariable(field);
3426 SourceInformation sourceInformation = 3431 SourceInformation sourceInformation =
3427 sourceInformationBuilder.buildGet(node); 3432 sourceInformationBuilder.buildGet(node);
3428 if (constant != null) { 3433 if (constant != null) {
3429 if (!field.isAssignable) { 3434 if (!field.isAssignable) {
(...skipping 5429 matching lines...) Expand 10 before | Expand all | Expand 10 after
8859 if (unaliased is TypedefType) throw 'unable to unalias $type'; 8864 if (unaliased is TypedefType) throw 'unable to unalias $type';
8860 unaliased.accept(this, builder); 8865 unaliased.accept(this, builder);
8861 } 8866 }
8862 8867
8863 void visitDynamicType(DynamicType type, SsaBuilder builder) { 8868 void visitDynamicType(DynamicType type, SsaBuilder builder) {
8864 JavaScriptBackend backend = builder.compiler.backend; 8869 JavaScriptBackend backend = builder.compiler.backend;
8865 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 8870 ClassElement cls = backend.findHelper('DynamicRuntimeType');
8866 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 8871 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
8867 } 8872 }
8868 } 8873 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698