OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 481 |
482 // Restore saved function. | 482 // Restore saved function. |
483 __ pop(r1); | 483 __ pop(r1); |
484 | 484 |
485 // Tear down temporary frame. | 485 // Tear down temporary frame. |
486 __ LeaveInternalFrame(); | 486 __ LeaveInternalFrame(); |
487 | 487 |
488 // Do a tail-call of the compiled function. | 488 // Do a tail-call of the compiled function. |
489 __ Jump(r2); | 489 __ Jump(r2); |
490 | 490 |
491 return GetCodeWithFlags(flags); | 491 return GetCodeWithFlags(flags, "LazyCompileStub"); |
492 } | 492 } |
493 | 493 |
494 | 494 |
495 Object* CallStubCompiler::CompileCallField(Object* object, | 495 Object* CallStubCompiler::CompileCallField(Object* object, |
496 JSObject* holder, | 496 JSObject* holder, |
497 int index) { | 497 int index, |
| 498 String* name) { |
498 // ----------- S t a t e ------------- | 499 // ----------- S t a t e ------------- |
499 // -- lr: return address | 500 // -- lr: return address |
500 // ----------------------------------- | 501 // ----------------------------------- |
501 Label miss; | 502 Label miss; |
502 | 503 |
503 const int argc = arguments().immediate(); | 504 const int argc = arguments().immediate(); |
504 | 505 |
505 // Get the receiver of the function from the stack into r0. | 506 // Get the receiver of the function from the stack into r0. |
506 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 507 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
507 // Check that the receiver isn't a smi. | 508 // Check that the receiver isn't a smi. |
(...skipping 23 matching lines...) Expand all Loading... |
531 | 532 |
532 // Invoke the function. | 533 // Invoke the function. |
533 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); | 534 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); |
534 | 535 |
535 // Handle call cache miss. | 536 // Handle call cache miss. |
536 __ bind(&miss); | 537 __ bind(&miss); |
537 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 538 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
538 __ Jump(ic, RelocInfo::CODE_TARGET); | 539 __ Jump(ic, RelocInfo::CODE_TARGET); |
539 | 540 |
540 // Return the generated code. | 541 // Return the generated code. |
541 return GetCode(FIELD); | 542 return GetCode(FIELD, name); |
542 } | 543 } |
543 | 544 |
544 | 545 |
545 Object* CallStubCompiler::CompileCallConstant(Object* object, | 546 Object* CallStubCompiler::CompileCallConstant(Object* object, |
546 JSObject* holder, | 547 JSObject* holder, |
547 JSFunction* function, | 548 JSFunction* function, |
548 CheckType check) { | 549 CheckType check) { |
549 // ----------- S t a t e ------------- | 550 // ----------- S t a t e ------------- |
550 // -- lr: return address | 551 // -- lr: return address |
551 // ----------------------------------- | 552 // ----------------------------------- |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 ParameterCount expected(function->shared()->formal_parameter_count()); | 653 ParameterCount expected(function->shared()->formal_parameter_count()); |
653 __ InvokeCode(code, expected, arguments(), | 654 __ InvokeCode(code, expected, arguments(), |
654 RelocInfo::CODE_TARGET, JUMP_FUNCTION); | 655 RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
655 | 656 |
656 // Handle call cache miss. | 657 // Handle call cache miss. |
657 __ bind(&miss); | 658 __ bind(&miss); |
658 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 659 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
659 __ Jump(ic, RelocInfo::CODE_TARGET); | 660 __ Jump(ic, RelocInfo::CODE_TARGET); |
660 | 661 |
661 // Return the generated code. | 662 // Return the generated code. |
662 return GetCode(CONSTANT_FUNCTION); | 663 String* function_name = NULL; |
| 664 if (function->shared()->name()->IsString()) { |
| 665 function_name = String::cast(function->shared()->name()); |
| 666 } |
| 667 return GetCode(CONSTANT_FUNCTION, function_name); |
663 } | 668 } |
664 | 669 |
665 | 670 |
666 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 671 Object* CallStubCompiler::CompileCallInterceptor(Object* object, |
667 JSObject* holder, | 672 JSObject* holder, |
668 String* name) { | 673 String* name) { |
669 // ----------- S t a t e ------------- | 674 // ----------- S t a t e ------------- |
670 // -- lr: return address | 675 // -- lr: return address |
671 // ----------------------------------- | 676 // ----------------------------------- |
672 Label miss; | 677 Label miss; |
673 | 678 |
674 // TODO(1224669): Implement. | 679 // TODO(1224669): Implement. |
675 | 680 |
676 // Handle call cache miss. | 681 // Handle call cache miss. |
677 __ bind(&miss); | 682 __ bind(&miss); |
678 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 683 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
679 __ Jump(ic, RelocInfo::CODE_TARGET); | 684 __ Jump(ic, RelocInfo::CODE_TARGET); |
680 | 685 |
681 // Return the generated code. | 686 // Return the generated code. |
682 return GetCode(INTERCEPTOR); | 687 return GetCode(INTERCEPTOR, name); |
683 } | 688 } |
684 | 689 |
685 | 690 |
686 Object* StoreStubCompiler::CompileStoreField(JSObject* object, | 691 Object* StoreStubCompiler::CompileStoreField(JSObject* object, |
687 int index, | 692 int index, |
688 Map* transition, | 693 Map* transition, |
689 String* name) { | 694 String* name) { |
690 // ----------- S t a t e ------------- | 695 // ----------- S t a t e ------------- |
691 // -- r0 : value | 696 // -- r0 : value |
692 // -- r2 : name | 697 // -- r2 : name |
(...skipping 12 matching lines...) Expand all Loading... |
705 index, | 710 index, |
706 transition, | 711 transition, |
707 r3, r2, r1, | 712 r3, r2, r1, |
708 &miss); | 713 &miss); |
709 __ bind(&miss); | 714 __ bind(&miss); |
710 __ mov(r2, Operand(Handle<String>(name))); // restore name | 715 __ mov(r2, Operand(Handle<String>(name))); // restore name |
711 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 716 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
712 __ Jump(ic, RelocInfo::CODE_TARGET); | 717 __ Jump(ic, RelocInfo::CODE_TARGET); |
713 | 718 |
714 // Return the generated code. | 719 // Return the generated code. |
715 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); | 720 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
716 } | 721 } |
717 | 722 |
718 | 723 |
719 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, | 724 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, |
720 AccessorInfo* callback, | 725 AccessorInfo* callback, |
721 String* name) { | 726 String* name) { |
722 // ----------- S t a t e ------------- | 727 // ----------- S t a t e ------------- |
723 // -- r0 : value | 728 // -- r0 : value |
724 // -- r2 : name | 729 // -- r2 : name |
725 // -- lr : return address | 730 // -- lr : return address |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 765 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
761 __ TailCallRuntime(store_callback_property, 4); | 766 __ TailCallRuntime(store_callback_property, 4); |
762 | 767 |
763 // Handle store cache miss. | 768 // Handle store cache miss. |
764 __ bind(&miss); | 769 __ bind(&miss); |
765 __ mov(r2, Operand(Handle<String>(name))); // restore name | 770 __ mov(r2, Operand(Handle<String>(name))); // restore name |
766 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 771 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
767 __ Jump(ic, RelocInfo::CODE_TARGET); | 772 __ Jump(ic, RelocInfo::CODE_TARGET); |
768 | 773 |
769 // Return the generated code. | 774 // Return the generated code. |
770 return GetCode(CALLBACKS); | 775 return GetCode(CALLBACKS, name); |
771 } | 776 } |
772 | 777 |
773 | 778 |
774 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, | 779 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, |
775 String* name) { | 780 String* name) { |
776 // ----------- S t a t e ------------- | 781 // ----------- S t a t e ------------- |
777 // -- r0 : value | 782 // -- r0 : value |
778 // -- r2 : name | 783 // -- r2 : name |
779 // -- lr : return address | 784 // -- lr : return address |
780 // -- [sp] : receiver | 785 // -- [sp] : receiver |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 817 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
813 __ TailCallRuntime(store_ic_property, 3); | 818 __ TailCallRuntime(store_ic_property, 3); |
814 | 819 |
815 // Handle store cache miss. | 820 // Handle store cache miss. |
816 __ bind(&miss); | 821 __ bind(&miss); |
817 __ mov(r2, Operand(Handle<String>(name))); // restore name | 822 __ mov(r2, Operand(Handle<String>(name))); // restore name |
818 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 823 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
819 __ Jump(ic, RelocInfo::CODE_TARGET); | 824 __ Jump(ic, RelocInfo::CODE_TARGET); |
820 | 825 |
821 // Return the generated code. | 826 // Return the generated code. |
822 return GetCode(INTERCEPTOR); | 827 return GetCode(INTERCEPTOR, name); |
823 } | 828 } |
824 | 829 |
825 | 830 |
826 Object* LoadStubCompiler::CompileLoadField(JSObject* object, | 831 Object* LoadStubCompiler::CompileLoadField(JSObject* object, |
827 JSObject* holder, | 832 JSObject* holder, |
828 int index) { | 833 int index, |
| 834 String* name) { |
829 // ----------- S t a t e ------------- | 835 // ----------- S t a t e ------------- |
830 // -- r2 : name | 836 // -- r2 : name |
831 // -- lr : return address | 837 // -- lr : return address |
832 // -- [sp] : receiver | 838 // -- [sp] : receiver |
833 // ----------------------------------- | 839 // ----------------------------------- |
834 Label miss; | 840 Label miss; |
835 | 841 |
836 __ ldr(r0, MemOperand(sp, 0)); | 842 __ ldr(r0, MemOperand(sp, 0)); |
837 | 843 |
838 GenerateLoadField(masm(), object, holder, r0, r3, r1, index, &miss); | 844 GenerateLoadField(masm(), object, holder, r0, r3, r1, index, &miss); |
839 __ bind(&miss); | 845 __ bind(&miss); |
840 GenerateLoadMiss(masm(), Code::LOAD_IC); | 846 GenerateLoadMiss(masm(), Code::LOAD_IC); |
841 | 847 |
842 // Return the generated code. | 848 // Return the generated code. |
843 return GetCode(FIELD); | 849 return GetCode(FIELD, name); |
844 } | 850 } |
845 | 851 |
846 | 852 |
847 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, | 853 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, |
848 JSObject* holder, | 854 JSObject* holder, |
849 AccessorInfo* callback) { | 855 AccessorInfo* callback, |
| 856 String* name) { |
850 // ----------- S t a t e ------------- | 857 // ----------- S t a t e ------------- |
851 // -- r2 : name | 858 // -- r2 : name |
852 // -- lr : return address | 859 // -- lr : return address |
853 // -- [sp] : receiver | 860 // -- [sp] : receiver |
854 // ----------------------------------- | 861 // ----------------------------------- |
855 Label miss; | 862 Label miss; |
856 | 863 |
857 __ ldr(r0, MemOperand(sp, 0)); | 864 __ ldr(r0, MemOperand(sp, 0)); |
858 GenerateLoadCallback(masm(), object, holder, r0, r2, r3, r1, callback, &miss); | 865 GenerateLoadCallback(masm(), object, holder, r0, r2, r3, r1, callback, &miss); |
859 __ bind(&miss); | 866 __ bind(&miss); |
860 GenerateLoadMiss(masm(), Code::LOAD_IC); | 867 GenerateLoadMiss(masm(), Code::LOAD_IC); |
861 | 868 |
862 // Return the generated code. | 869 // Return the generated code. |
863 return GetCode(CALLBACKS); | 870 return GetCode(CALLBACKS, name); |
864 } | 871 } |
865 | 872 |
866 | 873 |
867 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 874 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
868 JSObject* holder, | 875 JSObject* holder, |
869 Object* value) { | 876 Object* value, |
| 877 String* name) { |
870 // ----------- S t a t e ------------- | 878 // ----------- S t a t e ------------- |
871 // -- r2 : name | 879 // -- r2 : name |
872 // -- lr : return address | 880 // -- lr : return address |
873 // -- [sp] : receiver | 881 // -- [sp] : receiver |
874 // ----------------------------------- | 882 // ----------------------------------- |
875 Label miss; | 883 Label miss; |
876 | 884 |
877 __ ldr(r0, MemOperand(sp, 0)); | 885 __ ldr(r0, MemOperand(sp, 0)); |
878 | 886 |
879 GenerateLoadConstant(masm(), object, holder, r0, r3, r1, value, &miss); | 887 GenerateLoadConstant(masm(), object, holder, r0, r3, r1, value, &miss); |
880 __ bind(&miss); | 888 __ bind(&miss); |
881 GenerateLoadMiss(masm(), Code::LOAD_IC); | 889 GenerateLoadMiss(masm(), Code::LOAD_IC); |
882 | 890 |
883 // Return the generated code. | 891 // Return the generated code. |
884 return GetCode(CONSTANT_FUNCTION); | 892 return GetCode(CONSTANT_FUNCTION, name); |
885 } | 893 } |
886 | 894 |
887 | 895 |
888 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object, | 896 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object, |
889 JSObject* holder, | 897 JSObject* holder, |
890 String* name) { | 898 String* name) { |
891 // ----------- S t a t e ------------- | 899 // ----------- S t a t e ------------- |
892 // -- r2 : name | 900 // -- r2 : name |
893 // -- lr : return address | 901 // -- lr : return address |
894 // -- [sp] : receiver | 902 // -- [sp] : receiver |
895 // ----------------------------------- | 903 // ----------------------------------- |
896 Label miss; | 904 Label miss; |
897 | 905 |
898 __ ldr(r0, MemOperand(sp, 0)); | 906 __ ldr(r0, MemOperand(sp, 0)); |
899 | 907 |
900 GenerateLoadInterceptor(masm(), object, holder, r0, r2, r3, r1, &miss); | 908 GenerateLoadInterceptor(masm(), object, holder, r0, r2, r3, r1, &miss); |
901 __ bind(&miss); | 909 __ bind(&miss); |
902 GenerateLoadMiss(masm(), Code::LOAD_IC); | 910 GenerateLoadMiss(masm(), Code::LOAD_IC); |
903 | 911 |
904 // Return the generated code. | 912 // Return the generated code. |
905 return GetCode(INTERCEPTOR); | 913 return GetCode(INTERCEPTOR, name); |
906 } | 914 } |
907 | 915 |
908 | 916 |
909 // TODO(1224671): IC stubs for keyed loads have not been implemented | 917 // TODO(1224671): IC stubs for keyed loads have not been implemented |
910 // for ARM. | 918 // for ARM. |
911 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, | 919 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, |
912 JSObject* receiver, | 920 JSObject* receiver, |
913 JSObject* holder, | 921 JSObject* holder, |
914 int index) { | 922 int index) { |
915 // ----------- S t a t e ------------- | 923 // ----------- S t a t e ------------- |
916 // -- lr : return address | 924 // -- lr : return address |
917 // -- sp[0] : key | 925 // -- sp[0] : key |
918 // -- sp[4] : receiver | 926 // -- sp[4] : receiver |
919 // ----------------------------------- | 927 // ----------------------------------- |
920 Label miss; | 928 Label miss; |
921 | 929 |
922 __ ldr(r2, MemOperand(sp, 0)); | 930 __ ldr(r2, MemOperand(sp, 0)); |
923 __ ldr(r0, MemOperand(sp, kPointerSize)); | 931 __ ldr(r0, MemOperand(sp, kPointerSize)); |
924 | 932 |
925 __ cmp(r2, Operand(Handle<String>(name))); | 933 __ cmp(r2, Operand(Handle<String>(name))); |
926 __ b(ne, &miss); | 934 __ b(ne, &miss); |
927 | 935 |
928 GenerateLoadField(masm(), receiver, holder, r0, r3, r1, index, &miss); | 936 GenerateLoadField(masm(), receiver, holder, r0, r3, r1, index, &miss); |
929 __ bind(&miss); | 937 __ bind(&miss); |
930 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 938 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
931 | 939 |
932 return GetCode(FIELD); | 940 return GetCode(FIELD, name); |
933 } | 941 } |
934 | 942 |
935 | 943 |
936 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, | 944 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, |
937 JSObject* receiver, | 945 JSObject* receiver, |
938 JSObject* holder, | 946 JSObject* holder, |
939 AccessorInfo* callback) { | 947 AccessorInfo* callback) { |
940 // ----------- S t a t e ------------- | 948 // ----------- S t a t e ------------- |
941 // -- lr : return address | 949 // -- lr : return address |
942 // -- sp[0] : key | 950 // -- sp[0] : key |
943 // -- sp[4] : receiver | 951 // -- sp[4] : receiver |
944 // ----------------------------------- | 952 // ----------------------------------- |
945 Label miss; | 953 Label miss; |
946 | 954 |
947 __ ldr(r2, MemOperand(sp, 0)); | 955 __ ldr(r2, MemOperand(sp, 0)); |
948 __ ldr(r0, MemOperand(sp, kPointerSize)); | 956 __ ldr(r0, MemOperand(sp, kPointerSize)); |
949 | 957 |
950 __ cmp(r2, Operand(Handle<String>(name))); | 958 __ cmp(r2, Operand(Handle<String>(name))); |
951 __ b(ne, &miss); | 959 __ b(ne, &miss); |
952 | 960 |
953 GenerateLoadCallback(masm(), receiver, holder, r0, r2, r3, | 961 GenerateLoadCallback(masm(), receiver, holder, r0, r2, r3, |
954 r1, callback, &miss); | 962 r1, callback, &miss); |
955 __ bind(&miss); | 963 __ bind(&miss); |
956 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 964 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
957 | 965 |
958 return GetCode(CALLBACKS); | 966 return GetCode(CALLBACKS, name); |
959 } | 967 } |
960 | 968 |
961 | 969 |
962 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 970 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
963 JSObject* receiver, | 971 JSObject* receiver, |
964 JSObject* holder, | 972 JSObject* holder, |
965 Object* value) { | 973 Object* value) { |
966 // ----------- S t a t e ------------- | 974 // ----------- S t a t e ------------- |
967 // -- lr : return address | 975 // -- lr : return address |
968 // -- sp[0] : key | 976 // -- sp[0] : key |
969 // -- sp[4] : receiver | 977 // -- sp[4] : receiver |
970 // ----------------------------------- | 978 // ----------------------------------- |
971 Label miss; | 979 Label miss; |
972 | 980 |
973 // Check the key is the cached one | 981 // Check the key is the cached one |
974 __ ldr(r2, MemOperand(sp, 0)); | 982 __ ldr(r2, MemOperand(sp, 0)); |
975 __ ldr(r0, MemOperand(sp, kPointerSize)); | 983 __ ldr(r0, MemOperand(sp, kPointerSize)); |
976 | 984 |
977 __ cmp(r2, Operand(Handle<String>(name))); | 985 __ cmp(r2, Operand(Handle<String>(name))); |
978 __ b(ne, &miss); | 986 __ b(ne, &miss); |
979 | 987 |
980 GenerateLoadConstant(masm(), receiver, holder, r0, r3, r1, value, &miss); | 988 GenerateLoadConstant(masm(), receiver, holder, r0, r3, r1, value, &miss); |
981 __ bind(&miss); | 989 __ bind(&miss); |
982 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 990 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
983 | 991 |
984 // Return the generated code. | 992 // Return the generated code. |
985 return GetCode(CONSTANT_FUNCTION); | 993 return GetCode(CONSTANT_FUNCTION, name); |
986 } | 994 } |
987 | 995 |
988 | 996 |
989 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 997 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
990 JSObject* holder, | 998 JSObject* holder, |
991 String* name) { | 999 String* name) { |
992 // ----------- S t a t e ------------- | 1000 // ----------- S t a t e ------------- |
993 // -- lr : return address | 1001 // -- lr : return address |
994 // -- sp[0] : key | 1002 // -- sp[0] : key |
995 // -- sp[4] : receiver | 1003 // -- sp[4] : receiver |
996 // ----------------------------------- | 1004 // ----------------------------------- |
997 Label miss; | 1005 Label miss; |
998 | 1006 |
999 // Check the key is the cached one | 1007 // Check the key is the cached one |
1000 __ ldr(r2, MemOperand(sp, 0)); | 1008 __ ldr(r2, MemOperand(sp, 0)); |
1001 __ ldr(r0, MemOperand(sp, kPointerSize)); | 1009 __ ldr(r0, MemOperand(sp, kPointerSize)); |
1002 | 1010 |
1003 __ cmp(r2, Operand(Handle<String>(name))); | 1011 __ cmp(r2, Operand(Handle<String>(name))); |
1004 __ b(ne, &miss); | 1012 __ b(ne, &miss); |
1005 | 1013 |
1006 GenerateLoadInterceptor(masm(), receiver, holder, r0, r2, r3, r1, &miss); | 1014 GenerateLoadInterceptor(masm(), receiver, holder, r0, r2, r3, r1, &miss); |
1007 __ bind(&miss); | 1015 __ bind(&miss); |
1008 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1016 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1009 | 1017 |
1010 return GetCode(INTERCEPTOR); | 1018 return GetCode(INTERCEPTOR, name); |
1011 } | 1019 } |
1012 | 1020 |
1013 | 1021 |
1014 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { | 1022 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { |
1015 // ----------- S t a t e ------------- | 1023 // ----------- S t a t e ------------- |
1016 // -- lr : return address | 1024 // -- lr : return address |
1017 // -- sp[0] : key | 1025 // -- sp[0] : key |
1018 // -- sp[4] : receiver | 1026 // -- sp[4] : receiver |
1019 // ----------------------------------- | 1027 // ----------------------------------- |
1020 Label miss; | 1028 Label miss; |
1021 | 1029 |
1022 // Check the key is the cached one | 1030 // Check the key is the cached one |
1023 __ ldr(r2, MemOperand(sp, 0)); | 1031 __ ldr(r2, MemOperand(sp, 0)); |
1024 __ ldr(r0, MemOperand(sp, kPointerSize)); | 1032 __ ldr(r0, MemOperand(sp, kPointerSize)); |
1025 | 1033 |
1026 __ cmp(r2, Operand(Handle<String>(name))); | 1034 __ cmp(r2, Operand(Handle<String>(name))); |
1027 __ b(ne, &miss); | 1035 __ b(ne, &miss); |
1028 | 1036 |
1029 GenerateLoadArrayLength(masm(), r0, r3, &miss); | 1037 GenerateLoadArrayLength(masm(), r0, r3, &miss); |
1030 __ bind(&miss); | 1038 __ bind(&miss); |
1031 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1039 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1032 | 1040 |
1033 return GetCode(CALLBACKS); | 1041 return GetCode(CALLBACKS, name); |
1034 } | 1042 } |
1035 | 1043 |
1036 | 1044 |
1037 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { | 1045 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { |
1038 // ----------- S t a t e ------------- | 1046 // ----------- S t a t e ------------- |
1039 // -- lr : return address | 1047 // -- lr : return address |
1040 // -- sp[0] : key | 1048 // -- sp[0] : key |
1041 // -- sp[4] : receiver | 1049 // -- sp[4] : receiver |
1042 // ----------------------------------- | 1050 // ----------------------------------- |
1043 Label miss; | 1051 Label miss; |
1044 __ IncrementCounter(&Counters::keyed_load_string_length, 1, r1, r3); | 1052 __ IncrementCounter(&Counters::keyed_load_string_length, 1, r1, r3); |
1045 | 1053 |
1046 __ ldr(r2, MemOperand(sp)); | 1054 __ ldr(r2, MemOperand(sp)); |
1047 __ ldr(r0, MemOperand(sp, kPointerSize)); // receiver | 1055 __ ldr(r0, MemOperand(sp, kPointerSize)); // receiver |
1048 | 1056 |
1049 __ cmp(r2, Operand(Handle<String>(name))); | 1057 __ cmp(r2, Operand(Handle<String>(name))); |
1050 __ b(ne, &miss); | 1058 __ b(ne, &miss); |
1051 | 1059 |
1052 GenerateLoadStringLength2(masm(), r0, r1, r3, &miss); | 1060 GenerateLoadStringLength2(masm(), r0, r1, r3, &miss); |
1053 __ bind(&miss); | 1061 __ bind(&miss); |
1054 __ DecrementCounter(&Counters::keyed_load_string_length, 1, r1, r3); | 1062 __ DecrementCounter(&Counters::keyed_load_string_length, 1, r1, r3); |
1055 | 1063 |
1056 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1064 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1057 | 1065 |
1058 return GetCode(CALLBACKS); | 1066 return GetCode(CALLBACKS, name); |
1059 } | 1067 } |
1060 | 1068 |
1061 | 1069 |
1062 // TODO(1224671): implement the fast case. | 1070 // TODO(1224671): implement the fast case. |
1063 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { | 1071 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { |
1064 // ----------- S t a t e ------------- | 1072 // ----------- S t a t e ------------- |
1065 // -- lr : return address | 1073 // -- lr : return address |
1066 // -- sp[0] : key | 1074 // -- sp[0] : key |
1067 // -- sp[4] : receiver | 1075 // -- sp[4] : receiver |
1068 // ----------------------------------- | 1076 // ----------------------------------- |
1069 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1077 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1070 | 1078 |
1071 return GetCode(CALLBACKS); | 1079 return GetCode(CALLBACKS, name); |
1072 } | 1080 } |
1073 | 1081 |
1074 | 1082 |
1075 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | 1083 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
1076 int index, | 1084 int index, |
1077 Map* transition, | 1085 Map* transition, |
1078 String* name) { | 1086 String* name) { |
1079 // ----------- S t a t e ------------- | 1087 // ----------- S t a t e ------------- |
1080 // -- r0 : value | 1088 // -- r0 : value |
1081 // -- r2 : name | 1089 // -- r2 : name |
(...skipping 19 matching lines...) Expand all Loading... |
1101 r3, r2, r1, | 1109 r3, r2, r1, |
1102 &miss); | 1110 &miss); |
1103 __ bind(&miss); | 1111 __ bind(&miss); |
1104 | 1112 |
1105 __ DecrementCounter(&Counters::keyed_store_field, 1, r1, r3); | 1113 __ DecrementCounter(&Counters::keyed_store_field, 1, r1, r3); |
1106 __ mov(r2, Operand(Handle<String>(name))); // restore name register. | 1114 __ mov(r2, Operand(Handle<String>(name))); // restore name register. |
1107 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); | 1115 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); |
1108 __ Jump(ic, RelocInfo::CODE_TARGET); | 1116 __ Jump(ic, RelocInfo::CODE_TARGET); |
1109 | 1117 |
1110 // Return the generated code. | 1118 // Return the generated code. |
1111 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); | 1119 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
1112 } | 1120 } |
1113 | 1121 |
1114 | 1122 |
1115 #undef __ | 1123 #undef __ |
1116 | 1124 |
1117 } } // namespace v8::internal | 1125 } } // namespace v8::internal |
OLD | NEW |