Revision: 15751
Author: [email protected]
Date: Thu Jul 18 07:00:53 2013
Log: Handlify Accessors::FunctionGetArguments method.
[email protected]
Review URL: https://codereview.chromium.org/19638003
http://code.google.com/p/v8/source/detail?r=15751
Modified:
/branches/bleeding_edge/src/accessors.cc
/branches/bleeding_edge/src/accessors.h
/branches/bleeding_edge/src/deoptimizer.cc
/branches/bleeding_edge/src/runtime.cc
=======================================
--- /branches/bleeding_edge/src/accessors.cc Thu Jul 18 00:59:48 2013
+++ /branches/bleeding_edge/src/accessors.cc Thu Jul 18 07:00:53 2013
@@ -576,6 +576,13 @@
//
+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,
=======================================
--- /branches/bleeding_edge/src/accessors.h Thu Jul 18 00:59:48 2013
+++ /branches/bleeding_edge/src/accessors.h Thu Jul 18 07:00:53 2013
@@ -78,11 +78,11 @@
// 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 @@
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*);
=======================================
--- /branches/bleeding_edge/src/deoptimizer.cc Thu Jul 18 05:18:35 2013
+++ /branches/bleeding_edge/src/deoptimizer.cc Thu Jul 18 07:00:53 2013
@@ -1624,11 +1624,9 @@
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
=======================================
--- /branches/bleeding_edge/src/runtime.cc Thu Jul 18 05:25:22 2013
+++ /branches/bleeding_edge/src/runtime.cc Thu Jul 18 07:00:53 2013
@@ -12484,8 +12484,7 @@
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 @@
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 @@
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.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.