Remove --harmony-tostring runtime flag

ES2015 Object.prototype.toString semantics were enabled in version 4.9,
which has been in stable Chrome for nearly two weeks at this point.

R=littledan@chromium.org

Review URL: https://codereview.chromium.org/1784033002

Cr-Commit-Position: refs/heads/master@{#34732}
This commit is contained in:
adamk 2016-03-11 10:19:05 -08:00 committed by Commit bot
parent 515105a700
commit b16fc86389
22 changed files with 24 additions and 65 deletions

View File

@ -2251,7 +2251,6 @@ void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
isolate->factory()->ToBoolean(FLAG), NONE); \ isolate->factory()->ToBoolean(FLAG), NONE); \
} }
INITIALIZE_FLAG(FLAG_harmony_tostring)
INITIALIZE_FLAG(FLAG_harmony_species) INITIALIZE_FLAG(FLAG_harmony_species)
#undef INITIALIZE_FLAG #undef INITIALIZE_FLAG
@ -2293,13 +2292,6 @@ void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
} }
void Genesis::InitializeGlobal_harmony_tostring() {
if (!FLAG_harmony_tostring) return;
InstallPublicSymbol(factory(), native_context(), "toStringTag",
factory()->to_string_tag_symbol());
}
void Genesis::InitializeGlobal_harmony_regexp_subclass() { void Genesis::InitializeGlobal_harmony_regexp_subclass() {
if (!FLAG_harmony_regexp_subclass) return; if (!FLAG_harmony_regexp_subclass) return;
InstallPublicSymbol(factory(), native_context(), "match", InstallPublicSymbol(factory(), native_context(), "match",
@ -2957,7 +2949,6 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_modules_natives[] = {nullptr}; static const char* harmony_modules_natives[] = {nullptr};
static const char* harmony_regexps_natives[] = {"native harmony-regexp.js", static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
nullptr}; nullptr};
static const char* harmony_tostring_natives[] = {nullptr};
static const char* harmony_iterator_close_natives[] = {nullptr}; static const char* harmony_iterator_close_natives[] = {nullptr};
static const char* harmony_sloppy_natives[] = {nullptr}; static const char* harmony_sloppy_natives[] = {nullptr};
static const char* harmony_sloppy_function_natives[] = {nullptr}; static const char* harmony_sloppy_function_natives[] = {nullptr};

View File

@ -223,7 +223,6 @@ DEFINE_IMPLICATION(es_staging, harmony_tailcalls)
#define HARMONY_SHIPPING(V) \ #define HARMONY_SHIPPING(V) \
V(harmony_function_name, "harmony Function name inference") \ V(harmony_function_name, "harmony Function name inference") \
V(harmony_iterator_close, "harmony iterator finalization") \ V(harmony_iterator_close, "harmony iterator finalization") \
V(harmony_tostring, "harmony toString") \
V(harmony_regexps, "harmony regular expression extensions") \ V(harmony_regexps, "harmony regular expression extensions") \
V(harmony_unicode_regexps, "harmony unicode regexps") \ V(harmony_unicode_regexps, "harmony unicode regexps") \
V(harmony_sloppy, "harmony features in sloppy mode") \ V(harmony_sloppy, "harmony features in sloppy mode") \

View File

@ -23,7 +23,6 @@ var callSitePositionSymbol =
utils.ImportNow("call_site_position_symbol"); utils.ImportNow("call_site_position_symbol");
var callSiteStrictSymbol = var callSiteStrictSymbol =
utils.ImportNow("call_site_strict_symbol"); utils.ImportNow("call_site_strict_symbol");
var FLAG_harmony_tostring;
var Float32x4ToString; var Float32x4ToString;
var formattedStackTraceSymbol = var formattedStackTraceSymbol =
utils.ImportNow("formatted_stack_trace_symbol"); utils.ImportNow("formatted_stack_trace_symbol");
@ -67,10 +66,6 @@ utils.Import(function(from) {
Uint8x16ToString = from.Uint8x16ToString; Uint8x16ToString = from.Uint8x16ToString;
}); });
utils.ImportFromExperimental(function(from) {
FLAG_harmony_tostring = from.FLAG_harmony_tostring;
});
// ------------------------------------------------------------------- // -------------------------------------------------------------------
var GlobalError; var GlobalError;
@ -87,13 +82,8 @@ function NoSideEffectsObjectToString() {
if (IS_NULL(this)) return "[object Null]"; if (IS_NULL(this)) return "[object Null]";
var O = TO_OBJECT(this); var O = TO_OBJECT(this);
var builtinTag = %_ClassOf(O); var builtinTag = %_ClassOf(O);
var tag; var tag = %GetDataProperty(O, toStringTagSymbol);
if (FLAG_harmony_tostring) { if (!IS_STRING(tag)) {
tag = %GetDataProperty(O, toStringTagSymbol);
if (!IS_STRING(tag)) {
tag = builtinTag;
}
} else {
tag = builtinTag; tag = builtinTag;
} }
return `[object ${tag}]`; return `[object ${tag}]`;

View File

@ -84,9 +84,7 @@ utils.InstallConstants(GlobalSymbol, [
// "search", searchSymbol, // "search", searchSymbol,
// "split, splitSymbol, // "split, splitSymbol,
"toPrimitive", toPrimitiveSymbol, "toPrimitive", toPrimitiveSymbol,
// TODO(dslomov, caitp): Currently defined in harmony-tostring.js --- "toStringTag", toStringTagSymbol,
// Move here when shipping
// "toStringTag", toStringTagSymbol,
"unscopables", unscopablesSymbol, "unscopables", unscopablesSymbol,
]); ]);

View File

