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 12 matching lines...) Expand all Loading... |
23 | 23 |
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 Handle<HeapObject> value = ValueOf<Handle<HeapObject> >(node->op()); | 33 Unique<HeapObject> value = OpParameter<Unique<HeapObject> >(node); |
34 return !isolate()->heap()->InNewSpace(*value); | 34 return !isolate()->heap()->InNewSpace(*value.handle()); |
35 } | 35 } |
36 default: | 36 default: |
37 return false; | 37 return false; |
38 } | 38 } |
39 } | 39 } |
40 }; | 40 }; |
41 | 41 |
42 | 42 |
43 void InstructionSelector::VisitLoad(Node* node) { | 43 void InstructionSelector::VisitLoad(Node* node) { |
44 MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); | 44 MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 if (descriptor->kind() == CallDescriptor::kCallAddress && | 560 if (descriptor->kind() == CallDescriptor::kCallAddress && |
561 buffer.pushed_nodes.size() > 0) { | 561 buffer.pushed_nodes.size() > 0) { |
562 DCHECK(deoptimization == NULL && continuation == NULL); | 562 DCHECK(deoptimization == NULL && continuation == NULL); |
563 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL); | 563 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL); |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 } // namespace compiler | 567 } // namespace compiler |
568 } // namespace internal | 568 } // namespace internal |
569 } // namespace v8 | 569 } // namespace v8 |
OLD | NEW |