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

Unified Diff: src/factory.cc

Issue 2041963003: [elements] Precisely estimate elements size for large-object limits (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add missing method on string wrapper Created 4 years, 1 month 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/lookup.cc » ('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 4f42888164de48ec0b5f88a01b886f27ad80065e..61aada853c26cae0aa8869af8d8aeff572354a18 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -137,6 +137,15 @@ Handle<FixedArray> Factory::NewFixedArray(int size, PretenureFlag pretenure) {
FixedArray);
}
+MaybeHandle<FixedArray> Factory::TryNewFixedArray(int size,
+ PretenureFlag pretenure) {
+ DCHECK(0 <= size);
+ AllocationResult allocation =
+ isolate()->heap()->AllocateFixedArray(size, pretenure);
+ Object* array = NULL;
+ if (!allocation.To(&array)) return MaybeHandle<FixedArray>();
+ return Handle<FixedArray>(FixedArray::cast(array), isolate());
+}
Handle<FixedArray> Factory::NewFixedArrayWithHoles(int size,
PretenureFlag pretenure) {
« no previous file with comments | « src/factory.h ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698