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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 SharedFunctionInfo::kFormalParameterCountOffset)); | 1222 SharedFunctionInfo::kFormalParameterCountOffset)); |
1223 SmiUntag(expected_reg); | 1223 SmiUntag(expected_reg); |
1224 ldr(code_reg, | 1224 ldr(code_reg, |
1225 FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1225 FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
1226 | 1226 |
1227 ParameterCount expected(expected_reg); | 1227 ParameterCount expected(expected_reg); |
1228 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); | 1228 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); |
1229 } | 1229 } |
1230 | 1230 |
1231 | 1231 |
1232 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, | 1232 void MacroAssembler::InvokeFunction(Register function, |
1233 const ParameterCount& expected, | 1233 const ParameterCount& expected, |
1234 const ParameterCount& actual, | 1234 const ParameterCount& actual, |
1235 InvokeFlag flag, | 1235 InvokeFlag flag, |
1236 const CallWrapper& call_wrapper, | 1236 const CallWrapper& call_wrapper, |
1237 CallKind call_kind) { | 1237 CallKind call_kind) { |
1238 // You can't call a function without a valid frame. | 1238 // You can't call a function without a valid frame. |
1239 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 1239 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
1240 | 1240 |
| 1241 // Contract with called JS functions requires that function is passed in r1. |
| 1242 ASSERT(function.is(r1)); |
| 1243 |
1241 // Get the function and setup the context. | 1244 // Get the function and setup the context. |
1242 Move(r1, function); | |
1243 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 1245 ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
1244 | 1246 |
1245 // We call indirectly through the code field in the function to | 1247 // We call indirectly through the code field in the function to |
1246 // allow recompilation to take effect without changing any of the | 1248 // allow recompilation to take effect without changing any of the |
1247 // call sites. | 1249 // call sites. |
1248 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 1250 ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
1249 InvokeCode(r3, expected, actual, flag, call_wrapper, call_kind); | 1251 InvokeCode(r3, expected, actual, flag, call_wrapper, call_kind); |
1250 } | 1252 } |
1251 | 1253 |
1252 | 1254 |
| 1255 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
| 1256 const ParameterCount& expected, |
| 1257 const ParameterCount& actual, |
| 1258 InvokeFlag flag, |
| 1259 const CallWrapper& call_wrapper, |
| 1260 CallKind call_kind) { |
| 1261 Move(r1, function); |
| 1262 InvokeFunction(r1, expected, actual, flag, call_wrapper, call_kind); |
| 1263 } |
| 1264 |
| 1265 |
1253 void MacroAssembler::IsObjectJSObjectType(Register heap_object, | 1266 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
1254 Register map, | 1267 Register map, |
1255 Register scratch, | 1268 Register scratch, |
1256 Label* fail) { | 1269 Label* fail) { |
1257 ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); | 1270 ldr(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); |
1258 IsInstanceJSObjectType(map, scratch, fail); | 1271 IsInstanceJSObjectType(map, scratch, fail); |
1259 } | 1272 } |
1260 | 1273 |
1261 | 1274 |
1262 void MacroAssembler::IsInstanceJSObjectType(Register map, | 1275 void MacroAssembler::IsInstanceJSObjectType(Register map, |
(...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4070 void CodePatcher::EmitCondition(Condition cond) { | 4083 void CodePatcher::EmitCondition(Condition cond) { |
4071 Instr instr = Assembler::instr_at(masm_.pc_); | 4084 Instr instr = Assembler::instr_at(masm_.pc_); |
4072 instr = (instr & ~kCondMask) | cond; | 4085 instr = (instr & ~kCondMask) | cond; |
4073 masm_.emit(instr); | 4086 masm_.emit(instr); |
4074 } | 4087 } |
4075 | 4088 |
4076 | 4089 |
4077 } } // namespace v8::internal | 4090 } } // namespace v8::internal |
4078 | 4091 |
4079 #endif // V8_TARGET_ARCH_ARM | 4092 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |