| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 LoadDescriptor::SlotRegister())); | 528 LoadDescriptor::SlotRegister())); |
| 529 | 529 |
| 530 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, | 530 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, |
| 531 r9, &miss); | 531 r9, &miss); |
| 532 __ bind(&miss); | 532 __ bind(&miss); |
| 533 PropertyAccessCompiler::TailCallBuiltin( | 533 PropertyAccessCompiler::TailCallBuiltin( |
| 534 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); | 534 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); |
| 535 } | 535 } |
| 536 | 536 |
| 537 | 537 |
| 538 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { | |
| 539 // Return address is on the stack. | |
| 540 Label slow; | |
| 541 | |
| 542 Register receiver = LoadDescriptor::ReceiverRegister(); | |
| 543 Register key = LoadDescriptor::NameRegister(); | |
| 544 Register scratch = rax; | |
| 545 DCHECK(!scratch.is(receiver) && !scratch.is(key)); | |
| 546 | |
| 547 // Check that the key is an array index, that is Uint32. | |
| 548 STATIC_ASSERT(kSmiValueSize <= 32); | |
| 549 __ JumpUnlessNonNegativeSmi(key, &slow); | |
| 550 | |
| 551 // Everything is fine, call runtime. | |
| 552 __ PopReturnAddressTo(scratch); | |
| 553 __ Push(receiver); // receiver | |
| 554 __ Push(key); // key | |
| 555 __ PushReturnAddressFrom(scratch); | |
| 556 | |
| 557 // Perform tail call to the entry. | |
| 558 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor); | |
| 559 | |
| 560 __ bind(&slow); | |
| 561 PropertyAccessCompiler::TailCallBuiltin( | |
| 562 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | |
| 563 } | |
| 564 | |
| 565 | |
| 566 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { | 538 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 567 // Return address is on the stack. | 539 // Return address is on the stack. |
| 568 Label miss; | 540 Label miss; |
| 569 | 541 |
| 570 Register receiver = LoadDescriptor::ReceiverRegister(); | 542 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 571 Register index = LoadDescriptor::NameRegister(); | 543 Register index = LoadDescriptor::NameRegister(); |
| 572 Register scratch = rdi; | 544 Register scratch = rdi; |
| 573 Register result = rax; | 545 Register result = rax; |
| 574 DCHECK(!scratch.is(receiver) && !scratch.is(index)); | 546 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 575 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && | 547 DCHECK(!scratch.is(LoadWithVectorDescriptor::VectorRegister()) && |
| (...skipping 5030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5606 NULL); | 5578 NULL); |
| 5607 } | 5579 } |
| 5608 | 5580 |
| 5609 | 5581 |
| 5610 #undef __ | 5582 #undef __ |
| 5611 | 5583 |
| 5612 } // namespace internal | 5584 } // namespace internal |
| 5613 } // namespace v8 | 5585 } // namespace v8 |
| 5614 | 5586 |
| 5615 #endif // V8_TARGET_ARCH_X64 | 5587 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |