Title: [253865] trunk/Source/_javascript_Core
Revision
253865
Author
[email protected]
Date
2019-12-21 16:43:04 -0800 (Sat, 21 Dec 2019)

Log Message

Make JSString values from literals in a single consistent style
https://bugs.webkit.org/show_bug.cgi?id=205517

Reviewed by Saam Barati.

Some call sites did it like this:

    jsNontrivialString(vm, "literal"_s)

Others did it one of these:

    jsString(vm, "literal")
    jsNontrivialString(vm, "literal")

Changed all the call sites to do it the first, *slightly* more efficient, way.

* runtime/ArrayIteratorPrototype.cpp:
(JSC::ArrayIteratorPrototype::finishCreation):
* runtime/AsyncFunctionPrototype.cpp:
(JSC::AsyncFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorFunctionPrototype.cpp:
(JSC::AsyncGeneratorFunctionPrototype::finishCreation):
* runtime/AsyncGeneratorPrototype.cpp:
(JSC::AsyncGeneratorPrototype::finishCreation):
* runtime/BigIntPrototype.cpp:
(JSC::BigIntPrototype::finishCreation):
* runtime/GeneratorFunctionPrototype.cpp:
(JSC::GeneratorFunctionPrototype::finishCreation):
* runtime/GeneratorPrototype.cpp:
(JSC::GeneratorPrototype::finishCreation):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::finishCreation):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatToParts):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlPluralRulesPrototype.cpp:
(JSC::IntlPluralRulesPrototype::finishCreation):
* runtime/JSDataViewPrototype.cpp:
(JSC::JSDataViewPrototype::finishCreation):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
* runtime/JSONObject.cpp:
(JSC::JSONObject::finishCreation):
* runtime/JSPromisePrototype.cpp:
(JSC::JSPromisePrototype::finishCreation):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewProtoGetterFuncToStringTag):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoGetterSource):
* runtime/RegExpStringIteratorPrototype.cpp:
(JSC::RegExpStringIteratorPrototype::finishCreation):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* runtime/StringIteratorPrototype.cpp:
(JSC::StringIteratorPrototype::finishCreation):
* runtime/SymbolPrototype.cpp:
(JSC::SymbolPrototype::finishCreation):
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakObjectRefPrototype.cpp:
(JSC::WeakObjectRefPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):
Call jsNontrivialString instead of jsString and use the _s suffix.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (253864 => 253865)


