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

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

Issue 10533003: Remove the 'element' field on a HParameterValue to use the 'sourceElement' of HInstruction. Also, w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | lib/compiler/implementation/ssa/variable_allocator.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 bool typeGuardWouldBeValuable(HInstruction instruction, 108 bool typeGuardWouldBeValuable(HInstruction instruction,
109 HType speculativeType) { 109 HType speculativeType) {
110 110
111 Element source = instruction.sourceElement; 111 Element source = instruction.sourceElement;
112 // Do not insert a type guard if the instruction has a type 112 // Do not insert a type guard if the instruction has a type
113 // annotation that disagrees with the speculated type. 113 // annotation that disagrees with the speculated type.
114 if (source !== null) { 114 if (source !== null) {
115 Type sourceType = source.computeType(compiler); 115 Type sourceType = source.computeType(compiler);
116 Type speculatedType = speculativeType.computeType(compiler); 116 Type speculatedType = speculativeType.computeType(compiler);
117 if (speculatedType !== null 117 if (speculatedType !== null
118 && !compiler.types.isSubtype(speculatedType, sourceType)) { 118 && !compiler.types.isAssignable(speculatedType, sourceType)) {
119 return false; 119 return false;
120 } 120 }
121 } 121 }
122 122
123 bool isNested(HBasicBlock inner, HBasicBlock outer) { 123 bool isNested(HBasicBlock inner, HBasicBlock outer) {
124 if (inner === outer) return false; 124 if (inner === outer) return false;
125 if (outer === null) return true; 125 if (outer === null) return true;
126 while (inner !== null) { 126 while (inner !== null) {
127 if (inner === outer) return true; 127 if (inner === outer) return true;
128 inner = inner.parentLoopHeader; 128 inner = inner.parentLoopHeader;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } 425 }
426 } 426 }
427 } 427 }
428 428
429 visitTypeGuard(HTypeGuard guard) { 429 visitTypeGuard(HTypeGuard guard) {
430 blocks.forEach((HBasicBlock block) { 430 blocks.forEach((HBasicBlock block) {
431 block.guards.add(guard); 431 block.guards.add(guard);
432 }); 432 });
433 } 433 }
434 } 434 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/variable_allocator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698