Title: [240228] trunk/Source/_javascript_Core
Revision
240228
Author
yusukesuz...@slowstart.org
Date
2019-01-20 21:49:37 -0800 (Sun, 20 Jan 2019)

Log Message

[JSC] Reduce size of SourceProvider
https://bugs.webkit.org/show_bug.cgi?id=193544

Reviewed by Saam Barati.

This patch attempts to reduce the dirty memory footprint by the following 3 optimizations.

1. Reordering the members of SourceProvider to reduce the size. This affects on JSC, and CachedScriptSourceProvider used in WebCore.

2. Create one SourceProvider for all the builtin code and use substring to create builtin JS functions.
   This reduces # of SourceProvider created for builtins.

3. Drop m_validated flag in SourceProvider since nobody uses it. It also deletes dead code in Parser.cpp.

Unfortunately, MSVC does not accept super long C string literal. So instead, we construct combined string in a form of C array.

* Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result:
* Scripts/wkbuiltins/builtins_generate_combined_header.py:
(BuiltinsCombinedHeaderGenerator.generate_output):
* Scripts/wkbuiltins/builtins_generate_combined_implementation.py:
(BuiltinsCombinedImplementationGenerator.generate_output):
* Scripts/wkbuiltins/builtins_generate_separate_implementation.py:
(BuiltinsSeparateImplementationGenerator.generate_output):
* Scripts/wkbuiltins/builtins_generator.py:
(BuiltinsGenerator.generate_embedded_code_data_for_function):
(BuiltinsGenerator.generate_embedded_code_string_section_for_data):
(BuiltinsGenerator.generate_embedded_code_string_section_for_function): Deleted.
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::BuiltinExecutables):
(JSC::JSC_FOREACH_BUILTIN_CODE):
(JSC::BuiltinExecutables::createExecutable):
* builtins/BuiltinExecutables.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseExpressionOrLabelStatement):
(JSC::Parser<LexerType>::shouldCheckPropertyForUnderscoreProtoDuplicate):
(JSC::Parser<LexerType>::parseObjectLiteral):
(JSC::Parser<LexerType>::parseUnaryExpression):
* parser/Parser.h:
* parser/SourceCode.h:
* parser/SourceProvider.cpp:
(JSC::SourceProvider::SourceProvider):
* parser/SourceProvider.h:
(JSC::SourceProvider::isValid const): Deleted.
(JSC::SourceProvider::setValid): Deleted.
* runtime/CachedTypes.cpp:
(JSC::CachedSourceProviderShape::encode):
(JSC::CachedSourceProviderShape::decode const):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (240227 => 240228)


--- trunk/Source/_javascript_Core/ChangeLog	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-01-21 05:49:37 UTC (rev 240228)
@@ -1,3 +1,57 @@
+2019-01-20  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Reduce size of SourceProvider
+        https://bugs.webkit.org/show_bug.cgi?id=193544
+
+        Reviewed by Saam Barati.
+
+        This patch attempts to reduce the dirty memory footprint by the following 3 optimizations.
+
+        1. Reordering the members of SourceProvider to reduce the size. This affects on JSC, and CachedScriptSourceProvider used in WebCore.
+
+        2. Create one SourceProvider for all the builtin code and use substring to create builtin JS functions.
+           This reduces # of SourceProvider created for builtins.
+
+        3. Drop m_validated flag in SourceProvider since nobody uses it. It also deletes dead code in Parser.cpp.
+
+        Unfortunately, MSVC does not accept super long C string literal. So instead, we construct combined string in a form of C array.
+
+        * Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result:
+        * Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result:
+        * Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result:
+        * Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result:
+        * Scripts/wkbuiltins/builtins_generate_combined_header.py:
+        (BuiltinsCombinedHeaderGenerator.generate_output):
+        * Scripts/wkbuiltins/builtins_generate_combined_implementation.py:
+        (BuiltinsCombinedImplementationGenerator.generate_output):
+        * Scripts/wkbuiltins/builtins_generate_separate_implementation.py:
+        (BuiltinsSeparateImplementationGenerator.generate_output):
+        * Scripts/wkbuiltins/builtins_generator.py:
+        (BuiltinsGenerator.generate_embedded_code_data_for_function):
+        (BuiltinsGenerator.generate_embedded_code_string_section_for_data):
+        (BuiltinsGenerator.generate_embedded_code_string_section_for_function): Deleted.
+        * builtins/BuiltinExecutables.cpp:
+        (JSC::BuiltinExecutables::BuiltinExecutables):
+        (JSC::JSC_FOREACH_BUILTIN_CODE):
+        (JSC::BuiltinExecutables::createExecutable):
+        * builtins/BuiltinExecutables.h:
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::Parser):
+        (JSC::Parser<LexerType>::parseExpressionOrLabelStatement):
+        (JSC::Parser<LexerType>::shouldCheckPropertyForUnderscoreProtoDuplicate):
+        (JSC::Parser<LexerType>::parseObjectLiteral):
+        (JSC::Parser<LexerType>::parseUnaryExpression):
+        * parser/Parser.h:
+        * parser/SourceCode.h:
+        * parser/SourceProvider.cpp:
+        (JSC::SourceProvider::SourceProvider):
+        * parser/SourceProvider.h:
+        (JSC::SourceProvider::isValid const): Deleted.
+        (JSC::SourceProvider::setValid): Deleted.
+        * runtime/CachedTypes.cpp:
+        (JSC::CachedSourceProviderShape::encode):
+        (JSC::CachedSourceProviderShape::decode const):
+
 2019-01-20  Michael Catanzaro  <mcatanz...@igalia.com>
 
         Unreviewed, fix -Wint-in-bool-context warning

