Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3322 // sp: stack pointer (restored as callee's sp after C call) | 3322 // sp: stack pointer (restored as callee's sp after C call) |
| 3323 // cp: current context (C callee-saved) | 3323 // cp: current context (C callee-saved) |
| 3324 | 3324 |
| 3325 // Result returned in r0 or r0+r1 by default. | 3325 // Result returned in r0 or r0+r1 by default. |
| 3326 | 3326 |
| 3327 // NOTE: Invocations of builtins may return failure objects | 3327 // NOTE: Invocations of builtins may return failure objects |
| 3328 // instead of a proper result. The builtin entry handles | 3328 // instead of a proper result. The builtin entry handles |
| 3329 // this by performing a garbage collection and retrying the | 3329 // this by performing a garbage collection and retrying the |
| 3330 // builtin once. | 3330 // builtin once. |
| 3331 | 3331 |
| 3332 // Compute the argv pointer in a callee-saved register. | |
| 3333 __ add(r6, sp, Operand(r0, LSL, kPointerSizeLog2)); | |
| 3334 __ sub(r6, r6, Operand(kPointerSize)); | |
| 3335 | |
| 3332 // Enter the exit frame that transitions from JavaScript to C++. | 3336 // Enter the exit frame that transitions from JavaScript to C++. |
| 3333 __ EnterExitFrame(save_doubles_); | 3337 __ EnterExitFrame(save_doubles_); |
| 3334 | 3338 |
| 3339 // Setup argc and the builtin function in callee-saved registers. | |
| 3340 __ mov(r4, Operand(r0)); | |
| 3341 __ mov(r5, Operand(r1)); | |
| 3342 | |
| 3335 // r4: number of arguments (C callee-saved) | 3343 // r4: number of arguments (C callee-saved) |
| 3336 // r5: pointer to builtin function (C callee-saved) | 3344 // r5: pointer to builtin function (C callee-saved) |
| 3337 // r6: pointer to first argument (C callee-saved) | 3345 // r6: pointer to first argument (C callee-saved) |
| 3338 | 3346 |
| 3339 Label throw_normal_exception; | 3347 Label throw_normal_exception; |
| 3340 Label throw_termination_exception; | 3348 Label throw_termination_exception; |
| 3341 Label throw_out_of_memory_exception; | 3349 Label throw_out_of_memory_exception; |
| 3342 | 3350 |
| 3343 // Call into the runtime system. | 3351 // Call into the runtime system. |
| 3344 GenerateCore(masm, | 3352 GenerateCore(masm, |
| (...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5725 __ CallExternalReference(miss, 3); | 5733 __ CallExternalReference(miss, 3); |
| 5726 __ LeaveInternalFrame(); | 5734 __ LeaveInternalFrame(); |
| 5727 // Compute the entry point of the rewritten stub. | 5735 // Compute the entry point of the rewritten stub. |
| 5728 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 5736 __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 5729 // Restore registers. | 5737 // Restore registers. |
| 5730 __ pop(lr); | 5738 __ pop(lr); |
| 5731 __ pop(r0); | 5739 __ pop(r0); |
| 5732 __ pop(r1); | 5740 __ pop(r1); |
| 5733 __ Jump(r2); | 5741 __ Jump(r2); |
| 5734 } | 5742 } |
| 5735 | 5743 |
|
Erik Corry
2011/02/04 09:55:55
Missing blank line.
antonm
2011/02/04 12:59:45
Done.
| |
| 5744 void DirectCEntryStub::Generate(MacroAssembler* masm) { | |
| 5745 __ ldr(pc, MemOperand(sp, 0)); | |
| 5746 } | |
| 5747 | |
|
Erik Corry
2011/02/04 09:55:55
and here
antonm
2011/02/04 12:59:45
Done.
| |
| 5748 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, | |
| 5749 ApiFunction *function) { | |
| 5750 __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()), | |
| 5751 RelocInfo::CODE_TARGET)); | |
| 5752 // Push return address (accessible to GC through exit frame pc). | |
| 5753 ExternalReference ref = | |
| 5754 ExternalReference(function, ExternalReference::DIRECT_CALL); | |
| 5755 __ mov(r2, Operand(reinterpret_cast<intptr_t>(ref.address()))); | |
|
Erik Corry
2011/02/04 09:55:55
There is a constructor for Operand that takes an e
antonm
2011/02/04 12:59:45
Done.
| |
| 5756 __ add(ip, pc, Operand(4)); | |
|
Erik Corry
2011/02/04 09:55:55
It seems to me that omitting this add and just usi
antonm
2011/02/04 12:59:45
Hmm, ip would have any garbage then. Am I missing
Zaheer
2011/02/04 13:08:05
I think Erik meant pc.
Erik Corry
2011/02/04 13:19:52
No you are right of course.
| |
| 5757 __ str(ip, MemOperand(sp, 0)); | |
| 5758 __ Jump(r2); // Call the api function. | |
| 5759 } | |
| 5736 | 5760 |
|
Erik Corry
2011/02/04 09:55:55
and missing blank line here
antonm
2011/02/04 12:59:45
Done.
| |
| 5737 #undef __ | 5761 #undef __ |
| 5738 | 5762 |
| 5739 } } // namespace v8::internal | 5763 } } // namespace v8::internal |
| 5740 | 5764 |
| 5741 #endif // V8_TARGET_ARCH_ARM | 5765 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |