OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 JSObject::kPropertiesOffset)); | 132 JSObject::kPropertiesOffset)); |
133 GenerateDictionaryLoad(masm, &slow, dictionary, | 133 GenerateDictionaryLoad(masm, &slow, dictionary, |
134 LoadDescriptor::NameRegister(), rbx, rdi, rax); | 134 LoadDescriptor::NameRegister(), rbx, rdi, rax); |
135 __ ret(0); | 135 __ ret(0); |
136 | 136 |
137 // Dictionary load failed, go slow (but don't miss). | 137 // Dictionary load failed, go slow (but don't miss). |
138 __ bind(&slow); | 138 __ bind(&slow); |
139 LoadIC::GenerateRuntimeGetProperty(masm); | 139 LoadIC::GenerateRuntimeGetProperty(masm); |
140 } | 140 } |
141 | 141 |
142 | |
143 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
144 Register receiver = LoadDescriptor::ReceiverRegister(); | |
145 Register name = LoadDescriptor::NameRegister(); | |
146 Register slot = LoadDescriptor::SlotRegister(); | |
147 Register vector = LoadWithVectorDescriptor::VectorRegister(); | |
148 DCHECK(!rdi.is(receiver) && !rdi.is(name) && !rdi.is(slot) && | |
149 !rdi.is(vector)); | |
150 | |
151 __ PopReturnAddressTo(rdi); | |
152 __ Push(receiver); | |
153 __ Push(name); | |
154 __ Push(slot); | |
155 __ Push(vector); | |
156 __ PushReturnAddressFrom(rdi); | |
157 } | |
158 | |
159 | |
160 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
161 // The return address is on the stack. | |
162 | |
163 Counters* counters = masm->isolate()->counters(); | |
164 __ IncrementCounter(counters->ic_load_miss(), 1); | |
165 | |
166 LoadIC_PushArgs(masm); | |
167 | |
168 // Perform tail call to the entry. | |
169 __ TailCallRuntime(Runtime::kLoadIC_Miss); | |
170 } | |
171 | |
172 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 142 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
173 // The return address is on the stack. | 143 // The return address is on the stack. |
174 Register receiver = LoadDescriptor::ReceiverRegister(); | 144 Register receiver = LoadDescriptor::ReceiverRegister(); |
175 Register name = LoadDescriptor::NameRegister(); | 145 Register name = LoadDescriptor::NameRegister(); |
176 | 146 |
177 DCHECK(!rbx.is(receiver) && !rbx.is(name)); | 147 DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
178 | 148 |
179 __ PopReturnAddressTo(rbx); | 149 __ PopReturnAddressTo(rbx); |
180 __ Push(receiver); | 150 __ Push(receiver); |
181 __ Push(name); | 151 __ Push(name); |
182 __ PushReturnAddressFrom(rbx); | 152 __ PushReturnAddressFrom(rbx); |
183 | 153 |
184 // Do tail-call to runtime routine. | 154 // Do tail-call to runtime routine. |
185 __ TailCallRuntime(Runtime::kGetProperty); | 155 __ TailCallRuntime(Runtime::kGetProperty); |
186 } | 156 } |
187 | 157 |
188 | |
189 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
190 // The return address is on the stack. | |
191 Counters* counters = masm->isolate()->counters(); | |
192 __ IncrementCounter(counters->ic_keyed_load_miss(), 1); | |
193 | |
194 LoadIC_PushArgs(masm); | |
195 | |
196 // Perform tail call to the entry. | |
197 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | |
198 } | |
199 | |
200 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
201 // The return address is on the stack. | |
202 Register receiver = LoadDescriptor::ReceiverRegister(); | |
203 Register name = LoadDescriptor::NameRegister(); | |
204 | |
205 DCHECK(!rbx.is(receiver) && !rbx.is(name)); | |
206 | |
207 __ PopReturnAddressTo(rbx); | |
208 __ Push(receiver); | |
209 __ Push(name); | |
210 __ PushReturnAddressFrom(rbx); | |
211 | |
212 // Do tail-call to runtime routine. | |
213 __ TailCallRuntime(Runtime::kKeyedGetProperty); | |
214 } | |
215 | |
216 static void StoreIC_PushArgs(MacroAssembler* masm) { | 158 static void StoreIC_PushArgs(MacroAssembler* masm) { |
217 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); | 159 Register receiver = StoreWithVectorDescriptor::ReceiverRegister(); |
218 Register name = StoreWithVectorDescriptor::NameRegister(); | 160 Register name = StoreWithVectorDescriptor::NameRegister(); |
219 Register value = StoreWithVectorDescriptor::ValueRegister(); | 161 Register value = StoreWithVectorDescriptor::ValueRegister(); |
220 Register slot = StoreWithVectorDescriptor::SlotRegister(); | 162 Register slot = StoreWithVectorDescriptor::SlotRegister(); |
221 Register vector = StoreWithVectorDescriptor::VectorRegister(); | 163 Register vector = StoreWithVectorDescriptor::VectorRegister(); |
222 Register temp = r11; | 164 Register temp = r11; |
223 DCHECK(!AreAliased(receiver, name, value, slot, vector, temp)); | 165 DCHECK(!AreAliased(receiver, name, value, slot, vector, temp)); |
224 | 166 |
225 __ PopReturnAddressTo(temp); | 167 __ PopReturnAddressTo(temp); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 Condition cc = | 290 Condition cc = |
349 (check == ENABLE_INLINED_SMI_CHECK) | 291 (check == ENABLE_INLINED_SMI_CHECK) |
350 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 292 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
351 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 293 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
352 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 294 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
353 } | 295 } |
354 } // namespace internal | 296 } // namespace internal |
355 } // namespace v8 | 297 } // namespace v8 |
356 | 298 |
357 #endif // V8_TARGET_ARCH_X64 | 299 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |