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

Side by Side Diff: src/stub-cache-ia32.cc

Issue 27156: Follow on to r1368: Remove unnecessary HandleScope in the StubCompilers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 442
443 #undef __ 443 #undef __
444 444
445 #define __ masm()-> 445 #define __ masm()->
446 446
447 447
448 // TODO(1241006): Avoid having lazy compile stubs specialized by the 448 // TODO(1241006): Avoid having lazy compile stubs specialized by the
449 // number of arguments. It is not needed anymore. 449 // number of arguments. It is not needed anymore.
450 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { 450 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
451 HandleScope scope;
452
453 // Enter an internal frame. 451 // Enter an internal frame.
454 __ EnterInternalFrame(); 452 __ EnterInternalFrame();
455 453
456 // Push a copy of the function onto the stack. 454 // Push a copy of the function onto the stack.
457 __ push(edi); 455 __ push(edi);
458 456
459 __ push(edi); // function is also the parameter to the runtime call 457 __ push(edi); // function is also the parameter to the runtime call
460 __ CallRuntime(Runtime::kLazyCompile, 1); 458 __ CallRuntime(Runtime::kLazyCompile, 1);
461 __ pop(edi); 459 __ pop(edi);
462 460
463 // Tear down temporary frame. 461 // Tear down temporary frame.
464 __ LeaveInternalFrame(); 462 __ LeaveInternalFrame();
465 463
466 // Do a tail-call of the compiled function. 464 // Do a tail-call of the compiled function.
467 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); 465 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize));
468 __ jmp(Operand(ecx)); 466 __ jmp(Operand(ecx));
469 467
470 return GetCodeWithFlags(flags); 468 return GetCodeWithFlags(flags);
471 } 469 }
472 470
473 471
474 Object* CallStubCompiler::CompileCallField(Object* object, 472 Object* CallStubCompiler::CompileCallField(Object* object,
475 JSObject* holder, 473 JSObject* holder,
476 int index) { 474 int index) {
477 // ----------- S t a t e ------------- 475 // ----------- S t a t e -------------
478 // ----------------------------------- 476 // -----------------------------------
479
480 HandleScope scope;
481 Label miss; 477 Label miss;
482 478
483 // Get the receiver from the stack. 479 // Get the receiver from the stack.
484 const int argc = arguments().immediate(); 480 const int argc = arguments().immediate();
485 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 481 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
486 482
487 // Check that the receiver isn't a smi. 483 // Check that the receiver isn't a smi.
488 __ test(edx, Immediate(kSmiTagMask)); 484 __ test(edx, Immediate(kSmiTagMask));
489 __ j(zero, &miss, not_taken); 485 __ j(zero, &miss, not_taken);
490 486
(...skipping 30 matching lines...) Expand all
521 return GetCode(FIELD); 517 return GetCode(FIELD);
522 } 518 }
523 519
524 520
525 Object* CallStubCompiler::CompileCallConstant(Object* object, 521 Object* CallStubCompiler::CompileCallConstant(Object* object,
526 JSObject* holder, 522 JSObject* holder,
527 JSFunction* function, 523 JSFunction* function,
528 CheckType check) { 524 CheckType check) {
529 // ----------- S t a t e ------------- 525 // ----------- S t a t e -------------
530 // ----------------------------------- 526 // -----------------------------------
531
532 HandleScope scope;
533 Label miss; 527 Label miss;
534 528
535 // Get the receiver from the stack. 529 // Get the receiver from the stack.
536 const int argc = arguments().immediate(); 530 const int argc = arguments().immediate();
537 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 531 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
538 532
539 // Check that the receiver isn't a smi. 533 // Check that the receiver isn't a smi.
540 if (check != NUMBER_CHECK) { 534 if (check != NUMBER_CHECK) {
541 __ test(edx, Immediate(kSmiTagMask)); 535 __ test(edx, Immediate(kSmiTagMask));
542 __ j(zero, &miss, not_taken); 536 __ j(zero, &miss, not_taken);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // Return the generated code. 636 // Return the generated code.
643 return GetCode(CONSTANT_FUNCTION); 637 return GetCode(CONSTANT_FUNCTION);
644 } 638 }
645 639
646 640
647 Object* CallStubCompiler::CompileCallInterceptor(Object* object, 641 Object* CallStubCompiler::CompileCallInterceptor(Object* object,
648 JSObject* holder, 642 JSObject* holder,
649 String* name) { 643 String* name) {
650 // ----------- S t a t e ------------- 644 // ----------- S t a t e -------------
651 // ----------------------------------- 645 // -----------------------------------
652
653 HandleScope scope;
654 Label miss; 646 Label miss;
655 647
656 // Get the number of arguments. 648 // Get the number of arguments.
657 const int argc = arguments().immediate(); 649 const int argc = arguments().immediate();
658 650
659 // Get the receiver from the stack. 651 // Get the receiver from the stack.
660 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 652 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
661 653
662 // Check that the receiver isn't a smi. 654 // Check that the receiver isn't a smi.
663 __ test(edx, Immediate(kSmiTagMask)); 655 __ test(edx, Immediate(kSmiTagMask));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 Object* StoreStubCompiler::CompileStoreField(JSObject* object, 714 Object* StoreStubCompiler::CompileStoreField(JSObject* object,
723 int index, 715 int index,
724 Map* transition, 716 Map* transition,
725 String* name) { 717 String* name) {
726 // ----------- S t a t e ------------- 718 // ----------- S t a t e -------------
727 // -- eax : value 719 // -- eax : value
728 // -- ecx : name 720 // -- ecx : name
729 // -- esp[0] : return address 721 // -- esp[0] : return address
730 // -- esp[4] : receiver 722 // -- esp[4] : receiver
731 // ----------------------------------- 723 // -----------------------------------
732
733 HandleScope scope;
734 Label miss; 724 Label miss;
735 725
736 // Get the object from the stack. 726 // Get the object from the stack.
737 __ mov(ebx, Operand(esp, 1 * kPointerSize)); 727 __ mov(ebx, Operand(esp, 1 * kPointerSize));
738 728
739 // Generate store field code. Trashes the name register. 729 // Generate store field code. Trashes the name register.
740 GenerateStoreField(masm(), 730 GenerateStoreField(masm(),
741 Builtins::StoreIC_ExtendStorage, 731 Builtins::StoreIC_ExtendStorage,
742 object, 732 object,
743 index, 733 index,
(...skipping 14 matching lines...) Expand all
758 748
759 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, 749 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
760 AccessorInfo* callback, 750 AccessorInfo* callback,
761 String* name) { 751 String* name) {
762 // ----------- S t a t e ------------- 752 // ----------- S t a t e -------------
763 // -- eax : value 753 // -- eax : value
764 // -- ecx : name 754 // -- ecx : name
765 // -- esp[0] : return address 755 // -- esp[0] : return address
766 // -- esp[4] : receiver 756 // -- esp[4] : receiver
767 // ----------------------------------- 757 // -----------------------------------
768
769 HandleScope scope;
770 Label miss; 758 Label miss;
771 759
772 // Get the object from the stack. 760 // Get the object from the stack.
773 __ mov(ebx, Operand(esp, 1 * kPointerSize)); 761 __ mov(ebx, Operand(esp, 1 * kPointerSize));
774 762
775 // Check that the object isn't a smi. 763 // Check that the object isn't a smi.
776 __ test(ebx, Immediate(kSmiTagMask)); 764 __ test(ebx, Immediate(kSmiTagMask));
777 __ j(zero, &miss, not_taken); 765 __ j(zero, &miss, not_taken);
778 766
779 // Check that the map of the object hasn't changed. 767 // Check that the map of the object hasn't changed.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 802
815 803
816 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, 804 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
817 String* name) { 805 String* name) {
818 // ----------- S t a t e ------------- 806 // ----------- S t a t e -------------
819 // -- eax : value 807 // -- eax : value
820 // -- ecx : name 808 // -- ecx : name
821 // -- esp[0] : return address 809 // -- esp[0] : return address
822 // -- esp[4] : receiver 810 // -- esp[4] : receiver
823 // ----------------------------------- 811 // -----------------------------------
824
825 HandleScope scope;
826 Label miss; 812 Label miss;
827 813
828 // Get the object from the stack. 814 // Get the object from the stack.
829 __ mov(ebx, Operand(esp, 1 * kPointerSize)); 815 __ mov(ebx, Operand(esp, 1 * kPointerSize));
830 816
831 // Check that the object isn't a smi. 817 // Check that the object isn't a smi.
832 __ test(ebx, Immediate(kSmiTagMask)); 818 __ test(ebx, Immediate(kSmiTagMask));
833 __ j(zero, &miss, not_taken); 819 __ j(zero, &miss, not_taken);
834 820
835 // Check that the map of the object hasn't changed. 821 // Check that the map of the object hasn't changed.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, 857 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
872 int index, 858 int index,
873 Map* transition, 859 Map* transition,
874 String* name) { 860 String* name) {
875 // ----------- S t a t e ------------- 861 // ----------- S t a t e -------------
876 // -- eax : value 862 // -- eax : value
877 // -- esp[0] : return address 863 // -- esp[0] : return address
878 // -- esp[4] : key 864 // -- esp[4] : key
879 // -- esp[8] : receiver 865 // -- esp[8] : receiver
880 // ----------------------------------- 866 // -----------------------------------
881 HandleScope scope;
882 Label miss; 867 Label miss;
883 868
884 __ IncrementCounter(&Counters::keyed_store_field, 1); 869 __ IncrementCounter(&Counters::keyed_store_field, 1);
885 870
886 // Get the name from the stack. 871 // Get the name from the stack.
887 __ mov(ecx, Operand(esp, 1 * kPointerSize)); 872 __ mov(ecx, Operand(esp, 1 * kPointerSize));
888 // Check that the name has not changed. 873 // Check that the name has not changed.
889 __ cmp(Operand(ecx), Immediate(Handle<String>(name))); 874 __ cmp(Operand(ecx), Immediate(Handle<String>(name)));
890 __ j(not_equal, &miss, not_taken); 875 __ j(not_equal, &miss, not_taken);
891 876
(...skipping 21 matching lines...) Expand all
913 898
914 899
915 Object* LoadStubCompiler::CompileLoadField(JSObject* object, 900 Object* LoadStubCompiler::CompileLoadField(JSObject* object,
916 JSObject* holder, 901 JSObject* holder,
917 int index) { 902 int index) {
918 // ----------- S t a t e ------------- 903 // ----------- S t a t e -------------
919 // -- ecx : name 904 // -- ecx : name
920 // -- esp[0] : return address 905 // -- esp[0] : return address
921 // -- esp[4] : receiver 906 // -- esp[4] : receiver
922 // ----------------------------------- 907 // -----------------------------------
923
924 HandleScope scope;
925 Label miss; 908 Label miss;
926 909
927 __ mov(eax, (Operand(esp, kPointerSize))); 910 __ mov(eax, (Operand(esp, kPointerSize)));
928 GenerateLoadField(masm(), object, holder, eax, ebx, edx, index, &miss); 911 GenerateLoadField(masm(), object, holder, eax, ebx, edx, index, &miss);
929 __ bind(&miss); 912 __ bind(&miss);
930 GenerateLoadMiss(masm(), Code::LOAD_IC); 913 GenerateLoadMiss(masm(), Code::LOAD_IC);
931 914
932 // Return the generated code. 915 // Return the generated code.
933 return GetCode(FIELD); 916 return GetCode(FIELD);
934 } 917 }
935 918
936 919
937 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, 920 Object* LoadStubCompiler::CompileLoadCallback(JSObject* object,
938 JSObject* holder, 921 JSObject* holder,
939 AccessorInfo* callback) { 922 AccessorInfo* callback) {
940 // ----------- S t a t e ------------- 923 // ----------- S t a t e -------------
941 // -- ecx : name 924 // -- ecx : name
942 // -- esp[0] : return address 925 // -- esp[0] : return address
943 // -- esp[4] : receiver 926 // -- esp[4] : receiver
944 // ----------------------------------- 927 // -----------------------------------
945
946 HandleScope scope;
947 Label miss; 928 Label miss;
948 929
949 __ mov(eax, (Operand(esp, kPointerSize))); 930 __ mov(eax, (Operand(esp, kPointerSize)));
950 GenerateLoadCallback(masm(), object, holder, eax, ecx, ebx, 931 GenerateLoadCallback(masm(), object, holder, eax, ecx, ebx,
951 edx, callback, &miss); 932 edx, callback, &miss);
952 __ bind(&miss); 933 __ bind(&miss);
953 GenerateLoadMiss(masm(), Code::LOAD_IC); 934 GenerateLoadMiss(masm(), Code::LOAD_IC);
954 935
955 // Return the generated code. 936 // Return the generated code.
956 return GetCode(CALLBACKS); 937 return GetCode(CALLBACKS);
957 } 938 }
958 939
959 940
960 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, 941 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
961 JSObject* holder, 942 JSObject* holder,
962 Object* value) { 943 Object* value) {
963 // ----------- S t a t e ------------- 944 // ----------- S t a t e -------------
964 // -- ecx : name 945 // -- ecx : name
965 // -- esp[0] : return address 946 // -- esp[0] : return address
966 // -- esp[4] : receiver 947 // -- esp[4] : receiver
967 // ----------------------------------- 948 // -----------------------------------
968
969 HandleScope scope;
970 Label miss; 949 Label miss;
971 950
972 __ mov(eax, (Operand(esp, kPointerSize))); 951 __ mov(eax, (Operand(esp, kPointerSize)));
973 GenerateLoadConstant(masm(), object, holder, eax, ebx, edx, value, &miss); 952 GenerateLoadConstant(masm(), object, holder, eax, ebx, edx, value, &miss);
974 __ bind(&miss); 953 __ bind(&miss);
975 GenerateLoadMiss(masm(), Code::LOAD_IC); 954 GenerateLoadMiss(masm(), Code::LOAD_IC);
976 955
977 // Return the generated code. 956 // Return the generated code.
978 return GetCode(CONSTANT_FUNCTION); 957 return GetCode(CONSTANT_FUNCTION);
979 } 958 }
980 959
981 960
982 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, 961 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
983 JSObject* holder, 962 JSObject* holder,
984 String* name) { 963 String* name) {
985 // ----------- S t a t e ------------- 964 // ----------- S t a t e -------------
986 // -- ecx : name 965 // -- ecx : name
987 // -- esp[0] : return address 966 // -- esp[0] : return address
988 // -- esp[4] : receiver 967 // -- esp[4] : receiver
989 // ----------------------------------- 968 // -----------------------------------
990 HandleScope scope;
991 Label miss; 969 Label miss;
992 970
993 __ mov(eax, (Operand(esp, kPointerSize))); 971 __ mov(eax, (Operand(esp, kPointerSize)));
994 GenerateLoadInterceptor(masm(), receiver, holder, eax, ecx, edx, ebx, &miss); 972 GenerateLoadInterceptor(masm(), receiver, holder, eax, ecx, edx, ebx, &miss);
995 __ bind(&miss); 973 __ bind(&miss);
996 GenerateLoadMiss(masm(), Code::LOAD_IC); 974 GenerateLoadMiss(masm(), Code::LOAD_IC);
997 975
998 // Return the generated code. 976 // Return the generated code.
999 return GetCode(INTERCEPTOR); 977 return GetCode(INTERCEPTOR);
1000 } 978 }
1001 979
1002 980
1003 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, 981 Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
1004 JSObject* receiver, 982 JSObject* receiver,
1005 JSObject* holder, 983 JSObject* holder,
1006 int index) { 984 int index) {
1007 // ----------- S t a t e ------------- 985 // ----------- S t a t e -------------
1008 // -- esp[0] : return address 986 // -- esp[0] : return address
1009 // -- esp[4] : name 987 // -- esp[4] : name
1010 // -- esp[8] : receiver 988 // -- esp[8] : receiver
1011 // ----------------------------------- 989 // -----------------------------------
1012 HandleScope scope;
1013 Label miss; 990 Label miss;
1014 991
1015 __ mov(eax, (Operand(esp, kPointerSize))); 992 __ mov(eax, (Operand(esp, kPointerSize)));
1016 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 993 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1017 __ IncrementCounter(&Counters::keyed_load_field, 1); 994 __ IncrementCounter(&Counters::keyed_load_field, 1);
1018 995
1019 // Check that the name has not changed. 996 // Check that the name has not changed.
1020 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 997 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1021 __ j(not_equal, &miss, not_taken); 998 __ j(not_equal, &miss, not_taken);
1022 999
1023 GenerateLoadField(masm(), receiver, holder, ecx, ebx, edx, index, &miss); 1000 GenerateLoadField(masm(), receiver, holder, ecx, ebx, edx, index, &miss);
1024 __ bind(&miss); 1001 __ bind(&miss);
1025 __ DecrementCounter(&Counters::keyed_load_field, 1); 1002 __ DecrementCounter(&Counters::keyed_load_field, 1);
1026 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1003 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1027 1004
1028 // Return the generated code. 1005 // Return the generated code.
1029 return GetCode(FIELD); 1006 return GetCode(FIELD);
1030 } 1007 }
1031 1008
1032 1009
1033 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, 1010 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
1034 JSObject* receiver, 1011 JSObject* receiver,
1035 JSObject* holder, 1012 JSObject* holder,
1036 AccessorInfo* callback) { 1013 AccessorInfo* callback) {
1037 // ----------- S t a t e ------------- 1014 // ----------- S t a t e -------------
1038 // -- esp[0] : return address 1015 // -- esp[0] : return address
1039 // -- esp[4] : name 1016 // -- esp[4] : name
1040 // -- esp[8] : receiver 1017 // -- esp[8] : receiver
1041 // ----------------------------------- 1018 // -----------------------------------
1042 HandleScope scope;
1043 Label miss; 1019 Label miss;
1044 1020
1045 __ mov(eax, (Operand(esp, kPointerSize))); 1021 __ mov(eax, (Operand(esp, kPointerSize)));
1046 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1022 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1047 __ IncrementCounter(&Counters::keyed_load_callback, 1); 1023 __ IncrementCounter(&Counters::keyed_load_callback, 1);
1048 1024
1049 // Check that the name has not changed. 1025 // Check that the name has not changed.
1050 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1026 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1051 __ j(not_equal, &miss, not_taken); 1027 __ j(not_equal, &miss, not_taken);
1052 1028
(...skipping 10 matching lines...) Expand all
1063 1039
1064 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, 1040 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
1065 JSObject* receiver, 1041 JSObject* receiver,
1066 JSObject* holder, 1042 JSObject* holder,
1067 Object* value) { 1043 Object* value) {
1068 // ----------- S t a t e ------------- 1044 // ----------- S t a t e -------------
1069 // -- esp[0] : return address 1045 // -- esp[0] : return address
1070 // -- esp[4] : name 1046 // -- esp[4] : name
1071 // -- esp[8] : receiver 1047 // -- esp[8] : receiver
1072 // ----------------------------------- 1048 // -----------------------------------
1073 HandleScope scope;
1074 Label miss; 1049 Label miss;
1075 1050
1076 __ mov(eax, (Operand(esp, kPointerSize))); 1051 __ mov(eax, (Operand(esp, kPointerSize)));
1077 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1052 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1078 __ IncrementCounter(&Counters::keyed_load_constant_function, 1); 1053 __ IncrementCounter(&Counters::keyed_load_constant_function, 1);
1079 1054
1080 // Check that the name has not changed. 1055 // Check that the name has not changed.
1081 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1056 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1082 __ j(not_equal, &miss, not_taken); 1057 __ j(not_equal, &miss, not_taken);
1083 1058
1084 GenerateLoadConstant(masm(), receiver, holder, ecx, ebx, edx, value, &miss); 1059 GenerateLoadConstant(masm(), receiver, holder, ecx, ebx, edx, value, &miss);
1085 __ bind(&miss); 1060 __ bind(&miss);
1086 __ DecrementCounter(&Counters::keyed_load_constant_function, 1); 1061 __ DecrementCounter(&Counters::keyed_load_constant_function, 1);
1087 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1062 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1088 1063
1089 // Return the generated code. 1064 // Return the generated code.
1090 return GetCode(CONSTANT_FUNCTION); 1065 return GetCode(CONSTANT_FUNCTION);
1091 } 1066 }
1092 1067
1093 1068
1094 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, 1069 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
1095 JSObject* holder, 1070 JSObject* holder,
1096 String* name) { 1071 String* name) {
1097 // ----------- S t a t e ------------- 1072 // ----------- S t a t e -------------
1098 // -- esp[0] : return address 1073 // -- esp[0] : return address
1099 // -- esp[4] : name 1074 // -- esp[4] : name
1100 // -- esp[8] : receiver 1075 // -- esp[8] : receiver
1101 // ----------------------------------- 1076 // -----------------------------------
1102 HandleScope scope;
1103 Label miss; 1077 Label miss;
1104 1078
1105 __ mov(eax, (Operand(esp, kPointerSize))); 1079 __ mov(eax, (Operand(esp, kPointerSize)));
1106 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1080 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1107 __ IncrementCounter(&Counters::keyed_load_interceptor, 1); 1081 __ IncrementCounter(&Counters::keyed_load_interceptor, 1);
1108 1082
1109 // Check that the name has not changed. 1083 // Check that the name has not changed.
1110 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1084 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1111 __ j(not_equal, &miss, not_taken); 1085 __ j(not_equal, &miss, not_taken);
1112 1086
1113 GenerateLoadInterceptor(masm(), receiver, holder, ecx, eax, edx, ebx, &miss); 1087 GenerateLoadInterceptor(masm(), receiver, holder, ecx, eax, edx, ebx, &miss);
1114 __ bind(&miss); 1088 __ bind(&miss);
1115 __ DecrementCounter(&Counters::keyed_load_interceptor, 1); 1089 __ DecrementCounter(&Counters::keyed_load_interceptor, 1);
1116 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1090 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1117 1091
1118 // Return the generated code. 1092 // Return the generated code.
1119 return GetCode(INTERCEPTOR); 1093 return GetCode(INTERCEPTOR);
1120 } 1094 }
1121 1095
1122 1096
1123 1097
1124 1098
1125 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { 1099 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
1126 // ----------- S t a t e ------------- 1100 // ----------- S t a t e -------------
1127 // -- esp[0] : return address 1101 // -- esp[0] : return address
1128 // -- esp[4] : name 1102 // -- esp[4] : name
1129 // -- esp[8] : receiver 1103 // -- esp[8] : receiver
1130 // ----------------------------------- 1104 // -----------------------------------
1131 HandleScope scope;
1132 Label miss; 1105 Label miss;
1133 1106
1134 __ mov(eax, (Operand(esp, kPointerSize))); 1107 __ mov(eax, (Operand(esp, kPointerSize)));
1135 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1108 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1136 __ IncrementCounter(&Counters::keyed_load_array_length, 1); 1109 __ IncrementCounter(&Counters::keyed_load_array_length, 1);
1137 1110
1138 // Check that the name has not changed. 1111 // Check that the name has not changed.
1139 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1112 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1140 __ j(not_equal, &miss, not_taken); 1113 __ j(not_equal, &miss, not_taken);
1141 1114
1142 GenerateLoadArrayLength(masm(), ecx, edx, &miss); 1115 GenerateLoadArrayLength(masm(), ecx, edx, &miss);
1143 __ bind(&miss); 1116 __ bind(&miss);
1144 __ DecrementCounter(&Counters::keyed_load_array_length, 1); 1117 __ DecrementCounter(&Counters::keyed_load_array_length, 1);
1145 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1118 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1146 1119
1147 // Return the generated code. 1120 // Return the generated code.
1148 return GetCode(CALLBACKS); 1121 return GetCode(CALLBACKS);
1149 } 1122 }
1150 1123
1151 1124
1152 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { 1125 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
1153 // ----------- S t a t e ------------- 1126 // ----------- S t a t e -------------
1154 // -- esp[0] : return address 1127 // -- esp[0] : return address
1155 // -- esp[4] : name 1128 // -- esp[4] : name
1156 // -- esp[8] : receiver 1129 // -- esp[8] : receiver
1157 // ----------------------------------- 1130 // -----------------------------------
1158 HandleScope scope;
1159 Label miss; 1131 Label miss;
1160 1132
1161 __ mov(eax, (Operand(esp, kPointerSize))); 1133 __ mov(eax, (Operand(esp, kPointerSize)));
1162 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1134 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1163 __ IncrementCounter(&Counters::keyed_load_string_length, 1); 1135 __ IncrementCounter(&Counters::keyed_load_string_length, 1);
1164 1136
1165 // Check that the name has not changed. 1137 // Check that the name has not changed.
1166 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1138 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1167 __ j(not_equal, &miss, not_taken); 1139 __ j(not_equal, &miss, not_taken);
1168 1140
1169 GenerateLoadStringLength(masm(), ecx, edx, &miss); 1141 GenerateLoadStringLength(masm(), ecx, edx, &miss);
1170 __ bind(&miss); 1142 __ bind(&miss);
1171 __ DecrementCounter(&Counters::keyed_load_string_length, 1); 1143 __ DecrementCounter(&Counters::keyed_load_string_length, 1);
1172 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1144 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1173 1145
1174 // Return the generated code. 1146 // Return the generated code.
1175 return GetCode(CALLBACKS); 1147 return GetCode(CALLBACKS);
1176 } 1148 }
1177 1149
1178 1150
1179 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { 1151 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
1180 // ----------- S t a t e ------------- 1152 // ----------- S t a t e -------------
1181 // -- esp[0] : return address 1153 // -- esp[0] : return address
1182 // -- esp[4] : name 1154 // -- esp[4] : name
1183 // -- esp[8] : receiver 1155 // -- esp[8] : receiver
1184 // ----------------------------------- 1156 // -----------------------------------
1185 HandleScope scope;
1186 Label miss; 1157 Label miss;
1187 1158
1188 __ mov(eax, (Operand(esp, kPointerSize))); 1159 __ mov(eax, (Operand(esp, kPointerSize)));
1189 __ mov(ecx, (Operand(esp, 2 * kPointerSize))); 1160 __ mov(ecx, (Operand(esp, 2 * kPointerSize)));
1190 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); 1161 __ IncrementCounter(&Counters::keyed_load_function_prototype, 1);
1191 1162
1192 // Check that the name has not changed. 1163 // Check that the name has not changed.
1193 __ cmp(Operand(eax), Immediate(Handle<String>(name))); 1164 __ cmp(Operand(eax), Immediate(Handle<String>(name)));
1194 __ j(not_equal, &miss, not_taken); 1165 __ j(not_equal, &miss, not_taken);
1195 1166
1196 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); 1167 GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss);
1197 __ bind(&miss); 1168 __ bind(&miss);
1198 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); 1169 __ DecrementCounter(&Counters::keyed_load_function_prototype, 1);
1199 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1170 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1200 1171
1201 // Return the generated code. 1172 // Return the generated code.
1202 return GetCode(CALLBACKS); 1173 return GetCode(CALLBACKS);
1203 } 1174 }
1204 1175
1205 1176
1206 #undef __ 1177 #undef __
1207 1178
1208 } } // namespace v8::internal 1179 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698