Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 1820843002: Turn LoadIndexedInterceptor into a Turbofan stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase again Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698