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

Side by Side Diff: src/x64/ic-x64.cc

Issue 8361028: Handlify StubCompiler::CompileCallInitialize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // rax: elements 841 // rax: elements
842 // Search the dictionary placing the result in rdi. 842 // Search the dictionary placing the result in rdi.
843 GenerateDictionaryLoad(masm, &miss, rax, rcx, rbx, rdi, rdi); 843 GenerateDictionaryLoad(masm, &miss, rax, rcx, rbx, rdi, rdi);
844 844
845 GenerateFunctionTailCall(masm, argc, &miss); 845 GenerateFunctionTailCall(masm, argc, &miss);
846 846
847 __ bind(&miss); 847 __ bind(&miss);
848 } 848 }
849 849
850 850
851 static void GenerateCallMiss(MacroAssembler* masm, 851 void CallICBase::GenerateMiss(MacroAssembler* masm,
852 int argc, 852 int argc,
853 IC::UtilityId id, 853 IC::UtilityId id,
854 Code::ExtraICState extra_ic_state) { 854 Code::ExtraICState extra_state) {
855 // ----------- S t a t e ------------- 855 // ----------- S t a t e -------------
856 // rcx : function name 856 // rcx : function name
857 // rsp[0] : return address 857 // rsp[0] : return address
858 // rsp[8] : argument argc 858 // rsp[8] : argument argc
859 // rsp[16] : argument argc - 1 859 // rsp[16] : argument argc - 1
860 // ... 860 // ...
861 // rsp[argc * 8] : argument 1 861 // rsp[argc * 8] : argument 1
862 // rsp[(argc + 1) * 8] : argument 0 = receiver 862 // rsp[(argc + 1) * 8] : argument 0 = receiver
863 // ----------------------------------- 863 // -----------------------------------
864 864
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 __ j(not_equal, &invoke); 902 __ j(not_equal, &invoke);
903 903
904 // Patch the receiver on the stack. 904 // Patch the receiver on the stack.
905 __ bind(&global); 905 __ bind(&global);
906 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); 906 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
907 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx); 907 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
908 __ bind(&invoke); 908 __ bind(&invoke);
909 } 909 }
910 910
911 // Invoke the function. 911 // Invoke the function.
912 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) 912 CallKind call_kind = CallICBase::Contextual::decode(extra_state)
913 ? CALL_AS_FUNCTION 913 ? CALL_AS_FUNCTION
914 : CALL_AS_METHOD; 914 : CALL_AS_METHOD;
915 ParameterCount actual(argc); 915 ParameterCount actual(argc);
916 __ InvokeFunction(rdi, 916 __ InvokeFunction(rdi,
917 actual, 917 actual,
918 JUMP_FUNCTION, 918 JUMP_FUNCTION,
919 NullCallWrapper(), 919 NullCallWrapper(),
920 call_kind); 920 call_kind);
921 } 921 }
922 922
(...skipping 27 matching lines...) Expand all
950 // ... 950 // ...
951 // rsp[argc * 8] : argument 1 951 // rsp[argc * 8] : argument 1
952 // rsp[(argc + 1) * 8] : argument 0 = receiver 952 // rsp[(argc + 1) * 8] : argument 0 = receiver
953 // ----------------------------------- 953 // -----------------------------------
954 954
955 GenerateCallNormal(masm, argc); 955 GenerateCallNormal(masm, argc);
956 GenerateMiss(masm, argc, Code::kNoExtraICState); 956 GenerateMiss(masm, argc, Code::kNoExtraICState);
957 } 957 }
958 958
959 959
960 void CallIC::GenerateMiss(MacroAssembler* masm,
961 int argc,
962 Code::ExtraICState extra_ic_state) {
963 // ----------- S t a t e -------------
964 // rcx : function name
965 // rsp[0] : return address
966 // rsp[8] : argument argc
967 // rsp[16] : argument argc - 1
968 // ...
969 // rsp[argc * 8] : argument 1
970 // rsp[(argc + 1) * 8] : argument 0 = receiver
971 // -----------------------------------
972
973 GenerateCallMiss(masm, argc, IC::kCallIC_Miss, extra_ic_state);
974 }
975
976
977 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { 960 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
978 // ----------- S t a t e ------------- 961 // ----------- S t a t e -------------
979 // rcx : function name 962 // rcx : function name
980 // rsp[0] : return address 963 // rsp[0] : return address
981 // rsp[8] : argument argc 964 // rsp[8] : argument argc
982 // rsp[16] : argument argc - 1 965 // rsp[16] : argument argc - 1
983 // ... 966 // ...
984 // rsp[argc * 8] : argument 1 967 // rsp[argc * 8] : argument 1
985 // rsp[(argc + 1) * 8] : argument 0 = receiver 968 // rsp[(argc + 1) * 8] : argument 0 = receiver
986 // ----------------------------------- 969 // -----------------------------------
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 Label miss; 1083 Label miss;
1101 __ JumpIfSmi(rcx, &miss); 1084 __ JumpIfSmi(rcx, &miss);
1102 Condition cond = masm->IsObjectStringType(rcx, rax, rax); 1085 Condition cond = masm->IsObjectStringType(rcx, rax, rax);
1103 __ j(NegateCondition(cond), &miss); 1086 __ j(NegateCondition(cond), &miss);
1104 GenerateCallNormal(masm, argc); 1087 GenerateCallNormal(masm, argc);
1105 __ bind(&miss); 1088 __ bind(&miss);
1106 GenerateMiss(masm, argc); 1089 GenerateMiss(masm, argc);
1107 } 1090 }
1108 1091
1109 1092
1110 void KeyedCallIC::GenerateMiss(MacroAssembler* masm, int argc) {
1111 // ----------- S t a t e -------------
1112 // rcx : function name
1113 // rsp[0] : return address
1114 // rsp[8] : argument argc
1115 // rsp[16] : argument argc - 1
1116 // ...
1117 // rsp[argc * 8] : argument 1
1118 // rsp[(argc + 1) * 8] : argument 0 = receiver
1119 // -----------------------------------
1120
1121 GenerateCallMiss(masm, argc, IC::kKeyedCallIC_Miss, Code::kNoExtraICState);
1122 }
1123
1124
1125 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, 1093 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm,
1126 Register object, 1094 Register object,
1127 Register key, 1095 Register key,
1128 Register scratch1, 1096 Register scratch1,
1129 Register scratch2, 1097 Register scratch2,
1130 Register scratch3, 1098 Register scratch3,
1131 Label* unmapped_case, 1099 Label* unmapped_case,
1132 Label* slow_case) { 1100 Label* slow_case) {
1133 Heap* heap = masm->isolate()->heap(); 1101 Heap* heap = masm->isolate()->heap();
1134 1102
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1707 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1740 ? not_zero 1708 ? not_zero
1741 : zero; 1709 : zero;
1742 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1710 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1743 } 1711 }
1744 1712
1745 1713
1746 } } // namespace v8::internal 1714 } } // namespace v8::internal
1747 1715
1748 #endif // V8_TARGET_ARCH_X64 1716 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698