From 293f898a6f49f902c3cc5a4acaa7bf6f2984e633 Mon Sep 17 00:00:00 2001 From: dslomov Date: Fri, 5 Dec 2014 07:35:32 -0800 Subject: [PATCH] Make sure that individual shipping features can be disabled. R=rossberg@chromium.org Review URL: https://codereview.chromium.org/779203005 Cr-Commit-Position: refs/heads/master@{#25690} --- src/flag-definitions.h | 17 ++++++++++++++--- test/mjsunit/harmony/disable-harmony-string.js | 7 +++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 test/mjsunit/harmony/disable-harmony-string.js diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 6ede843..5cdad43 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -16,6 +16,9 @@ #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \ DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) +#define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ + DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) + // We want to declare the names of the variables for the header file. Normally // this will just be an extern declaration, but for a readonly flag we let the // compiler make better optimizations by giving it the value. @@ -54,6 +57,9 @@ #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) \ if (FLAG_##whenflag) FLAG_##thenflag = value; +#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) \ + if (!FLAG_##whenflag) FLAG_##thenflag = value; + #else #error No mode supplied when including flags.defs #endif @@ -75,6 +81,10 @@ #define DEFINE_VALUE_IMPLICATION(whenflag, thenflag, value) #endif +#ifndef DEFINE_NEG_VALUE_IMPLICATION +#define DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, value) +#endif + #define COMMA , #ifdef FLAG_MODE_DECLARE @@ -202,9 +212,9 @@ HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) HARMONY_STAGED(FLAG_STAGED_FEATURES) #undef FLAG_STAGED_FEATURES -#define FLAG_SHIPPING_FEATURES(id, description) \ - DEFINE_BOOL(id, false, "enable " #description) \ - DEFINE_IMPLICATION(harmony_shipping, id) +#define FLAG_SHIPPING_FEATURES(id, description) \ + DEFINE_BOOL(id, true, "enable " #description) \ + DEFINE_NEG_NEG_IMPLICATION(harmony_shipping, id) HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) #undef FLAG_SHIPPING_FEATURES @@ -985,6 +995,7 @@ DEFINE_IMPLICATION(unbox_double_fields, track_double_fields) #undef DEFINE_ARGS #undef DEFINE_IMPLICATION #undef DEFINE_NEG_IMPLICATION +#undef DEFINE_NEG_VALUE_IMPLICATION #undef DEFINE_VALUE_IMPLICATION #undef DEFINE_ALIAS_BOOL #undef DEFINE_ALIAS_INT diff --git a/test/mjsunit/harmony/disable-harmony-string.js b/test/mjsunit/harmony/disable-harmony-string.js new file mode 100644 index 0000000..0b88ae0 --- /dev/null +++ b/test/mjsunit/harmony/disable-harmony-string.js @@ -0,0 +1,7 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --noharmony-strings + +assertEquals(undefined, String.prototype.includes); -- 2.7.4