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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 13 matching lines...) Expand all Loading... |
24 bool CanBeImmediate(Node* node) { | 24 bool CanBeImmediate(Node* node) { |
25 switch (node->opcode()) { | 25 switch (node->opcode()) { |
26 case IrOpcode::kInt32Constant: | 26 case IrOpcode::kInt32Constant: |
27 case IrOpcode::kNumberConstant: | 27 case IrOpcode::kNumberConstant: |
28 case IrOpcode::kExternalConstant: | 28 case IrOpcode::kExternalConstant: |
29 return true; | 29 return true; |
30 case IrOpcode::kHeapConstant: { | 30 case IrOpcode::kHeapConstant: { |
31 // Constants in new space cannot be used as immediates in V8 because | 31 // Constants in new space cannot be used as immediates in V8 because |
32 // the GC does not scan code objects when collecting the new generation. | 32 // the GC does not scan code objects when collecting the new generation. |
33 Unique<HeapObject> value = OpParameter<Unique<HeapObject> >(node); | 33 Unique<HeapObject> value = OpParameter<Unique<HeapObject> >(node); |
34 return !isolate()->heap()->InNewSpace(*value.handle()); | 34 Isolate* isolate = value.handle()->GetIsolate(); |
| 35 return !isolate->heap()->InNewSpace(*value.handle()); |
35 } | 36 } |
36 default: | 37 default: |
37 return false; | 38 return false; |
38 } | 39 } |
39 } | 40 } |
40 | 41 |
41 AddressingMode GenerateMemoryOperandInputs(Node* index, int scale, Node* base, | 42 AddressingMode GenerateMemoryOperandInputs(Node* index, int scale, Node* base, |
42 Node* displacement_node, | 43 Node* displacement_node, |
43 InstructionOperand* inputs[], | 44 InstructionOperand* inputs[], |
44 size_t* input_count) { | 45 size_t* input_count) { |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 MachineOperatorBuilder::kFloat64Ceil | | 1008 MachineOperatorBuilder::kFloat64Ceil | |
1008 MachineOperatorBuilder::kFloat64RoundTruncate | | 1009 MachineOperatorBuilder::kFloat64RoundTruncate | |
1009 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1010 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1010 } | 1011 } |
1011 return MachineOperatorBuilder::Flag::kNoFlags; | 1012 return MachineOperatorBuilder::Flag::kNoFlags; |
1012 } | 1013 } |
1013 | 1014 |
1014 } // namespace compiler | 1015 } // namespace compiler |
1015 } // namespace internal | 1016 } // namespace internal |
1016 } // namespace v8 | 1017 } // namespace v8 |
OLD | NEW |