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

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

Issue 1334203002: Compute Compiler.proxyConstant on demand. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 HConstant constantInput = actualReceiver; 261 HConstant constantInput = actualReceiver;
262 ListConstantValue constant = constantInput.constant; 262 ListConstantValue constant = constantInput.constant;
263 return graph.addConstantInt(constant.length, compiler); 263 return graph.addConstantInt(constant.length, compiler);
264 } 264 }
265 Element element = backend.jsIndexableLength; 265 Element element = backend.jsIndexableLength;
266 bool isFixed = isFixedLength(actualReceiver.instructionType, compiler); 266 bool isFixed = isFixedLength(actualReceiver.instructionType, compiler);
267 TypeMask actualType = node.instructionType; 267 TypeMask actualType = node.instructionType;
268 ClassWorld classWorld = compiler.world; 268 ClassWorld classWorld = compiler.world;
269 TypeMask resultType = backend.positiveIntType; 269 TypeMask resultType = backend.positiveIntType;
270 // If we already have computed a more specific type, keep that type. 270 // If we already have computed a more specific type, keep that type.
271 if (actualType.satisfies(backend.jsUInt31Class, classWorld)) { 271 if (HInstruction.isInstanceOf(
272 actualType, backend.jsUInt31Class, classWorld)) {
272 resultType = backend.uint31Type; 273 resultType = backend.uint31Type;
273 } else if (actualType.satisfies(backend.jsUInt32Class, classWorld)) { 274 } else if (HInstruction.isInstanceOf(
275 actualType, backend.jsUInt32Class, classWorld)) {
274 resultType = backend.uint32Type; 276 resultType = backend.uint32Type;
275 } 277 }
276 HFieldGet result = new HFieldGet( 278 HFieldGet result = new HFieldGet(
277 element, actualReceiver, resultType, 279 element, actualReceiver, resultType,
278 isAssignable: !isFixed); 280 isAssignable: !isFixed);
279 return result; 281 return result;
280 } else if (actualReceiver.isConstantMap()) { 282 } else if (actualReceiver.isConstantMap()) {
281 HConstant constantInput = actualReceiver; 283 HConstant constantInput = actualReceiver;
282 MapConstantValue constant = constantInput.constant; 284 MapConstantValue constant = constantInput.constant;
283 return graph.addConstantInt(constant.length, compiler); 285 return graph.addConstantInt(constant.length, compiler);
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 2312
2311 keyedValues.forEach((receiver, values) { 2313 keyedValues.forEach((receiver, values) {
2312 result.keyedValues[receiver] = 2314 result.keyedValues[receiver] =
2313 new Map<HInstruction, HInstruction>.from(values); 2315 new Map<HInstruction, HInstruction>.from(values);
2314 }); 2316 });
2315 2317
2316 result.nonEscapingReceivers.addAll(nonEscapingReceivers); 2318 result.nonEscapingReceivers.addAll(nonEscapingReceivers);
2317 return result; 2319 return result;
2318 } 2320 }
2319 } 2321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698