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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 break; | 49 break; |
50 } | 50 } |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 bool CanBeImmediate(Node* node) { | 54 bool CanBeImmediate(Node* node) { |
55 switch (node->opcode()) { | 55 switch (node->opcode()) { |
56 case IrOpcode::kInt32Constant: | 56 case IrOpcode::kInt32Constant: |
57 case IrOpcode::kNumberConstant: | 57 case IrOpcode::kNumberConstant: |
58 case IrOpcode::kExternalConstant: | 58 case IrOpcode::kExternalConstant: |
| 59 case IrOpcode::kRelocatableInt32Constant: |
| 60 case IrOpcode::kRelocatableInt64Constant: |
59 return true; | 61 return true; |
60 case IrOpcode::kHeapConstant: { | 62 case IrOpcode::kHeapConstant: { |
61 // Constants in new space cannot be used as immediates in V8 because | 63 // Constants in new space cannot be used as immediates in V8 because |
62 // the GC does not scan code objects when collecting the new generation. | 64 // the GC does not scan code objects when collecting the new generation. |
63 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); | 65 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node); |
64 Isolate* isolate = value->GetIsolate(); | 66 Isolate* isolate = value->GetIsolate(); |
65 return !isolate->heap()->InNewSpace(*value); | 67 return !isolate->heap()->InNewSpace(*value); |
66 } | 68 } |
67 default: | 69 default: |
68 return false; | 70 return false; |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 MachineOperatorBuilder::kFloat64RoundTruncate | | 1588 MachineOperatorBuilder::kFloat64RoundTruncate | |
1587 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1589 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1588 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1590 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1589 } | 1591 } |
1590 return flags; | 1592 return flags; |
1591 } | 1593 } |
1592 | 1594 |
1593 } // namespace compiler | 1595 } // namespace compiler |
1594 } // namespace internal | 1596 } // namespace internal |
1595 } // namespace v8 | 1597 } // namespace v8 |
OLD | NEW |