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

Unified Diff: src/parser.cc

Issue 6481001: Bypass JS accessors when building error array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Lasse's concerns Created 9 years, 10 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-1130.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index e1a99cb4a038eca520caa99014de94c5df663125..04d510f2fdcf174fe9615e7e871fc20ae236ff2d 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3923,16 +3923,15 @@ Expression* Parser::NewThrowError(Handle<String> constructor,
Handle<String> type,
Vector< Handle<Object> > arguments) {
int argc = arguments.length();
- Handle<JSArray> array = Factory::NewJSArray(argc, TENURED);
- ASSERT(array->IsJSArray() && array->HasFastElements());
+ Handle<FixedArray> elements = Factory::NewFixedArray(argc, TENURED);
for (int i = 0; i < argc; i++) {
Handle<Object> element = arguments[i];
if (!element.is_null()) {
- // We know this doesn't cause a GC here because we allocated the JSArray
- // large enough.
- array->SetFastElement(i, *element)->ToObjectUnchecked();
+ elements->set(i, *element);
}
}
+ Handle<JSArray> array = Factory::NewJSArrayWithElements(elements, TENURED);
+
ZoneList<Expression*>* args = new ZoneList<Expression*>(2);
args->Add(new Literal(type));
args->Add(new Literal(array));
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1130.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698