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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 __ ret(0); | 298 __ ret(0); |
299 } | 299 } |
300 | 300 |
301 | 301 |
302 static void StoreIC_PushArgs(MacroAssembler* masm) { | 302 static void StoreIC_PushArgs(MacroAssembler* masm) { |
303 Register receiver = StoreDescriptor::ReceiverRegister(); | 303 Register receiver = StoreDescriptor::ReceiverRegister(); |
304 Register name = StoreDescriptor::NameRegister(); | 304 Register name = StoreDescriptor::NameRegister(); |
305 Register value = StoreDescriptor::ValueRegister(); | 305 Register value = StoreDescriptor::ValueRegister(); |
306 | 306 |
307 if (FLAG_vector_stores) { | 307 Register slot = VectorStoreICDescriptor::SlotRegister(); |
308 Register slot = VectorStoreICDescriptor::SlotRegister(); | 308 Register vector = VectorStoreICDescriptor::VectorRegister(); |
309 Register vector = VectorStoreICDescriptor::VectorRegister(); | |
310 | 309 |
311 __ PopReturnAddressTo(r11); | 310 __ PopReturnAddressTo(r11); |
312 __ Push(receiver); | 311 __ Push(receiver); |
313 __ Push(name); | 312 __ Push(name); |
314 __ Push(value); | 313 __ Push(value); |
315 __ Push(slot); | 314 __ Push(slot); |
316 __ Push(vector); | 315 __ Push(vector); |
317 __ PushReturnAddressFrom(r11); | 316 __ PushReturnAddressFrom(r11); |
318 } else { | |
319 DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value)); | |
320 | |
321 __ PopReturnAddressTo(rbx); | |
322 __ Push(receiver); | |
323 __ Push(name); | |
324 __ Push(value); | |
325 __ PushReturnAddressFrom(rbx); | |
326 } | |
327 } | 317 } |
328 | 318 |
329 | 319 |
330 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 320 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
331 // Return address is on the stack. | 321 // Return address is on the stack. |
332 StoreIC_PushArgs(masm); | 322 StoreIC_PushArgs(masm); |
333 | 323 |
334 // Do tail-call to runtime routine. | 324 // Do tail-call to runtime routine. |
335 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); | 325 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5, 1); |
336 } | 326 } |
337 | 327 |
338 | 328 |
339 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 329 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
340 // Return address is on the stack. | 330 // Return address is on the stack. |
341 StoreIC_PushArgs(masm); | 331 StoreIC_PushArgs(masm); |
342 | 332 |
343 // Do tail-call to runtime routine. | 333 // Do tail-call to runtime routine. |
344 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, | 334 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5, 1); |
345 1); | |
346 } | 335 } |
347 | 336 |
348 | 337 |
349 #undef __ | 338 #undef __ |
350 #define __ ACCESS_MASM((masm())) | 339 #define __ ACCESS_MASM((masm())) |
351 | 340 |
352 | 341 |
353 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 342 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
354 Handle<Name> name) { | 343 Handle<Name> name) { |
355 if (!label->is_unused()) { | 344 if (!label->is_unused()) { |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 // Return the generated code. | 800 // Return the generated code. |
812 return GetCode(kind(), Code::NORMAL, name); | 801 return GetCode(kind(), Code::NORMAL, name); |
813 } | 802 } |
814 | 803 |
815 | 804 |
816 #undef __ | 805 #undef __ |
817 } // namespace internal | 806 } // namespace internal |
818 } // namespace v8 | 807 } // namespace v8 |
819 | 808 |
820 #endif // V8_TARGET_ARCH_X64 | 809 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |