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