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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 InstructionOperand CreateImmediate(int imm) { | 54 InstructionOperand CreateImmediate(int imm) { |
55 return sequence()->AddImmediate(Constant(imm)); | 55 return sequence()->AddImmediate(Constant(imm)); |
56 } | 56 } |
57 | 57 |
58 bool CanBeImmediate(Node* node) { | 58 bool CanBeImmediate(Node* node) { |
59 switch (node->opcode()) { | 59 switch (node->opcode()) { |
60 case IrOpcode::kInt32Constant: | 60 case IrOpcode::kInt32Constant: |
61 case IrOpcode::kNumberConstant: | 61 case IrOpcode::kNumberConstant: |
62 case IrOpcode::kExternalConstant: | 62 case IrOpcode::kExternalConstant: |
| 63 case IrOpcode::kRelocatableInt32Constant: |
| 64 case IrOpcode::kRelocatableInt64Constant: |
63 return true; | 65 return true; |
64 case IrOpcode::kHeapConstant: { | 66 case IrOpcode::kHeapConstant: { |
65 // Constants in new space cannot be used as immediates in V8 because | 67 // Constants in new space cannot be used as immediates in V8 because |
66 // the GC does not scan code objects when collecting the new generation. | 68 // the GC does not scan code objects when collecting the new generation. |
67 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); | 69 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); |
68 Isolate* isolate = value->GetIsolate(); | 70 Isolate* isolate = value->GetIsolate(); |
69 return !isolate->heap()->InNewSpace(*value); | 71 return !isolate->heap()->InNewSpace(*value); |
70 } | 72 } |
71 default: | 73 default: |
72 return false; | 74 return false; |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 MachineOperatorBuilder::kFloat32RoundTruncate | | 1611 MachineOperatorBuilder::kFloat32RoundTruncate | |
1610 MachineOperatorBuilder::kFloat64RoundTruncate | | 1612 MachineOperatorBuilder::kFloat64RoundTruncate | |
1611 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1613 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1612 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1614 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1613 return flags; | 1615 return flags; |
1614 } | 1616 } |
1615 | 1617 |
1616 } // namespace compiler | 1618 } // namespace compiler |
1617 } // namespace internal | 1619 } // namespace internal |
1618 } // namespace v8 | 1620 } // namespace v8 |
OLD | NEW |