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

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

Issue 1820843002: Turn LoadIndexedInterceptor into a Turbofan stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
OLDNEW
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_IA32 5 #if V8_TARGET_ARCH_IA32
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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 __ j(equal, &miss); 659 __ j(equal, &miss);
660 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss); 660 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss);
661 __ ret(0); 661 __ ret(0);
662 662
663 __ bind(&miss); 663 __ bind(&miss);
664 PropertyAccessCompiler::TailCallBuiltin( 664 PropertyAccessCompiler::TailCallBuiltin(
665 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 665 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
666 } 666 }
667 667
668 668
669 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
670 // Return address is on the stack.
671 Label slow;
672
673 Register receiver = LoadDescriptor::ReceiverRegister();
674 Register key = LoadDescriptor::NameRegister();
675 Register scratch = eax;
676 DCHECK(!scratch.is(receiver) && !scratch.is(key));
677
678 // Check that the key is an array index, that is Uint32.
679 __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
680 __ j(not_zero, &slow);
681
682 // Everything is fine, call runtime.
683 __ pop(scratch);
684 __ push(receiver); // receiver
685 __ push(key); // key
686 __ push(scratch); // return address
687
688 // Perform tail call to the entry.
689 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor);
690
691 __ bind(&slow);
692 PropertyAccessCompiler::TailCallBuiltin(
693 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
694 }
695
696
697 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 669 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
698 // Return address is on the stack. 670 // Return address is on the stack.
699 Label miss; 671 Label miss;
700 672
701 Register receiver = LoadDescriptor::ReceiverRegister(); 673 Register receiver = LoadDescriptor::ReceiverRegister();
702 Register index = LoadDescriptor::NameRegister(); 674 Register index = LoadDescriptor::NameRegister();
703 Register scratch = edi; 675 Register scratch = edi;
704 DCHECK(!scratch.is(receiver) && !scratch.is(index)); 676 DCHECK(!scratch.is(receiver) && !scratch.is(index));
705 Register result = eax; 677 Register result = eax;
706 DCHECK(!result.is(scratch)); 678 DCHECK(!result.is(scratch));
(...skipping 5156 matching lines...) Expand 10 before | Expand all | Expand 10 after
5863 return_value_operand, NULL); 5835 return_value_operand, NULL);
5864 } 5836 }
5865 5837
5866 5838
5867 #undef __ 5839 #undef __
5868 5840
5869 } // namespace internal 5841 } // namespace internal
5870 } // namespace v8 5842 } // namespace v8
5871 5843
5872 #endif // V8_TARGET_ARCH_IA32 5844 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/code-stubs.cc ('K') | « src/code-stubs.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698