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

Unified Diff: src/factory.cc

Issue 2140163002: Revert of making heap verification more aggressive (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 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);
}
}
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698