| 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 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_ | 5 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_ |
| 6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_ | 6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_ |
| 7 | 7 |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } else { | 285 } else { |
| 286 return TypeError(node, output_type, kRepWord32); | 286 return TypeError(node, output_type, kRepWord32); |
| 287 } | 287 } |
| 288 return jsgraph()->graph()->NewNode(op, node); | 288 return jsgraph()->graph()->NewNode(op, node); |
| 289 } | 289 } |
| 290 | 290 |
| 291 Node* GetBitRepresentationFor(Node* node, MachineTypeUnion output_type) { | 291 Node* GetBitRepresentationFor(Node* node, MachineTypeUnion output_type) { |
| 292 // Eagerly fold representation changes for constants. | 292 // Eagerly fold representation changes for constants. |
| 293 switch (node->opcode()) { | 293 switch (node->opcode()) { |
| 294 case IrOpcode::kHeapConstant: { | 294 case IrOpcode::kHeapConstant: { |
| 295 Handle<Object> value = OpParameter<Unique<Object> >(node).handle(); | 295 Handle<Object> value = OpParameter<Handle<Object>>(node); |
| 296 DCHECK(value.is_identical_to(factory()->true_value()) || | 296 DCHECK(value.is_identical_to(factory()->true_value()) || |
| 297 value.is_identical_to(factory()->false_value())); | 297 value.is_identical_to(factory()->false_value())); |
| 298 return jsgraph()->Int32Constant( | 298 return jsgraph()->Int32Constant( |
| 299 value.is_identical_to(factory()->true_value()) ? 1 : 0); | 299 value.is_identical_to(factory()->true_value()) ? 1 : 0); |
| 300 } | 300 } |
| 301 default: | 301 default: |
| 302 break; | 302 break; |
| 303 } | 303 } |
| 304 // Select the correct X -> Bit operator. | 304 // Select the correct X -> Bit operator. |
| 305 const Operator* op; | 305 const Operator* op; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 Factory* factory() const { return isolate()->factory(); } | 453 Factory* factory() const { return isolate()->factory(); } |
| 454 SimplifiedOperatorBuilder* simplified() { return simplified_; } | 454 SimplifiedOperatorBuilder* simplified() { return simplified_; } |
| 455 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 455 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |
| 456 }; | 456 }; |
| 457 | 457 |
| 458 } // namespace compiler | 458 } // namespace compiler |
| 459 } // namespace internal | 459 } // namespace internal |
| 460 } // namespace v8 | 460 } // namespace v8 |
| 461 | 461 |
| 462 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ | 462 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ |
| OLD | NEW |