Re-enable double const store check under v8_enable_test_features flag

R=machenbach@chromium.org, tebbi@chromium.org

Change-Id: I99a5d5200ef7e0e812a2bf1e22a5f8ff813a1ca6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653117
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Georg Schmid <gsps@google.com>
Cr-Commit-Position: refs/heads/master@{#62098}
This commit is contained in:
Georg Schmid 2019-06-11 16:13:45 +02:00 committed by Commit Bot
parent 3b8c624bda
commit b536240340
3 changed files with 15 additions and 5 deletions

View File

@ -410,6 +410,7 @@ config("features") {
if (v8_enable_test_features) {
defines += [ "V8_ENABLE_ALLOCATION_TIMEOUT" ]
defines += [ "V8_ENABLE_FORCE_SLOW_PATH" ]
defines += [ "V8_ENABLE_DOUBLE_CONST_STORE_CHECK" ]
}
if (v8_enable_i18n_support) {
defines += [ "V8_INTL_SUPPORT" ]

View File

@ -923,20 +923,23 @@ Reduction LoadElimination::ReduceStoreField(Node* node,
FieldInfo const* lookup_result =
state->LookupField(object, field_index, constness);
if (lookup_result && constness == PropertyConstness::kMutable) {
if (lookup_result && (constness == PropertyConstness::kMutable ||
V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL)) {
// At runtime, we should never encounter
// - any store replacing existing info with a different, incompatible
// representation, nor
// - two consecutive const stores.
// However, we may see such code statically, so we guard against
// executing it by emitting Unreachable.
// TODO(gsps): Re-enable the double const store check once we have
// identified other FieldAccesses that should be marked mutable
// instead of const (cf. JSCreateLowering::AllocateFastLiteral).
// TODO(gsps): Re-enable the double const store check even for
// non-debug builds once we have identified other FieldAccesses
// that should be marked mutable instead of const
// (cf. JSCreateLowering::AllocateFastLiteral).
bool incompatible_representation =
!lookup_result->name.is_null() &&
!IsCompatible(representation, lookup_result->representation);
if (incompatible_representation) {
if (incompatible_representation ||
constness == PropertyConstness::kConst) {
Node* control = NodeProperties::GetControlInput(node);
Node* unreachable =
graph()->NewNode(common()->Unreachable(), effect, control);

View File

@ -289,6 +289,12 @@ DEFINE_BOOL(icu_timezone_data, true, "get information about timezones from ICU")
#define V8_ENABLE_RAW_HEAP_SNAPSHOTS_BOOL false
#endif // V8_ENABLE_RAW_HEAP_SNAPSHOTS
#ifdef V8_ENABLE_DOUBLE_CONST_STORE_CHECK
#define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL true
#else
#define V8_ENABLE_DOUBLE_CONST_STORE_CHECK_BOOL false
#endif
#ifdef V8_LITE_MODE
#define V8_LITE_BOOL true
#else