| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 __ mov(r2, r0); | 326 __ mov(r2, r0); |
| 327 | 327 |
| 328 // Restore number of arguments and function. | 328 // Restore number of arguments and function. |
| 329 __ pop(r1); | 329 __ pop(r1); |
| 330 __ pop(r0); | 330 __ pop(r0); |
| 331 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); | 331 __ mov(r0, Operand(r0, ASR, kSmiTagSize)); |
| 332 | 332 |
| 333 __ LeaveInternalFrame(); | 333 __ LeaveInternalFrame(); |
| 334 __ b(&patch_receiver); | 334 __ b(&patch_receiver); |
| 335 | 335 |
| 336 // Use the global object from the called function as the receiver. | 336 // Use the global receiver object from the called function as the receiver. |
| 337 __ bind(&use_global_receiver); | 337 __ bind(&use_global_receiver); |
| 338 const int kGlobalIndex = | 338 const int kGlobalIndex = |
| 339 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; | 339 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
| 340 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); | 340 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); |
| 341 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
| 341 | 342 |
| 342 __ bind(&patch_receiver); | 343 __ bind(&patch_receiver); |
| 343 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); | 344 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); |
| 344 __ str(r2, MemOperand(r3, -kPointerSize)); | 345 __ str(r2, MemOperand(r3, -kPointerSize)); |
| 345 | 346 |
| 346 __ bind(&done); | 347 __ bind(&done); |
| 347 } | 348 } |
| 348 | 349 |
| 349 // 4. Shift stuff one slot down the stack | 350 // 4. Shift stuff one slot down the stack |
| 350 // r0: actual number of arguments (including call() receiver) | 351 // r0: actual number of arguments (including call() receiver) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 __ cmp(r1, Operand(LAST_JS_OBJECT_TYPE)); | 466 __ cmp(r1, Operand(LAST_JS_OBJECT_TYPE)); |
| 466 __ b(le, &push_receiver); | 467 __ b(le, &push_receiver); |
| 467 | 468 |
| 468 // Convert the receiver to a regular object. | 469 // Convert the receiver to a regular object. |
| 469 // r0: receiver | 470 // r0: receiver |
| 470 __ bind(&call_to_object); | 471 __ bind(&call_to_object); |
| 471 __ push(r0); | 472 __ push(r0); |
| 472 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); | 473 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_JS); |
| 473 __ b(&push_receiver); | 474 __ b(&push_receiver); |
| 474 | 475 |
| 475 // Use the current global object as the receiver. | 476 // Use the current global receiver object as the receiver. |
| 476 __ bind(&use_global_receiver); | 477 __ bind(&use_global_receiver); |
| 477 __ ldr(r0, FieldMemOperand(cp, Context::kHeaderSize + | 478 const int kGlobalOffset = |
| 478 Context::GLOBAL_INDEX * kPointerSize)); | 479 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
| 480 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); |
| 481 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
| 479 | 482 |
| 480 // Push the receiver. | 483 // Push the receiver. |
| 481 // r0: receiver | 484 // r0: receiver |
| 482 __ bind(&push_receiver); | 485 __ bind(&push_receiver); |
| 483 __ push(r0); | 486 __ push(r0); |
| 484 | 487 |
| 485 // Copy all arguments from the array to the stack. | 488 // Copy all arguments from the array to the stack. |
| 486 Label entry, loop; | 489 Label entry, loop; |
| 487 __ ldr(r0, MemOperand(fp, kIndexOffset)); | 490 __ ldr(r0, MemOperand(fp, kIndexOffset)); |
| 488 __ b(&entry); | 491 __ b(&entry); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 } | 812 } |
| 810 | 813 |
| 811 void Builtins::Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) { | 814 void Builtins::Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) { |
| 812 // Generate nothing as CodeStub CallFunction is not used on ARM. | 815 // Generate nothing as CodeStub CallFunction is not used on ARM. |
| 813 } | 816 } |
| 814 | 817 |
| 815 | 818 |
| 816 #undef __ | 819 #undef __ |
| 817 | 820 |
| 818 } } // namespace v8::internal | 821 } } // namespace v8::internal |
| OLD | NEW |