Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 3aacc59d503673d627955e79d590acb3a1f066bb..60a17f1355937fb939a4f1cf08acca8762a5854e 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -88,23 +88,27 @@ Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { |
} |
-Handle<FixedDoubleArray> Factory::NewFixedDoubleArray(int size, |
+Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, |
PretenureFlag pretenure) { |
ASSERT(0 <= size); |
CALL_HEAP_FUNCTION( |
isolate(), |
isolate()->heap()->AllocateUninitializedFixedDoubleArray(size, pretenure), |
- FixedDoubleArray); |
+ FixedArrayBase); |
} |
-Handle<FixedDoubleArray> Factory::NewFixedDoubleArrayWithHoles( |
+Handle<FixedArrayBase> Factory::NewFixedDoubleArrayWithHoles( |
int size, |
PretenureFlag pretenure) { |
ASSERT(0 <= size); |
- Handle<FixedDoubleArray> array = NewFixedDoubleArray(size, pretenure); |
- for (int i = 0; i < size; ++i) { |
- array->set_the_hole(i); |
+ Handle<FixedArrayBase> array = NewFixedDoubleArray(size, pretenure); |
+ if (size > 0) { |
+ Handle<FixedDoubleArray> double_array = |
+ Handle<FixedDoubleArray>::cast(array); |
+ for (int i = 0; i < size; ++i) { |
+ double_array->set_the_hole(i); |
+ } |
} |
return array; |
} |