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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 256453004: Avoid inlining constants that are used via a deferred import. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use intermediate constants. Created 6 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
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 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBitAnd(HBitAnd node); 9 R visitBitAnd(HBitAnd node);
10 R visitBitNot(HBitNot node); 10 R visitBitNot(HBitNot node);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 result = new HConstant.internal(constant, type); 177 result = new HConstant.internal(constant, type);
178 entry.addAtExit(result); 178 entry.addAtExit(result);
179 constants[constant] = result; 179 constants[constant] = result;
180 } else if (result.block == null) { 180 } else if (result.block == null) {
181 // The constant was not used anymore. 181 // The constant was not used anymore.
182 entry.addAtExit(result); 182 entry.addAtExit(result);
183 } 183 }
184 return result; 184 return result;
185 } 185 }
186 186
187 HConstant addDeferredConstant(Constant constant, PrefixElement prefix, Compile r compiler) {
Johnni Winther 2014/04/28 11:58:31 Long line.
sigurdm 2014/04/28 12:07:48 Done.
188 Constant wrapper = new DeferredConstant(constant,
189 prefix);
Johnni Winther 2014/04/28 11:58:31 Put this on one line.
sigurdm 2014/04/28 12:07:48 Done.
190 compiler.deferredLoadTask.registerConstantDeferredUse(wrapper, prefix);
191 return addConstant(wrapper, compiler);
192 }
193
187 HConstant addConstantInt(int i, Compiler compiler) { 194 HConstant addConstantInt(int i, Compiler compiler) {
188 return addConstant(compiler.backend.constantSystem.createInt(i), compiler); 195 return addConstant(compiler.backend.constantSystem.createInt(i), compiler);
189 } 196 }
190 197
191 HConstant addConstantDouble(double d, Compiler compiler) { 198 HConstant addConstantDouble(double d, Compiler compiler) {
192 return addConstant( 199 return addConstant(
193 compiler.backend.constantSystem.createDouble(d), compiler); 200 compiler.backend.constantSystem.createDouble(d), compiler);
194 } 201 }
195 202
196 HConstant addConstantString(ast.DartString str, 203 HConstant addConstantString(ast.DartString str,
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
3025 class HDynamicType extends HRuntimeType { 3032 class HDynamicType extends HRuntimeType {
3026 HDynamicType(DynamicType dartType, TypeMask instructionType) 3033 HDynamicType(DynamicType dartType, TypeMask instructionType)
3027 : super(const <HInstruction>[], dartType, instructionType); 3034 : super(const <HInstruction>[], dartType, instructionType);
3028 3035
3029 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3036 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3030 3037
3031 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3038 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3032 3039
3033 bool typeEquals(HInstruction other) => other is HDynamicType; 3040 bool typeEquals(HInstruction other) => other is HDynamicType;
3034 } 3041 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698