--- trunk/Source/_javascript_Core/ChangeLog	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-12-22 00:43:04 UTC (rev 253865)
@@ -1,3 +1,83 @@
+2019-12-20  Darin Adler  <[email protected]>
+
+        Make JSString values from literals in a single consistent style
+        https://bugs.webkit.org/show_bug.cgi?id=205517
+
+        Reviewed by Saam Barati.
+
+        Some call sites did it like this:
+
+            jsNontrivialString(vm, "literal"_s)
+
+        Others did it one of these:
+
+            jsString(vm, "literal")
+            jsNontrivialString(vm, "literal")
+
+        Changed all the call sites to do it the first, *slightly* more efficient, way.
+
+        * runtime/ArrayIteratorPrototype.cpp:
+        (JSC::ArrayIteratorPrototype::finishCreation):
+        * runtime/AsyncFunctionPrototype.cpp:
+        (JSC::AsyncFunctionPrototype::finishCreation):
+        * runtime/AsyncGeneratorFunctionPrototype.cpp:
+        (JSC::AsyncGeneratorFunctionPrototype::finishCreation):
+        * runtime/AsyncGeneratorPrototype.cpp:
+        (JSC::AsyncGeneratorPrototype::finishCreation):
+        * runtime/BigIntPrototype.cpp:
+        (JSC::BigIntPrototype::finishCreation):
+        * runtime/GeneratorFunctionPrototype.cpp:
+        (JSC::GeneratorFunctionPrototype::finishCreation):
+        * runtime/GeneratorPrototype.cpp:
+        (JSC::GeneratorPrototype::finishCreation):
+        * runtime/IntlCollatorPrototype.cpp:
+        (JSC::IntlCollatorPrototype::finishCreation):
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::IntlDateTimeFormat::formatToParts):
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        (JSC::IntlDateTimeFormatPrototype::finishCreation):
+        * runtime/IntlNumberFormat.cpp:
+        (JSC::IntlNumberFormat::formatToParts):
+        * runtime/IntlNumberFormatPrototype.cpp:
+        (JSC::IntlNumberFormatPrototype::finishCreation):
+        * runtime/IntlPluralRulesPrototype.cpp:
+        (JSC::IntlPluralRulesPrototype::finishCreation):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::JSDataViewPrototype::finishCreation):
+        * runtime/JSModuleNamespaceObject.cpp:
+        (JSC::JSModuleNamespaceObject::finishCreation):
+        * runtime/JSONObject.cpp:
+        (JSC::JSONObject::finishCreation):
+        * runtime/JSPromisePrototype.cpp:
+        (JSC::JSPromisePrototype::finishCreation):
+        * runtime/JSTypedArrayViewPrototype.cpp:
+        (JSC::typedArrayViewProtoGetterFuncToStringTag):
+        * runtime/MapIteratorPrototype.cpp:
+        (JSC::MapIteratorPrototype::finishCreation):
+        * runtime/MapPrototype.cpp:
+        (JSC::MapPrototype::finishCreation):
+        * runtime/MathObject.cpp:
+        (JSC::MathObject::finishCreation):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::regExpProtoGetterSource):
+        * runtime/RegExpStringIteratorPrototype.cpp:
+        (JSC::RegExpStringIteratorPrototype::finishCreation):
+        * runtime/SetIteratorPrototype.cpp:
+        (JSC::SetIteratorPrototype::finishCreation):
+        * runtime/SetPrototype.cpp:
+        (JSC::SetPrototype::finishCreation):
+        * runtime/StringIteratorPrototype.cpp:
+        (JSC::StringIteratorPrototype::finishCreation):
+        * runtime/SymbolPrototype.cpp:
+        (JSC::SymbolPrototype::finishCreation):
+        * runtime/WeakMapPrototype.cpp:
+        (JSC::WeakMapPrototype::finishCreation):
+        * runtime/WeakObjectRefPrototype.cpp:
+        (JSC::WeakObjectRefPrototype::finishCreation):
+        * runtime/WeakSetPrototype.cpp:
+        (JSC::WeakSetPrototype::finishCreation):
+        Call jsNontrivialString instead of jsString and use the _s suffix.
+
 2019-12-21  Yusuke Suzuki  <[email protected]>
 
         [JSC] Remove m_globalObject field from JSFunction

Modified: trunk/Source/_javascript_Core/runtime/ArrayIteratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/ArrayIteratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/ArrayIteratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -43,10 +43,8 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Array Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Array Iterator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, arrayIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
 }
 
-// ------------------------------ Array Functions ----------------------------
-
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/AsyncFunctionPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/AsyncFunctionPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/AsyncFunctionPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -50,7 +50,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
     putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "AsyncFunction"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "AsyncFunction"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/AsyncGeneratorFunctionPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -50,7 +50,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
     putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "AsyncGeneratorFunction"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "AsyncGeneratorFunction"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/AsyncGeneratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/AsyncGeneratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/AsyncGeneratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -49,7 +49,7 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "AsyncGenerator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "AsyncGenerator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/BigIntPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/BigIntPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/BigIntPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -72,7 +72,7 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "BigInt"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "BigInt"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 // ------------------------------ Functions ---------------------------

