OLD | NEW |
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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 __ j(not_equal, miss); | 814 __ j(not_equal, miss); |
815 | 815 |
816 // Invoke the function. | 816 // Invoke the function. |
817 ParameterCount actual(argc); | 817 ParameterCount actual(argc); |
818 __ InvokeFunction(rdi, actual, JUMP_FUNCTION, | 818 __ InvokeFunction(rdi, actual, JUMP_FUNCTION, |
819 NullCallWrapper(), CALL_AS_METHOD); | 819 NullCallWrapper(), CALL_AS_METHOD); |
820 } | 820 } |
821 | 821 |
822 | 822 |
823 // The generated code falls through if the call should be handled by runtime. | 823 // The generated code falls through if the call should be handled by runtime. |
824 static void GenerateCallNormal(MacroAssembler* masm, int argc) { | 824 void CallICBase::GenerateNormal(MacroAssembler* masm, int argc) { |
825 // ----------- S t a t e ------------- | 825 // ----------- S t a t e ------------- |
826 // rcx : function name | 826 // rcx : function name |
827 // rsp[0] : return address | 827 // rsp[0] : return address |
828 // rsp[8] : argument argc | 828 // rsp[8] : argument argc |
829 // rsp[16] : argument argc - 1 | 829 // rsp[16] : argument argc - 1 |
830 // ... | 830 // ... |
831 // rsp[argc * 8] : argument 1 | 831 // rsp[argc * 8] : argument 1 |
832 // rsp[(argc + 1) * 8] : argument 0 = receiver | 832 // rsp[(argc + 1) * 8] : argument 0 = receiver |
833 // ----------------------------------- | 833 // ----------------------------------- |
834 Label miss; | 834 Label miss; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 // rsp[(argc + 1) * 8] : argument 0 = receiver | 934 // rsp[(argc + 1) * 8] : argument 0 = receiver |
935 // ----------------------------------- | 935 // ----------------------------------- |
936 | 936 |
937 // Get the receiver of the function from the stack; 1 ~ return address. | 937 // Get the receiver of the function from the stack; 1 ~ return address. |
938 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 938 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
939 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); | 939 GenerateMonomorphicCacheProbe(masm, argc, Code::CALL_IC, extra_ic_state); |
940 GenerateMiss(masm, argc, extra_ic_state); | 940 GenerateMiss(masm, argc, extra_ic_state); |
941 } | 941 } |
942 | 942 |
943 | 943 |
944 void CallIC::GenerateNormal(MacroAssembler* masm, int argc) { | |
945 // ----------- S t a t e ------------- | |
946 // rcx : function name | |
947 // rsp[0] : return address | |
948 // rsp[8] : argument argc | |
949 // rsp[16] : argument argc - 1 | |
950 // ... | |
951 // rsp[argc * 8] : argument 1 | |
952 // rsp[(argc + 1) * 8] : argument 0 = receiver | |
953 // ----------------------------------- | |
954 | |
955 GenerateCallNormal(masm, argc); | |
956 GenerateMiss(masm, argc, Code::kNoExtraICState); | |
957 } | |
958 | |
959 | |
960 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { | 944 void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) { |
961 // ----------- S t a t e ------------- | 945 // ----------- S t a t e ------------- |
962 // rcx : function name | 946 // rcx : function name |
963 // rsp[0] : return address | 947 // rsp[0] : return address |
964 // rsp[8] : argument argc | 948 // rsp[8] : argument argc |
965 // rsp[16] : argument argc - 1 | 949 // rsp[16] : argument argc - 1 |
966 // ... | 950 // ... |
967 // rsp[argc * 8] : argument 1 | 951 // rsp[argc * 8] : argument 1 |
968 // rsp[(argc + 1) * 8] : argument 0 = receiver | 952 // rsp[(argc + 1) * 8] : argument 0 = receiver |
969 // ----------------------------------- | 953 // ----------------------------------- |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 // ... | 1061 // ... |
1078 // rsp[argc * 8] : argument 1 | 1062 // rsp[argc * 8] : argument 1 |
1079 // rsp[(argc + 1) * 8] : argument 0 = receiver | 1063 // rsp[(argc + 1) * 8] : argument 0 = receiver |
1080 // ----------------------------------- | 1064 // ----------------------------------- |
1081 | 1065 |
1082 // Check if the name is a string. | 1066 // Check if the name is a string. |
1083 Label miss; | 1067 Label miss; |
1084 __ JumpIfSmi(rcx, &miss); | 1068 __ JumpIfSmi(rcx, &miss); |
1085 Condition cond = masm->IsObjectStringType(rcx, rax, rax); | 1069 Condition cond = masm->IsObjectStringType(rcx, rax, rax); |
1086 __ j(NegateCondition(cond), &miss); | 1070 __ j(NegateCondition(cond), &miss); |
1087 GenerateCallNormal(masm, argc); | 1071 CallICBase::GenerateNormal(masm, argc); |
1088 __ bind(&miss); | 1072 __ bind(&miss); |
1089 GenerateMiss(masm, argc); | 1073 GenerateMiss(masm, argc); |
1090 } | 1074 } |
1091 | 1075 |
1092 | 1076 |
1093 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, | 1077 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, |
1094 Register object, | 1078 Register object, |
1095 Register key, | 1079 Register key, |
1096 Register scratch1, | 1080 Register scratch1, |
1097 Register scratch2, | 1081 Register scratch2, |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 Condition cc = *jmp_address == Assembler::kJncShortOpcode | 1691 Condition cc = *jmp_address == Assembler::kJncShortOpcode |
1708 ? not_zero | 1692 ? not_zero |
1709 : zero; | 1693 : zero; |
1710 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1694 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1711 } | 1695 } |
1712 | 1696 |
1713 | 1697 |
1714 } } // namespace v8::internal | 1698 } } // namespace v8::internal |
1715 | 1699 |
1716 #endif // V8_TARGET_ARCH_X64 | 1700 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |