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

Unified Diff: src/heap.cc

Issue 669060: Add runtime function for string to array conversion. (Closed)
Patch Set: Created 10 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
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 6310eac6b3e93c526dc337ba341c3e79faf8bd97..aba9e4161ccbd26fd382e75350f485ba829dec31 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2967,6 +2967,18 @@ Object* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) {
}
+Object* Heap::AllocateUninitializedFixedArray(int length) {
+ if (length == 0) return empty_fixed_array();
+
+ Object* obj = AllocateRawFixedArray(length);
+ if (obj->IsFailure()) return obj;
+
+ reinterpret_cast<FixedArray*>(obj)->set_map(fixed_array_map());
+ FixedArray::cast(obj)->set_length(length);
+ return obj;
+}
+
+
Object* Heap::AllocateFixedArrayWithHoles(int length) {
if (length == 0) return empty_fixed_array();
Object* result = AllocateRawFixedArray(length);

Powered by Google App Engine
This is Rietveld 408576698