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 5249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5260 // Grab that for the second argument to the hook. | 5260 // Grab that for the second argument to the hook. |
5261 __ Addu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); | 5261 __ Addu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); |
5262 | 5262 |
5263 // Align the stack if necessary. | 5263 // Align the stack if necessary. |
5264 int frame_alignment = masm->ActivationFrameAlignment(); | 5264 int frame_alignment = masm->ActivationFrameAlignment(); |
5265 if (frame_alignment > kPointerSize) { | 5265 if (frame_alignment > kPointerSize) { |
5266 __ mov(s5, sp); | 5266 __ mov(s5, sp); |
5267 ASSERT(IsPowerOf2(frame_alignment)); | 5267 ASSERT(IsPowerOf2(frame_alignment)); |
5268 __ And(sp, sp, Operand(-frame_alignment)); | 5268 __ And(sp, sp, Operand(-frame_alignment)); |
5269 } | 5269 } |
5270 | 5270 __ Subu(sp, sp, kCArgsSlotsSize); |
5271 #if defined(V8_HOST_ARCH_MIPS) | 5271 #if defined(V8_HOST_ARCH_MIPS) |
5272 int32_t entry_hook = | 5272 int32_t entry_hook = |
5273 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); | 5273 reinterpret_cast<int32_t>(masm->isolate()->function_entry_hook()); |
5274 __ li(at, Operand(entry_hook)); | 5274 __ li(t9, Operand(entry_hook)); |
5275 #else | 5275 #else |
5276 // Under the simulator we need to indirect the entry hook through a | 5276 // Under the simulator we need to indirect the entry hook through a |
5277 // trampoline function at a known address. | 5277 // trampoline function at a known address. |
5278 // It additionally takes an isolate as a third parameter. | 5278 // It additionally takes an isolate as a third parameter. |
5279 __ li(a2, Operand(ExternalReference::isolate_address(masm->isolate()))); | 5279 __ li(a2, Operand(ExternalReference::isolate_address(masm->isolate()))); |
5280 | 5280 |
5281 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); | 5281 ApiFunction dispatcher(FUNCTION_ADDR(EntryHookTrampoline)); |
5282 __ li(at, Operand(ExternalReference(&dispatcher, | 5282 __ li(t9, Operand(ExternalReference(&dispatcher, |
5283 ExternalReference::BUILTIN_CALL, | 5283 ExternalReference::BUILTIN_CALL, |
5284 masm->isolate()))); | 5284 masm->isolate()))); |
5285 #endif | 5285 #endif |
5286 __ Call(at); | 5286 // Call C function through t9 to conform ABI for PIC. |
| 5287 __ Call(t9); |
5287 | 5288 |
5288 // Restore the stack pointer if needed. | 5289 // Restore the stack pointer if needed. |
5289 if (frame_alignment > kPointerSize) { | 5290 if (frame_alignment > kPointerSize) { |
5290 __ mov(sp, s5); | 5291 __ mov(sp, s5); |
| 5292 } else { |
| 5293 __ Addu(sp, sp, kCArgsSlotsSize); |
5291 } | 5294 } |
5292 | 5295 |
5293 // Also pop ra to get Ret(0). | 5296 // Also pop ra to get Ret(0). |
5294 __ MultiPop(kSavedRegs | ra.bit()); | 5297 __ MultiPop(kSavedRegs | ra.bit()); |
5295 __ Ret(); | 5298 __ Ret(); |
5296 } | 5299 } |
5297 | 5300 |
5298 | 5301 |
5299 template<class T> | 5302 template<class T> |
5300 static void CreateArrayDispatch(MacroAssembler* masm, | 5303 static void CreateArrayDispatch(MacroAssembler* masm, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5727 MemOperand(fp, 6 * kPointerSize), | 5730 MemOperand(fp, 6 * kPointerSize), |
5728 NULL); | 5731 NULL); |
5729 } | 5732 } |
5730 | 5733 |
5731 | 5734 |
5732 #undef __ | 5735 #undef __ |
5733 | 5736 |
5734 } } // namespace v8::internal | 5737 } } // namespace v8::internal |
5735 | 5738 |
5736 #endif // V8_TARGET_ARCH_MIPS | 5739 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |