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

Unified Diff: src/factory.cc

Issue 1144393003: Also allocate small typed arrays on heap when initialized from an array-like (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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') | src/heap/heap.h » ('j') | 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 f4b609a7f94fd882faacfe89847d8c495cf58456..47de1e6a78b3d03962da7a193be6e743a39ad011 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -917,16 +917,12 @@ Handle<ExternalArray> Factory::NewExternalArray(int length,
Handle<FixedTypedArrayBase> Factory::NewFixedTypedArray(
- int length,
- ExternalArrayType array_type,
+ int length, ExternalArrayType array_type, bool initialize,
PretenureFlag pretenure) {
DCHECK(0 <= length && length <= Smi::kMaxValue);
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->AllocateFixedTypedArray(length,
- array_type,
- pretenure),
- FixedTypedArrayBase);
+ CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateFixedTypedArray(
+ length, array_type, initialize, pretenure),
+ FixedTypedArrayBase);
}
@@ -1962,7 +1958,7 @@ Handle<JSTypedArray> Factory::NewJSTypedArray(ElementsKind elements_kind,
obj->set_buffer(*buffer);
Handle<FixedTypedArrayBase> elements =
isolate()->factory()->NewFixedTypedArray(
- static_cast<int>(number_of_elements), array_type);
+ static_cast<int>(number_of_elements), array_type, true);
obj->set_elements(*elements);
return obj;
}
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698