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

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

Issue 1106443003: Optimize DateTime properties (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase 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 | 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 class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase { 7 class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
8 final Map<int, HInstruction> workmap = new Map<int, HInstruction>(); 8 final Map<int, HInstruction> workmap = new Map<int, HInstruction>();
9 final List<int> worklist = new List<int>(); 9 final List<int> worklist = new List<int>();
10 final Map<HInstruction, Function> pendingOptimizations = 10 final Map<HInstruction, Function> pendingOptimizations =
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 TypeMask visitAdd(HAdd instruction) { 126 TypeMask visitAdd(HAdd instruction) {
127 return checkPositiveInteger(instruction); 127 return checkPositiveInteger(instruction);
128 } 128 }
129 129
130 TypeMask visitDivide(HDivide instruction) { 130 TypeMask visitDivide(HDivide instruction) {
131 // Always double, as initialized. 131 // Always double, as initialized.
132 return instruction.instructionType; 132 return instruction.instructionType;
133 } 133 }
134 134
135 TypeMask visitTruncatingDivide(HTruncatingDivide instruction) {
136 // Always as initialized.
137 return instruction.instructionType;
138 }
139
135 TypeMask visitNegate(HNegate instruction) { 140 TypeMask visitNegate(HNegate instruction) {
136 HInstruction operand = instruction.operand; 141 HInstruction operand = instruction.operand;
137 // We have integer subclasses that represent ranges, so widen any int 142 // We have integer subclasses that represent ranges, so widen any int
138 // subclass to full integer. 143 // subclass to full integer.
139 if (operand.isInteger(compiler)) return backend.intType; 144 if (operand.isInteger(compiler)) return backend.intType;
140 return instruction.operand.instructionType; 145 return instruction.operand.instructionType;
141 } 146 }
142 147
143 TypeMask visitInstruction(HInstruction instruction) { 148 TypeMask visitInstruction(HInstruction instruction) {
144 assert(instruction.instructionType != null); 149 assert(instruction.instructionType != null);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 instruction.block.addBefore(instruction.next, converted); 372 instruction.block.addBefore(instruction.next, converted);
368 receiver.replaceAllUsersDominatedBy(converted.next, converted); 373 receiver.replaceAllUsersDominatedBy(converted.next, converted);
369 addDependentInstructionsToWorkList(converted); 374 addDependentInstructionsToWorkList(converted);
370 } 375 }
371 } 376 }
372 377
373 return instruction.specializer.computeTypeFromInputTypes( 378 return instruction.specializer.computeTypeFromInputTypes(
374 instruction, compiler); 379 instruction, compiler);
375 } 380 }
376 } 381 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698