OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 } | 967 } |
968 | 968 |
969 | 969 |
970 void CEntryStub::Generate(MacroAssembler* masm) { | 970 void CEntryStub::Generate(MacroAssembler* masm) { |
971 // Called from JavaScript; parameters are on stack as if calling JS function. | 971 // Called from JavaScript; parameters are on stack as if calling JS function. |
972 // r0: number of arguments including receiver | 972 // r0: number of arguments including receiver |
973 // r1: pointer to builtin function | 973 // r1: pointer to builtin function |
974 // fp: frame pointer (restored after C call) | 974 // fp: frame pointer (restored after C call) |
975 // sp: stack pointer (restored as callee's sp after C call) | 975 // sp: stack pointer (restored as callee's sp after C call) |
976 // cp: current context (C callee-saved) | 976 // cp: current context (C callee-saved) |
977 // | 977 |
978 // If argv_in_register(): | |
979 // r2: pointer to the first argument | |
980 ProfileEntryHookStub::MaybeCallEntryHook(masm); | 978 ProfileEntryHookStub::MaybeCallEntryHook(masm); |
981 | 979 |
982 __ mov(r5, Operand(r1)); | 980 __ mov(r5, Operand(r1)); |
983 | 981 |
984 if (!argv_in_register()) { | 982 // Compute the argv pointer in a callee-saved register. |
985 // Compute the argv pointer in a callee-saved register. | 983 __ add(r1, sp, Operand(r0, LSL, kPointerSizeLog2)); |
986 __ add(r1, sp, Operand(r0, LSL, kPointerSizeLog2)); | 984 __ sub(r1, r1, Operand(kPointerSize)); |
987 __ sub(r1, r1, Operand(kPointerSize)); | |
988 } else { | |
989 // Move argv into the correct register. | |
990 __ mov(r1, Operand(r2)); | |
991 } | |
992 | 985 |
993 // Enter the exit frame that transitions from JavaScript to C++. | 986 // Enter the exit frame that transitions from JavaScript to C++. |
994 FrameScope scope(masm, StackFrame::MANUAL); | 987 FrameScope scope(masm, StackFrame::MANUAL); |
995 __ EnterExitFrame(save_doubles()); | 988 __ EnterExitFrame(save_doubles()); |
996 | 989 |
997 // Store a copy of argc in callee-saved registers for later. | 990 // Store a copy of argc in callee-saved registers for later. |
998 __ mov(r4, Operand(r0)); | 991 __ mov(r4, Operand(r0)); |
999 | 992 |
1000 // r0, r4: number of arguments including receiver (C callee-saved) | 993 // r0, r4: number of arguments including receiver (C callee-saved) |
1001 // r1: pointer to the first argument (C callee-saved) | 994 // r1: pointer to the first argument (C callee-saved) |
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5540 MemOperand(fp, 6 * kPointerSize), NULL); | 5533 MemOperand(fp, 6 * kPointerSize), NULL); |
5541 } | 5534 } |
5542 | 5535 |
5543 | 5536 |
5544 #undef __ | 5537 #undef __ |
5545 | 5538 |
5546 } // namespace internal | 5539 } // namespace internal |
5547 } // namespace v8 | 5540 } // namespace v8 |
5548 | 5541 |
5549 #endif // V8_TARGET_ARCH_ARM | 5542 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |