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/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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 | 96 |
97 Node* ChangeLowering::LoadHeapNumberValue(Node* value, Node* control) { | 97 Node* ChangeLowering::LoadHeapNumberValue(Node* value, Node* control) { |
98 return graph()->NewNode(machine()->Load(kMachFloat64), value, | 98 return graph()->NewNode(machine()->Load(kMachFloat64), value, |
99 HeapNumberValueIndexConstant(), graph()->start(), | 99 HeapNumberValueIndexConstant(), graph()->start(), |
100 control); | 100 control); |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) { | 104 Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) { |
105 Diamond d(graph(), common(), val); | 105 MachineType const type = static_cast<MachineType>(kTypeBool | kRepTagged); |
106 d.Chain(control); | 106 return Replace(graph()->NewNode(common()->Select(type), val, |
107 MachineType machine_type = static_cast<MachineType>(kTypeBool | kRepTagged); | 107 jsgraph()->TrueConstant(), |
108 return Replace(d.Phi(machine_type, jsgraph()->TrueConstant(), | 108 jsgraph()->FalseConstant())); |
109 jsgraph()->FalseConstant())); | |
110 } | 109 } |
111 | 110 |
112 | 111 |
113 Reduction ChangeLowering::ChangeBoolToBit(Node* val) { | 112 Reduction ChangeLowering::ChangeBoolToBit(Node* val) { |
114 return Replace( | 113 return Replace( |
115 graph()->NewNode(machine()->WordEqual(), val, jsgraph()->TrueConstant())); | 114 graph()->NewNode(machine()->WordEqual(), val, jsgraph()->TrueConstant())); |
116 } | 115 } |
117 | 116 |
118 | 117 |
119 Reduction ChangeLowering::ChangeFloat64ToTagged(Node* val, Node* control) { | 118 Reduction ChangeLowering::ChangeFloat64ToTagged(Node* val, Node* control) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 210 } |
212 | 211 |
213 | 212 |
214 MachineOperatorBuilder* ChangeLowering::machine() const { | 213 MachineOperatorBuilder* ChangeLowering::machine() const { |
215 return jsgraph()->machine(); | 214 return jsgraph()->machine(); |
216 } | 215 } |
217 | 216 |
218 } // namespace compiler | 217 } // namespace compiler |
219 } // namespace internal | 218 } // namespace internal |
220 } // namespace v8 | 219 } // namespace v8 |
OLD | NEW |