| 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" |
| 7 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/graph-inl.h" | 9 #include "src/compiler/graph-inl.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/representation-change.h" | 11 #include "src/compiler/representation-change.h" |
| 11 #include "src/compiler/simplified-lowering.h" | 12 #include "src/compiler/simplified-lowering.h" |
| 12 #include "src/compiler/simplified-operator.h" | 13 #include "src/compiler/simplified-operator.h" |
| 13 #include "src/objects.h" | 14 #include "src/objects.h" |
| 14 | 15 |
| 15 namespace v8 { | 16 namespace v8 { |
| 16 namespace internal { | 17 namespace internal { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool lower() { return phase_ == LOWER; } | 145 bool lower() { return phase_ == LOWER; } |
| 145 | 146 |
| 146 void Enqueue(Node* node, MachineType use) { | 147 void Enqueue(Node* node, MachineType use) { |
| 147 Enqueue(node, static_cast<MachineTypeUnion>(use)); | 148 Enqueue(node, static_cast<MachineTypeUnion>(use)); |
| 148 } | 149 } |
| 149 | 150 |
| 150 void SetOutput(Node* node, MachineTypeUnion output) { | 151 void SetOutput(Node* node, MachineTypeUnion output) { |
| 151 // Every node should have at most one output representation. Note that | 152 // Every node should have at most one output representation. Note that |
| 152 // phis can have 0, if they have not been used in a representation-inducing | 153 // phis can have 0, if they have not been used in a representation-inducing |
| 153 // instruction. | 154 // instruction. |
| 154 DCHECK((output & kRepMask) == 0 || IsPowerOf2(output & kRepMask)); | 155 DCHECK((output & kRepMask) == 0 || |
| 156 base::bits::IsPowerOfTwo32(output & kRepMask)); |
| 155 GetInfo(node)->output = output; | 157 GetInfo(node)->output = output; |
| 156 } | 158 } |
| 157 | 159 |
| 158 bool BothInputsAre(Node* node, Type* type) { | 160 bool BothInputsAre(Node* node, Type* type) { |
| 159 DCHECK_EQ(2, node->InputCount()); | 161 DCHECK_EQ(2, node->InputCount()); |
| 160 return NodeProperties::GetBounds(node->InputAt(0)).upper->Is(type) && | 162 return NodeProperties::GetBounds(node->InputAt(0)).upper->Is(type) && |
| 161 NodeProperties::GetBounds(node->InputAt(1)).upper->Is(type); | 163 NodeProperties::GetBounds(node->InputAt(1)).upper->Is(type); |
| 162 } | 164 } |
| 163 | 165 |
| 164 void ProcessInput(Node* node, int index, MachineTypeUnion use) { | 166 void ProcessInput(Node* node, int index, MachineTypeUnion use) { |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode())); | 832 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(stub.GetCode())); |
| 831 node->AppendInput(zone(), jsgraph()->UndefinedConstant()); | 833 node->AppendInput(zone(), jsgraph()->UndefinedConstant()); |
| 832 node->AppendInput(zone(), graph()->start()); | 834 node->AppendInput(zone(), graph()->start()); |
| 833 node->AppendInput(zone(), graph()->start()); | 835 node->AppendInput(zone(), graph()->start()); |
| 834 } | 836 } |
| 835 | 837 |
| 836 | 838 |
| 837 } // namespace compiler | 839 } // namespace compiler |
| 838 } // namespace internal | 840 } // namespace internal |
| 839 } // namespace v8 | 841 } // namespace v8 |
| OLD | NEW |