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) { |