From da9fe0f96184aaa2ec505984cd74298832213cd2 Mon Sep 17 00:00:00 2001 From: "ricow@chromium.org" Date: Tue, 8 Mar 2011 14:18:28 +0000 Subject: [PATCH] Remove GetProvidedParametersCount from JavaScriptFrame, it simply calls ComputeParametersCount. Review URL: http://codereview.chromium.org/6635042 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/accessors.cc | 2 +- src/frames.cc | 5 ----- src/frames.h | 6 ------ src/runtime.cc | 14 +++++++------- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/accessors.cc b/src/accessors.cc index 1826425..ccd9da9 100644 --- a/src/accessors.cc +++ b/src/accessors.cc @@ -791,7 +791,7 @@ MaybeObject* Accessors::FunctionGetArguments(Object* object, void*) { // Get the number of arguments and construct an arguments object // mirror for the right frame. - const int length = frame->GetProvidedParametersCount(); + const int length = frame->ComputeParametersCount(); Handle arguments = Factory::NewArgumentsObject(function, length); Handle array = Factory::NewFixedArray(length); diff --git a/src/frames.cc b/src/frames.cc index 24ea8dd..7dae462 100644 --- a/src/frames.cc +++ b/src/frames.cc @@ -630,11 +630,6 @@ Code* JavaScriptFrame::unchecked_code() const { } -int JavaScriptFrame::GetProvidedParametersCount() const { - return ComputeParametersCount(); -} - - Address JavaScriptFrame::GetCallerStackPointer() const { int arguments; if (Heap::gc_state() != Heap::NOT_IN_GC || diff --git a/src/frames.h b/src/frames.h index 5378709..2ead5d7 100644 --- a/src/frames.h +++ b/src/frames.h @@ -452,12 +452,6 @@ class JavaScriptFrame: public StandardFrame { Object* GetParameter(int index) const; int ComputeParametersCount() const; - // Temporary way of getting access to the number of parameters - // passed on the stack by the caller. Once argument adaptor frames - // has been introduced on ARM, this number will always match the - // computed parameters count. - int GetProvidedParametersCount() const; - // Check if this frame is a constructor frame invoked through 'new'. bool IsConstructor() const; diff --git a/src/runtime.cc b/src/runtime.cc index 965a083..6511c8a 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -4344,7 +4344,7 @@ static MaybeObject* Runtime_GetArgumentsProperty(Arguments args) { JavaScriptFrame* frame = it.frame(); // Get the actual number of provided arguments. - const uint32_t n = frame->GetProvidedParametersCount(); + const uint32_t n = frame->ComputeParametersCount(); // Try to convert the key to an index. If successful and within // index return the the argument from the frame. @@ -6899,7 +6899,7 @@ static MaybeObject* Runtime_NewObjectFromBound(Arguments args) { ASSERT(!frame->is_optimized()); it.AdvanceToArgumentsFrame(); frame = it.frame(); - int argc = frame->GetProvidedParametersCount(); + int argc = frame->ComputeParametersCount(); // Prepend bound arguments to caller's arguments. int total_argc = bound_argc + argc; @@ -7738,7 +7738,7 @@ static void PrintTransition(Object* result) { // supplied parameters, not all parameters required) PrintF("(this="); PrintObject(frame->receiver()); - const int length = frame->GetProvidedParametersCount(); + const int length = frame->ComputeParametersCount(); for (int i = 0; i < length; i++) { PrintF(", "); PrintObject(frame->GetParameter(i)); @@ -9251,8 +9251,8 @@ static MaybeObject* Runtime_GetFrameDetails(Arguments args) { // Find the number of arguments to fill. At least fill the number of // parameters for the function and fill more if more parameters are provided. int argument_count = info.number_of_parameters(); - if (argument_count < it.frame()->GetProvidedParametersCount()) { - argument_count = it.frame()->GetProvidedParametersCount(); + if (argument_count < it.frame()->ComputeParametersCount()) { + argument_count = it.frame()->ComputeParametersCount(); } // Calculate the size of the result. @@ -9309,7 +9309,7 @@ static MaybeObject* Runtime_GetFrameDetails(Arguments args) { // TODO(3141533): We should be able to get the actual parameter // value for optimized frames. if (!is_optimized_frame && - (i < it.frame()->GetProvidedParametersCount())) { + (i < it.frame()->ComputeParametersCount())) { details->set(details_index++, it.frame()->GetParameter(i)); } else { details->set(details_index++, Heap::undefined_value()); @@ -10189,7 +10189,7 @@ static Handle GetArgumentsObject(JavaScriptFrame* frame, } } - const int length = frame->GetProvidedParametersCount(); + const int length = frame->ComputeParametersCount(); Handle arguments = Factory::NewArgumentsObject(function, length); Handle array = Factory::NewFixedArray(length); -- 2.7.4