Modified: trunk/Source/_javascript_Core/runtime/GeneratorFunctionPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/GeneratorFunctionPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/GeneratorFunctionPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -52,7 +52,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
     putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "GeneratorFunction"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "GeneratorFunction"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/GeneratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/GeneratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/GeneratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -49,7 +49,7 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Generator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Generator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -75,7 +75,7 @@
 {
     Base::finishCreation(vm);
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Object"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Object"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 static EncodedJSValue JSC_HOST_CALL IntlCollatorFuncCompare(JSGlobalObject* globalObject, CallFrame* callFrame)

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -1013,7 +1013,7 @@
 
     auto resultString = String(result.data(), resultLength);
     auto typePropertyName = Identifier::fromString(vm, "type");
-    auto literalString = jsString(vm, "literal"_s);
+    auto literalString = jsNontrivialString(vm, "literal"_s);
 
     int32_t previousEndIndex = 0;
     int32_t beginIndex = 0;

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -89,7 +89,7 @@
     UNUSED_PARAM(globalObject);
 #endif
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Object"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Object"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatFuncFormatDateTime(JSGlobalObject* globalObject, CallFrame* callFrame)

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -529,7 +529,7 @@
 
     auto resultString = String(result.data(), resultLength);
     auto typePropertyName = Identifier::fromString(vm, "type");
-    auto literalString = jsString(vm, "literal"_s);
+    auto literalString = jsNontrivialString(vm, "literal"_s);
 
     int32_t currentIndex = 0;
     while (currentIndex < resultLength) {

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -86,7 +86,7 @@
     UNUSED_PARAM(globalObject);
 #endif
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Object"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Object"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 static EncodedJSValue JSC_HOST_CALL IntlNumberFormatFuncFormatNumber(JSGlobalObject* globalObject, CallFrame* callFrame)

Modified: trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/IntlPluralRulesPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -75,7 +75,7 @@
 {
     Base::finishCreation(vm);
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Object"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Object"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 EncodedJSValue JSC_HOST_CALL IntlPluralRulesPrototypeFuncSelect(JSGlobalObject* globalObject, CallFrame* callFrame)

Modified: trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/JSDataViewPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -109,7 +109,7 @@
 void JSDataViewPrototype::finishCreation(JSC::VM& vm)
 {
     Base::finishCreation(vm);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "DataView"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "DataView"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 Structure* JSDataViewPrototype::createStructure(

Modified: trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -70,7 +70,7 @@
         }
     }
 
-    putDirect(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Module"), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
+    putDirect(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Module"_s), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly);
 
     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-getprototypeof
     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-setprototypeof-v

Modified: trunk/Source/_javascript_Core/runtime/JSONObject.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/JSONObject.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -65,7 +65,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "JSON"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "JSON"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 // PropertyNameForFunctionCall objects must be on the stack, since the JSValue that they create is not marked.

Modified: trunk/Source/_javascript_Core/runtime/JSPromisePrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/JSPromisePrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/JSPromisePrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -76,7 +76,7 @@
 {
     Base::finishCreation(vm);
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().thenPublicName(), globalObject->promiseProtoThenFunction(), static_cast<unsigned>(PropertyAttribute::DontEnum));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Promise"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Promise"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 void JSPromisePrototype::addOwnInternalSlots(VM& vm, JSGlobalObject* globalObject)

Modified: trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/JSTypedArrayViewPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -256,23 +256,23 @@
     VM& vm = globalObject->vm();
     switch (thisValue.getObject()->classInfo(vm)->typedArrayStorageType) {
     case TypeUint8Clamped:
-        return JSValue::encode(jsString(vm, "Uint8ClampedArray"));
+        return JSValue::encode(jsNontrivialString(vm, "Uint8ClampedArray"_s));
     case TypeInt32:
-        return JSValue::encode(jsString(vm, "Int32Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Int32Array"_s));
     case TypeUint32:
-        return JSValue::encode(jsString(vm, "Uint32Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Uint32Array"_s));
     case TypeFloat64:
-        return JSValue::encode(jsString(vm, "Float64Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Float64Array"_s));
     case TypeFloat32:
-        return JSValue::encode(jsString(vm, "Float32Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Float32Array"_s));
     case TypeInt8:
-        return JSValue::encode(jsString(vm, "Int8Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Int8Array"_s));
     case TypeUint8:
-        return JSValue::encode(jsString(vm, "Uint8Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Uint8Array"_s));
     case TypeInt16:
-        return JSValue::encode(jsString(vm, "Int16Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Int16Array"_s));
     case TypeUint16:
-        return JSValue::encode(jsString(vm, "Uint16Array"));
+        return JSValue::encode(jsNontrivialString(vm, "Uint16Array"_s));
     case NotTypedArray:
     case TypeDataView:
         return JSValue::encode(jsUndefined());

Modified: trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/MapIteratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -38,7 +38,7 @@
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Map Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Map Iterator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, mapIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
 }
 

Modified: trunk/Source/_javascript_Core/runtime/MapPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/MapPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/MapPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -73,7 +73,7 @@
     JSFunction* entries = JSFunction::create(vm, mapPrototypeEntriesCodeGenerator(vm), globalObject);
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().entriesPublicName(), entries, static_cast<unsigned>(PropertyAttribute::DontEnum));
     putDirectWithoutTransition(vm, vm.propertyNames->iteratorSymbol, entries, static_cast<unsigned>(PropertyAttribute::DontEnum));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Map"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Map"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 
     JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->size, mapProtoFuncSize, PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
 

Modified: trunk/Source/_javascript_Core/runtime/MathObject.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/MathObject.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/MathObject.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -86,7 +86,7 @@
     putDirectWithoutTransition(vm, Identifier::fromString(vm, "PI"), jsNumber(piDouble), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     putDirectWithoutTransition(vm, Identifier::fromString(vm, "SQRT1_2"), jsNumber(sqrt(0.5)), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     putDirectWithoutTransition(vm, Identifier::fromString(vm, "SQRT2"), jsNumber(sqrt(2.0)), PropertyAttribute::DontDelete | PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Math"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Math"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 
     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier::fromString(vm, "abs"), 1, mathProtoFuncAbs, AbsIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier::fromString(vm, "acos"), 1, mathProtoFuncACos, ACosIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));

Modified: trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -463,7 +463,7 @@
     auto* regexp = jsDynamicCast<RegExpObject*>(vm, thisValue);
     if (UNLIKELY(!regexp)) {
         if (thisValue.inherits<RegExpPrototype>(vm))
-            return JSValue::encode(jsString(vm, "(?:)"_s));
+            return JSValue::encode(jsNontrivialString(vm, "(?:)"_s));
         return throwVMTypeError(globalObject, scope, "The RegExp.prototype.source getter can only be called on a RegExp object"_s);
     }
 

Modified: trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/RegExpStringIteratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -44,7 +44,7 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "RegExp String Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "RegExp String Iterator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, regExpStringIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
 }
 

Modified: trunk/Source/_javascript_Core/runtime/SetIteratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/SetIteratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/SetIteratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -39,7 +39,7 @@
     ASSERT(inherits(vm, info()));
 
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("next", setIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Set Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Set Iterator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 }

Modified: trunk/Source/_javascript_Core/runtime/SetPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/SetPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/SetPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -71,7 +71,7 @@
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().valuesPublicName(), values, static_cast<unsigned>(PropertyAttribute::DontEnum));
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().keysPublicName(), values, static_cast<unsigned>(PropertyAttribute::DontEnum));
     putDirectWithoutTransition(vm, vm.propertyNames->iteratorSymbol, values, static_cast<unsigned>(PropertyAttribute::DontEnum));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Set"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Set"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 
     JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->size, setProtoFuncSize, PropertyAttribute::DontEnum | PropertyAttribute::Accessor);
 

Modified: trunk/Source/_javascript_Core/runtime/StringIteratorPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/StringIteratorPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/StringIteratorPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -41,7 +41,7 @@
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "String Iterator"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "String Iterator"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, stringIteratorPrototypeNextCodeGenerator, static_cast<unsigned>(PropertyAttribute::DontEnum));
 }
 

