WebKit Bugzilla
Attachment 359648 Details for
Bug 193544
: [JSC] Reduce size of SourceProvider
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193544-20190120134344.patch (text/plain), 72.00 KB, created by
Yusuke Suzuki
on 2019-01-20 13:43:44 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-01-20 13:43:44 PST
Size:
72.00 KB
patch
obsolete
>Subversion Revision: 240217 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 8e9e5844a8e04cf906fddea1329e58b3d3c7ccd2..cff612a8aa7c5de2a3d8651e3b3a86471330d6f8 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,85 @@ >+2019-01-20 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ [JSC] Reduce size of SourceProvider >+ https://bugs.webkit.org/show_bug.cgi?id=193544 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch attempts to reduce the dirty memory footprint by the following 2 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. >+ >+ We also remove the dead code using m_syntaxAlreadyValidated 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/wkbuiltins/builtins_generate_combined_header.py: >+ (BuiltinsCombinedHeaderGenerator.generate_output): >+ * Scripts/wkbuiltins/builtins_generate_combined_implementation.py: >+ (BuiltinsCombinedImplementationGenerator.generate_output): >+ * Scripts/wkbuiltins/builtins_generator.py: >+ (BuiltinsGenerator.generate_embedded_code_data_section_for_function): >+ (BuiltinsGenerator.generate_embedded_code_string_section_for_function): >+ * 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. >+ >+ * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result: >+ * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result: >+ * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result: >+ * Scripts/tests/builtins/expected/JavaScriptCore-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 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [JSC] Shrink data structure size in JSC/heap >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >index fc1e99623ebdca2319b79669a49a7b0fcb65dc4c..eb61c36f51f1cef790a5b70d86f90b9f22bcfe72 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result >@@ -40,6 +40,10 @@ enum class ConstructAbility : unsigned; > > 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,44 +119,22 @@ JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) > > 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, 105, 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, 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, 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; > 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 > ; > > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >index 247b97abdbe9a788c5317bb987cf00eda8cf1728..04023c2edd9371c8101500548ec7725e1ce4c6e8 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result >@@ -40,6 +40,10 @@ enum class ConstructAbility : unsigned; > > 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,154 +131,36 @@ JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) > > 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, 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, 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, 114, 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, 112, 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; > 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; > 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; > 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 > ; > > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >index eab9f74917c4209d4ff74edf02e452937596bd89..dfc016a11dd35f68df58068b5a67b67220a2cd34 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result >@@ -39,6 +39,10 @@ enum class ConstructAbility : unsigned; > > namespace JSC { > >+extern const char s_JSCCombinedCode[]; >+ >+extern const unsigned s_JSCCombinedCodeLength; >+ > /* BuiltinConstructor */ > extern const char* s_builtinConstructorOfCode; > extern const int s_builtinConstructorOfCodeLength; >@@ -113,100 +117,22 @@ JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) > > 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, 105, 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, 108, 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, 101, 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, 110, 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; > 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 > ; > > >diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >index 0571bd1e277ba6a6b09bc704db09f8306f2d91e2..862d137acaa8a3e6fdc85a9b2e30c212c2fa971c 100644 >--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result >@@ -40,6 +40,10 @@ enum class ConstructAbility : unsigned; > > namespace JSC { > >+extern const char s_JSCCombinedCode[]; >+ >+extern const unsigned s_JSCCombinedCodeLength; >+ > /* InternalClashingNames */ > extern const char* s_internalClashingNamesIsReadableStreamLockedCode; > extern const int s_internalClashingNamesIsReadableStreamLockedCodeLength; >@@ -114,28 +118,22 @@ JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) > > 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; > 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 > ; > > >diff --git a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py >index eac694803adbaac3e6bc48aa2a34cc8efacef2df..88744b1f823527c5198cc9420285dd8567dd47c1 100644 >--- a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py >+++ b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_header.py >@@ -55,6 +55,8 @@ def generate_output(self): > 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()) >diff --git a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_implementation.py b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_implementation.py >index 7874dcad94b4a6a2fc7c418f04e69d1395c1edb0..21c5e4668d2713c20c7a6479f7fa3793519df4c9 100644 >--- a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_implementation.py >+++ b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_combined_implementation.py >@@ -56,8 +56,27 @@ def generate_output(self): > 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 = self.generate_embedded_code_data_for_function(function) >+ 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.JavaScriptCore: > sections.append(Template(Templates.CombinedJSCImplementationStaticMacros).substitute(args)) > elif self.model().framework is Frameworks.WebCore: >diff --git a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_separate_implementation.py b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_separate_implementation.py >index ced9a53867d42bc88562d208b4724cf6f6684900..9ff12f17b3431fc8b8ba2213ba7ae2b02e582643 100644 >--- a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_separate_implementation.py >+++ b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generate_separate_implementation.py >@@ -67,7 +67,7 @@ def generate_output(self): > 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.JavaScriptCore: > sections.append(Template(Templates.SeparateJSCImplementationStaticMacros).substitute(args)) > elif self.model().framework is Frameworks.WebCore: >diff --git a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generator.py b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generator.py >index 9fa94547a25f7ce69c1203cfd40da9cd322ab846..e8a7cc17b7831157ee50ceae7533f818de539797 100644 >--- a/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generator.py >+++ b/Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generator.py >@@ -111,7 +111,7 @@ def generate_primary_header_includes(self): > "#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 @@ def generate_embedded_code_string_section_for_function(self, function): > 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. >diff --git a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >index ba6ad37e425a81a71d72e55b21014cf1ce538830..de4709385093b4700c8be6cea67565bcc50b9fd0 100644 >--- a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >+++ b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp >@@ -36,9 +36,10 @@ namespace JSC { > > 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 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S > > 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 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S > > 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 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S > 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); >diff --git a/Source/JavaScriptCore/builtins/BuiltinExecutables.h b/Source/JavaScriptCore/builtins/BuiltinExecutables.h >index 438c60ce119181d45d20f057f85c7432fe20ce11..6dcbedd473e186a5346c38041bec699ed0d606d9 100644 >--- a/Source/JavaScriptCore/builtins/BuiltinExecutables.h >+++ b/Source/JavaScriptCore/builtins/BuiltinExecutables.h >@@ -47,7 +47,7 @@ UnlinkedFunctionExecutable* name##Executable(); \ > 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 @@ const SourceCode& name##Source() { return m_##name##Source; } > > 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; >diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp >index 4b840d3ec340b0431277a5cfa3e6b546bcf866ba..1d223bc3a1236cd785bf04aee9e02e104c2b97bc 100644 >--- a/Source/JavaScriptCore/parser/Parser.cpp >+++ b/Source/JavaScriptCore/parser/Parser.cpp >@@ -129,7 +129,6 @@ Parser<LexerType>::Parser(VM* vm, const SourceCode& source, JSParserBuiltinMode > , 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 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExpressionOrL > 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 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExpressionOrL > } > 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 <class TreeBuilder> TreeProperty Parser<LexerType>::parseGetterSetter(T > 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 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseObjectLitera > 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 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseObjectLitera > 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 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseUnaryExpress > 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 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseUnaryExpress > > JSTextPosition end = lastTokenEndPosition(); > >- if (!TreeBuilder::CreatesAST && (m_syntaxAlreadyValidated || !strictMode())) >+ if (!TreeBuilder::CreatesAST && (!strictMode())) > return expr; > > while (tokenStackDepth) { >diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h >index 14cdd1a3a4bce1837a8796150a2a3a2f3b71ba5b..4dc4fa7336c4a054a5d0bb6470bc867095380813 100644 >--- a/Source/JavaScriptCore/parser/Parser.h >+++ b/Source/JavaScriptCore/parser/Parser.h >@@ -1857,7 +1857,6 @@ class Parser { > JSToken m_token; > bool m_allowsIn; > JSTextPosition m_lastTokenEndPosition; >- bool m_syntaxAlreadyValidated; > int m_statementDepth; > RefPtr<SourceProviderCache> m_functionCache; > SourceElements* m_sourceElements; >diff --git a/Source/JavaScriptCore/parser/SourceCode.h b/Source/JavaScriptCore/parser/SourceCode.h >index c96a24adf1626113789e55466a49af6bd3d8d940..fbe4c9a0df1cc1af00b252857ee9c784fa27af4e 100644 >--- a/Source/JavaScriptCore/parser/SourceCode.h >+++ b/Source/JavaScriptCore/parser/SourceCode.h >@@ -55,13 +55,6 @@ namespace JSC { > { > } > >- 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))) >diff --git a/Source/JavaScriptCore/parser/SourceProvider.cpp b/Source/JavaScriptCore/parser/SourceProvider.cpp >index 5c198fdb13ad8b7953e5b6dd06dd7cda7e01cc58..15f00f306a3063adedc38a8fd1677b5bb9abb996 100644 >--- a/Source/JavaScriptCore/parser/SourceProvider.cpp >+++ b/Source/JavaScriptCore/parser/SourceProvider.cpp >@@ -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) > { >diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h >index 40c7aa7ed16cfab667fa40613dc029f6b4198b35..09ad16834b0afb7be9f314afc2f250ad82edb5e5 100644 >--- a/Source/JavaScriptCore/parser/SourceProvider.h >+++ b/Source/JavaScriptCore/parser/SourceProvider.h >@@ -72,18 +72,14 @@ namespace JSC { > 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; } > > private: > JS_EXPORT_PRIVATE void getID(); > >- URL m_url; > SourceProviderSourceType m_sourceType; >- bool m_validated : 1; >+ URL m_url; > SourceOrigin m_sourceOrigin; > String m_sourceURLDirective; > String m_sourceMappingURLDirective; >diff --git a/Source/JavaScriptCore/runtime/CachedTypes.cpp b/Source/JavaScriptCore/runtime/CachedTypes.cpp >index 2acd61cc92ebc00f3c3d02b0e1e69b56e453ee7c..fdbc7c35a63c9d32279e81c1e0e4182036869ef0 100644 >--- a/Source/JavaScriptCore/runtime/CachedTypes.cpp >+++ b/Source/JavaScriptCore/runtime/CachedTypes.cpp >@@ -1226,7 +1226,6 @@ class CachedSourceProviderShape : public CachedObject<Source> { > public: > void encode(Encoder& encoder, const SourceProvider& sourceProvider) > { >- m_validated = sourceProvider.isValid(); > m_sourceOrigin.encode(encoder, sourceProvider.sourceOrigin()); > m_url.encode(encoder, sourceProvider.url()); > m_sourceURLDirective.encode(encoder, sourceProvider.sourceURL()); >@@ -1236,14 +1235,11 @@ class CachedSourceProviderShape : public CachedObject<Source> { > > void decode(Decoder& decoder, SourceProvider& sourceProvider) const > { >- if (m_validated) >- sourceProvider.setValid(); > sourceProvider.setSourceURLDirective(m_sourceURLDirective.decode(decoder)); > sourceProvider.setSourceMappingURLDirective(m_sourceMappingURLDirective.decode(decoder)); > } > > protected: >- bool m_validated : 1; > CachedSourceOrigin m_sourceOrigin; > CachedString m_url; > CachedString m_sourceURLDirective;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193544
:
359464
|
359467
|
359468
|
359469
|
359471
|
359584
|
359587
|
359595
|
359597
|
359599
|
359648
|
359649