Modified: trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result	2019-01-21 05:49:37 UTC (rev 240228)
@@ -40,6 +40,10 @@
 
 namespace JSC {
 
+extern const char s_JSCCombinedCode[];
+
+extern const unsigned s_JSCCombinedCodeLength;
+
 /* Builtin.Promise */
 extern const char* s_builtinPromiseRejectPromiseCode;
 extern const int s_builtinPromiseRejectPromiseCodeLength;
@@ -115,24 +119,15 @@
 
 namespace JSC {
 
+const char s_JSCCombinedCode[] = { 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 112, 114, 111, 109, 105, 115, 101, 44, 32, 118, 97, 108, 117, 101, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 114, 101, 97, 99, 116, 105, 111, 110, 115, 32, 61, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 70, 117, 108, 102, 105, 108, 108, 82, 101, 97, 99, 116, 105, 111, 110, 115, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 82, 101, 115, 117, 108, 116, 32, 61, 32, 118, 97, 108, 117, 101, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 70, 117, 108, 102, 105, 108, 108, 82, 101, 97, 99, 116, 105, 111, 110, 115, 32, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109,
  105, 115, 101, 82, 101, 106, 101, 99, 116, 82, 101, 97, 99, 116, 105, 111, 110, 115, 32, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 83, 116, 97, 116, 101, 32, 61, 32, 64, 112, 114, 111, 109, 105, 115, 101, 70, 117, 108, 102, 105, 108, 108, 101, 100, 59, 10, 10, 32, 32, 32, 32, 64, 73, 110, 115, 112, 101, 99, 116, 111, 114, 73, 110, 115, 116, 114, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 46, 112, 114, 111, 109, 105, 115, 101, 70, 117, 108, 102, 105, 108, 108, 101, 100, 40, 112, 114, 111, 109, 105, 115, 101, 44, 32, 118, 97, 108, 117, 101, 44, 32, 114, 101, 97, 99, 116, 105, 111, 110, 115, 41, 59, 10, 10, 32, 32, 32, 32, 64, 116, 114, 105, 103, 103, 101, 114, 80, 114, 111, 109, 105, 115, 101, 82, 101, 97, 99, 116, 105, 111, 110, 115, 40, 114, 101, 97, 99, 116, 105, 111, 110, 115, 44, 32, 118, 97, 108, 117, 101, 41, 59, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 10
 5, 111, 110, 32, 40, 112, 114, 111, 109, 105, 115, 101, 44, 32, 114, 101, 97, 115, 111, 110, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 114, 101, 97, 99, 116, 105, 111, 110, 115, 32, 61, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 82, 101, 106, 101, 99, 116, 82, 101, 97, 99, 116, 105, 111, 110, 115, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 82, 101, 115, 117, 108, 116, 32, 61, 32, 114, 101, 97, 115, 111, 110, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 70, 117, 108, 102, 105, 108, 108, 82, 101, 97, 99, 116, 105, 111, 110, 115, 32, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 82, 101, 106, 101, 99, 116, 82, 101, 97, 99, 116, 105, 11
 1, 110, 115, 32, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 112, 114, 111, 109, 105, 115, 101, 46, 64, 112, 114, 111, 109, 105, 115, 101, 83, 116, 97, 116, 101, 32, 61, 32, 64, 112, 114, 111, 109, 105, 115, 101, 82, 101, 106, 101, 99, 116, 101, 100, 59, 10, 10, 32, 32, 32, 32, 64, 73, 110, 115, 112, 101, 99, 116, 111, 114, 73, 110, 115, 116, 114, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 46, 112, 114, 111, 109, 105, 115, 101, 82, 101, 106, 101, 99, 116, 101, 100, 40, 112, 114, 111, 109, 105, 115, 101, 44, 32, 114, 101, 97, 115, 111, 110, 44, 32, 114, 101, 97, 99, 116, 105, 111, 110, 115, 41, 59, 10, 10, 32, 32, 32, 32, 64, 116, 114, 105, 103, 103, 101, 114, 80, 114, 111, 109, 105, 115, 101, 82, 101, 97, 99, 116, 105, 111, 110, 115, 40, 114, 101, 97, 99, 116, 105, 111, 110, 115, 44, 32, 114, 101, 97, 115, 111, 110, 41, 59, 10, 125, 41, 10 };
+
+const unsigned s_JSCCombinedCodeLength = 825;
+
 const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 const int s_builtinPromiseFulfillPromiseCodeLength = 412;
 static const JSC::Intrinsic s_builtinPromiseFulfillPromiseCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinPromiseFulfillPromiseCode =
-    "(function (promise, value)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    var reactions = promise.@promiseFulfillReactions;\n" \
-    "    promise.@promiseResult = value;\n" \
-    "    promise.@promiseFulfillReactions = undefined;\n" \
-    "    promise.@promiseRejectReactions = undefined;\n" \
-    "    promise.@promiseState = @promiseFulfilled;\n" \
-    "\n" \
-    "    @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);\n" \
-    "\n" \
-    "    @triggerPromiseReactions(reactions, value);\n" \
-    "})\n" \
+s_JSCCombinedCode + 0
 ;
 
 const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -139,20 +134,7 @@
 const int s_builtinPromiseRejectPromiseCodeLength = 413;
 static const JSC::Intrinsic s_builtinPromiseRejectPromiseCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinPromiseRejectPromiseCode =
-    "(function (promise, reason)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    var reactions = promise.@promiseRejectReactions;\n" \
-    "    promise.@promiseResult = reason;\n" \
-    "    promise.@promiseFulfillReactions = undefined;\n" \
-    "    promise.@promiseRejectReactions = undefined;\n" \
-    "    promise.@promiseState = @promiseRejected;\n" \
-    "\n" \
-    "    @InspectorInstrumentation.promiseRejected(promise, reason, reactions);\n" \
-    "\n" \
-    "    @triggerPromiseReactions(reactions, reason);\n" \
-    "})\n" \
+s_JSCCombinedCode + 412
 ;
 
 

Modified: trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result	2019-01-21 05:49:37 UTC (rev 240228)
@@ -40,6 +40,10 @@
 
 namespace JSC {
 
+extern const char s_JSCCombinedCode[];
+
+extern const unsigned s_JSCCombinedCodeLength;
+
 /* Builtin.prototype */
 extern const char* s_builtinPrototypeEveryCode;
 extern const int s_builtinPrototypeEveryCodeLength;
@@ -127,37 +131,15 @@
 
 namespace JSC {
 
+const char s_JSCCombinedCode[] = { 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 99, 97, 108, 108, 98, 97, 99, 107, 32, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 104, 105, 115, 32, 61, 61, 61, 32, 110, 117, 108, 108, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 101, 118, 101, 114, 121, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 110, 111, 116, 32, 98, 101, 32, 110, 117, 108, 108, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 104, 105, 115, 32, 61, 61, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101
 , 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 101, 118, 101, 114, 121, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 110, 111, 116, 32, 98, 101, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 118, 97, 114, 32, 97, 114, 114, 97, 121, 32, 61, 32, 64, 79, 98, 106, 101, 99, 116, 40, 116, 104, 105, 115, 41, 59, 10, 32, 32, 32, 32, 118, 97, 114, 32, 108, 101, 110, 103, 116, 104, 32, 61, 32, 64, 116, 111, 76, 101, 110, 103, 116, 104, 40, 97, 114, 114, 97, 121, 46, 108, 101, 110, 103, 116, 104, 41, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 121, 112, 101, 111, 102, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 33, 61, 61, 32, 34, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34,
  65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 101, 118, 101, 114, 121, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 109, 117, 115, 116, 32, 98, 101, 32, 97, 32, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 104, 105, 115, 65, 114, 103, 32, 61, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 46, 108, 101, 110, 103, 116, 104, 32, 62, 32, 49, 32, 63, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 91, 49, 93, 32, 58, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 33, 40, 105, 32, 105, 110, 32, 97, 114, 114, 97, 121, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99, 111, 110, 116, 105, 110, 117, 101, 59, 10, 32, 32, 32, 32, 32, 32,
  32, 32, 105, 102, 32, 40, 33, 99, 97, 108, 108, 98, 97, 99, 107, 46, 64, 99, 97, 108, 108, 40, 116, 104, 105, 115, 65, 114, 103, 44, 32, 97, 114, 114, 97, 121, 91, 105, 93, 44, 32, 105, 44, 32, 97, 114, 114, 97, 121, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 102, 97, 108, 115, 101, 59, 10, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 116, 114, 117, 101, 59, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 99, 97, 108, 108, 98, 97, 99, 107, 32, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 104, 105, 115, 32, 61, 61, 61, 32, 110, 117, 108, 108, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 102, 111, 114
 , 69, 97, 99, 104, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 110, 111, 116, 32, 98, 101, 32, 110, 117, 108, 108, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 104, 105, 115, 32, 61, 61, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 102, 111, 114, 69, 97, 99, 104, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 110, 111, 116, 32, 98, 101, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 118, 97, 114, 32, 97, 114, 114, 97, 121, 32, 61, 32, 64, 79, 98, 106, 101, 99, 116, 40, 116, 104, 105, 115, 41, 59, 10, 32, 32, 32, 32, 118, 97, 114, 32, 108, 101, 110, 103, 116, 10
 4, 32, 61, 32, 64, 116, 111, 76, 101, 110, 103, 116, 104, 40, 97, 114, 114, 97, 121, 46, 108, 101, 110, 103, 116, 104, 41, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 116, 121, 112, 101, 111, 102, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 33, 61, 61, 32, 34, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 102, 111, 114, 69, 97, 99, 104, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 109, 117, 115, 116, 32, 98, 101, 32, 97, 32, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 104, 105, 115, 65, 114, 103, 32, 61, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 46, 108, 101, 110, 103, 116, 104, 32, 62, 32, 49, 32, 63, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 91, 49, 93, 32, 58, 32, 117, 110, 100, 101, 102,
  105, 110, 101, 100, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 105, 32, 61, 32, 48, 59, 32, 105, 32, 60, 32, 108, 101, 110, 103, 116, 104, 59, 32, 105, 43, 43, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 105, 32, 105, 110, 32, 97, 114, 114, 97, 121, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 99, 97, 108, 108, 98, 97, 99, 107, 46, 64, 99, 97, 108, 108, 40, 116, 104, 105, 115, 65, 114, 103, 44, 32, 97, 114, 114, 97, 121, 91, 105, 93, 44, 32, 105, 44, 32, 97, 114, 114, 97, 121, 41, 59, 10, 32, 32, 32, 32, 125, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 115, 116, 114, 65, 114, 103, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 33, 64, 105, 115, 79, 98, 106, 101, 99, 116, 40, 116, 104, 105, 115, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 64, 116, 104, 114, 111, 119, 84, 121, 112, 101, 69, 114, 114
 , 111, 114, 40, 34, 82, 101, 103, 69, 120, 112, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 64, 64, 109, 97, 116, 99, 104, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 98, 101, 32, 97, 110, 32, 79, 98, 106, 101, 99, 116, 34, 41, 59, 10, 10, 32, 32, 32, 32, 108, 101, 116, 32, 114, 101, 103, 101, 120, 112, 32, 61, 32, 116, 104, 105, 115, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 105, 102, 32, 40, 33, 64, 104, 97, 115, 79, 98, 115, 101, 114, 118, 97, 98, 108, 101, 83, 105, 100, 101, 69, 102, 102, 101, 99, 116, 115, 70, 111, 114, 82, 101, 103, 69, 120, 112, 77, 97, 116, 99, 104, 40, 114, 101, 103, 101, 120, 112, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 64, 114, 101, 103, 69, 120, 112, 77, 97, 116, 99, 104, 70, 97, 115, 116, 46, 64, 99, 97, 108, 108, 40, 114, 101, 103, 101, 120, 112, 44, 32, 115, 116, 114, 65, 114, 103, 41, 59, 10, 10, 32, 32, 32, 32, 108, 101, 116, 32,
  115, 116, 114, 32, 61, 32, 64, 116, 111, 83, 116, 114, 105, 110, 103, 40, 115, 116, 114, 65, 114, 103, 41, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 33, 114, 101, 103, 101, 120, 112, 46, 103, 108, 111, 98, 97, 108, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 64, 114, 101, 103, 69, 120, 112, 69, 120, 101, 99, 40, 114, 101, 103, 101, 120, 112, 44, 32, 115, 116, 114, 41, 59, 10, 32, 32, 32, 32, 10, 32, 32, 32, 32, 108, 101, 116, 32, 117, 110, 105, 99, 111, 100, 101, 32, 61, 32, 114, 101, 103, 101, 120, 112, 46, 117, 110, 105, 99, 111, 100, 101, 59, 10, 32, 32, 32, 32, 114, 101, 103, 101, 120, 112, 46, 108, 97, 115, 116, 73, 110, 100, 101, 120, 32, 61, 32, 48, 59, 10, 32, 32, 32, 32, 108, 101, 116, 32, 114, 101, 115, 117, 108, 116, 76, 105, 115, 116, 32, 61, 32, 91, 93, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 99, 111, 110, 115, 116, 32, 109, 97, 120, 105, 109, 117, 109, 82, 101, 97
 , 115, 111, 110, 97, 98, 108, 101, 77, 97, 116, 99, 104, 83, 105, 122, 101, 32, 61, 32, 49, 48, 48, 48, 48, 48, 48, 48, 48, 59, 10, 10, 32, 32, 32, 32, 119, 104, 105, 108, 101, 32, 40, 116, 114, 117, 101, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 108, 101, 116, 32, 114, 101, 115, 117, 108, 116, 32, 61, 32, 64, 114, 101, 103, 69, 120, 112, 69, 120, 101, 99, 40, 114, 101, 103, 101, 120, 112, 44, 32, 115, 116, 114, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 114, 101, 115, 117, 108, 116, 32, 61, 61, 61, 32, 110, 117, 108, 108, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 114, 101, 115, 117, 108, 116, 76, 105, 115, 116, 46, 108, 101, 110, 103, 116, 104, 32, 61, 61, 61, 32, 48, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 110, 117, 108, 108, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 
 114, 101, 115, 117, 108, 116, 76, 105, 115, 116, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 114, 101, 115, 117, 108, 116, 76, 105, 115, 116, 46, 108, 101, 110, 103, 116, 104, 32, 62, 32, 109, 97, 120, 105, 109, 117, 109, 82, 101, 97, 115, 111, 110, 97, 98, 108, 101, 77, 97, 116, 99, 104, 83, 105, 122, 101, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 116, 104, 114, 111, 119, 79, 117, 116, 79, 102, 77, 101, 109, 111, 114, 121, 69, 114, 114, 111, 114, 40, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 33, 64, 105, 115, 79, 98, 106, 101, 99, 116, 40, 114, 101, 115, 117, 108, 116, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 116, 104, 114, 111, 119, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 82, 101, 103, 69, 120, 112, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 64, 64, 109, 97, 116, 99, 104, 32, 99, 97, 108, 108, 32, 116, 111, 32, 82, 101, 103, 69, 120, 112,
  46, 101, 120, 101, 99, 32, 100, 105, 100, 110, 39, 116, 32, 114, 101, 116, 117, 114, 110, 32, 110, 117, 108, 108, 32, 111, 114, 32, 97, 110, 32, 111, 98, 106, 101, 99, 116, 34, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 108, 101, 116, 32, 114, 101, 115, 117, 108, 116, 83, 116, 114, 105, 110, 103, 32, 61, 32, 64, 116, 111, 83, 116, 114, 105, 110, 103, 40, 114, 101, 115, 117, 108, 116, 91, 48, 93, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 33, 114, 101, 115, 117, 108, 116, 83, 116, 114, 105, 110, 103, 46, 108, 101, 110, 103, 116, 104, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 103, 101, 120, 112, 46, 108, 97, 115, 116, 73, 110, 100, 101, 120, 32, 61, 32, 64, 97, 100, 118, 97, 110, 99, 101, 83, 116, 114, 105, 110, 103, 73, 110, 100, 101, 120, 40, 115, 116, 114, 44, 32, 114, 101, 103, 101, 120, 112, 46, 108, 97, 115, 116, 73, 110, 100, 101, 120, 44, 32, 117, 110, 105, 99, 111, 100, 101, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 1
 14, 101, 115, 117, 108, 116, 76, 105, 115, 116, 46, 64, 112, 117, 115, 104, 40, 114, 101, 115, 117, 108, 116, 83, 116, 114, 105, 110, 103, 41, 59, 10, 32, 32, 32, 32, 125, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 115, 116, 114, 65, 114, 103, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 108, 101, 116, 32, 114, 101, 103, 101, 120, 112, 32, 61, 32, 116, 104, 105, 115, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 105, 102, 32, 40, 64, 105, 115, 82, 101, 103, 69, 120, 112, 79, 98, 106, 101, 99, 116, 40, 114, 101, 103, 101, 120, 112, 41, 32, 38, 38, 32, 64, 116, 114, 121, 71, 101, 116, 66, 121, 73, 100, 40, 114, 101, 103, 101, 120, 112, 44, 32, 34, 101, 120, 101, 99, 34, 41, 32, 61, 61, 61, 32, 64, 114, 101, 103, 69, 120, 112, 66, 117, 105, 108, 116, 105, 110, 69, 120, 101, 99, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 64, 114, 101, 103, 69, 120, 11
 2, 84, 101, 115, 116, 70, 97, 115, 116, 46, 64, 99, 97, 108, 108, 40, 114, 101, 103, 101, 120, 112, 44, 32, 115, 116, 114, 65, 114, 103, 41, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 105, 102, 32, 40, 33, 64, 105, 115, 79, 98, 106, 101, 99, 116, 40, 114, 101, 103, 101, 120, 112, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 64, 116, 104, 114, 111, 119, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 82, 101, 103, 69, 120, 112, 46, 112, 114, 111, 116, 111, 116, 121, 112, 101, 46, 116, 101, 115, 116, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 124, 116, 104, 105, 115, 124, 32, 98, 101, 32, 97, 110, 32, 79, 98, 106, 101, 99, 116, 34, 41, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 108, 101, 116, 32, 115, 116, 114, 32, 61, 32, 64, 116, 111, 83, 116, 114, 105, 110, 103, 40, 115, 116, 114, 65, 114, 103, 41, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 108, 101, 116, 32, 109, 97, 116, 99, 104, 32, 
 61, 32, 64, 114, 101, 103, 69, 120, 112, 69, 120, 101, 99, 40, 114, 101, 103, 101, 120, 112, 44, 32, 115, 116, 114, 41, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 105, 102, 32, 40, 109, 97, 116, 99, 104, 32, 33, 61, 61, 32, 110, 117, 108, 108, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 116, 114, 117, 101, 59, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 102, 97, 108, 115, 101, 59, 10, 125, 41, 10 };
+
+const unsigned s_JSCCombinedCodeLength = 3198;
+
 const JSC::ConstructAbility s_builtinPrototypeEveryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 const int s_builtinPrototypeEveryCodeLength = 762;
 static const JSC::Intrinsic s_builtinPrototypeEveryCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinPrototypeEveryCode =
-    "(function (callback )\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (this === null)\n" \
-    "        throw new @TypeError(\"Array.prototype.every requires that |this| not be null\");\n" \
-    "    \n" \
-    "    if (this === undefined)\n" \
-    "        throw new @TypeError(\"Array.prototype.every requires that |this| not be undefined\");\n" \
-    "    \n" \
-    "    var array = @Object(this);\n" \
-    "    var length = @toLength(array.length);\n" \
-    "\n" \
-    "    if (typeof callback !== \"function\")\n" \
-    "        throw new @TypeError(\"Array.prototype.every callback must be a function\");\n" \
-    "    \n" \
-    "    var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
-    "    \n" \
-    "    for (var i = 0; i < length; i++) {\n" \
-    "        if (!(i in array))\n" \
-    "            continue;\n" \
-    "        if (!callback.@call(thisArg, array[i], i, array))\n" \
-    "            return false;\n" \
-    "    }\n" \
-    "    \n" \
-    "    return true;\n" \
-    "})\n" \
+s_JSCCombinedCode + 0
 ;
 
 const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -164,29 +146,7 @@
 const int s_builtinPrototypeForEachCodeLength = 694;
 static const JSC::Intrinsic s_builtinPrototypeForEachCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinPrototypeForEachCode =
-    "(function (callback )\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (this === null)\n" \
-    "        throw new @TypeError(\"Array.prototype.forEach requires that |this| not be null\");\n" \
-    "    \n" \
-    "    if (this === undefined)\n" \
-    "        throw new @TypeError(\"Array.prototype.forEach requires that |this| not be undefined\");\n" \
-    "    \n" \
-    "    var array = @Object(this);\n" \
-    "    var length = @toLength(array.length);\n" \
-    "\n" \
-    "    if (typeof callback !== \"function\")\n" \
-    "        throw new @TypeError(\"Array.prototype.forEach callback must be a function\");\n" \
-    "    \n" \
-    "    var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
-    "    \n" \
-    "    for (var i = 0; i < length; i++) {\n" \
-    "        if (i in array)\n" \
-    "            callback.@call(thisArg, array[i], i, array);\n" \
-    "    }\n" \
-    "})\n" \
+s_JSCCombinedCode + 762
 ;
 
 const JSC::ConstructAbility s_builtinPrototypeMatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -193,56 +153,7 @@
 const int s_builtinPrototypeMatchCodeLength = 1238;
 static const JSC::Intrinsic s_builtinPrototypeMatchCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinPrototypeMatchCode =
-    "(function (strArg)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    if (!@isObject(this))\n" \
-    "        @throwTypeError(\"RegExp.prototype.@@match requires that |this| be an Object\");\n" \
-    "\n" \
-    "    let regexp = this;\n" \
-    "\n" \
-    "    //\n" \
-    "    if (!@hasObservableSideEffectsForRegExpMatch(regexp))\n" \
-    "        return @regExpMatchFast.@call(regexp, strArg);\n" \
-    "\n" \
-    "    let str = @toString(strArg);\n" \
-    "\n" \
-    "    if (!regexp.global)\n" \
-    "        return @regExpExec(regexp, str);\n" \
-    "    \n" \
-    "    let unicode = regexp.unicode;\n" \
-    "    regexp.lastIndex = 0;\n" \
-    "    let resultList = [];\n" \
-    "\n" \
-    "    //\n" \
-    "    //\n" \
-    "    //\n" \
-    "    const maximumReasonableMatchSize = 100000000;\n" \
-    "\n" \
-    "    while (true) {\n" \
-    "        let result = @regExpExec(regexp, str);\n" \
-    "        \n" \
-    "        if (result === null) {\n" \
-    "            if (resultList.length === 0)\n" \
-    "                return null;\n" \
-    "            return resultList;\n" \
-    "        }\n" \
-    "\n" \
-    "        if (resultList.length > maximumReasonableMatchSize)\n" \
-    "            @throwOutOfMemoryError();\n" \
-    "\n" \
-    "        if (!@isObject(result))\n" \
-    "            @throwTypeError(\"RegExp.prototype.@@match call to RegExp.exec didn't return null or an object\");\n" \
-    "\n" \
-    "        let resultString = @toString(result[0]);\n" \
-    "\n" \
-    "        if (!resultString.length)\n" \
-    "            regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);\n" \
-    "\n" \
-    "        resultList.@push(resultString);\n" \
-    "    }\n" \
-    "})\n" \
+s_JSCCombinedCode + 1456
 ;
 
 const JSC::ConstructAbility s_builtinPrototypeTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -249,32 +160,7 @@
 const int s_builtinPrototypeTestCodeLength = 504;
 static const JSC::Intrinsic s_builtinPrototypeTestCodeIntrinsic = JSC::RegExpTestIntrinsic;
 const char* s_builtinPrototypeTestCode =
-    "(function (strArg)\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    let regexp = this;\n" \
-    "\n" \
-    "    //\n" \
-    "    if (@isRegExpObject(regexp) && @tryGetById(regexp, \"exec\") === @regExpBuiltinExec)\n" \
-    "        return @regExpTestFast.@call(regexp, strArg);\n" \
-    "\n" \
-    "    //\n" \
-    "    //\n" \
-    "    if (!@isObject(regexp))\n" \
-    "        @throwTypeError(\"RegExp.prototype.test requires that |this| be an Object\");\n" \
-    "\n" \
-    "    //\n" \
-    "    let str = @toString(strArg);\n" \
-    "\n" \
-    "    //\n" \
-    "    let match = @regExpExec(regexp, str);\n" \
-    "\n" \
-    "    //\n" \
-    "    if (match !== null)\n" \
-    "        return true;\n" \
-    "    return false;\n" \
-    "})\n" \
+s_JSCCombinedCode + 2694
 ;
 
 

Modified: trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result	2019-01-21 05:49:37 UTC (rev 240228)
@@ -39,6 +39,10 @@
 
 namespace JSC {
 
+extern const char s_JSCCombinedCode[];
+
+extern const unsigned s_JSCCombinedCodeLength;
+
 /* BuiltinConstructor */
 extern const char* s_builtinConstructorOfCode;
 extern const int s_builtinConstructorOfCodeLength;
@@ -113,82 +117,15 @@
 
 namespace JSC {
 
+const char s_JSCCombinedCode[] = { 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 105, 116, 101, 109, 115, 32, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 104, 105, 115, 79, 98, 106, 32, 61, 32, 116, 104, 105, 115, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 109, 97, 112, 70, 110, 32, 61, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 46, 108, 101, 110, 103, 116, 104, 32, 62, 32, 49, 32, 63, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 91, 49, 93, 32, 58, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 116, 104, 105, 115, 65, 114, 103, 59, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 109, 97, 112, 70, 110, 32, 33, 61, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 116, 121, 112, 101, 111, 102, 32, 109, 97, 112, 70, 110, 32, 33, 61, 61, 32, 34, 102, 117
 , 110, 99, 116, 105, 111, 110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 102, 114, 111, 109, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 116, 104, 101, 32, 115, 101, 99, 111, 110, 100, 32, 97, 114, 103, 117, 109, 101, 110, 116, 44, 32, 119, 104, 101, 110, 32, 112, 114, 111, 118, 105, 100, 101, 100, 44, 32, 98, 101, 32, 97, 32, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 97, 114, 103, 117, 109, 101, 110, 116, 115, 46, 108, 101, 110, 103, 116, 104, 32, 62, 32, 50, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 105, 115, 65, 114, 103, 32, 61, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 91, 50, 93, 59, 10, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 105, 102, 32, 40, 105, 116, 101, 109, 115, 32, 61, 61, 32, 110, 117, 108, 108, 
 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 102, 114, 111, 109, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 97, 110, 32, 97, 114, 114, 97, 121, 45, 108, 105, 107, 101, 32, 111, 98, 106, 101, 99, 116, 32, 45, 32, 110, 111, 116, 32, 110, 117, 108, 108, 32, 111, 114, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 34, 41, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 105, 116, 101, 114, 97, 116, 111, 114, 77, 101, 116, 104, 111, 100, 32, 61, 32, 105, 116, 101, 109, 115, 91, 64, 115, 121, 109, 98, 111, 108, 73, 116, 101, 114, 97, 116, 111, 114, 93, 59, 10, 32, 32, 32, 32, 105, 102, 32, 40, 105, 116, 101, 114, 97, 116, 111, 114, 77, 101, 116, 104, 111, 100, 32, 33, 61, 32, 110, 117, 108, 108, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 116, 121, 112, 101, 111, 102, 32, 105, 116, 101, 114, 97, 116, 111, 114, 77, 101, 116, 104, 111, 100, 
 32, 33, 61, 61, 32, 34, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 116, 104, 114, 111, 119, 32, 110, 101, 119, 32, 64, 84, 121, 112, 101, 69, 114, 114, 111, 114, 40, 34, 65, 114, 114, 97, 121, 46, 102, 114, 111, 109, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 116, 104, 97, 116, 32, 116, 104, 101, 32, 112, 114, 111, 112, 101, 114, 116, 121, 32, 111, 102, 32, 116, 104, 101, 32, 102, 105, 114, 115, 116, 32, 97, 114, 103, 117, 109, 101, 110, 116, 44, 32, 105, 116, 101, 109, 115, 91, 83, 121, 109, 98, 111, 108, 46, 105, 116, 101, 114, 97, 116, 111, 114, 93, 44, 32, 119, 104, 101, 110, 32, 101, 120, 105, 115, 116, 115, 44, 32, 98, 101, 32, 97, 32, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 32, 32, 32, 32, 118, 97, 114, 32, 114, 101, 115, 117, 108, 116, 32, 61, 32, 40, 116, 121, 112, 101, 111, 102, 32, 116, 104, 105, 115, 79, 98, 106, 32, 61, 61, 61, 32, 
 34, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 32, 63, 32, 64, 79, 98, 106, 101, 99, 116, 40, 110, 101, 119, 32, 116, 104, 105, 115, 79, 98, 106, 40, 41, 41, 32, 58, 32, 91, 93, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 118, 97, 114, 32, 107, 32, 61, 32, 48, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 118, 97, 114, 32, 105, 116, 101, 114, 97, 116, 111, 114, 32, 61, 32, 105, 116, 101, 114, 97, 116, 111, 114, 77, 101, 116, 104, 111, 100, 46, 64, 99, 97, 108, 108, 40, 105, 116, 101, 109, 115, 41, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 32, 32, 32, 32, 118, 97, 114, 32, 119, 114, 97, 112, 112, 101, 114, 32, 61, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 91, 64, 115, 121, 109, 98, 111, 108, 73, 116, 101, 114, 97, 116, 111, 114, 93, 40, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 1
 05, 116, 101, 114, 97, 116, 111, 114, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 32, 32, 32, 32, 125, 59, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 118, 97, 108, 117, 101, 32, 111, 102, 32, 119, 114, 97, 112, 112, 101, 114, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 105, 102, 32, 40, 109, 97, 112, 70, 110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 112, 117, 116, 66, 121, 86, 97, 108, 68, 105, 114, 101, 99, 116, 40, 114, 101, 115, 117, 108, 116, 44, 32, 107, 44, 32, 116, 104, 105, 115, 65, 114, 103, 32, 61, 61, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 32, 63, 32, 109, 97, 112, 70, 110, 40, 118, 97, 108, 117, 101, 44, 32, 107, 41, 32, 58, 32, 109, 97, 112, 70, 110, 46, 64, 99, 97, 108, 108, 40, 116, 104, 105, 115, 65, 114, 103, 44, 32, 118, 97, 108, 117, 101, 44, 32, 107, 41, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 101, 10
 8, 115, 101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 112, 117, 116, 66, 121, 86, 97, 108, 68, 105, 114, 101, 99, 116, 40, 114, 101, 115, 117, 108, 116, 44, 32, 107, 44, 32, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 107, 32, 43, 61, 32, 49, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 115, 117, 108, 116, 46, 108, 101, 110, 103, 116, 104, 32, 61, 32, 107, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 114, 101, 115, 117, 108, 116, 59, 10, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 97, 114, 114, 97, 121, 76, 105, 107, 101, 32, 61, 32, 64, 79, 98, 106, 101, 99, 116, 40, 105, 116, 101, 109, 115, 41, 59, 10, 32, 32, 32, 32, 118, 97, 114, 32, 97, 114, 114, 97, 121, 76, 105, 107, 101, 76, 101, 110, 103, 116, 104, 32, 61, 32, 64, 116, 111, 76, 101, 110, 103, 116, 104, 40, 97, 114, 114, 97, 121, 76, 105, 107, 101, 46, 108, 1
 01, 110, 103, 116, 104, 41, 59, 10, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 118, 97, 114, 32, 114, 101, 115, 117, 108, 116, 32, 61, 32, 40, 116, 121, 112, 101, 111, 102, 32, 116, 104, 105, 115, 79, 98, 106, 32, 61, 61, 61, 32, 34, 102, 117, 110, 99, 116, 105, 111, 110, 34, 41, 32, 63, 32, 64, 79, 98, 106, 101, 99, 116, 40, 110, 101, 119, 32, 116, 104, 105, 115, 79, 98, 106, 40, 97, 114, 114, 97, 121, 76, 105, 107, 101, 76, 101, 110, 103, 116, 104, 41, 41, 32, 58, 32, 110, 101, 119, 32, 64, 65, 114, 114, 97, 121, 40, 97, 114, 114, 97, 121, 76, 105, 107, 101, 76, 101, 110, 103, 116, 104, 41, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 107, 32, 61, 32, 48, 59, 10, 32, 32, 32, 32, 119, 104, 105, 108, 101, 32, 40, 107, 32, 60, 32, 97, 114, 114, 97, 121, 76, 105, 107, 101, 76, 101, 110, 103, 116, 104, 41, 32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 118, 97, 114, 32, 118, 97, 108, 117, 101, 32, 61, 32, 97, 114, 114, 97, 121, 76, 105, 107, 101, 91, 107, 93, 59, 10, 32, 32, 32, 32
 , 32, 32, 32, 32, 105, 102, 32, 40, 109, 97, 112, 70, 110, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 112, 117, 116, 66, 121, 86, 97, 108, 68, 105, 114, 101, 99, 116, 40, 114, 101, 115, 117, 108, 116, 44, 32, 107, 44, 32, 116, 104, 105, 115, 65, 114, 103, 32, 61, 61, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100, 32, 63, 32, 109, 97, 112, 70, 110, 40, 118, 97, 108, 117, 101, 44, 32, 107, 41, 32, 58, 32, 109, 97, 112, 70, 110, 46, 64, 99, 97, 108, 108, 40, 116, 104, 105, 115, 65, 114, 103, 44, 32, 118, 97, 108, 117, 101, 44, 32, 107, 41, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 101, 108, 115, 101, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 112, 117, 116, 66, 121, 86, 97, 108, 68, 105, 114, 101, 99, 116, 40, 114, 101, 115, 117, 108, 116, 44, 32, 107, 44, 32, 118, 97, 108, 117, 101, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 107, 32, 43, 61, 32, 49, 59, 10, 32, 32, 32, 32, 125, 10, 10, 32, 32, 32, 32, 114, 101, 115, 117, 108, 116, 46, 108, 101, 1
 10, 103, 116, 104, 32, 61, 32, 97, 114, 114, 97, 121, 76, 105, 107, 101, 76, 101, 110, 103, 116, 104, 59, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 114, 101, 115, 117, 108, 116, 59, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 41, 10, 123, 10, 32, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 118, 97, 114, 32, 108, 101, 110, 103, 116, 104, 32, 61, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 46, 108, 101, 110, 103, 116, 104, 59, 10, 32, 32, 32, 32, 47, 47, 10, 32, 32, 32, 32, 118, 97, 114, 32, 97, 114, 114, 97, 121, 32, 61, 32, 116, 121, 112, 101, 111, 102, 32, 116, 104, 105, 115, 32, 61, 61, 61, 32, 39, 102, 117, 110, 99, 116, 105, 111, 110, 39, 32, 63, 32, 110, 101, 119, 32, 116, 104, 105, 115, 40, 108, 101, 110, 103, 116, 104, 41, 32, 58, 32, 110, 101, 119, 32, 64, 65, 114, 114, 97, 121, 40, 108, 101, 110, 103, 116, 104, 41, 59, 10, 32, 32, 32, 32, 102, 111, 114, 32, 40, 118, 97, 114, 32, 107,
  32, 61, 32, 48, 59, 32, 107, 32, 60, 32, 108, 101, 110, 103, 116, 104, 59, 32, 43, 43, 107, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 64, 112, 117, 116, 66, 121, 86, 97, 108, 68, 105, 114, 101, 99, 116, 40, 97, 114, 114, 97, 121, 44, 32, 107, 44, 32, 97, 114, 103, 117, 109, 101, 110, 116, 115, 91, 107, 93, 41, 59, 10, 32, 32, 32, 32, 97, 114, 114, 97, 121, 46, 108, 101, 110, 103, 116, 104, 32, 61, 32, 108, 101, 110, 103, 116, 104, 59, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 97, 114, 114, 97, 121, 59, 10, 125, 41, 10 };
+
+const unsigned s_JSCCombinedCodeLength = 2340;
+
 const JSC::ConstructAbility s_builtinConstructorFromCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 const int s_builtinConstructorFromCodeLength = 2046;
 static const JSC::Intrinsic s_builtinConstructorFromCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinConstructorFromCode =
-    "(function (items )\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    var thisObj = this;\n" \
-    "\n" \
-    "    var mapFn = arguments.length > 1 ? arguments[1] : undefined;\n" \
-    "\n" \
-    "    var thisArg;\n" \
-    "\n" \
-    "    if (mapFn !== undefined) {\n" \
-    "        if (typeof mapFn !== \"function\")\n" \
-    "            throw new @TypeError(\"Array.from requires that the second argument, when provided, be a function\");\n" \
-    "\n" \
-    "        if (arguments.length > 2)\n" \
-    "            thisArg = arguments[2];\n" \
-    "    }\n" \
-    "\n" \
-    "    if (items == null)\n" \
-    "        throw new @TypeError(\"Array.from requires an array-like object - not null or undefined\");\n" \
-    "\n" \
-    "    var iteratorMethod = items[@symbolIterator];\n" \
-    "    if (iteratorMethod != null) {\n" \
-    "        if (typeof iteratorMethod !== \"function\")\n" \
-    "            throw new @TypeError(\"Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function\");\n" \
-    "\n" \
-    "        //\n" \
-    "        var result = (typeof thisObj === \"function\") ? @Object(new thisObj()) : [];\n" \
-    "\n" \
-    "        var k = 0;\n" \
-    "        var iterator = iteratorMethod.@call(items);\n" \
-    "\n" \
-    "        //\n" \
-    "        //\n" \
-    "        //\n" \
-    "        var wrapper = {\n" \
-    "            [@symbolIterator]() {\n" \
-    "                return iterator;\n" \
-    "            }\n" \
-    "        };\n" \
-    "\n" \
-    "        for (var value of wrapper) {\n" \
-    "            if (mapFn)\n" \
-    "                @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
-    "            else\n" \
-    "                @putByValDirect(result, k, value);\n" \
-    "            k += 1;\n" \
-    "        }\n" \
-    "\n" \
-    "        result.length = k;\n" \
-    "        return result;\n" \
-    "    }\n" \
-    "\n" \
-    "    var arrayLike = @Object(items);\n" \
-    "    var arrayLikeLength = @toLength(arrayLike.length);\n" \
-    "\n" \
-    "    //\n" \
-    "    var result = (typeof thisObj === \"function\") ? @Object(new thisObj(arrayLikeLength)) : new @Array(arrayLikeLength);\n" \
-    "\n" \
-    "    var k = 0;\n" \
-    "    while (k < arrayLikeLength) {\n" \
-    "        var value = arrayLike[k];\n" \
-    "        if (mapFn)\n" \
-    "            @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
-    "        else\n" \
-    "            @putByValDirect(result, k, value);\n" \
-    "        k += 1;\n" \
-    "    }\n" \
-    "\n" \
-    "    result.length = arrayLikeLength;\n" \
-    "    return result;\n" \
-    "})\n" \
+s_JSCCombinedCode + 0
 ;
 
 const JSC::ConstructAbility s_builtinConstructorOfCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -195,18 +132,7 @@
 const int s_builtinConstructorOfCodeLength = 294;
 static const JSC::Intrinsic s_builtinConstructorOfCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_builtinConstructorOfCode =
-    "(function ()\n" \
-    "{\n" \
-    "    \"use strict\";\n" \
-    "\n" \
-    "    var length = arguments.length;\n" \
-    "    //\n" \
-    "    var array = typeof this === 'function' ? new this(length) : new @Array(length);\n" \
-    "    for (var k = 0; k < length; ++k)\n" \
-    "        @putByValDirect(array, k, arguments[k]);\n" \
-    "    array.length = length;\n" \
-    "    return array;\n" \
-    "})\n" \
+s_JSCCombinedCode + 2046
 ;
 
 

Modified: trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result	2019-01-21 05:49:37 UTC (rev 240228)
@@ -40,6 +40,10 @@
 
 namespace JSC {
 
+extern const char s_JSCCombinedCode[];
+
+extern const unsigned s_JSCCombinedCodeLength;
+
 /* InternalClashingNames */
 extern const char* s_internalClashingNamesIsReadableStreamLockedCode;
 extern const int s_internalClashingNamesIsReadableStreamLockedCodeLength;
@@ -114,16 +118,15 @@
 
 namespace JSC {
 
+const char s_JSCCombinedCode[] = { 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 115, 116, 114, 101, 97, 109, 41, 10, 123, 10, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 33, 33, 115, 116, 114, 101, 97, 109, 46, 64, 114, 101, 97, 100, 101, 114, 59, 10, 125, 41, 10, 40, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 115, 116, 114, 101, 97, 109, 41, 10, 123, 10, 32, 32, 32, 34, 117, 115, 101, 32, 115, 116, 114, 105, 99, 116, 34, 59, 10, 10, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 32, 33, 33, 115, 116, 114, 101, 97, 109, 46, 64, 114, 101, 97, 100, 101, 114, 59, 10, 125, 41, 10 };
+
+const unsigned s_JSCCombinedCodeLength = 142;
+
 const JSC::ConstructAbility s_internalClashingNamesIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 const int s_internalClashingNamesIsReadableStreamLockedCodeLength = 71;
 static const JSC::Intrinsic s_internalClashingNamesIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_internalClashingNamesIsReadableStreamLockedCode =
-    "(function (stream)\n" \
-    "{\n" \
-    "   \"use strict\";\n" \
-    "\n" \
-    "    return !!stream.@reader;\n" \
-    "})\n" \
+s_JSCCombinedCode + 0
 ;
 
 const JSC::ConstructAbility s_internalClashingNamesIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -130,12 +133,7 @@
 const int s_internalClashingNamesIsReadableStreamLockedCodeLength = 71;
 static const JSC::Intrinsic s_internalClashingNamesIsReadableStreamLockedCodeIntrinsic = JSC::NoIntrinsic;
 const char* s_internalClashingNamesIsReadableStreamLockedCode =
-    "(function (stream)\n" \
-    "{\n" \
-    "   \"use strict\";\n" \
-    "\n" \
-    "    return !!stream.@reader;\n" \
-    "})\n" \
+s_JSCCombinedCode + 71
 ;
 
 

Modified: trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_header.py	2019-01-21 05:49:37 UTC (rev 240228)
@@ -55,6 +55,8 @@
         sections.append(Template(Templates.HeaderIncludeGuard).substitute(args))
         sections.append(self.generate_forward_declarations())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
+        sections.append("extern const char s_%(namespace)sCombinedCode[];" % args);
+        sections.append("extern const unsigned s_%(namespace)sCombinedCodeLength;" % args);
         for object in self.model().objects:
             sections.append(self.generate_section_for_object(object))
         sections.append(self.generate_section_for_code_table_macro())

Modified: trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_implementation.py (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_implementation.py	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_combined_implementation.py	2019-01-21 05:49:37 UTC (rev 240228)
@@ -56,8 +56,27 @@
         sections.append(self.generate_primary_header_includes())
         sections.append(self.generate_secondary_header_includes())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
+
+        combinedCode = ""
+        combinedCodeOffset = 0
+        function_data = []
         for function in self.model().all_functions():
-            sections.append(self.generate_embedded_code_string_section_for_function(function))
+            data = ""
+            combinedCode += data['originalSource']
+            data['embeddedSource'] = "s_%sCombinedCode + %d" % (args['namespace'], combinedCodeOffset)
+            combinedCodeOffset += data['embeddedSourceLength']
+            function_data.append(data)
+
+        combinedCharacters = []
+        for ch in combinedCode:
+            combinedCharacters.append(str(ord(ch)))
+
+        sections.append("const char s_%sCombinedCode[] = { %s };" % (args['namespace'], (", ".join(combinedCharacters))));
+        sections.append("const unsigned s_%sCombinedCodeLength = %d;" % (args['namespace'], len(combinedCharacters)));
+
+        for data in function_data:
+            sections.append(self.generate_embedded_code_string_section_for_data(data))
+
         if self.model().framework is Frameworks._javascript_Core:
             sections.append(Template(Templates.CombinedJSCImplementationStaticMacros).substitute(args))
         elif self.model().framework is Frameworks.WebCore:

Modified: trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_separate_implementation.py (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_separate_implementation.py	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generate_separate_implementation.py	2019-01-21 05:49:37 UTC (rev 240228)
@@ -67,7 +67,7 @@
         sections.append(self.generate_secondary_header_includes())
         sections.append(Template(Templates.NamespaceTop).substitute(args))
         for function in self.object.functions:
-            sections.append(self.generate_embedded_code_string_section_for_function(function))
+            sections.append(self.generate_embedded_code_string_section_for_data(self.generate_embedded_code_data_for_function(function)))
         if self.model().framework is Frameworks._javascript_Core:
             sections.append(Template(Templates.SeparateJSCImplementationStaticMacros).substitute(args))
         elif self.model().framework is Frameworks.WebCore:

Modified: trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generator.py (240227 => 240228)


--- trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generator.py	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/Scripts/wkbuiltins/builtins_generator.py	2019-01-21 05:49:37 UTC (rev 240228)
@@ -111,7 +111,7 @@
             "#include \"%s.h\"" % name,
         ])
 
-    def generate_embedded_code_string_section_for_function(self, function):
+    def generate_embedded_code_data_for_function(self, function):
         text = function.function_source
         # Wrap it in parens to avoid adding to global scope.
         function_type_string = "function "
@@ -129,19 +129,21 @@
         if function.is_constructor:
             constructAbility = "CanConstruct"
 
-        args = {
+        return {
             'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
             'embeddedSource': embeddedSource,
             'embeddedSourceLength': embeddedSourceLength,
+            'originalSource': text + "\n",
             'canConstruct': constructAbility,
             'intrinsic': function.intrinsic
         }
 
+    def generate_embedded_code_string_section_for_data(self, data):
         lines = []
-        lines.append("const JSC::ConstructAbility s_%(codeName)sConstructAbility = JSC::ConstructAbility::%(canConstruct)s;" % args);
-        lines.append("const int s_%(codeName)sLength = %(embeddedSourceLength)d;" % args);
-        lines.append("static const JSC::Intrinsic s_%(codeName)sIntrinsic = JSC::%(intrinsic)s;" % args);
-        lines.append("const char* s_%(codeName)s =\n%(embeddedSource)s\n;" % args);
+        lines.append("const JSC::ConstructAbility s_%(codeName)sConstructAbility = JSC::ConstructAbility::%(canConstruct)s;" % data);
+        lines.append("const int s_%(codeName)sLength = %(embeddedSourceLength)d;" % data);
+        lines.append("static const JSC::Intrinsic s_%(codeName)sIntrinsic = JSC::%(intrinsic)s;" % data);
+        lines.append("const char* s_%(codeName)s =\n%(embeddedSource)s\n;" % data);
         return '\n'.join(lines)
 
     # Helper methods.

Modified: trunk/Source/_javascript_Core/builtins/BuiltinExecutables.cpp (240227 => 240228)


--- trunk/Source/_javascript_Core/builtins/BuiltinExecutables.cpp	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/builtins/BuiltinExecutables.cpp	2019-01-21 05:49:37 UTC (rev 240228)
@@ -36,9 +36,10 @@
 
 BuiltinExecutables::BuiltinExecutables(VM& vm)
     : m_vm(vm)
-#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overrideName, length) , m_##name##Source(makeSource(StringImpl::createFromLiteral(s_##name, length), { }))
+    , m_combinedSourceProvider(StringSourceProvider::create(StringImpl::createFromLiteral(s_JSCCombinedCode, s_JSCCombinedCodeLength), { }, URL()))
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overrideName, length) , m_##name##Source(m_combinedSourceProvider.copyRef(), s_##name - s_JSCCombinedCode, (s_##name - s_JSCCombinedCode) + length, 1, 1)
     JSC_FOREACH_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
-#undef EXPOSE_BUILTIN_STRINGS
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 {
 }
 
@@ -101,18 +102,6 @@
 
     unsigned asyncOffset = isAsyncFunction ? strlen("async ") : 0;
     unsigned parametersStart = strlen("function (") + asyncOffset;
-    JSTokenLocation start;
-    start.line = -1;
-    start.lineStartOffset = std::numeric_limits<unsigned>::max();
-    start.startOffset = parametersStart;
-    start.endOffset = std::numeric_limits<unsigned>::max();
-
-    JSTokenLocation end;
-    end.line = 1;
-    end.lineStartOffset = 0;
-    end.startOffset = strlen("(") + asyncOffset;
-    end.endOffset = std::numeric_limits<unsigned>::max();
-
     unsigned startColumn = parametersStart;
     int functionKeywordStart = strlen("(") + asyncOffset;
     int functionNameStart = parametersStart;
@@ -192,16 +181,29 @@
 
     JSTextPosition positionBeforeLastNewline;
     positionBeforeLastNewline.line = lineCount;
-    positionBeforeLastNewline.offset = offsetOfLastNewline;
-    positionBeforeLastNewline.lineStartOffset = positionBeforeLastNewlineLineStartOffset;
+    positionBeforeLastNewline.offset = source.startOffset() + offsetOfLastNewline;
+    positionBeforeLastNewline.lineStartOffset = source.startOffset() + positionBeforeLastNewlineLineStartOffset;
 
-    SourceCode newSource = source.subExpression(parametersStart, view.length() - closeBraceOffsetFromEnd, 0, parametersStart);
+    SourceCode newSource = source.subExpression(source.startOffset() + parametersStart, source.startOffset() + (view.length() - closeBraceOffsetFromEnd), 0, parametersStart);
     bool isBuiltinDefaultClassConstructor = constructorKind != ConstructorKind::None;
     UnlinkedFunctionKind kind = isBuiltinDefaultClassConstructor ? UnlinkedNormalFunction : UnlinkedBuiltinFunction;
 
     SourceParseMode parseMode = isAsyncFunction ? SourceParseMode::AsyncFunctionMode : SourceParseMode::NormalFunctionMode;
+
+    JSTokenLocation start;
+    start.line = -1;
+    start.lineStartOffset = std::numeric_limits<unsigned>::max();
+    start.startOffset = source.startOffset() + parametersStart;
+    start.endOffset = std::numeric_limits<unsigned>::max();
+
+    JSTokenLocation end;
+    end.line = 1;
+    end.lineStartOffset = source.startOffset();
+    end.startOffset = source.startOffset() + strlen("(") + asyncOffset;
+    end.endOffset = std::numeric_limits<unsigned>::max();
+
     FunctionMetadataNode metadata(
-        start, end, startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart,
+        start, end, startColumn, endColumn, source.startOffset() + functionKeywordStart, source.startOffset() + functionNameStart, source.startOffset() + parametersStart,
         isInStrictContext, constructorKind, constructorKind == ConstructorKind::Extends ? SuperBinding::Needed : SuperBinding::NotNeeded,
         parameterCount, parseMode, isArrowFunctionBodyExpression);
 
@@ -237,7 +239,6 @@
             RELEASE_ASSERT(metadataFromParser);
             metadataFromParser->overrideName(name);
             metadataFromParser->setEndPosition(positionBeforeLastNewlineFromParser);
-
             if (metadata != *metadataFromParser || positionBeforeLastNewlineFromParser != positionBeforeLastNewline) {
                 dataLogLn("Expected Metadata:\n", metadata);
                 dataLogLn("Metadata from parser:\n", *metadataFromParser);

Modified: trunk/Source/_javascript_Core/builtins/BuiltinExecutables.h (240227 => 240228)


--- trunk/Source/_javascript_Core/builtins/BuiltinExecutables.h	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/builtins/BuiltinExecutables.h	2019-01-21 05:49:37 UTC (rev 240228)
@@ -47,7 +47,7 @@
 const SourceCode& name##Source() { return m_##name##Source; }
     
     JSC_FOREACH_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
-#undef EXPOSE_BUILTIN_SOURCES
+#undef EXPOSE_BUILTIN_EXECUTABLES
 
     static SourceCode defaultConstructorSourceCode(ConstructorKind);
     UnlinkedFunctionExecutable* createDefaultConstructor(ConstructorKind, const Identifier& name);
@@ -60,6 +60,7 @@
 
     UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&, const Identifier&, ConstructAbility);
 
+    Ref<StringSourceProvider> m_combinedSourceProvider;
 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length)\
     SourceCode m_##name##Source; \
     Weak<UnlinkedFunctionExecutable> m_##name##Executable;

Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (240227 => 240228)


--- trunk/Source/_javascript_Core/parser/Parser.cpp	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp	2019-01-21 05:49:37 UTC (rev 240228)
@@ -129,7 +129,6 @@
     , m_source(&source)
     , m_hasStackOverflow(false)
     , m_allowsIn(true)
-    , m_syntaxAlreadyValidated(source.provider()->isValid())
     , m_statementDepth(0)
     , m_sourceElements(0)
     , m_parsingBuiltin(builtinMode == JSParserBuiltinMode::Builtin)
@@ -3010,14 +3009,13 @@
         JSTextPosition end = tokenEndPosition();
         next();
         consumeOrFail(COLON, "Labels must be followed by a ':'");
-        if (!m_syntaxAlreadyValidated) {
-            // This is O(N^2) over the current list of consecutive labels, but I
-            // have never seen more than one label in a row in the real world.
-            for (size_t i = 0; i < labels.size(); i++)
-                failIfTrue(ident->impl() == labels[i].m_ident->impl(), "Attempted to redeclare the label '", ident->impl(), "'");
-            failIfTrue(getLabel(ident), "Cannot find scope for the label '", ident->impl(), "'");
-            labels.append(LabelInfo(ident, start, end));
-        }
+
+        // This is O(N^2) over the current list of consecutive labels, but I
+        // have never seen more than one label in a row in the real world.
+        for (size_t i = 0; i < labels.size(); i++)
+            failIfTrue(ident->impl() == labels[i].m_ident->impl(), "Attempted to redeclare the label '", ident->impl(), "'");
+        failIfTrue(getLabel(ident), "Cannot find scope for the label '", ident->impl(), "'");
+        labels.append(LabelInfo(ident, start, end));
     } while (matchSpecIdentifier());
     bool isLoop = false;
     switch (m_token.m_type) {
@@ -3032,16 +3030,12 @@
     }
     const Identifier* unused = 0;
     ScopeRef labelScope = currentScope();
-    if (!m_syntaxAlreadyValidated) {
-        for (size_t i = 0; i < labels.size(); i++)
-            pushLabel(labels[i].m_ident, isLoop);
-    }
+    for (size_t i = 0; i < labels.size(); i++)
+        pushLabel(labels[i].m_ident, isLoop);
     m_immediateParentAllowsFunctionDeclarationInStatement = allowFunctionDeclarationAsStatement;
     TreeStatement statement = parseStatement(context, unused);
-    if (!m_syntaxAlreadyValidated) {
-        for (size_t i = 0; i < labels.size(); i++)
-            popLabel(labelScope);
-    }
+    for (size_t i = 0; i < labels.size(); i++)
+        popLabel(labelScope);
     failIfFalse(statement, "Cannot parse statement");
     for (size_t i = 0; i < labels.size(); i++) {
         const LabelInfo& info = labels[labels.size() - i - 1];
@@ -4124,9 +4118,6 @@
 template <typename LexerType>
 template <class TreeBuilder> bool Parser<LexerType>::shouldCheckPropertyForUnderscoreProtoDuplicate(TreeBuilder& context, const TreeProperty& property)
 {
-    if (m_syntaxAlreadyValidated)
-        return false;
-
     if (!context.getName(property))
         return false;
 
@@ -4181,7 +4172,7 @@
     TreeProperty property = parseProperty(context, false);
     failIfFalse(property, "Cannot parse object literal property");
 
-    if (!m_syntaxAlreadyValidated && context.getType(property) & (PropertyNode::Getter | PropertyNode::Setter)) {
+    if (context.getType(property) & (PropertyNode::Getter | PropertyNode::Setter)) {
         restoreSavePoint(savePoint);
         return parseStrictObjectLiteral(context);
     }
@@ -4199,7 +4190,7 @@
         JSTokenLocation propertyLocation(tokenLocation());
         property = parseProperty(context, false);
         failIfFalse(property, "Cannot parse object literal property");
-        if (!m_syntaxAlreadyValidated && context.getType(property) & (PropertyNode::Getter | PropertyNode::Setter)) {
+        if (context.getType(property) & (PropertyNode::Getter | PropertyNode::Setter)) {
             restoreSavePoint(savePoint);
             return parseStrictObjectLiteral(context);
         }
@@ -4968,7 +4959,7 @@
     if (UNLIKELY(isUpdateOp(static_cast<JSTokenType>(lastOperator)) && context.isMetaProperty(expr)))
         internalFailWithMessage(false, metaPropertyName(context, expr), " can't come after a prefix operator");
     bool isEvalOrArguments = false;
-    if (strictMode() && !m_syntaxAlreadyValidated) {
+    if (strictMode()) {
         if (context.isResolve(expr))
             isEvalOrArguments = *m_parserState.lastIdentifier == m_vm->propertyNames->eval || *m_parserState.lastIdentifier == m_vm->propertyNames->arguments;
     }
@@ -5004,7 +4995,7 @@
     
     JSTextPosition end = lastTokenEndPosition();
 
-    if (!TreeBuilder::CreatesAST && (m_syntaxAlreadyValidated || !strictMode()))
+    if (!TreeBuilder::CreatesAST && (!strictMode()))
         return expr;
 
     while (tokenStackDepth) {

Modified: trunk/Source/_javascript_Core/parser/Parser.h (240227 => 240228)


--- trunk/Source/_javascript_Core/parser/Parser.h	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/parser/Parser.h	2019-01-21 05:49:37 UTC (rev 240228)
@@ -1857,7 +1857,6 @@
     JSToken m_token;
     bool m_allowsIn;
     JSTextPosition m_lastTokenEndPosition;
-    bool m_syntaxAlreadyValidated;
     int m_statementDepth;
     RefPtr<SourceProviderCache> m_functionCache;
     SourceElements* m_sourceElements;

Modified: trunk/Source/_javascript_Core/parser/SourceCode.h (240227 => 240228)


--- trunk/Source/_javascript_Core/parser/SourceCode.h	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/parser/SourceCode.h	2019-01-21 05:49:37 UTC (rev 240228)
@@ -53,13 +53,6 @@
         {
         }
 
-        SourceCode(Ref<SourceProvider>&& provider, int startOffset, int endOffset, int firstLine, int startColumn)
-            : UnlinkedSourceCode(WTFMove(provider), startOffset, endOffset)
-            , m_firstLine(OrdinalNumber::fromOneBasedInt(std::max(firstLine, 1)))
-            , m_startColumn(OrdinalNumber::fromOneBasedInt(std::max(startColumn, 1)))
-        {
-        }
-
         SourceCode(RefPtr<SourceProvider>&& provider, int startOffset, int endOffset, int firstLine, int startColumn)
             : UnlinkedSourceCode(WTFMove(provider), startOffset, endOffset)
             , m_firstLine(OrdinalNumber::fromOneBasedInt(std::max(firstLine, 1)))

Modified: trunk/Source/_javascript_Core/parser/SourceProvider.cpp (240227 => 240228)


--- trunk/Source/_javascript_Core/parser/SourceProvider.cpp	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.cpp	2019-01-21 05:49:37 UTC (rev 240228)
@@ -32,9 +32,8 @@
 namespace JSC {
 
 SourceProvider::SourceProvider(const SourceOrigin& sourceOrigin, URL&& url, const TextPosition& startPosition, SourceProviderSourceType sourceType)
-    : m_url(WTFMove(url))
-    , m_sourceType(sourceType)
-    , m_validated(false)
+    : m_sourceType(sourceType)
+    , m_url(WTFMove(url))
     , m_sourceOrigin(sourceOrigin)
     , m_startPosition(startPosition)
 {

Modified: trunk/Source/_javascript_Core/parser/SourceProvider.h (240227 => 240228)


--- trunk/Source/_javascript_Core/parser/SourceProvider.h	2019-01-21 05:40:20 UTC (rev 240227)
+++ trunk/Source/_javascript_Core/parser/SourceProvider.h	2019-01-21 05:49:37 UTC (rev 240228)
@@ -72,9 +72,6 @@
             return m_id;
         }
 
-        bool isValid() const { return m_validated; }
-        void setValid() { m_validated = true; }
-
         void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL; }
         void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL; }
 
@@ -81,9 +78,8 @@
     private:
         JS_EXPORT_PRIVATE void getID();
 
+        SourceProviderSourceType m_sourceType;
         URL m_url;
-        SourceProviderSourceType m_sourceType;
-        bool m_validated : 1;
         SourceOrigin m_sourceOrigin;
         String m_sourceURLDirective;
         String m_sourceMappingURLDirective;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to