| 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 InstructionOperand DefineAsByteRegister(Node* node) { | 25 InstructionOperand DefineAsByteRegister(Node* node) { |
| 26 // TODO(titzer): encode byte register def constraints. | 26 // TODO(titzer): encode byte register def constraints. |
| 27 return DefineAsRegister(node); | 27 return DefineAsRegister(node); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool CanBeImmediate(Node* node) { | 30 bool CanBeImmediate(Node* node) { |
| 31 switch (node->opcode()) { | 31 switch (node->opcode()) { |
| 32 case IrOpcode::kInt32Constant: | 32 case IrOpcode::kInt32Constant: |
| 33 case IrOpcode::kNumberConstant: | 33 case IrOpcode::kNumberConstant: |
| 34 case IrOpcode::kExternalConstant: | 34 case IrOpcode::kExternalConstant: |
| 35 case IrOpcode::kRelocatableInt32Constant: |
| 36 case IrOpcode::kRelocatableInt64Constant: |
| 35 return true; | 37 return true; |
| 36 case IrOpcode::kHeapConstant: { | 38 case IrOpcode::kHeapConstant: { |
| 37 // Constants in new space cannot be used as immediates in V8 because | 39 // Constants in new space cannot be used as immediates in V8 because |
| 38 // the GC does not scan code objects when collecting the new generation. | 40 // the GC does not scan code objects when collecting the new generation. |
| 39 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); | 41 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); |
| 40 Isolate* isolate = value->GetIsolate(); | 42 Isolate* isolate = value->GetIsolate(); |
| 41 return !isolate->heap()->InNewSpace(*value); | 43 return !isolate->heap()->InNewSpace(*value); |
| 42 } | 44 } |
| 43 default: | 45 default: |
| 44 return false; | 46 return false; |
| (...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 MachineOperatorBuilder::kFloat64RoundTruncate | | 1543 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1542 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1544 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1543 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1545 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1544 } | 1546 } |
| 1545 return flags; | 1547 return flags; |
| 1546 } | 1548 } |
| 1547 | 1549 |
| 1548 } // namespace compiler | 1550 } // namespace compiler |
| 1549 } // namespace internal | 1551 } // namespace internal |
| 1550 } // namespace v8 | 1552 } // namespace v8 |
| OLD | NEW |