OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 __ ldr(r0, MemOperand(sp)); | 162 __ ldr(r0, MemOperand(sp)); |
163 | 163 |
164 // Remove receiver from the stack, remove caller arguments, and | 164 // Remove receiver from the stack, remove caller arguments, and |
165 // return. | 165 // return. |
166 __ bind(&exit); | 166 __ bind(&exit); |
167 // r0: result | 167 // r0: result |
168 // sp[0]: receiver (newly allocated object) | 168 // sp[0]: receiver (newly allocated object) |
169 // sp[1]: constructor function | 169 // sp[1]: constructor function |
170 // sp[2]: number of arguments (smi-tagged) | 170 // sp[2]: number of arguments (smi-tagged) |
171 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); | 171 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); |
172 __ ExitInternalFrame(); | 172 __ LeaveInternalFrame(); |
173 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); | 173 __ add(sp, sp, Operand(r1, LSL, kPointerSizeLog2 - 1)); |
174 __ add(sp, sp, Operand(kPointerSize)); | 174 __ add(sp, sp, Operand(kPointerSize)); |
175 __ mov(pc, Operand(lr)); | 175 __ mov(pc, Operand(lr)); |
176 | 176 |
177 // Compute the offset from the beginning of the JSConstructCall | 177 // Compute the offset from the beginning of the JSConstructCall |
178 // builtin code object to the return address after the call. | 178 // builtin code object to the return address after the call. |
179 ASSERT(return_site.is_bound()); | 179 ASSERT(return_site.is_bound()); |
180 construct_call_pc_offset_ = return_site.pos() + Code::kHeaderSize; | 180 construct_call_pc_offset_ = return_site.pos() + Code::kHeaderSize; |
181 } | 181 } |
182 | 182 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (is_construct) { | 234 if (is_construct) { |
235 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), | 235 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), |
236 code_target); | 236 code_target); |
237 } else { | 237 } else { |
238 ParameterCount actual(r0); | 238 ParameterCount actual(r0); |
239 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 239 __ InvokeFunction(r1, actual, CALL_FUNCTION); |
240 } | 240 } |
241 | 241 |
242 // Exit the JS frame and remove the parameters (except function), and return. | 242 // Exit the JS frame and remove the parameters (except function), and return. |
243 // Respect ABI stack constraint. | 243 // Respect ABI stack constraint. |
244 __ ExitInternalFrame(); | 244 __ LeaveInternalFrame(); |
245 __ mov(pc, lr); | 245 __ mov(pc, lr); |
246 | 246 |
247 // r0: result | 247 // r0: result |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { | 251 void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) { |
252 Generate_JSEntryTrampolineHelper(masm, false); | 252 Generate_JSEntryTrampolineHelper(masm, false); |
253 } | 253 } |
254 | 254 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 __ push(r2); | 332 __ push(r2); |
333 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); | 333 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); |
334 __ mov(r2, r0); | 334 __ mov(r2, r0); |
335 | 335 |
336 // Restore number of arguments and function. | 336 // Restore number of arguments and function. |
337 __ pop(r1); | 337 __ pop(r1); |
338 __ pop(r0); | 338 __ pop(r0); |
339 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); | 339 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
340 | 340 |
341 __ ExitInternalFrame(); | 341 __ LeaveInternalFrame(); |
342 __ b(&patch_receiver); | 342 __ b(&patch_receiver); |
343 | 343 |
344 // Use the global object from the called function as the receiver. | 344 // Use the global object from the called function as the receiver. |
345 __ bind(&use_global_receiver); | 345 __ bind(&use_global_receiver); |
346 const int kGlobalIndex = | 346 const int kGlobalIndex = |
347 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; | 347 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
348 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); | 348 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); |
349 | 349 |
350 __ bind(&patch_receiver); | 350 __ bind(&patch_receiver); |
351 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); | 351 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 __ cmp(r0, r1); | 523 __ cmp(r0, r1); |
524 __ b(ne, &loop); | 524 __ b(ne, &loop); |
525 | 525 |
526 // Invoke the function. | 526 // Invoke the function. |
527 ParameterCount actual(r0); | 527 ParameterCount actual(r0); |
528 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); | 528 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
529 __ ldr(r1, MemOperand(fp, kFunctionOffset)); | 529 __ ldr(r1, MemOperand(fp, kFunctionOffset)); |
530 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 530 __ InvokeFunction(r1, actual, CALL_FUNCTION); |
531 | 531 |
532 // Tear down the internal frame and remove function, receiver and args. | 532 // Tear down the internal frame and remove function, receiver and args. |
533 __ ExitInternalFrame(); | 533 __ LeaveInternalFrame(); |
534 __ add(sp, sp, Operand(3 * kPointerSize)); | 534 __ add(sp, sp, Operand(3 * kPointerSize)); |
535 __ mov(pc, lr); | 535 __ mov(pc, lr); |
536 } | 536 } |
537 | 537 |
538 | 538 |
539 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 539 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
540 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 540 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
541 __ mov(r4, Operand(ArgumentsAdaptorFrame::SENTINEL)); | 541 __ mov(r4, Operand(ArgumentsAdaptorFrame::SENTINEL)); |
542 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); | 542 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); |
543 __ add(fp, sp, Operand(3 * kPointerSize)); | 543 __ add(fp, sp, Operand(3 * kPointerSize)); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 } | 828 } |
829 | 829 |
830 void Builtins::Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) { | 830 void Builtins::Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) { |
831 // Generate nothing as CodeStub CallFunction is not used on ARM. | 831 // Generate nothing as CodeStub CallFunction is not used on ARM. |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 #undef __ | 835 #undef __ |
836 | 836 |
837 } } // namespace v8::internal | 837 } } // namespace v8::internal |
OLD | NEW |