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

Side by Side Diff: src/compiler/change-lowering.cc

Issue 714413004: [turbofan] More useful typing for And, Or and Shr. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix the range/bitset subtyping mess-up in bitwise or. Created 6 years, 1 month 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 | src/compiler/typer.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler/diamond.h" 8 #include "src/compiler/diamond.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return Replace(AllocateHeapNumberWithValue(val, control)); 156 return Replace(AllocateHeapNumberWithValue(val, control));
157 } 157 }
158 158
159 159
160 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) { 160 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) {
161 if (machine()->Is64()) { 161 if (machine()->Is64()) {
162 return Replace(graph()->NewNode( 162 return Replace(graph()->NewNode(
163 machine()->Word64Shl(), 163 machine()->Word64Shl(),
164 graph()->NewNode(machine()->ChangeInt32ToInt64(), value), 164 graph()->NewNode(machine()->ChangeInt32ToInt64(), value),
165 SmiShiftBitsConstant())); 165 SmiShiftBitsConstant()));
166 } else if (NodeProperties::GetBounds(value).upper->Is(Type::SignedSmall())) {
167 return Replace(
168 graph()->NewNode(machine()->WordShl(), value, SmiShiftBitsConstant()));
166 } 169 }
167 170
168 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value); 171 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value);
169 Node* ovf = graph()->NewNode(common()->Projection(1), add); 172 Node* ovf = graph()->NewNode(common()->Projection(1), add);
170 173
171 Diamond d(graph(), common(), ovf, BranchHint::kFalse); 174 Diamond d(graph(), common(), ovf, BranchHint::kFalse);
172 d.Chain(control); 175 d.Chain(control);
173 return Replace( 176 return Replace(
174 d.Phi(kMachAnyTagged, 177 d.Phi(kMachAnyTagged,
175 AllocateHeapNumberWithValue(ChangeInt32ToFloat64(value), d.if_true), 178 AllocateHeapNumberWithValue(ChangeInt32ToFloat64(value), d.if_true),
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 276 }
274 277
275 278
276 MachineOperatorBuilder* ChangeLowering::machine() const { 279 MachineOperatorBuilder* ChangeLowering::machine() const {
277 return jsgraph()->machine(); 280 return jsgraph()->machine();
278 } 281 }
279 282
280 } // namespace compiler 283 } // namespace compiler
281 } // namespace internal 284 } // namespace internal
282 } // namespace v8 285 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698