Handlify Accessors::FunctionGetArguments method.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/19638003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 97681be4
......@@ -576,6 +576,13 @@ const AccessorDescriptor Accessors::FunctionName = {
//
Handle<Object> Accessors::FunctionGetArguments(Handle<Object> object) {
Isolate* isolate = Isolate::Current();
CALL_HEAP_FUNCTION(
isolate, Accessors::FunctionGetArguments(*object, 0), Object);
}
static MaybeObject* ConstructArgumentsObjectForInlinedFunction(
JavaScriptFrame* frame,
Handle<JSFunction> inlined_function,
......
......@@ -78,11 +78,11 @@ class Accessors : public AllStatic {
// Accessor functions called directly from the runtime system.
static Handle<Object> FunctionGetPrototype(Handle<Object> object);
static Handle<Object> FunctionGetArguments(Handle<Object> object);
MUST_USE_RESULT static MaybeObject* FunctionSetPrototype(JSObject* object,
Object* value,
void*);
static MaybeObject* FunctionGetArguments(Object* object, void*);
// Accessor infos.
static Handle<AccessorInfo> MakeModuleExport(
......@@ -90,10 +90,11 @@ class Accessors : public AllStatic {
private:
// Accessor functions only used through the descriptor.
static MaybeObject* FunctionGetPrototype(Object* object, void*);
static MaybeObject* FunctionGetLength(Object* object, void*);
static MaybeObject* FunctionGetName(Object* object, void*);
static MaybeObject* FunctionGetArguments(Object* object, void*);
static MaybeObject* FunctionGetCaller(Object* object, void*);
static MaybeObject* FunctionGetPrototype(Object* object, void*);
MUST_USE_RESULT static MaybeObject* ArraySetLength(JSObject* object,
Object* value, void*);
static MaybeObject* ArrayGetLength(Object* object, void*);
......
......@@ -1624,11 +1624,9 @@ void Deoptimizer::MaterializeHeapObjects(JavaScriptFrameIterator* it) {
if (arguments.is_null()) {
if (frame->has_adapted_arguments()) {
// Use the arguments adapter frame we just built to materialize the
// arguments object. FunctionGetArguments can't throw an exception,
// so cast away the doubt with an assert.
arguments = Handle<JSObject>(JSObject::cast(
Accessors::FunctionGetArguments(*function,
NULL)->ToObjectUnchecked()));
// arguments object. FunctionGetArguments can't throw an exception.
arguments = Handle<JSObject>::cast(
Accessors::FunctionGetArguments(function));
values.RewindBy(length);
} else {
// Construct an arguments object and copy the parameters to a newly
......
......@@ -12484,8 +12484,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearStepping) {
static Handle<JSObject> MaterializeArgumentsObject(
Isolate* isolate,
Handle<JSObject> target,
Handle<JSFunction> function,
FrameInspector* frame_inspector) {
Handle<JSFunction> function) {
// Do not materialize the arguments object for eval or top-level code.
// Skip if "arguments" is already taken.
if (!function->shared()->is_function() ||
......@@ -12493,10 +12492,9 @@ static Handle<JSObject> MaterializeArgumentsObject(
return target;
}
// FunctionGetArguments can't return a non-Object.
Handle<JSObject> arguments(JSObject::cast(
Accessors::FunctionGetArguments(frame_inspector->GetFunction(),
NULL)->ToObjectUnchecked()), isolate);
// FunctionGetArguments can't throw an exception.
Handle<JSObject> arguments = Handle<JSObject>::cast(
Accessors::FunctionGetArguments(function));
SetProperty(isolate,
target,
isolate->factory()->arguments_string(),
......@@ -12600,8 +12598,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluate) {
isolate, materialized, function, &frame_inspector);
RETURN_IF_EMPTY_HANDLE(isolate, materialized);
materialized = MaterializeArgumentsObject(
isolate, materialized, function, &frame_inspector);
materialized = MaterializeArgumentsObject(isolate, materialized, function);
RETURN_IF_EMPTY_HANDLE(isolate, materialized);
// Add the materialized object in a with-scope to shadow the stack locals.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment