// Clobbers r2; preserves all other registers.
-static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset, Register argc,
+static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
// Check the stack for overflow. We are not trying to catch
// interruptions (e.g. debug break and preemption) here, so the "real stack
__ b(gt, &okay); // Signed comparison.
// Out of stack space.
- __ ldr(r1, MemOperand(fp, calleeOffset));
- if (argc_is_tagged == kArgcIsUntaggedInt) {
- __ SmiTag(argc);
- }
- __ Push(r1, argc);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
__ bind(&okay);
__ Push(r1, r2);
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kPointerSize;
// Clobbers r2.
- Generate_CheckStackOverflow(masm, kFunctionOffset, r3, kArgcIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, r3, kArgcIsUntaggedInt);
// Remember new.target.
__ mov(r5, r0);
__ InvokeBuiltin(Context::APPLY_PREPARE_BUILTIN_INDEX, CALL_FUNCTION);
}
- Generate_CheckStackOverflow(masm, kFunctionOffset, r0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, r0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
__ InvokeBuiltin(Context::REFLECT_CONSTRUCT_PREPARE_BUILTIN_INDEX,
CALL_FUNCTION);
- Generate_CheckStackOverflow(masm, kFunctionOffset, r0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, r0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
// Clobbers x10, x15; preserves all other registers.
-static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset, Register argc,
+static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
- Register function = x15;
-
// Check the stack for overflow.
// We are not trying to catch interruptions (e.g. debug break and
// preemption) here, so the "real stack limit" is checked.
Label enough_stack_space;
__ LoadRoot(x10, Heap::kRealStackLimitRootIndex);
- __ Ldr(function, MemOperand(fp, calleeOffset));
// Make x10 the space we have left. The stack might already be overflowed
// here which will cause x10 to become negative.
// TODO(jbramley): Check that the stack usage here is safe.
__ Cmp(x10, Operand(argc, LSL, kPointerSizeLog2));
}
__ B(gt, &enough_stack_space);
- // There is not enough stack space, so use a builtin to throw an appropriate
- // error.
- if (argc_is_tagged == kArgcIsUntaggedInt) {
- __ SmiTag(argc);
- }
- __ Push(function, argc);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
// We should never return from the APPLY_OVERFLOW builtin.
if (__ emit_debug_code()) {
__ Push(function, receiver);
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kPointerSize;
// Expects argument count in eax. Clobbers ecx, edx, edi.
- Generate_CheckStackOverflow(masm, kFunctionOffset, argc,
- kArgcIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, argc, kArgcIsUntaggedInt);
// Copy arguments to the stack in a loop, in reverse order.
// x3: argc.
}
Register argc = x0;
- Generate_CheckStackOverflow(masm, kFunctionOffset, argc, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, argc, kArgcIsSmiTagged);
// Push current limit, index and receiver.
__ Mov(x1, 0); // Initial index.
CALL_FUNCTION);
Register argc = x0;
- Generate_CheckStackOverflow(masm, kFunctionOffset, argc, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, argc, kArgcIsSmiTagged);
// Push current limit and index & constructor function as callee.
__ Mov(x1, 0); // Initial index.
// Clobbers ecx, edx, edi; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset,
IsTagged eax_is_tagged) {
// eax : the number of items to be pushed to the stack
//
__ j(greater, &okay); // Signed comparison.
// Out of stack space.
- __ push(Operand(ebp, calleeOffset)); // push this
- if (eax_is_tagged == kEaxIsUntaggedInt) {
- __ SmiTag(eax);
- }
- __ push(eax);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
__ bind(&okay);
__ mov(ebx, Operand(ebx, EntryFrameConstants::kArgvOffset));
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kPointerSize;
// Expects argument count in eax. Clobbers ecx, edx, edi.
- Generate_CheckStackOverflow(masm, kFunctionOffset, kEaxIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, kEaxIsUntaggedInt);
// Copy arguments to the stack in a loop.
Label loop, entry;
__ InvokeBuiltin(Context::APPLY_PREPARE_BUILTIN_INDEX, CALL_FUNCTION);
}
- Generate_CheckStackOverflow(masm, kFunctionOffset, kEaxIsSmiTagged);
+ Generate_CheckStackOverflow(masm, kEaxIsSmiTagged);
// Push current index and limit.
const int kLimitOffset = kVectorOffset - 1 * kPointerSize;
__ InvokeBuiltin(Context::REFLECT_CONSTRUCT_PREPARE_BUILTIN_INDEX,
CALL_FUNCTION);
- Generate_CheckStackOverflow(masm, kFunctionOffset, kEaxIsSmiTagged);
+ Generate_CheckStackOverflow(masm, kEaxIsSmiTagged);
// Push current index and limit.
const int kLimitOffset = kVectorOffset - 1 * kPointerSize;
// Clobbers a2; preserves all other registers.
-static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset, Register argc,
+static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
// Check the stack for overflow. We are not trying to catch
// interruptions (e.g. debug break and preemption) here, so the "real stack
__ Branch(&okay, gt, a2, Operand(t3));
// Out of stack space.
- __ lw(a1, MemOperand(fp, calleeOffset));
- if (argc_is_tagged == kArgcIsUntaggedInt) {
- __ SmiTag(argc);
- }
- __ Push(a1, argc);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
__ bind(&okay);
__ Push(a1, a2);
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kPointerSize;
// Clobbers a2.
- Generate_CheckStackOverflow(masm, kFunctionOffset, a3, kArgcIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, a3, kArgcIsUntaggedInt);
// Remember new.target.
__ mov(t1, a0);
}
// Returns the result in v0.
- Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, v0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
CALL_FUNCTION);
// Returns result in v0.
- Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, v0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
// Clobbers a2; preserves all other registers.
-static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset, Register argc,
+static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
// Check the stack for overflow. We are not trying to catch
// interruptions (e.g. debug break and preemption) here, so the "real stack
__ Branch(&okay, gt, a2, Operand(a7)); // Signed comparison.
// Out of stack space.
- __ ld(a1, MemOperand(fp, calleeOffset));
- if (argc_is_tagged == kArgcIsUntaggedInt) {
- __ SmiTag(argc);
- }
- __ Push(a1, argc);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
__ bind(&okay);
__ Push(a1, a2);
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kPointerSize;
// Clobbers a2.
- Generate_CheckStackOverflow(masm, kFunctionOffset, a3, kArgcIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, a3, kArgcIsUntaggedInt);
// Remember new.target.
__ mov(a5, a0);
}
// Returns the result in v0.
- Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, v0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
CALL_FUNCTION);
// Returns result in v0.
- Generate_CheckStackOverflow(masm, kFunctionOffset, v0, kArgcIsSmiTagged);
+ Generate_CheckStackOverflow(masm, v0, kArgcIsSmiTagged);
// Push current limit and index.
const int kIndexOffset = kVectorOffset - (2 * kPointerSize);
// Clobbers rcx, r11, kScratchRegister; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm,
- const int calleeOffset,
IsTagged rax_is_tagged) {
// rax : the number of items to be pushed to the stack
//
__ j(greater, &okay); // Signed comparison.
// Out of stack space.
- __ Push(Operand(rbp, calleeOffset));
- if (rax_is_tagged == kRaxIsUntaggedInt) {
- __ Integer32ToSmi(rax, rax);
- }
- __ Push(rax);
__ CallRuntime(Runtime::kThrowStackOverflow, 0);
__ bind(&okay);
// rdx : new.target
// Check if we have enough stack space to push all arguments.
- // The function is the first thing that was pushed above after entering
- // the internal frame.
- const int kFunctionOffset =
- InternalFrameConstants::kCodeOffset - kRegisterSize;
// Expects argument count in rax. Clobbers rcx, r11.
- Generate_CheckStackOverflow(masm, kFunctionOffset, kRaxIsUntaggedInt);
+ Generate_CheckStackOverflow(masm, kRaxIsUntaggedInt);
// Copy arguments to the stack in a loop.
// Register rbx points to array of pointers to handle locations.
__ InvokeBuiltin(Context::APPLY_PREPARE_BUILTIN_INDEX, CALL_FUNCTION);
}
- Generate_CheckStackOverflow(masm, kFunctionOffset, kRaxIsSmiTagged);
+ Generate_CheckStackOverflow(masm, kRaxIsSmiTagged);
// Push current index and limit, and receiver.
const int kLimitOffset = kVectorOffset - 1 * kPointerSize;
__ InvokeBuiltin(Context::REFLECT_CONSTRUCT_PREPARE_BUILTIN_INDEX,
CALL_FUNCTION);
- Generate_CheckStackOverflow(masm, kFunctionOffset, kRaxIsSmiTagged);
+ Generate_CheckStackOverflow(masm, kRaxIsSmiTagged);
// Push current index and limit.
const int kLimitOffset = kVectorOffset - 1 * kPointerSize;