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 23 matching lines...) Expand all Loading... |
34 return !isolate()->heap()->InNewSpace(*value); | 34 return !isolate()->heap()->InNewSpace(*value); |
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 MachineRepresentation rep = OpParameter<MachineRepresentation>(node); | 44 MachineType rep = OpParameter<MachineType>(node); |
45 IA32OperandGenerator g(this); | 45 IA32OperandGenerator g(this); |
46 Node* base = node->InputAt(0); | 46 Node* base = node->InputAt(0); |
47 Node* index = node->InputAt(1); | 47 Node* index = node->InputAt(1); |
48 | 48 |
49 InstructionOperand* output = rep == kMachineFloat64 | 49 InstructionOperand* output = rep == kMachineFloat64 |
50 ? g.DefineAsDoubleRegister(node) | 50 ? g.DefineAsDoubleRegister(node) |
51 : g.DefineAsRegister(node); | 51 : g.DefineAsRegister(node); |
52 ArchOpcode opcode; | 52 ArchOpcode opcode; |
53 switch (rep) { | 53 switch (rep) { |
54 case kMachineFloat64: | 54 case kMachineFloat64: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 void InstructionSelector::VisitStore(Node* node) { | 90 void InstructionSelector::VisitStore(Node* node) { |
91 IA32OperandGenerator g(this); | 91 IA32OperandGenerator g(this); |
92 Node* base = node->InputAt(0); | 92 Node* base = node->InputAt(0); |
93 Node* index = node->InputAt(1); | 93 Node* index = node->InputAt(1); |
94 Node* value = node->InputAt(2); | 94 Node* value = node->InputAt(2); |
95 | 95 |
96 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); | 96 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); |
97 MachineRepresentation rep = store_rep.rep; | 97 MachineType rep = store_rep.rep; |
98 if (store_rep.write_barrier_kind == kFullWriteBarrier) { | 98 if (store_rep.write_barrier_kind == kFullWriteBarrier) { |
99 DCHECK_EQ(kMachineTagged, rep); | 99 DCHECK_EQ(kMachineTagged, rep); |
100 // TODO(dcarney): refactor RecordWrite function to take temp registers | 100 // TODO(dcarney): refactor RecordWrite function to take temp registers |
101 // and pass them here instead of using fixed regs | 101 // and pass them here instead of using fixed regs |
102 // TODO(dcarney): handle immediate indices. | 102 // TODO(dcarney): handle immediate indices. |
103 InstructionOperand* temps[] = {g.TempRegister(ecx), g.TempRegister(edx)}; | 103 InstructionOperand* temps[] = {g.TempRegister(ecx), g.TempRegister(edx)}; |
104 Emit(kIA32StoreWriteBarrier, NULL, g.UseFixed(base, ebx), | 104 Emit(kIA32StoreWriteBarrier, NULL, g.UseFixed(base, ebx), |
105 g.UseFixed(index, ecx), g.UseFixed(value, edx), ARRAY_SIZE(temps), | 105 g.UseFixed(index, ecx), g.UseFixed(value, edx), ARRAY_SIZE(temps), |
106 temps); | 106 temps); |
107 return; | 107 return; |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 if (descriptor->kind() == CallDescriptor::kCallAddress && | 551 if (descriptor->kind() == CallDescriptor::kCallAddress && |
552 buffer.pushed_count > 0) { | 552 buffer.pushed_count > 0) { |
553 DCHECK(deoptimization == NULL && continuation == NULL); | 553 DCHECK(deoptimization == NULL && continuation == NULL); |
554 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); | 554 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); |
555 } | 555 } |
556 } | 556 } |
557 | 557 |
558 } // namespace compiler | 558 } // namespace compiler |
559 } // namespace internal | 559 } // namespace internal |
560 } // namespace v8 | 560 } // namespace v8 |
OLD | NEW |