OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |