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

Unified Diff: src/factory.cc

Issue 206073007: ArraySplice builtin handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 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 | « src/factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 557760714cc0d2d143851f21b27340c6699045a5..ffe196eee458ec3e1995d6f33747d7d2537359ff 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1441,8 +1441,9 @@ Handle<JSObject> Factory::NewJSObjectFromMap(
}
-Handle<JSArray> Factory::NewJSArray(int capacity,
- ElementsKind elements_kind,
+Handle<JSArray> Factory::NewJSArray(ElementsKind elements_kind,
+ int length,
+ int capacity,
PretenureFlag pretenure) {
if (capacity != 0) {
elements_kind = GetHoleyElementsKind(elements_kind);
@@ -1450,7 +1451,7 @@ Handle<JSArray> Factory::NewJSArray(int capacity,
CALL_HEAP_FUNCTION(isolate(),
isolate()->heap()->AllocateJSArrayAndStorage(
elements_kind,
- 0,
+ length,
capacity,
INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE,
pretenure),
@@ -1460,12 +1461,14 @@ Handle<JSArray> Factory::NewJSArray(int capacity,
Handle<JSArray> Factory::NewJSArrayWithElements(Handle<FixedArrayBase> elements,
ElementsKind elements_kind,
+ int length,
PretenureFlag pretenure) {
+ ASSERT(length <= elements->length());
CALL_HEAP_FUNCTION(
isolate(),
isolate()->heap()->AllocateJSArrayWithElements(*elements,
elements_kind,
- elements->length(),
+ length,
pretenure),
JSArray);
}
« no previous file with comments | « src/factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698