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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 104663004: Preview of a first step towards unification of hydrogen calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge fix Created 6 years, 11 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/arm/macro-assembler-arm.h ('k') | src/code-stubs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 const CallWrapper& call_wrapper) { 1106 const CallWrapper& call_wrapper) {
1107 bool definitely_matches = false; 1107 bool definitely_matches = false;
1108 *definitely_mismatches = false; 1108 *definitely_mismatches = false;
1109 Label regular_invoke; 1109 Label regular_invoke;
1110 1110
1111 // Check whether the expected and actual arguments count match. If not, 1111 // Check whether the expected and actual arguments count match. If not,
1112 // setup registers according to contract with ArgumentsAdaptorTrampoline: 1112 // setup registers according to contract with ArgumentsAdaptorTrampoline:
1113 // r0: actual arguments count 1113 // r0: actual arguments count
1114 // r1: function (passed through to callee) 1114 // r1: function (passed through to callee)
1115 // r2: expected arguments count 1115 // r2: expected arguments count
1116 // r3: callee code entry
1117 1116
1118 // The code below is made a lot easier because the calling code already sets 1117 // The code below is made a lot easier because the calling code already sets
1119 // up actual and expected registers according to the contract if values are 1118 // up actual and expected registers according to the contract if values are
1120 // passed in registers. 1119 // passed in registers.
1121 ASSERT(actual.is_immediate() || actual.reg().is(r0)); 1120 ASSERT(actual.is_immediate() || actual.reg().is(r0));
1122 ASSERT(expected.is_immediate() || expected.reg().is(r2)); 1121 ASSERT(expected.is_immediate() || expected.reg().is(r2));
1123 ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3)); 1122 ASSERT((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(r3));
1124 1123
1125 if (expected.is_immediate()) { 1124 if (expected.is_immediate()) {
1126 ASSERT(actual.is_immediate()); 1125 ASSERT(actual.is_immediate());
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 Jump(code); 1196 Jump(code);
1198 } 1197 }
1199 1198
1200 // Continue here if InvokePrologue does handle the invocation due to 1199 // Continue here if InvokePrologue does handle the invocation due to
1201 // mismatched parameter counts. 1200 // mismatched parameter counts.
1202 bind(&done); 1201 bind(&done);
1203 } 1202 }
1204 } 1203 }
1205 1204
1206 1205
1207 void MacroAssembler::InvokeCode(Handle<Code> code,
1208 const ParameterCount& expected,
1209 const ParameterCount& actual,
1210 RelocInfo::Mode rmode,
1211 InvokeFlag flag) {
1212 // You can't call a function without a valid frame.
1213 ASSERT(flag == JUMP_FUNCTION || has_frame());
1214
1215 Label done;
1216 bool definitely_mismatches = false;
1217 InvokePrologue(expected, actual, code, no_reg,
1218 &done, &definitely_mismatches, flag,
1219 NullCallWrapper());
1220 if (!definitely_mismatches) {
1221 if (flag == CALL_FUNCTION) {
1222 Call(code, rmode);
1223 } else {
1224 Jump(code, rmode);
1225 }
1226
1227 // Continue here if InvokePrologue does handle the invocation due to
1228 // mismatched parameter counts.
1229 bind(&done);
1230 }
1231 }
1232
1233
1234 void MacroAssembler::InvokeFunction(Register fun, 1206 void MacroAssembler::InvokeFunction(Register fun,
1235 const ParameterCount& actual, 1207 const ParameterCount& actual,
1236 InvokeFlag flag, 1208 InvokeFlag flag,
1237 const CallWrapper& call_wrapper) { 1209 const CallWrapper& call_wrapper) {
1238 // You can't call a function without a valid frame. 1210 // You can't call a function without a valid frame.
1239 ASSERT(flag == JUMP_FUNCTION || has_frame()); 1211 ASSERT(flag == JUMP_FUNCTION || has_frame());
1240 1212
1241 // Contract with called JS functions requires that function is passed in r1. 1213 // Contract with called JS functions requires that function is passed in r1.
1242 ASSERT(fun.is(r1)); 1214 ASSERT(fun.is(r1));
1243 1215
(...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after
4099 void CodePatcher::EmitCondition(Condition cond) { 4071 void CodePatcher::EmitCondition(Condition cond) {
4100 Instr instr = Assembler::instr_at(masm_.pc_); 4072 Instr instr = Assembler::instr_at(masm_.pc_);
4101 instr = (instr & ~kCondMask) | cond; 4073 instr = (instr & ~kCondMask) | cond;
4102 masm_.emit(instr); 4074 masm_.emit(instr);
4103 } 4075 }
4104 4076
4105 4077
4106 } } // namespace v8::internal 4078 } } // namespace v8::internal
4107 4079
4108 #endif // V8_TARGET_ARCH_ARM 4080 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698