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 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return !isolate()->heap()->InNewSpace(*value); | 49 return !isolate()->heap()->InNewSpace(*value); |
50 } | 50 } |
51 default: | 51 default: |
52 return false; | 52 return false; |
53 } | 53 } |
54 } | 54 } |
55 }; | 55 }; |
56 | 56 |
57 | 57 |
58 void InstructionSelector::VisitLoad(Node* node) { | 58 void InstructionSelector::VisitLoad(Node* node) { |
59 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); | 59 MachineType rep = OpParameter<MachineType>(node); |
60 X64OperandGenerator g(this); | 60 X64OperandGenerator g(this); |
61 Node* base = node->InputAt(0); | 61 Node* base = node->InputAt(0); |
62 Node* index = node->InputAt(1); | 62 Node* index = node->InputAt(1); |
63 | 63 |
64 InstructionOperand* output = rep == kMachineFloat64 | 64 InstructionOperand* output = rep == kMachineFloat64 |
65 ? g.DefineAsDoubleRegister(node) | 65 ? g.DefineAsDoubleRegister(node) |
66 : g.DefineAsRegister(node); | 66 : g.DefineAsRegister(node); |
67 ArchOpcode opcode; | 67 ArchOpcode opcode; |
68 switch (rep) { | 68 switch (rep) { |
69 case kMachineFloat64: | 69 case kMachineFloat64: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 void InstructionSelector::VisitStore(Node* node) { | 104 void InstructionSelector::VisitStore(Node* node) { |
105 X64OperandGenerator g(this); | 105 X64OperandGenerator g(this); |
106 Node* base = node->InputAt(0); | 106 Node* base = node->InputAt(0); |
107 Node* index = node->InputAt(1); | 107 Node* index = node->InputAt(1); |
108 Node* value = node->InputAt(2); | 108 Node* value = node->InputAt(2); |
109 | 109 |
110 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 110 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); |
111 MachineRepresentation rep = store_rep.rep; | 111 MachineType rep = store_rep.rep; |
112 if (store_rep.write_barrier_kind == kFullWriteBarrier) { | 112 if (store_rep.write_barrier_kind == kFullWriteBarrier) { |
113 DCHECK(rep == kMachineTagged); | 113 DCHECK(rep == kMachineTagged); |
114 // TODO(dcarney): refactor RecordWrite function to take temp registers | 114 // TODO(dcarney): refactor RecordWrite function to take temp registers |
115 // and pass them here instead of using fixed regs | 115 // and pass them here instead of using fixed regs |
116 // TODO(dcarney): handle immediate indices. | 116 // TODO(dcarney): handle immediate indices. |
117 InstructionOperand* temps[] = {g.TempRegister(rcx), g.TempRegister(rdx)}; | 117 InstructionOperand* temps[] = {g.TempRegister(rcx), g.TempRegister(rdx)}; |
118 Emit(kX64StoreWriteBarrier, NULL, g.UseFixed(base, rbx), | 118 Emit(kX64StoreWriteBarrier, NULL, g.UseFixed(base, rbx), |
119 g.UseFixed(index, rcx), g.UseFixed(value, rdx), ARRAY_SIZE(temps), | 119 g.UseFixed(index, rcx), g.UseFixed(value, rdx), ARRAY_SIZE(temps), |
120 temps); | 120 temps); |
121 return; | 121 return; |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 if (descriptor->kind() == CallDescriptor::kCallAddress && | 713 if (descriptor->kind() == CallDescriptor::kCallAddress && |
714 buffer.pushed_count > 0) { | 714 buffer.pushed_count > 0) { |
715 DCHECK(deoptimization == NULL && continuation == NULL); | 715 DCHECK(deoptimization == NULL && continuation == NULL); |
716 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); | 716 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); |
717 } | 717 } |
718 } | 718 } |
719 | 719 |
720 } // namespace compiler | 720 } // namespace compiler |
721 } // namespace internal | 721 } // namespace internal |
722 } // namespace v8 | 722 } // namespace v8 |
OLD | NEW |