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

Unified Diff: src/heap.cc

Issue 226153002: Callers of ElementsAccessor::Validate() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« src/heap.h ('K') | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index f06b8be1d98246d3ea9b5f3237b7a96ae211572c..32d16d180b20ba37a2a40b21251a3bcb86956239 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -4647,18 +4647,18 @@ MaybeObject* Heap::AllocateJSArrayStorage(
}
-MaybeObject* Heap::AllocateJSArrayWithElements(
- FixedArrayBase* elements,
+Handle<JSArray> Heap::AllocateJSArrayWithElements(
Yang 2014/04/07 07:20:48 Since this is now handlified, it belongs to factor
Igor Sheludko 2014/04/07 09:29:17 Done.
+ Handle<FixedArrayBase> elements,
ElementsKind elements_kind,
int length,
PretenureFlag pretenure) {
- MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure);
- JSArray* array;
- if (!maybe_array->To(&array)) return maybe_array;
+ ASSERT(length <= elements->length());
+ Handle<JSArray> array =
+ isolate()->factory()->NewJSArray(elements_kind, pretenure);
- array->set_elements(elements);
+ array->set_elements(*elements);
array->set_length(Smi::FromInt(length));
- array->ValidateElements();
+ JSObject::ValidateElements(array);
return array;
}
« src/heap.h ('K') | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698