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 DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value)); | 307 if (FLAG_vector_stores) { |
| 308 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 309 Register vector = VectorStoreICDescriptor::VectorRegister(); |
308 | 310 |
309 __ PopReturnAddressTo(rbx); | 311 __ PopReturnAddressTo(r11); |
310 __ Push(receiver); | 312 __ Push(receiver); |
311 __ Push(name); | 313 __ Push(name); |
312 __ Push(value); | 314 __ Push(value); |
313 __ PushReturnAddressFrom(rbx); | 315 __ Push(slot); |
| 316 __ Push(vector); |
| 317 __ 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 } |
314 } | 327 } |
315 | 328 |
316 | 329 |
317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 330 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
318 // Return address is on the stack. | 331 // Return address is on the stack. |
319 StoreIC_PushArgs(masm); | 332 StoreIC_PushArgs(masm); |
320 | 333 |
321 // Do tail-call to runtime routine. | 334 // Do tail-call to runtime routine. |
322 __ TailCallRuntime(Runtime::kStoreIC_Slow, 3, 1); | 335 __ TailCallRuntime(Runtime::kStoreIC_Slow, FLAG_vector_stores ? 5 : 3, 1); |
323 } | 336 } |
324 | 337 |
325 | 338 |
326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 339 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
327 // Return address is on the stack. | 340 // Return address is on the stack. |
328 StoreIC_PushArgs(masm); | 341 StoreIC_PushArgs(masm); |
329 | 342 |
330 // Do tail-call to runtime routine. | 343 // Do tail-call to runtime routine. |
331 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 3, 1); | 344 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, FLAG_vector_stores ? 5 : 3, |
| 345 1); |
332 } | 346 } |
333 | 347 |
334 | 348 |
335 #undef __ | 349 #undef __ |
336 #define __ ACCESS_MASM((masm())) | 350 #define __ ACCESS_MASM((masm())) |
337 | 351 |
338 | 352 |
339 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 353 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
340 Handle<Name> name) { | 354 Handle<Name> name) { |
341 if (!label->is_unused()) { | 355 if (!label->is_unused()) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 __ bind(&success); | 582 __ bind(&success); |
569 } | 583 } |
570 } | 584 } |
571 | 585 |
572 | 586 |
573 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 587 void NamedStoreHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
574 if (!miss->is_unused()) { | 588 if (!miss->is_unused()) { |
575 Label success; | 589 Label success; |
576 __ jmp(&success); | 590 __ jmp(&success); |
577 GenerateRestoreName(miss, name); | 591 GenerateRestoreName(miss, name); |
| 592 if (IC::ICUseVector(kind())) PopVectorAndSlot(); |
578 TailCallBuiltin(masm(), MissBuiltin(kind())); | 593 TailCallBuiltin(masm(), MissBuiltin(kind())); |
579 __ bind(&success); | 594 __ bind(&success); |
580 } | 595 } |
581 } | 596 } |
582 | 597 |
583 | 598 |
584 void NamedLoadHandlerCompiler::GenerateLoadCallback( | 599 void NamedLoadHandlerCompiler::GenerateLoadCallback( |
585 Register reg, Handle<ExecutableAccessorInfo> callback) { | 600 Register reg, Handle<ExecutableAccessorInfo> callback) { |
586 // Insert additional parameters into the stack frame above return address. | 601 // Insert additional parameters into the stack frame above return address. |
587 DCHECK(!scratch4().is(reg)); | 602 DCHECK(!scratch4().is(reg)); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // Return the generated code. | 811 // Return the generated code. |
797 return GetCode(kind(), Code::NORMAL, name); | 812 return GetCode(kind(), Code::NORMAL, name); |
798 } | 813 } |
799 | 814 |
800 | 815 |
801 #undef __ | 816 #undef __ |
802 } // namespace internal | 817 } // namespace internal |
803 } // namespace v8 | 818 } // namespace v8 |
804 | 819 |
805 #endif // V8_TARGET_ARCH_X64 | 820 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |