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

Unified Diff: src/factory.cc

Issue 2126613002: making heap verification more aggressive (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: temporarily reducing verification strength 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') | src/objects-debug.cc » ('J')
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 85a974a5a3f24548148a4ebb40b670db7fa3c139..d550ac98661d1349f1d41ef228e64dcb36c8e04e 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1645,19 +1645,27 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
Handle<FixedArrayBase> elms;
ElementsKind elements_kind = array->GetElementsKind();
if (IsFastDoubleElementsKind(elements_kind)) {
- if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) {
- elms = NewFixedDoubleArray(capacity);
- } else {
- DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
- elms = NewFixedDoubleArrayWithHoles(capacity);
+ switch (mode) {
+ case DONT_INITIALIZE_ARRAY_ELEMENTS:
+ elms = NewFixedDoubleArray(capacity);
+ break;
+ case INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE:
+ elms = NewFixedDoubleArrayWithHoles(capacity);
+ break;
+ default:
ulan 2016/07/08 06:19:40 case INITIALIZE_ARRAY_ELEMENTS_WITH_UNDEFINED: UNR
Camillo Bruni 2016/07/11 11:46:38 done.
+ UNREACHABLE();
}
} else {
DCHECK(IsFastSmiOrObjectElementsKind(elements_kind));
- if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) {
- elms = NewUninitializedFixedArray(capacity);
- } else {
- DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
- elms = NewFixedArrayWithHoles(capacity);
+ 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);
Igor Sheludko 2016/07/08 08:38:22 I think it's better to have breaks even in the las
Camillo Bruni 2016/07/11 11:46:38 done.
}
}
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | src/objects-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698