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

Side by Side Diff: lib/compiler/implementation/ssa/bailout.dart

Issue 10106004: Revert "Refactor type propagation." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
« no previous file with comments | « frog/tests/leg/src/TypeInferenceTest.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class BailoutInfo { 5 class BailoutInfo {
6 int instructionId; 6 int instructionId;
7 int bailoutId; 7 int bailoutId;
8 BailoutInfo(this.instructionId, this.bailoutId); 8 BailoutInfo(this.instructionId, this.bailoutId);
9 } 9 }
10 10
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 environment.clear(); 269 environment.clear();
270 visitInstruction(instruction); 270 visitInstruction(instruction);
271 } 271 }
272 272
273 void visitControlFlow(HControlFlow instruction) { 273 void visitControlFlow(HControlFlow instruction) {
274 compiler.internalError('Control flow instructions already dealt with.', 274 compiler.internalError('Control flow instructions already dealt with.',
275 instruction: instruction); 275 instruction: instruction);
276 } 276 }
277 277
278 bool shouldCaptureEnvironment(HInstruction instruction) { 278 bool shouldCaptureEnvironment(HInstruction instruction) {
279 HType propagatedType = instruction.propagatedType; 279 return instruction.type.isKnown() && !instruction.hasExpectedType();
280 return propagatedType.isUseful()
281 && propagatedType != instruction.computeTypeFromInputTypes();
282 } 280 }
283 281
284 void insertCapturedEnvironments() { 282 void insertCapturedEnvironments() {
285 work.guards = <HTypeGuard>[]; 283 work.guards = <HTypeGuard>[];
286 int state = 1; 284 int state = 1;
287 capturedEnvironments.forEach((HInstruction instruction, Environment env) { 285 capturedEnvironments.forEach((HInstruction instruction, Environment env) {
288 List<HInstruction> inputs = env.buildAndSetLast(instruction); 286 List<HInstruction> inputs = env.buildAndSetLast(instruction);
289 HTypeGuard guard = new HTypeGuard(state++, inputs); 287 HTypeGuard guard = new HTypeGuard(state++, inputs);
290 work.guards.add(guard); 288 work.guards.add(guard);
291 instruction.block.rewrite(instruction, guard); 289 instruction.block.rewrite(instruction, guard);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 compiler.internalError('Control flow instructions already dealt with.', 359 compiler.internalError('Control flow instructions already dealt with.',
362 instruction: instruction); 360 instruction: instruction);
363 } 361 }
364 362
365 visitTypeGuard(HTypeGuard guard) { 363 visitTypeGuard(HTypeGuard guard) {
366 blocks.forEach((HBasicBlock block) { 364 blocks.forEach((HBasicBlock block) {
367 block.guards.add(guard); 365 block.guards.add(guard);
368 }); 366 });
369 } 367 }
370 } 368 }
OLDNEW
« no previous file with comments | « frog/tests/leg/src/TypeInferenceTest.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698