OLD | NEW |
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/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 STATIC_ASSERT(kSmiTagMask == 1); | 117 STATIC_ASSERT(kSmiTagMask == 1); |
118 | 118 |
119 Node* tag = graph()->NewNode(machine()->WordAnd(), val, | 119 Node* tag = graph()->NewNode(machine()->WordAnd(), val, |
120 jsgraph()->Int32Constant(kSmiTagMask)); | 120 jsgraph()->Int32Constant(kSmiTagMask)); |
121 Node* branch = graph()->NewNode(common()->Branch(), tag, control); | 121 Node* branch = graph()->NewNode(common()->Branch(), tag, control); |
122 | 122 |
123 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 123 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
124 Node* load = graph()->NewNode( | 124 Node* load = graph()->NewNode( |
125 machine()->Load(kMachFloat64), val, HeapNumberValueIndexConstant(), | 125 machine()->Load(kMachFloat64), val, HeapNumberValueIndexConstant(), |
126 graph()->NewNode(common()->ControlEffect(), if_true)); | 126 graph()->NewNode(common()->ControlEffect(), if_true)); |
127 Node* change = graph()->NewNode(machine()->ChangeFloat64ToInt32(), load); | 127 Node* change = graph()->NewNode(machine()->TruncateFloat64ToInt32(), load); |
128 | 128 |
129 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 129 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
130 Node* integer = | 130 Node* integer = |
131 graph()->NewNode(machine()->WordSar(), val, SmiShiftBitsConstant()); | 131 graph()->NewNode(machine()->WordSar(), val, SmiShiftBitsConstant()); |
132 Node* number = | 132 Node* number = |
133 machine()->is64() | 133 machine()->is64() |
134 ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer) | 134 ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer) |
135 : integer; | 135 : integer; |
136 | 136 |
137 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); | 137 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 jsgraph()->Int32Constant(function->nargs), context, effect, control); | 197 jsgraph()->Int32Constant(function->nargs), context, effect, control); |
198 Node* store = graph()->NewNode( | 198 Node* store = graph()->NewNode( |
199 machine()->Store(kMachFloat64, kNoWriteBarrier), heap_number, | 199 machine()->Store(kMachFloat64, kNoWriteBarrier), heap_number, |
200 HeapNumberValueIndexConstant(), value, heap_number, control); | 200 HeapNumberValueIndexConstant(), value, heap_number, control); |
201 return graph()->NewNode(common()->Finish(1), heap_number, store); | 201 return graph()->NewNode(common()->Finish(1), heap_number, store); |
202 } | 202 } |
203 | 203 |
204 } // namespace compiler | 204 } // namespace compiler |
205 } // namespace internal | 205 } // namespace internal |
206 } // namespace v8 | 206 } // namespace v8 |
OLD | NEW |