Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: src/runtime.cc

Issue 12674027: Correctly materialize arguments object in Runtime_DebugEvaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-222893.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 38f77d07137eb06acec574d67d409cdfca073cd1..67ccda2c381cb091e34ef54982d163c84cf6f301 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11549,19 +11549,10 @@ static Handle<Object> GetArgumentsObject(Isolate* isolate,
}
}
- Handle<JSFunction> function(JSFunction::cast(frame_inspector->GetFunction()));
- int length = frame_inspector->GetParametersCount();
- Handle<JSObject> arguments =
- isolate->factory()->NewArgumentsObject(function, length);
- Handle<FixedArray> array = isolate->factory()->NewFixedArray(length);
-
- AssertNoAllocation no_gc;
- WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc);
- for (int i = 0; i < length; i++) {
- array->set(i, frame_inspector->GetParameter(i), mode);
- }
- arguments->set_elements(*array);
- return arguments;
+ // FunctionGetArguments can't return a non-Object.
+ return Handle<JSObject>(JSObject::cast(
+ Accessors::FunctionGetArguments(frame_inspector->GetFunction(),
+ NULL)->ToObjectUnchecked()), isolate);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-222893.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698