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

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

Issue 767743002: Hydrogen code stubs for vector-based ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 6 years 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/hydrogen-instructions.cc ('k') | src/ia32/lithium-codegen-ia32.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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 __ bind(&done); 645 __ bind(&done);
646 __ IncrementCounter(counters->math_pow(), 1); 646 __ IncrementCounter(counters->math_pow(), 1);
647 __ ret(0); 647 __ ret(0);
648 } 648 }
649 } 649 }
650 650
651 651
652 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { 652 void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
653 Label miss; 653 Label miss;
654 Register receiver = LoadDescriptor::ReceiverRegister(); 654 Register receiver = LoadDescriptor::ReceiverRegister();
655 if (FLAG_vector_ics) {
656 // With careful management, we won't have to save slot and vector on
657 // the stack. Simply handle the possibly missing case first.
658 // TODO(mvstanton): this code can be more efficient.
659 __ cmp(FieldOperand(receiver, JSFunction::kPrototypeOrInitialMapOffset),
660 Immediate(isolate()->factory()->the_hole_value()));
661 __ j(equal, &miss);
662 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss);
663 __ ret(0);
664 } else {
665 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax,
666 ebx, &miss);
667 }
655 668
656 NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax,
657 ebx, &miss);
658 __ bind(&miss); 669 __ bind(&miss);
659 PropertyAccessCompiler::TailCallBuiltin( 670 PropertyAccessCompiler::TailCallBuiltin(
660 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 671 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
661 } 672 }
662 673
663 674
664 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { 675 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
665 // Return address is on the stack. 676 // Return address is on the stack.
666 Label slow; 677 Label slow;
667 678
(...skipping 22 matching lines...) Expand all
690 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 701 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
691 } 702 }
692 703
693 704
694 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 705 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
695 // Return address is on the stack. 706 // Return address is on the stack.
696 Label miss; 707 Label miss;
697 708
698 Register receiver = LoadDescriptor::ReceiverRegister(); 709 Register receiver = LoadDescriptor::ReceiverRegister();
699 Register index = LoadDescriptor::NameRegister(); 710 Register index = LoadDescriptor::NameRegister();
700 Register scratch = ebx; 711 Register scratch = edi;
701 DCHECK(!scratch.is(receiver) && !scratch.is(index)); 712 DCHECK(!scratch.is(receiver) && !scratch.is(index));
702 Register result = eax; 713 Register result = eax;
703 DCHECK(!result.is(scratch)); 714 DCHECK(!result.is(scratch));
715 DCHECK(!FLAG_vector_ics ||
716 (!scratch.is(VectorLoadICDescriptor::VectorRegister()) &&
717 result.is(VectorLoadICDescriptor::SlotRegister())));
704 718
719 // StringCharAtGenerator doesn't use the result register until it's passed
720 // the different miss possibilities. If it did, we would have a conflict
721 // when FLAG_vector_ics is true.
705 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, 722 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
706 &miss, // When not a string. 723 &miss, // When not a string.
707 &miss, // When not a number. 724 &miss, // When not a number.
708 &miss, // When index out of range. 725 &miss, // When index out of range.
709 STRING_INDEX_IS_ARRAY_INDEX, 726 STRING_INDEX_IS_ARRAY_INDEX,
710 RECEIVER_IS_STRING); 727 RECEIVER_IS_STRING);
711 char_at_generator.GenerateFast(masm); 728 char_at_generator.GenerateFast(masm);
712 __ ret(0); 729 __ ret(0);
713 730
714 StubRuntimeCallHelper call_helper; 731 StubRuntimeCallHelper call_helper;
(...skipping 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after
4795 Operand(ebp, 7 * kPointerSize), 4812 Operand(ebp, 7 * kPointerSize),
4796 NULL); 4813 NULL);
4797 } 4814 }
4798 4815
4799 4816
4800 #undef __ 4817 #undef __
4801 4818
4802 } } // namespace v8::internal 4819 } } // namespace v8::internal
4803 4820
4804 #endif // V8_TARGET_ARCH_IA32 4821 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698