From f2789a903b90f14ebdd268005439cd3e55261129 Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Tue, 19 Oct 2010 11:14:03 +0000 Subject: [PATCH] Change the StackGuard runtime function to take no arguments. For some reason the StackGuard runtime function took a dummy argument that it always ignored. Change it to take no arguments. Review URL: http://codereview.chromium.org/3838003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5660 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 8 +------- src/ia32/code-stubs-ia32.cc | 11 +---------- src/runtime.cc | 2 +- src/runtime.h | 2 +- src/x64/code-stubs-x64.cc | 11 +---------- 5 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index c63c3bd..b3b0766 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -2297,13 +2297,7 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { void StackCheckStub::Generate(MacroAssembler* masm) { - // Do tail-call to runtime routine. Runtime routines expect at least one - // argument, so give it a Smi. - __ mov(r0, Operand(Smi::FromInt(0))); - __ push(r0); - __ TailCallRuntime(Runtime::kStackGuard, 1, 1); - - __ Ret(); + __ TailCallRuntime(Runtime::kStackGuard, 0, 1); } diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index 897a3d5..348bb14 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -2964,16 +2964,7 @@ void CompareStub::BranchIfNonSymbol(MacroAssembler* masm, void StackCheckStub::Generate(MacroAssembler* masm) { - // Because builtins always remove the receiver from the stack, we - // have to fake one to avoid underflowing the stack. The receiver - // must be inserted below the return address on the stack so we - // temporarily store that in a register. - __ pop(eax); - __ push(Immediate(Smi::FromInt(0))); - __ push(eax); - - // Do tail-call to runtime routine. - __ TailCallRuntime(Runtime::kStackGuard, 1, 1); + __ TailCallRuntime(Runtime::kStackGuard, 0, 1); } diff --git a/src/runtime.cc b/src/runtime.cc index d387618..9a604a0 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -6703,7 +6703,7 @@ static Object* Runtime_StackOverflow(Arguments args) { static Object* Runtime_StackGuard(Arguments args) { - ASSERT(args.length() == 1); + ASSERT(args.length() == 0); // First check if this is a real stack overflow. if (StackGuard::IsStackOverflow()) { diff --git a/src/runtime.h b/src/runtime.h index 19f4144..2cd95c4 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -267,7 +267,7 @@ namespace internal { F(Throw, 1, 1) \ F(ReThrow, 1, 1) \ F(ThrowReferenceError, 1, 1) \ - F(StackGuard, 1, 1) \ + F(StackGuard, 0, 1) \ F(PromoteScheduledException, 0, 1) \ \ /* Contexts */ \ diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index 295d758..2d87667 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -2394,16 +2394,7 @@ void CompareStub::BranchIfNonSymbol(MacroAssembler* masm, void StackCheckStub::Generate(MacroAssembler* masm) { - // Because builtins always remove the receiver from the stack, we - // have to fake one to avoid underflowing the stack. The receiver - // must be inserted below the return address on the stack so we - // temporarily store that in a register. - __ pop(rax); - __ Push(Smi::FromInt(0)); - __ push(rax); - - // Do tail-call to runtime routine. - __ TailCallRuntime(Runtime::kStackGuard, 1, 1); + __ TailCallRuntime(Runtime::kStackGuard, 0, 1); } -- 2.7.4