Revision: 19121
Author: [email protected]
Date: Wed Feb 5 22:28:46 2014 UTC
Log: MIPS: Fix crashes after profile entry hook calls.
The call to C++ function has to be done through t9 register for
the position independent code.
The crashes occur only for shared library build.
TEST=cctest/test-api/SetFunctionEntryHook
BUG=
[email protected]
Review URL: https://codereview.chromium.org/132113009
Patch from Dusan Milosavljevic <[email protected]>.
http://code.google.com/p/v8/source/detail?r=19121
Modified:
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Feb 4 00:06:44
2014 UTC
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed Feb 5 22:28:46
2014 UTC
@@ -5267,11 +5267,11 @@
ASSERT(IsPowerOf2(frame_alignment));
__ And(sp, sp, Operand(-frame_alignment));
}
-
+ __ Subu(sp, sp, kCArgsSlotsSize);
#if defined(V8_HOST_ARCH_MIPS)
int32_t entry_hook =
reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook());
- __ li(at, Operand(entry_hook));
+ __ li(t9, Operand(entry_hook));
#else
// Under the simulator we need to indirect the entry hook through a
// trampoline function at a known address.
@@ -5279,15 +5279,18 @@
__ li(a2, Operand(ExternalReference::isolate_address(masm->isolate())));
ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline));
- __ li(at, Operand(ExternalReference(&dispatcher,
+ __ li(t9, Operand(ExternalReference(&dispatcher,
ExternalReference::BUILTIN_CALL,
masm->isolate())));
#endif
- __ Call(at);
+ // Call C function through t9 to conform ABI for PIC.
+ __ Call(t9);
// Restore the stack pointer if needed.
if (frame_alignment > kPointerSize) {
__ mov(sp, s5);
+ } else {
+ __ Addu(sp, sp, kCArgsSlotsSize);
}
// Also pop ra to get Ret(0).
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.