Modified: trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/SymbolPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -62,7 +62,7 @@
 void SymbolPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
 {
     Base::finishCreation(vm);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "Symbol"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "Symbol"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
     ASSERT(inherits(vm, info()));
 
     JSFunction* toPrimitiveFunction = JSFunction::create(vm, globalObject, 1, "[Symbol.toPrimitive]"_s, symbolProtoFuncValueOf, NoIntrinsic);

Modified: trunk/Source/_javascript_Core/runtime/WeakMapPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/WeakMapPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/WeakMapPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -48,7 +48,7 @@
     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->has, protoFuncWeakMapHas, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakMapHasIntrinsic);
     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->set, protoFuncWeakMapSet, static_cast<unsigned>(PropertyAttribute::DontEnum), 2, JSWeakMapSetIntrinsic);
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "WeakMap"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "WeakMap"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 ALWAYS_INLINE static JSWeakMap* getWeakMap(JSGlobalObject* globalObject, JSValue value)

Modified: trunk/Source/_javascript_Core/runtime/WeakObjectRefPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/WeakObjectRefPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/WeakObjectRefPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -44,7 +44,7 @@
     // FIXME: It wouldn't be hard to make this an intrinsic.
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->deref, protoFuncWeakRefDeref, static_cast<unsigned>(PropertyAttribute::DontEnum), 0);
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "WeakRef"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "WeakRef"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 ALWAYS_INLINE static JSWeakObjectRef* getWeakRef(JSGlobalObject* globalObject, JSValue value)

Modified: trunk/Source/_javascript_Core/runtime/WeakSetPrototype.cpp (253864 => 253865)


--- trunk/Source/_javascript_Core/runtime/WeakSetPrototype.cpp	2019-12-21 17:18:32 UTC (rev 253864)
+++ trunk/Source/_javascript_Core/runtime/WeakSetPrototype.cpp	2019-12-22 00:43:04 UTC (rev 253865)
@@ -46,7 +46,7 @@
     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->has, protoFuncWeakSetHas, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakSetHasIntrinsic);
     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->add, protoFuncWeakSetAdd, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakSetAddIntrinsic);
 
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, "WeakSet"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
+    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsNontrivialString(vm, "WeakSet"_s), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
 }
 
 ALWAYS_INLINE static JSWeakSet* getWeakSet(JSGlobalObject* globalObject, JSValue value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to