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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 __ CallRuntime(Runtime::kLazyCompile, 1); | 458 __ CallRuntime(Runtime::kLazyCompile, 1); |
459 __ pop(edi); | 459 __ pop(edi); |
460 | 460 |
461 // Tear down temporary frame. | 461 // Tear down temporary frame. |
462 __ LeaveInternalFrame(); | 462 __ LeaveInternalFrame(); |
463 | 463 |
464 // Do a tail-call of the compiled function. | 464 // Do a tail-call of the compiled function. |
465 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); | 465 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); |
466 __ jmp(Operand(ecx)); | 466 __ jmp(Operand(ecx)); |
467 | 467 |
468 return GetCodeWithFlags(flags); | 468 return GetCodeWithFlags(flags, "LazyCompileStub"); |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 Object* CallStubCompiler::CompileCallField(Object* object, | 472 Object* CallStubCompiler::CompileCallField(Object* object, |
473 JSObject* holder, | 473 JSObject* holder, |
474 int index) { | 474 int index, |
| 475 String* name) { |
475 // ----------- S t a t e ------------- | 476 // ----------- S t a t e ------------- |
476 // ----------------------------------- | 477 // ----------------------------------- |
477 Label miss; | 478 Label miss; |
478 | 479 |
479 // Get the receiver from the stack. | 480 // Get the receiver from the stack. |
480 const int argc = arguments().immediate(); | 481 const int argc = arguments().immediate(); |
481 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 482 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
482 | 483 |
483 // Check that the receiver isn't a smi. | 484 // Check that the receiver isn't a smi. |
484 __ test(edx, Immediate(kSmiTagMask)); | 485 __ test(edx, Immediate(kSmiTagMask)); |
(...skipping 22 matching lines...) Expand all Loading... |
507 | 508 |
508 // Invoke the function. | 509 // Invoke the function. |
509 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); | 510 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); |
510 | 511 |
511 // Handle call cache miss. | 512 // Handle call cache miss. |
512 __ bind(&miss); | 513 __ bind(&miss); |
513 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 514 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
514 __ jmp(ic, RelocInfo::CODE_TARGET); | 515 __ jmp(ic, RelocInfo::CODE_TARGET); |
515 | 516 |
516 // Return the generated code. | 517 // Return the generated code. |
517 return GetCode(FIELD); | 518 return GetCode(FIELD, name); |
518 } | 519 } |
519 | 520 |
520 | 521 |
521 Object* CallStubCompiler::CompileCallConstant(Object* object, | 522 Object* CallStubCompiler::CompileCallConstant(Object* object, |
522 JSObject* holder, | 523 JSObject* holder, |
523 JSFunction* function, | 524 JSFunction* function, |
524 CheckType check) { | 525 CheckType check) { |
525 // ----------- S t a t e ------------- | 526 // ----------- S t a t e ------------- |
526 // ----------------------------------- | 527 // ----------------------------------- |
527 Label miss; | 528 Label miss; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 ParameterCount expected(function->shared()->formal_parameter_count()); | 628 ParameterCount expected(function->shared()->formal_parameter_count()); |
628 __ InvokeCode(code, expected, arguments(), | 629 __ InvokeCode(code, expected, arguments(), |
629 RelocInfo::CODE_TARGET, JUMP_FUNCTION); | 630 RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
630 | 631 |
631 // Handle call cache miss. | 632 // Handle call cache miss. |
632 __ bind(&miss); | 633 __ bind(&miss); |
633 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 634 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
634 __ jmp(ic, RelocInfo::CODE_TARGET); | 635 __ jmp(ic, RelocInfo::CODE_TARGET); |
635 | 636 |
636 // Return the generated code. | 637 // Return the generated code. |
637 return GetCode(CONSTANT_FUNCTION); | 638 String* function_name = NULL; |
| 639 if (function->shared()->name()->IsString()) { |
| 640 function_name = String::cast(function->shared()->name()); |
| 641 } |
| 642 return GetCode(CONSTANT_FUNCTION, function_name); |
638 } | 643 } |
639 | 644 |
640 | 645 |
641 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 646 Object* CallStubCompiler::CompileCallInterceptor(Object* object, |
642 JSObject* holder, | 647 JSObject* holder, |
643 String* name) { | 648 String* name) { |
644 // ----------- S t a t e ------------- | 649 // ----------- S t a t e ------------- |
645 // ----------------------------------- | 650 // ----------------------------------- |
646 Label miss; | 651 Label miss; |
647 | 652 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 705 |
701 // Invoke the function. | 706 // Invoke the function. |
702 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); | 707 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); |
703 | 708 |
704 // Handle load cache miss. | 709 // Handle load cache miss. |
705 __ bind(&miss); | 710 __ bind(&miss); |
706 Handle<Code> ic = ComputeCallMiss(argc); | 711 Handle<Code> ic = ComputeCallMiss(argc); |
707 __ jmp(ic, RelocInfo::CODE_TARGET); | 712 __ jmp(ic, RelocInfo::CODE_TARGET); |
708 | 713 |
709 // Return the generated code. | 714 // Return the generated code. |
710 return GetCode(INTERCEPTOR); | 715 return GetCode(INTERCEPTOR, name); |
711 } | 716 } |
712 | 717 |
713 | 718 |
714 Object* StoreStubCompiler::CompileStoreField(JSObject* object, | 719 Object* StoreStubCompiler::CompileStoreField(JSObject* object, |
715 int index, | 720 int index, |
716 Map* transition, | 721 Map* transition, |
717 String* name) { | 722 String* name) { |
718 // ----------- S t a t e ------------- | 723 // ----------- S t a t e ------------- |
719 // -- eax : value | 724 // -- eax : value |
720 // -- ecx : name | 725 // -- ecx : name |
(...skipping 14 matching lines...) Expand all Loading... |
735 ebx, ecx, edx, | 740 ebx, ecx, edx, |
736 &miss); | 741 &miss); |
737 | 742 |
738 // Handle store cache miss. | 743 // Handle store cache miss. |
739 __ bind(&miss); | 744 __ bind(&miss); |
740 __ mov(ecx, Immediate(Handle<String>(name))); // restore name | 745 __ mov(ecx, Immediate(Handle<String>(name))); // restore name |
741 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 746 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
742 __ jmp(ic, RelocInfo::CODE_TARGET); | 747 __ jmp(ic, RelocInfo::CODE_TARGET); |
743 | 748 |
744 // Return the generated code. | 749 // Return the generated code. |
745 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); | 750 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
746 } | 751 } |
747 | 752 |
748 | 753 |
749 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, | 754 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, |
750 AccessorInfo* callback, | 755 AccessorInfo* callback, |
751 String* name) { | 756 String* name) { |
752 // ----------- S t a t e ------------- | 757 // ----------- S t a t e ------------- |
753 // -- eax : value | 758 // -- eax : value |
754 // -- ecx : name | 759 // -- ecx : name |
755 // -- esp[0] : return address | 760 // -- esp[0] : return address |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 795 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
791 __ TailCallRuntime(store_callback_property, 4); | 796 __ TailCallRuntime(store_callback_property, 4); |
792 | 797 |
793 // Handle store cache miss. | 798 // Handle store cache miss. |
794 __ bind(&miss); | 799 __ bind(&miss); |
795 __ mov(ecx, Immediate(Handle<String>(name))); // restore name | 800 __ mov(ecx, Immediate(Handle<String>(name))); // restore name |
796 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 801 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
797 __ jmp(ic, RelocInfo::CODE_TARGET); | 802 __ jmp(ic, RelocInfo::CODE_TARGET); |
798 | 803 |
799 // Return the generated code. | 804 // Return the generated code. |
800 return GetCode(CALLBACKS); | 805 return GetCode(CALLBACKS, name); |
801 } | 806 } |
802 | 807 |
803 | 808 |
804 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, | 809 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, |
805 String* name) { | 810 String* name) { |
806 // ----------- S t a t e ------------- | 811 // ----------- S t a t e ------------- |
807 // -- eax : value | 812 // -- eax : value |
808 // -- ecx : name | 813 // -- ecx : name |
809 // -- esp[0] : return address | 814 // -- esp[0] : return address |
810 // -- esp[4] : receiver | 815 // -- esp[4] : receiver |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 848 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
844 __ TailCallRuntime(store_ic_property, 3); | 849 __ TailCallRuntime(store_ic_property, 3); |
845 | 850 |
846 // Handle store cache miss. | 851 // Handle store cache miss. |
847 __ bind(&miss); | 852 __ bind(&miss); |
848 __ mov(ecx, Immediate(Handle<String>(name))); // restore name | 853 __ mov(ecx, Immediate(Handle<String>(name))); // restore name |
849 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 854 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
850 __ jmp(ic, RelocInfo::CODE_TARGET); | 855 __ jmp(ic, RelocInfo::CODE_TARGET); |
851 | 856 |
852 // Return the generated code. | 857 // Return the generated code. |
853 return GetCode(INTERCEPTOR); | 858 return GetCode(INTERCEPTOR, name); |
854 } | 859 } |
855 | 860 |
856 | 861 |
857 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | 862 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
858 int index, | 863 int index, |
859 Map* transition, | 864 Map* transition, |
860 String* name) { | 865 String* name) { |
861 // ----------- S t a t e ------------- | 866 // ----------- S t a t e ------------- |
862 // -- eax : value | 867 // -- eax : value |
863 // -- esp[0] : return address | 868 // -- esp[0] : return address |
(...skipping 22 matching lines...) Expand all Loading... |
886 ebx, ecx, edx, | 891 ebx, ecx, edx, |
887 &miss); | 892 &miss); |
888 | 893 |
889 // Handle store cache miss. | 894 // Handle store cache miss. |
890 __ bind(&miss); | 895 __ bind(&miss); |
891 __ DecrementCounter(&Counters::keyed_store_field, 1); | 896 __ DecrementCounter(&Counters::keyed_store_field, 1); |
892 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); | 897 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); |
893 __ jmp(ic, RelocInfo::CODE_TARGET); | 898 __ jmp(ic, RelocInfo::CODE_TARGET); |
894 | 899 |
895 // Return the generated code. | 900 // Return the generated code. |
896 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); | 901 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
897 } | 902 } |
898 | 903 |
899 | 904 |
900 Object* LoadStubCompiler::CompileLoadField(JSObject* object, | 905 Object* LoadStubCompiler::CompileLoadField(JSObject* object, |
901 JSObject* holder, | 906 JSObject* holder, |
902 int index) { | 907 int index, |
| 908 String* name) { |
903 // ----------- S t a t e ------------- | 909 // ----------- S t a t e ------------- |
904 // -- ecx : name | 910 // -- ecx : name |
905 // -- esp[0] : return address | 911 // -- esp[0] : return address |
906 // -- esp[4] : receiver | 912 // -- esp[4] : receiver |
907 // ----------------------------------- | 913 // ----------------------------------- |
908 Label miss; | 914 Label miss; |
909 | 915 |
910 __ mov(eax, (Operand(esp, kPointerSize))); | 916 __ mov(eax, (Operand(esp, kPointerSize))); |
911 GenerateLoadField(masm(), object, holder, eax, ebx, edx, index, &miss); | 917 GenerateLoadField(masm(), object, holder, eax, ebx, edx, index, &miss); |
912 __ bind(&miss); | 918 __ bind(&miss); |
913 GenerateLoadMiss(masm(), Code::LOAD_IC); | 919 GenerateLoadMiss(masm(), Code::LOAD_IC); |
914 | 920 |
915 // Return the generated code. | 921 // Return the generated code. |
916 return GetCode(FIELD); | 922 return GetCode(FIELD, name); |
917 } | 923 } |
918 | 924 |
919 | 925 |
920 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, | 926 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, |
921 JSObject* holder, | 927 JSObject* holder, |
922 AccessorInfo* callback) { | 928 AccessorInfo* callback, |
| 929 String* name) { |
923 // ----------- S t a t e ------------- | 930 // ----------- S t a t e ------------- |
924 // -- ecx : name | 931 // -- ecx : name |
925 // -- esp[0] : return address | 932 // -- esp[0] : return address |
926 // -- esp[4] : receiver | 933 // -- esp[4] : receiver |
927 // ----------------------------------- | 934 // ----------------------------------- |
928 Label miss; | 935 Label miss; |
929 | 936 |
930 __ mov(eax, (Operand(esp, kPointerSize))); | 937 __ mov(eax, (Operand(esp, kPointerSize))); |
931 GenerateLoadCallback(masm(), object, holder, eax, ecx, ebx, | 938 GenerateLoadCallback(masm(), object, holder, eax, ecx, ebx, |
932 edx, callback, &miss); | 939 edx, callback, &miss); |
933 __ bind(&miss); | 940 __ bind(&miss); |
934 GenerateLoadMiss(masm(), Code::LOAD_IC); | 941 GenerateLoadMiss(masm(), Code::LOAD_IC); |
935 | 942 |
936 // Return the generated code. | 943 // Return the generated code. |
937 return GetCode(CALLBACKS); | 944 return GetCode(CALLBACKS, name); |
938 } | 945 } |
939 | 946 |
940 | 947 |
941 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 948 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
942 JSObject* holder, | 949 JSObject* holder, |
943 Object* value) { | 950 Object* value, |
| 951 String* name) { |
944 // ----------- S t a t e ------------- | 952 // ----------- S t a t e ------------- |
945 // -- ecx : name | 953 // -- ecx : name |
946 // -- esp[0] : return address | 954 // -- esp[0] : return address |
947 // -- esp[4] : receiver | 955 // -- esp[4] : receiver |
948 // ----------------------------------- | 956 // ----------------------------------- |
949 Label miss; | 957 Label miss; |
950 | 958 |
951 __ mov(eax, (Operand(esp, kPointerSize))); | 959 __ mov(eax, (Operand(esp, kPointerSize))); |
952 GenerateLoadConstant(masm(), object, holder, eax, ebx, edx, value, &miss); | 960 GenerateLoadConstant(masm(), object, holder, eax, ebx, edx, value, &miss); |
953 __ bind(&miss); | 961 __ bind(&miss); |
954 GenerateLoadMiss(masm(), Code::LOAD_IC); | 962 GenerateLoadMiss(masm(), Code::LOAD_IC); |
955 | 963 |
956 // Return the generated code. | 964 // Return the generated code. |
957 return GetCode(CONSTANT_FUNCTION); | 965 return GetCode(CONSTANT_FUNCTION, name); |
958 } | 966 } |
959 | 967 |
960 | 968 |
961 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 969 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
962 JSObject* holder, | 970 JSObject* holder, |
963 String* name) { | 971 String* name) { |
964 // ----------- S t a t e ------------- | 972 // ----------- S t a t e ------------- |
965 // -- ecx : name | 973 // -- ecx : name |
966 // -- esp[0] : return address | 974 // -- esp[0] : return address |
967 // -- esp[4] : receiver | 975 // -- esp[4] : receiver |
968 // ----------------------------------- | 976 // ----------------------------------- |
969 Label miss; | 977 Label miss; |
970 | 978 |
971 __ mov(eax, (Operand(esp, kPointerSize))); | 979 __ mov(eax, (Operand(esp, kPointerSize))); |
972 GenerateLoadInterceptor(masm(), receiver, holder, eax, ecx, edx, ebx, &miss); | 980 GenerateLoadInterceptor(masm(), receiver, holder, eax, ecx, edx, ebx, &miss); |
973 __ bind(&miss); | 981 __ bind(&miss); |
974 GenerateLoadMiss(masm(), Code::LOAD_IC); | 982 GenerateLoadMiss(masm(), Code::LOAD_IC); |
975 | 983 |
976 // Return the generated code. | 984 // Return the generated code. |
977 return GetCode(INTERCEPTOR); | 985 return GetCode(INTERCEPTOR, name); |
978 } | 986 } |
979 | 987 |
980 | 988 |
981 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, | 989 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, |
982 JSObject* receiver, | 990 JSObject* receiver, |
983 JSObject* holder, | 991 JSObject* holder, |
984 int index) { | 992 int index) { |
985 // ----------- S t a t e ------------- | 993 // ----------- S t a t e ------------- |
986 // -- esp[0] : return address | 994 // -- esp[0] : return address |
987 // -- esp[4] : name | 995 // -- esp[4] : name |
988 // -- esp[8] : receiver | 996 // -- esp[8] : receiver |
989 // ----------------------------------- | 997 // ----------------------------------- |
990 Label miss; | 998 Label miss; |
991 | 999 |
992 __ mov(eax, (Operand(esp, kPointerSize))); | 1000 __ mov(eax, (Operand(esp, kPointerSize))); |
993 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1001 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
994 __ IncrementCounter(&Counters::keyed_load_field, 1); | 1002 __ IncrementCounter(&Counters::keyed_load_field, 1); |
995 | 1003 |
996 // Check that the name has not changed. | 1004 // Check that the name has not changed. |
997 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1005 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
998 __ j(not_equal, &miss, not_taken); | 1006 __ j(not_equal, &miss, not_taken); |
999 | 1007 |
1000 GenerateLoadField(masm(), receiver, holder, ecx, ebx, edx, index, &miss); | 1008 GenerateLoadField(masm(), receiver, holder, ecx, ebx, edx, index, &miss); |
1001 __ bind(&miss); | 1009 __ bind(&miss); |
1002 __ DecrementCounter(&Counters::keyed_load_field, 1); | 1010 __ DecrementCounter(&Counters::keyed_load_field, 1); |
1003 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1011 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1004 | 1012 |
1005 // Return the generated code. | 1013 // Return the generated code. |
1006 return GetCode(FIELD); | 1014 return GetCode(FIELD, name); |
1007 } | 1015 } |
1008 | 1016 |
1009 | 1017 |
1010 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, | 1018 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, |
1011 JSObject* receiver, | 1019 JSObject* receiver, |
1012 JSObject* holder, | 1020 JSObject* holder, |
1013 AccessorInfo* callback) { | 1021 AccessorInfo* callback) { |
1014 // ----------- S t a t e ------------- | 1022 // ----------- S t a t e ------------- |
1015 // -- esp[0] : return address | 1023 // -- esp[0] : return address |
1016 // -- esp[4] : name | 1024 // -- esp[4] : name |
1017 // -- esp[8] : receiver | 1025 // -- esp[8] : receiver |
1018 // ----------------------------------- | 1026 // ----------------------------------- |
1019 Label miss; | 1027 Label miss; |
1020 | 1028 |
1021 __ mov(eax, (Operand(esp, kPointerSize))); | 1029 __ mov(eax, (Operand(esp, kPointerSize))); |
1022 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1030 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1023 __ IncrementCounter(&Counters::keyed_load_callback, 1); | 1031 __ IncrementCounter(&Counters::keyed_load_callback, 1); |
1024 | 1032 |
1025 // Check that the name has not changed. | 1033 // Check that the name has not changed. |
1026 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1034 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1027 __ j(not_equal, &miss, not_taken); | 1035 __ j(not_equal, &miss, not_taken); |
1028 | 1036 |
1029 GenerateLoadCallback(masm(), receiver, holder, ecx, eax, ebx, edx, | 1037 GenerateLoadCallback(masm(), receiver, holder, ecx, eax, ebx, edx, |
1030 callback, &miss); | 1038 callback, &miss); |
1031 __ bind(&miss); | 1039 __ bind(&miss); |
1032 __ DecrementCounter(&Counters::keyed_load_callback, 1); | 1040 __ DecrementCounter(&Counters::keyed_load_callback, 1); |
1033 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1041 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1034 | 1042 |
1035 // Return the generated code. | 1043 // Return the generated code. |
1036 return GetCode(CALLBACKS); | 1044 return GetCode(CALLBACKS, name); |
1037 } | 1045 } |
1038 | 1046 |
1039 | 1047 |
1040 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 1048 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
1041 JSObject* receiver, | 1049 JSObject* receiver, |
1042 JSObject* holder, | 1050 JSObject* holder, |
1043 Object* value) { | 1051 Object* value) { |
1044 // ----------- S t a t e ------------- | 1052 // ----------- S t a t e ------------- |
1045 // -- esp[0] : return address | 1053 // -- esp[0] : return address |
1046 // -- esp[4] : name | 1054 // -- esp[4] : name |
1047 // -- esp[8] : receiver | 1055 // -- esp[8] : receiver |
1048 // ----------------------------------- | 1056 // ----------------------------------- |
1049 Label miss; | 1057 Label miss; |
1050 | 1058 |
1051 __ mov(eax, (Operand(esp, kPointerSize))); | 1059 __ mov(eax, (Operand(esp, kPointerSize))); |
1052 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1060 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1053 __ IncrementCounter(&Counters::keyed_load_constant_function, 1); | 1061 __ IncrementCounter(&Counters::keyed_load_constant_function, 1); |
1054 | 1062 |
1055 // Check that the name has not changed. | 1063 // Check that the name has not changed. |
1056 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1064 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1057 __ j(not_equal, &miss, not_taken); | 1065 __ j(not_equal, &miss, not_taken); |
1058 | 1066 |
1059 GenerateLoadConstant(masm(), receiver, holder, ecx, ebx, edx, value, &miss); | 1067 GenerateLoadConstant(masm(), receiver, holder, ecx, ebx, edx, value, &miss); |
1060 __ bind(&miss); | 1068 __ bind(&miss); |
1061 __ DecrementCounter(&Counters::keyed_load_constant_function, 1); | 1069 __ DecrementCounter(&Counters::keyed_load_constant_function, 1); |
1062 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1070 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1063 | 1071 |
1064 // Return the generated code. | 1072 // Return the generated code. |
1065 return GetCode(CONSTANT_FUNCTION); | 1073 return GetCode(CONSTANT_FUNCTION, name); |
1066 } | 1074 } |
1067 | 1075 |
1068 | 1076 |
1069 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, | 1077 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, |
1070 JSObject* holder, | 1078 JSObject* holder, |
1071 String* name) { | 1079 String* name) { |
1072 // ----------- S t a t e ------------- | 1080 // ----------- S t a t e ------------- |
1073 // -- esp[0] : return address | 1081 // -- esp[0] : return address |
1074 // -- esp[4] : name | 1082 // -- esp[4] : name |
1075 // -- esp[8] : receiver | 1083 // -- esp[8] : receiver |
1076 // ----------------------------------- | 1084 // ----------------------------------- |
1077 Label miss; | 1085 Label miss; |
1078 | 1086 |
1079 __ mov(eax, (Operand(esp, kPointerSize))); | 1087 __ mov(eax, (Operand(esp, kPointerSize))); |
1080 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1088 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1081 __ IncrementCounter(&Counters::keyed_load_interceptor, 1); | 1089 __ IncrementCounter(&Counters::keyed_load_interceptor, 1); |
1082 | 1090 |
1083 // Check that the name has not changed. | 1091 // Check that the name has not changed. |
1084 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1092 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1085 __ j(not_equal, &miss, not_taken); | 1093 __ j(not_equal, &miss, not_taken); |
1086 | 1094 |
1087 GenerateLoadInterceptor(masm(), receiver, holder, ecx, eax, edx, ebx, &miss); | 1095 GenerateLoadInterceptor(masm(), receiver, holder, ecx, eax, edx, ebx, &miss); |
1088 __ bind(&miss); | 1096 __ bind(&miss); |
1089 __ DecrementCounter(&Counters::keyed_load_interceptor, 1); | 1097 __ DecrementCounter(&Counters::keyed_load_interceptor, 1); |
1090 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1098 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1091 | 1099 |
1092 // Return the generated code. | 1100 // Return the generated code. |
1093 return GetCode(INTERCEPTOR); | 1101 return GetCode(INTERCEPTOR, name); |
1094 } | 1102 } |
1095 | 1103 |
1096 | 1104 |
1097 | 1105 |
1098 | 1106 |
1099 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { | 1107 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { |
1100 // ----------- S t a t e ------------- | 1108 // ----------- S t a t e ------------- |
1101 // -- esp[0] : return address | 1109 // -- esp[0] : return address |
1102 // -- esp[4] : name | 1110 // -- esp[4] : name |
1103 // -- esp[8] : receiver | 1111 // -- esp[8] : receiver |
1104 // ----------------------------------- | 1112 // ----------------------------------- |
1105 Label miss; | 1113 Label miss; |
1106 | 1114 |
1107 __ mov(eax, (Operand(esp, kPointerSize))); | 1115 __ mov(eax, (Operand(esp, kPointerSize))); |
1108 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1116 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1109 __ IncrementCounter(&Counters::keyed_load_array_length, 1); | 1117 __ IncrementCounter(&Counters::keyed_load_array_length, 1); |
1110 | 1118 |
1111 // Check that the name has not changed. | 1119 // Check that the name has not changed. |
1112 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1120 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1113 __ j(not_equal, &miss, not_taken); | 1121 __ j(not_equal, &miss, not_taken); |
1114 | 1122 |
1115 GenerateLoadArrayLength(masm(), ecx, edx, &miss); | 1123 GenerateLoadArrayLength(masm(), ecx, edx, &miss); |
1116 __ bind(&miss); | 1124 __ bind(&miss); |
1117 __ DecrementCounter(&Counters::keyed_load_array_length, 1); | 1125 __ DecrementCounter(&Counters::keyed_load_array_length, 1); |
1118 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1126 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1119 | 1127 |
1120 // Return the generated code. | 1128 // Return the generated code. |
1121 return GetCode(CALLBACKS); | 1129 return GetCode(CALLBACKS, name); |
1122 } | 1130 } |
1123 | 1131 |
1124 | 1132 |
1125 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { | 1133 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { |
1126 // ----------- S t a t e ------------- | 1134 // ----------- S t a t e ------------- |
1127 // -- esp[0] : return address | 1135 // -- esp[0] : return address |
1128 // -- esp[4] : name | 1136 // -- esp[4] : name |
1129 // -- esp[8] : receiver | 1137 // -- esp[8] : receiver |
1130 // ----------------------------------- | 1138 // ----------------------------------- |
1131 Label miss; | 1139 Label miss; |
1132 | 1140 |
1133 __ mov(eax, (Operand(esp, kPointerSize))); | 1141 __ mov(eax, (Operand(esp, kPointerSize))); |
1134 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1142 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1135 __ IncrementCounter(&Counters::keyed_load_string_length, 1); | 1143 __ IncrementCounter(&Counters::keyed_load_string_length, 1); |
1136 | 1144 |
1137 // Check that the name has not changed. | 1145 // Check that the name has not changed. |
1138 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1146 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1139 __ j(not_equal, &miss, not_taken); | 1147 __ j(not_equal, &miss, not_taken); |
1140 | 1148 |
1141 GenerateLoadStringLength(masm(), ecx, edx, &miss); | 1149 GenerateLoadStringLength(masm(), ecx, edx, &miss); |
1142 __ bind(&miss); | 1150 __ bind(&miss); |
1143 __ DecrementCounter(&Counters::keyed_load_string_length, 1); | 1151 __ DecrementCounter(&Counters::keyed_load_string_length, 1); |
1144 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1152 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1145 | 1153 |
1146 // Return the generated code. | 1154 // Return the generated code. |
1147 return GetCode(CALLBACKS); | 1155 return GetCode(CALLBACKS, name); |
1148 } | 1156 } |
1149 | 1157 |
1150 | 1158 |
1151 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { | 1159 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { |
1152 // ----------- S t a t e ------------- | 1160 // ----------- S t a t e ------------- |
1153 // -- esp[0] : return address | 1161 // -- esp[0] : return address |
1154 // -- esp[4] : name | 1162 // -- esp[4] : name |
1155 // -- esp[8] : receiver | 1163 // -- esp[8] : receiver |
1156 // ----------------------------------- | 1164 // ----------------------------------- |
1157 Label miss; | 1165 Label miss; |
1158 | 1166 |
1159 __ mov(eax, (Operand(esp, kPointerSize))); | 1167 __ mov(eax, (Operand(esp, kPointerSize))); |
1160 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); | 1168 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); |
1161 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); | 1169 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); |
1162 | 1170 |
1163 // Check that the name has not changed. | 1171 // Check that the name has not changed. |
1164 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 1172 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
1165 __ j(not_equal, &miss, not_taken); | 1173 __ j(not_equal, &miss, not_taken); |
1166 | 1174 |
1167 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); | 1175 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); |
1168 __ bind(&miss); | 1176 __ bind(&miss); |
1169 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); | 1177 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); |
1170 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1178 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1171 | 1179 |
1172 // Return the generated code. | 1180 // Return the generated code. |
1173 return GetCode(CALLBACKS); | 1181 return GetCode(CALLBACKS, name); |
1174 } | 1182 } |
1175 | 1183 |
1176 | 1184 |
1177 #undef __ | 1185 #undef __ |
1178 | 1186 |
1179 } } // namespace v8::internal | 1187 } } // namespace v8::internal |
OLD | NEW |