Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 48118fc78e19e35d7f4561c126c3b1df8ae6add5..4140159f9312ffb8ce5c83fa4a536997c99fd8cf 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1647,29 +1647,19 @@ |
Handle<FixedArrayBase> elms; |
ElementsKind elements_kind = array->GetElementsKind(); |
if (IsFastDoubleElementsKind(elements_kind)) { |
- switch (mode) { |
- case DONT_INITIALIZE_ARRAY_ELEMENTS: |
- elms = NewFixedDoubleArray(capacity); |
- break; |
- case INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE: |
- elms = NewFixedDoubleArrayWithHoles(capacity); |
- break; |
- case INITIALIZE_ARRAY_ELEMENTS_WITH_UNDEFINED: |
- UNREACHABLE(); |
- break; |
+ if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { |
+ elms = NewFixedDoubleArray(capacity); |
+ } else { |
+ DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
+ elms = NewFixedDoubleArrayWithHoles(capacity); |
} |
} else { |
DCHECK(IsFastSmiOrObjectElementsKind(elements_kind)); |
- switch (mode) { |
- case DONT_INITIALIZE_ARRAY_ELEMENTS: |
- elms = NewUninitializedFixedArray(capacity); |
- break; |
- case INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE: |
- elms = NewFixedArrayWithHoles(capacity); |
- break; |
- case INITIALIZE_ARRAY_ELEMENTS_WITH_UNDEFINED: |
- elms = NewFixedArray(capacity); |
- break; |
+ if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { |
+ elms = NewUninitializedFixedArray(capacity); |
+ } else { |
+ DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
+ elms = NewFixedArrayWithHoles(capacity); |
} |
} |