@ -2463,11 +2463,9 @@ Handle<String> JSReceiver::GetConstructorName(Handle<JSReceiver> receiver) {
} }
} }
if (FLAG_harmony_tostring) { Handle<Object> maybe_tag = JSReceiver::GetDataProperty(
Handle<Object> maybe_tag = JSReceiver::GetDataProperty( receiver, isolate->factory()->to_string_tag_symbol());
receiver, isolate->factory()->to_string_tag_symbol()); if (maybe_tag->IsString()) return Handle<String>::cast(maybe_tag);
if (maybe_tag->IsString()) return Handle<String>::cast(maybe_tag);
}
PrototypeIterator iter(isolate, receiver); PrototypeIterator iter(isolate, receiver);
if (iter.IsAtEnd()) return handle(receiver->class_name()); if (iter.IsAtEnd()) return handle(receiver->class_name());
@ -16647,16 +16645,14 @@ MaybeHandle<String> Object::ObjectProtoToString(Isolate* isolate,
Object::ToObject(isolate, object).ToHandleChecked(); Object::ToObject(isolate, object).ToHandleChecked();
Handle<String> tag; Handle<String> tag;
if (FLAG_harmony_tostring) { Handle<Object> to_string_tag;
Handle<Object> to_string_tag; ASSIGN_RETURN_ON_EXCEPTION(
ASSIGN_RETURN_ON_EXCEPTION( isolate, to_string_tag,
isolate, to_string_tag, JSReceiver::GetProperty(receiver,
JSReceiver::GetProperty(receiver, isolate->factory()->to_string_tag_symbol()),
isolate->factory()->to_string_tag_symbol()), String);
String); if (to_string_tag->IsString()) {
if (to_string_tag->IsString()) { tag = Handle<String>::cast(to_string_tag);
tag = Handle<String>::cast(to_string_tag);
}
} }
if (tag.is_null()) { if (tag.is_null()) {

View File

@ -13300,8 +13300,6 @@ THREADED_TEST(ObjectProtoToString) {
TEST(ObjectProtoToStringES6) { TEST(ObjectProtoToStringES6) {
// TODO(dslomov, caitp): merge into ObjectProtoToString test once shipped.
i::FLAG_harmony_tostring = true;
LocalContext context; LocalContext context;
v8::Isolate* isolate = CcTest::isolate(); v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate); v8::HandleScope scope(isolate);
@ -24759,7 +24757,6 @@ TEST(AccessCheckedIsConcatSpreadable) {
TEST(AccessCheckedToStringTag) { TEST(AccessCheckedToStringTag) {
i::FLAG_harmony_tostring = true;
v8::Isolate* isolate = CcTest::isolate(); v8::Isolate* isolate = CcTest::isolate();
HandleScope scope(isolate); HandleScope scope(isolate);
LocalContext env; LocalContext env;

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --allow-natives-syntax --harmony-tostring // Flags: --allow-natives-syntax
function le(a, b) { function le(a, b) {
return a <= b; return a <= b;

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --harmony-tostring // Flags: --allow-natives-syntax
var NONE = 0; var NONE = 0;

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring
var global = this; var global = this;
var funs = { var funs = {

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring
'use strict'; 'use strict';
function assertGetterName(expected, object, name) { function assertGetterName(expected, object, name) {

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --allow-natives-syntax --harmony-tostring // Flags: --allow-natives-syntax
(function TestSetIterator() { (function TestSetIterator() {

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-gc --allow-natives-syntax --harmony-tostring // Flags: --expose-gc --allow-natives-syntax
function assertSize(expected, collection) { function assertSize(expected, collection) {

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --harmony-tostring // Flags: --allow-natives-syntax
// Test instantations of generators. // Test instantations of generators.

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring
function testJSONToString() { function testJSONToString() {
assertEquals('[object JSON]', "" + JSON); assertEquals('[object JSON]', "" + JSON);
assertEquals("JSON", JSON[Symbol.toStringTag]); assertEquals("JSON", JSON[Symbol.toStringTag]);

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring
function testMathToString() { function testMathToString() {
assertEquals('[object Math]', "" + Math); assertEquals('[object Math]', "" + Math);
assertEquals("Math", Math[Symbol.toStringTag]); assertEquals("Math", Math[Symbol.toStringTag]);

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring --harmony-proxies // Flags: --harmony-proxies
var global = this; var global = this;

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --harmony-tostring --promise-extra // Flags: --allow-natives-syntax --promise-extra
// Make sure we don't rely on functions patchable by monkeys. // Make sure we don't rely on functions patchable by monkeys.
var call = Function.prototype.call.call.bind(Function.prototype.call) var call = Function.prototype.call.call.bind(Function.prototype.call)

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-tostring
function TestStringPrototypeIterator() { function TestStringPrototypeIterator() {
assertTrue(String.prototype.hasOwnProperty(Symbol.iterator)); assertTrue(String.prototype.hasOwnProperty(Symbol.iterator));
assertFalse("".hasOwnProperty(Symbol.iterator)); assertFalse("".hasOwnProperty(Symbol.iterator));

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --expose-gc --allow-natives-syntax --harmony-tostring // Flags: --expose-gc --allow-natives-syntax
var symbols = [] var symbols = []

View File

@ -25,8 +25,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-tostring
// ArrayBuffer // ArrayBuffer
function TestByteLength(param, expectedByteLength) { function TestByteLength(param, expectedByteLength) {

View File

@ -25,7 +25,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-sharedarraybuffer --harmony-tostring // Flags: --harmony-sharedarraybuffer
// SharedArrayBuffer // SharedArrayBuffer

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-simd --harmony-tostring --harmony-reflect // Flags: --harmony-simd --harmony-reflect
// Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt // Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt
function lanesForType(typeName) { function lanesForType(typeName) {