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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } | 666 } |
667 | 667 |
668 | 668 |
669 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 669 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
670 // Return address is on the stack. | 670 // Return address is on the stack. |
671 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); | 671 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); |
672 LoadIC_PushArgs(masm); | 672 LoadIC_PushArgs(masm); |
673 | 673 |
674 // Perform tail call to the entry. | 674 // Perform tail call to the entry. |
675 int arg_count = 4; | 675 int arg_count = 4; |
676 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1); | 676 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count); |
677 } | 677 } |
678 | 678 |
679 | 679 |
680 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 680 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
681 LanguageMode language_mode) { | 681 LanguageMode language_mode) { |
682 // Return address is on the stack. | 682 // Return address is on the stack. |
683 Register receiver = LoadDescriptor::ReceiverRegister(); | 683 Register receiver = LoadDescriptor::ReceiverRegister(); |
684 Register name = LoadDescriptor::NameRegister(); | 684 Register name = LoadDescriptor::NameRegister(); |
685 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 685 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
686 | 686 |
687 __ pop(ebx); | 687 __ pop(ebx); |
688 __ push(receiver); | 688 __ push(receiver); |
689 __ push(name); | 689 __ push(name); |
690 __ push(ebx); | 690 __ push(ebx); |
691 | 691 |
692 // Do tail-call to runtime routine. | 692 // Do tail-call to runtime routine. |
693 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 693 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
694 : Runtime::kGetProperty, | 694 : Runtime::kGetProperty, |
695 2, 1); | 695 2); |
696 } | 696 } |
697 | 697 |
698 | 698 |
699 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 699 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
700 // Return address is on the stack. | 700 // Return address is on the stack. |
701 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); | 701 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); |
702 | 702 |
703 LoadIC_PushArgs(masm); | 703 LoadIC_PushArgs(masm); |
704 | 704 |
705 // Perform tail call to the entry. | 705 // Perform tail call to the entry. |
706 int arg_count = 4; | 706 int arg_count = 4; |
707 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1); | 707 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count); |
708 } | 708 } |
709 | 709 |
710 | 710 |
711 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 711 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
712 LanguageMode language_mode) { | 712 LanguageMode language_mode) { |
713 // Return address is on the stack. | 713 // Return address is on the stack. |
714 Register receiver = LoadDescriptor::ReceiverRegister(); | 714 Register receiver = LoadDescriptor::ReceiverRegister(); |
715 Register name = LoadDescriptor::NameRegister(); | 715 Register name = LoadDescriptor::NameRegister(); |
716 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 716 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
717 | 717 |
718 __ pop(ebx); | 718 __ pop(ebx); |
719 __ push(receiver); | 719 __ push(receiver); |
720 __ push(name); | 720 __ push(name); |
721 __ push(ebx); | 721 __ push(ebx); |
722 | 722 |
723 // Do tail-call to runtime routine. | 723 // Do tail-call to runtime routine. |
724 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 724 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
725 : Runtime::kKeyedGetProperty, | 725 : Runtime::kKeyedGetProperty, |
726 2, 1); | 726 2); |
727 } | 727 } |
728 | 728 |
729 | 729 |
730 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 730 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
731 // This shouldn't be called. | 731 // This shouldn't be called. |
732 // TODO(mvstanton): remove this method. | 732 // TODO(mvstanton): remove this method. |
733 __ int3(); | 733 __ int3(); |
734 return; | 734 return; |
735 } | 735 } |
736 | 736 |
(...skipping 12 matching lines...) Expand all Loading... |
749 __ push(vector); | 749 __ push(vector); |
750 __ push(receiver); // Contains the return address. | 750 __ push(receiver); // Contains the return address. |
751 } | 751 } |
752 | 752 |
753 | 753 |
754 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 754 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
755 // Return address is on the stack. | 755 // Return address is on the stack. |
756 StoreIC_PushArgs(masm); | 756 StoreIC_PushArgs(masm); |
757 | 757 |
758 // Perform tail call to the entry. | 758 // Perform tail call to the entry. |
759 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5, 1); | 759 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); |
760 } | 760 } |
761 | 761 |
762 | 762 |
763 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 763 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
764 Label restore_miss; | 764 Label restore_miss; |
765 Register receiver = StoreDescriptor::ReceiverRegister(); | 765 Register receiver = StoreDescriptor::ReceiverRegister(); |
766 Register name = StoreDescriptor::NameRegister(); | 766 Register name = StoreDescriptor::NameRegister(); |
767 Register value = StoreDescriptor::ValueRegister(); | 767 Register value = StoreDescriptor::ValueRegister(); |
768 Register vector = VectorStoreICDescriptor::VectorRegister(); | 768 Register vector = VectorStoreICDescriptor::VectorRegister(); |
769 Register slot = VectorStoreICDescriptor::SlotRegister(); | 769 Register slot = VectorStoreICDescriptor::SlotRegister(); |
(...skipping 21 matching lines...) Expand all Loading... |
791 __ IncrementCounter(counters->store_normal_miss(), 1); | 791 __ IncrementCounter(counters->store_normal_miss(), 1); |
792 GenerateMiss(masm); | 792 GenerateMiss(masm); |
793 } | 793 } |
794 | 794 |
795 | 795 |
796 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 796 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
797 // Return address is on the stack. | 797 // Return address is on the stack. |
798 StoreIC_PushArgs(masm); | 798 StoreIC_PushArgs(masm); |
799 | 799 |
800 // Do tail-call to runtime routine. | 800 // Do tail-call to runtime routine. |
801 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5, 1); | 801 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); |
802 } | 802 } |
803 | 803 |
804 | 804 |
805 #undef __ | 805 #undef __ |
806 | 806 |
807 | 807 |
808 Condition CompareIC::ComputeCondition(Token::Value op) { | 808 Condition CompareIC::ComputeCondition(Token::Value op) { |
809 switch (op) { | 809 switch (op) { |
810 case Token::EQ_STRICT: | 810 case Token::EQ_STRICT: |
811 case Token::EQ: | 811 case Token::EQ: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 Condition cc = | 870 Condition cc = |
871 (check == ENABLE_INLINED_SMI_CHECK) | 871 (check == ENABLE_INLINED_SMI_CHECK) |
872 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 872 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
873 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 873 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
874 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 874 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
875 } | 875 } |
876 } // namespace internal | 876 } // namespace internal |
877 } // namespace v8 | 877 } // namespace v8 |
878 | 878 |
879 #endif // V8_TARGET_ARCH_X87 | 879 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |