OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 CallKind call_kind) { | 1067 CallKind call_kind) { |
1068 bool definitely_matches = false; | 1068 bool definitely_matches = false; |
1069 *definitely_mismatches = false; | 1069 *definitely_mismatches = false; |
1070 Label regular_invoke; | 1070 Label regular_invoke; |
1071 | 1071 |
1072 // Check whether the expected and actual arguments count match. If not, | 1072 // Check whether the expected and actual arguments count match. If not, |
1073 // setup registers according to contract with ArgumentsAdaptorTrampoline: | 1073 // setup registers according to contract with ArgumentsAdaptorTrampoline: |
1074 // r0: actual arguments count | 1074 // r0: actual arguments count |
1075 // r1: function (passed through to callee) | 1075 // r1: function (passed through to callee) |
1076 // r2: expected arguments count | 1076 // r2: expected arguments count |
1077 // r3: callee code entry | |
1078 | 1077 |
1079 // The code below is made a lot easier because the calling code already sets | 1078 // The code below is made a lot easier because the calling code already sets |
1080 // up actual and expected registers according to the contract if values are | 1079 // up actual and expected registers according to the contract if values are |
1081 // passed in registers. | 1080 // passed in registers. |
1082 ASSERT(actual.is_immediate() || actual.reg().is(r0)); | 1081 ASSERT(actual.is_immediate() || actual.reg().is(r0)); |
1083 ASSERT(expected.is_immediate() || expected.reg().is(r2)); | 1082 ASSERT(expected.is_immediate() || expected.reg().is(r2)); |
1084 ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3)); | 1083 ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3)); |
1085 | 1084 |
1086 if (expected.is_immediate()) { | 1085 if (expected.is_immediate()) { |
1087 ASSERT(actual.is_immediate()); | 1086 ASSERT(actual.is_immediate()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 Jump(code); | 1162 Jump(code); |
1164 } | 1163 } |
1165 | 1164 |
1166 // Continue here if InvokePrologue does handle the invocation due to | 1165 // Continue here if InvokePrologue does handle the invocation due to |
1167 // mismatched parameter counts. | 1166 // mismatched parameter counts. |
1168 bind(&done); | 1167 bind(&done); |
1169 } | 1168 } |
1170 } | 1169 } |
1171 | 1170 |
1172 | 1171 |
1173 void MacroAssembler::InvokeCode(Handle<Code> code, | |
1174 const ParameterCount& expected, | |
1175 const ParameterCount& actual, | |
1176 RelocInfo::Mode rmode, | |
1177 InvokeFlag flag, | |
1178 CallKind call_kind) { | |
1179 // You can't call a function without a valid frame. | |
1180 ASSERT(flag == JUMP_FUNCTION || has_frame()); | |
1181 | |
1182 Label done; | |
1183 bool definitely_mismatches = false; | |
1184 InvokePrologue(expected, actual, code, no_reg, | |
1185 &done, &definitely_mismatches, flag, | |
1186 NullCallWrapper(), call_kind); | |
1187 if (!definitely_mismatches) { | |
1188 if (flag == CALL_FUNCTION) { | |
1189 SetCallKind(r5, call_kind); | |
1190 Call(code, rmode); | |
1191 } else { | |
1192 SetCallKind(r5, call_kind); | |
1193 Jump(code, rmode); | |
1194 } | |
1195 | |
1196 // Continue here if InvokePrologue does handle the invocation due to | |
1197 // mismatched parameter counts. | |
1198 bind(&done); | |
1199 } | |
1200 } | |
1201 | |
1202 | |
1203 void MacroAssembler::InvokeFunction(Register fun, | 1172 void MacroAssembler::InvokeFunction(Register fun, |
1204 const ParameterCount& actual, | 1173 const ParameterCount& actual, |
1205 InvokeFlag flag, | 1174 InvokeFlag flag, |
1206 const CallWrapper& call_wrapper, | 1175 const CallWrapper& call_wrapper, |
1207 CallKind call_kind) { | 1176 CallKind call_kind) { |
1208 // You can't call a function without a valid frame. | 1177 // You can't call a function without a valid frame. |
1209 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 1178 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
1210 | 1179 |
1211 // Contract with called JS functions requires that function is passed in r1. | 1180 // Contract with called JS functions requires that function is passed in r1. |
1212 ASSERT(fun.is(r1)); | 1181 ASSERT(fun.is(r1)); |
(...skipping 2866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4079 void CodePatcher::EmitCondition(Condition cond) { | 4048 void CodePatcher::EmitCondition(Condition cond) { |
4080 Instr instr = Assembler::instr_at(masm_.pc_); | 4049 Instr instr = Assembler::instr_at(masm_.pc_); |
4081 instr = (instr & ~kCondMask) | cond; | 4050 instr = (instr & ~kCondMask) | cond; |
4082 masm_.emit(instr); | 4051 masm_.emit(instr); |
4083 } | 4052 } |
4084 | 4053 |
4085 | 4054 |
4086 } } // namespace v8::internal | 4055 } } // namespace v8::internal |
4087 | 4056 |
4088 #endif // V8_TARGET_ARCH_ARM | 4057 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |