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

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

Issue 2620023002: Use elements/types in constants/values (Closed)
Patch Set: Created 3 years, 11 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 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
8 import '../common/tasks.dart' show CompilerTask; 8 import '../common/tasks.dart' show CompilerTask;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constant_system.dart'; 10 import '../constants/constant_system.dart';
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 ConstantValue constant, SourceInformation sourceInformation) { 2063 ConstantValue constant, SourceInformation sourceInformation) {
2064 if (constant.isFunction) { 2064 if (constant.isFunction) {
2065 FunctionConstantValue function = constant; 2065 FunctionConstantValue function = constant;
2066 registry.registerStaticUse(new StaticUse.staticTearOff(function.element)); 2066 registry.registerStaticUse(new StaticUse.staticTearOff(function.element));
2067 } 2067 }
2068 if (constant.isType) { 2068 if (constant.isType) {
2069 // If the type is a web component, we need to ensure the constructors are 2069 // If the type is a web component, we need to ensure the constructors are
2070 // available to 'upgrade' the native object. 2070 // available to 'upgrade' the native object.
2071 TypeConstantValue type = constant; 2071 TypeConstantValue type = constant;
2072 if (type.representedType.isInterfaceType) { 2072 if (type.representedType.isInterfaceType) {
2073 registry.registerTypeConstant(type.representedType.element); 2073 InterfaceType representedType = type.representedType;
2074 registry.registerTypeConstant(representedType.element);
2074 } 2075 }
2075 } 2076 }
2076 js.Expression expression = backend.emitter.constantReference(constant); 2077 js.Expression expression = backend.emitter.constantReference(constant);
2077 if (!constant.isDummy) { 2078 if (!constant.isDummy) {
2078 // TODO(johnniwinther): Support source information on synthetic constants. 2079 // TODO(johnniwinther): Support source information on synthetic constants.
2079 expression = expression.withSourceInformation(sourceInformation); 2080 expression = expression.withSourceInformation(sourceInformation);
2080 } 2081 }
2081 push(expression); 2082 push(expression);
2082 } 2083 }
2083 2084
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 registry.registerStaticUse(new StaticUse.staticInvoke( 3120 registry.registerStaticUse(new StaticUse.staticInvoke(
3120 helper, new CallStructure.unnamed(argumentCount))); 3121 helper, new CallStructure.unnamed(argumentCount)));
3121 return backend.emitter.staticFunctionAccess(helper); 3122 return backend.emitter.staticFunctionAccess(helper);
3122 } 3123 }
3123 3124
3124 @override 3125 @override
3125 void visitRef(HRef node) { 3126 void visitRef(HRef node) {
3126 visit(node.value); 3127 visit(node.value);
3127 } 3128 }
3128 } 3129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698