Changeset 221404 in webkit for trunk/Source/JavaScriptCore/Scripts
- Timestamp:
- Aug 30, 2017, 3:54:22 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore/Scripts
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py
r221327 r221404 124 124 function_args = { 125 125 'funcName': function.function_name, 126 'overriddenName': function.overridden_name,127 126 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code', 128 127 } 129 128 130 lines.append(" macro(%(codeName)s, %(funcName)s, %(overriddenName)s,s_%(codeName)sLength) \\" % function_args)129 lines.append(" macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args) 131 130 return '\n'.join(lines) 132 131 -
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py
r221327 r221404 91 91 ), 92 92 (["JavaScriptCore", "WebCore"], 93 ("JavaScriptCore", "runtime/IdentifierInlines.h"),94 ),95 (["JavaScriptCore", "WebCore"],96 93 ("JavaScriptCore", "runtime/Intrinsic.h"), 97 94 ), -
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py
r221327 r221404 173 173 function_args = { 174 174 'funcName': function.function_name, 175 'overriddenName': function.overridden_name,176 175 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code', 177 176 } 178 177 179 lines.append(" macro(%(codeName)s, %(funcName)s, %(overriddenName)s,s_%(codeName)sLength) \\" % function_args)178 lines.append(" macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args) 180 179 return '\n'.join(lines) 181 180 -
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py
r221327 r221404 103 103 ), 104 104 (["JavaScriptCore", "WebCore"], 105 ("JavaScriptCore", "runtime/IdentifierInlines.h"),106 ),107 (["JavaScriptCore", "WebCore"],108 105 ("JavaScriptCore", "runtime/Intrinsic.h"), 109 106 ), -
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_model.py
r221327 r221404 43 43 } 44 44 45 functionHeadRegExp = re.compile(r"(?:@[\w|= \[\] \"\.]+\s*\n)*function\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL)45 functionHeadRegExp = re.compile(r"(?:@[\w|=]+\s*\n)*function\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL) 46 46 functionGlobalPrivateRegExp = re.compile(r".*^@globalPrivate", re.MULTILINE | re.DOTALL) 47 47 functionIntrinsicRegExp = re.compile(r".*^@intrinsic=(\w+)", re.MULTILINE | re.DOTALL) 48 48 functionIsConstructorRegExp = re.compile(r".*^@constructor", re.MULTILINE | re.DOTALL) 49 functionIsGetterRegExp = re.compile(r".*^@getter", re.MULTILINE | re.DOTALL)50 49 functionNameRegExp = re.compile(r"function\s+(\w+)\s*\(", re.MULTILINE | re.DOTALL) 51 functionOverriddenNameRegExp = re.compile(r".*^@overriddenName=(\".+\")$", re.MULTILINE | re.DOTALL)52 50 functionParameterFinder = re.compile(r"^function\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.DOTALL) 53 51 … … 100 98 101 99 class BuiltinFunction: 102 def __init__(self, function_name, function_source, parameters, is_constructor, is_global_private, intrinsic , overridden_name):100 def __init__(self, function_name, function_source, parameters, is_constructor, is_global_private, intrinsic): 103 101 self.function_name = function_name 104 102 self.function_source = function_source … … 107 105 self.is_global_private = is_global_private 108 106 self.intrinsic = intrinsic 109 self.overridden_name = overridden_name110 107 self.object = None # Set by the owning BuiltinObject 111 108 … … 120 117 function_source = functionIntrinsicRegExp.sub("", function_source) 121 118 122 overridden_name = None123 overriddenNameMatch = functionOverriddenNameRegExp.search(function_source)124 if overriddenNameMatch:125 overridden_name = overriddenNameMatch.group(1)126 function_source = functionOverriddenNameRegExp.sub("", function_source)127 128 119 if os.getenv("CONFIGURATION", "Debug").startswith("Debug"): 129 120 function_source = lineWithOnlySingleLineCommentRegExp.sub("", function_source) … … 133 124 function_name = functionNameRegExp.findall(function_source)[0] 134 125 is_constructor = functionIsConstructorRegExp.match(function_source) != None 135 is_getter = functionIsGetterRegExp.match(function_source) != None136 126 is_global_private = functionGlobalPrivateRegExp.match(function_source) != None 137 127 parameters = [s.strip() for s in functionParameterFinder.findall(function_source)[0].split(',')] … … 139 129 parameters = [] 140 130 141 if is_getter and not overridden_name: 142 overridden_name = "\"get %s\"" % (function_name) 143 144 if not overridden_name: 145 overridden_name = "static_cast<const char*>(nullptr)" 146 147 return BuiltinFunction(function_name, function_source, parameters, is_constructor, is_global_private, intrinsic, overridden_name) 131 return BuiltinFunction(function_name, function_source, parameters, is_constructor, is_global_private, intrinsic) 148 132 149 133 def __str__(self): -
trunk/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py
r221327 r221404 68 68 69 69 CombinedHeaderStaticMacros = ( 70 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\70 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 71 71 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 72 72 … … 75 75 76 76 SeparateHeaderStaticMacros = ( 77 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\77 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 78 78 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 79 79 … … 83 83 CombinedJSCImplementationStaticMacros = ( 84 84 """ 85 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\85 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 86 86 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ 87 87 {\\ … … 94 94 SeparateJSCImplementationStaticMacros = ( 95 95 """ 96 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\96 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 97 97 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ 98 98 {\\ … … 105 105 CombinedWebCoreImplementationStaticMacros = ( 106 106 """ 107 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\107 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 108 108 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ 109 109 {\\ … … 117 117 SeparateWebCoreImplementationStaticMacros = ( 118 118 """ 119 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \\119 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\ 120 120 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\ 121 121 {\\ … … 133 133 : m_vm(*vm) 134 134 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 135 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))135 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 136 136 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 137 137 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 139 139 } 140 140 141 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \\141 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \\ 142 142 JSC::UnlinkedFunctionExecutable* name##Executable(); \\ 143 143 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 154 154 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 155 155 156 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \\156 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \\ 157 157 JSC::SourceCode m_##name##Source;\\ 158 158 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 162 162 }; 163 163 164 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \\164 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \\ 165 165 inline JSC::UnlinkedFunctionExecutable* ${objectName}BuiltinsWrapper::name##Executable() \\ 166 166 {\\ 167 if (!m_##name##Executable) {\\ 168 JSC::Identifier executableName = functionName##PublicName();\\ 169 if (overriddenName)\\ 170 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\\ 171 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\\ 172 }\\ 167 if (!m_##name##Executable)\\ 168 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\\ 173 169 return m_##name##Executable.get();\\ 174 170 } … … 202 198 inline void ${objectName}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject) 203 199 { 204 #define EXPORT_FUNCTION(codeName, functionName, overriddenName,length)\\205 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create (m_vm, codeName##Generator(m_vm), &globalObject));200 #define EXPORT_FUNCTION(codeName, functionName, length)\\ 201 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject)); 206 202 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(EXPORT_FUNCTION) 207 203 #undef EXPORT_FUNCTION -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js
r221327 r221404 77 77 } 78 78 } 79 80 @overriddenName="[Symbol.match]"81 function match(strArg)82 {83 "use strict";84 85 if (!@isObject(this))86 @throwTypeError("RegExp.prototype.@@match requires that |this| be an Object");87 88 let regexp = this;89 90 // Check for observable side effects and call the fast path if there aren't any.91 if (!@hasObservableSideEffectsForRegExpMatch(regexp))92 return @regExpMatchFast.@call(regexp, strArg);93 94 let str = @toString(strArg);95 96 if (!regexp.global)97 return @regExpExec(regexp, str);98 99 let unicode = regexp.unicode;100 regexp.lastIndex = 0;101 let resultList = [];102 103 // FIXME: It would be great to implement a solution similar to what we do in104 // RegExpObject::matchGlobal(). It's not clear if this is possible, since this loop has105 // effects. https://bugs.webkit.org/show_bug.cgi?id=158145106 const maximumReasonableMatchSize = 100000000;107 108 while (true) {109 let result = @regExpExec(regexp, str);110 111 if (result === null) {112 if (resultList.length === 0)113 return null;114 return resultList;115 }116 117 if (resultList.length > maximumReasonableMatchSize)118 @throwOutOfMemoryError();119 120 if (!@isObject(result))121 @throwTypeError("RegExp.prototype.@@match call to RegExp.exec didn't return null or an object");122 123 let resultString = @toString(result[0]);124 125 if (!resultString.length)126 regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);127 128 resultList.@push(resultString);129 }130 }131 132 @intrinsic=RegExpTestIntrinsic133 function test(strArg)134 {135 "use strict";136 137 let regexp = this;138 139 // Check for observable side effects and call the fast path if there aren't any.140 if (@isRegExpObject(regexp) && @tryGetById(regexp, "exec") === @regExpBuiltinExec)141 return @regExpTestFast.@call(regexp, strArg);142 143 // 1. Let R be the this value.144 // 2. If Type(R) is not Object, throw a TypeError exception.145 if (!@isObject(regexp))146 @throwTypeError("RegExp.prototype.test requires that |this| be an Object");147 148 // 3. Let string be ? ToString(S).149 let str = @toString(strArg);150 151 // 4. Let match be ? RegExpExec(R, string).152 let match = @regExpExec(regexp, str);153 154 // 5. If match is not null, return true; else return false.155 if (match !== null)156 return true;157 return false;158 } -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Separate.js
r221327 r221404 77 77 } 78 78 } 79 80 @overriddenName="[Symbol.match]"81 function match(strArg)82 {83 "use strict";84 85 if (!@isObject(this))86 @throwTypeError("RegExp.prototype.@@match requires that |this| be an Object");87 88 let regexp = this;89 90 // Check for observable side effects and call the fast path if there aren't any.91 if (!@hasObservableSideEffectsForRegExpMatch(regexp))92 return @regExpMatchFast.@call(regexp, strArg);93 94 let str = @toString(strArg);95 96 if (!regexp.global)97 return @regExpExec(regexp, str);98 99 let unicode = regexp.unicode;100 regexp.lastIndex = 0;101 let resultList = [];102 103 // FIXME: It would be great to implement a solution similar to what we do in104 // RegExpObject::matchGlobal(). It's not clear if this is possible, since this loop has105 // effects. https://bugs.webkit.org/show_bug.cgi?id=158145106 const maximumReasonableMatchSize = 100000000;107 108 while (true) {109 let result = @regExpExec(regexp, str);110 111 if (result === null) {112 if (resultList.length === 0)113 return null;114 return resultList;115 }116 117 if (resultList.length > maximumReasonableMatchSize)118 @throwOutOfMemoryError();119 120 if (!@isObject(result))121 @throwTypeError("RegExp.prototype.@@match call to RegExp.exec didn't return null or an object");122 123 let resultString = @toString(result[0]);124 125 if (!resultString.length)126 regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);127 128 resultList.@push(resultString);129 }130 }131 132 @intrinsic=RegExpTestIntrinsic133 function test(strArg)134 {135 "use strict";136 137 let regexp = this;138 139 // Check for observable side effects and call the fast path if there aren't any.140 if (@isRegExpObject(regexp) && @tryGetById(regexp, "exec") === @regExpBuiltinExec)141 return @regExpTestFast.@call(regexp, strArg);142 143 // 1. Let R be the this value.144 // 2. If Type(R) is not Object, throw a TypeError exception.145 if (!@isObject(regexp))146 @throwTypeError("RegExp.prototype.test requires that |this| be an Object");147 148 // 3. Let string be ? ToString(S).149 let str = @toString(strArg);150 151 // 4. Let match be ? RegExpExec(R, string).152 let match = @regExpExec(regexp, str);153 154 // 5. If match is not null, return true; else return false.155 if (match !== null)156 return true;157 return false;158 } -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result
r221327 r221404 54 54 55 55 #define JSC_FOREACH_BUILTIN_CODE(macro) \ 56 macro(builtinPromiseRejectPromiseCode, rejectPromise, s tatic_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \57 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s tatic_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \56 macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \ 57 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \ 58 58 59 59 #define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \ … … 63 63 #define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \ 64 64 65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 66 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 67 67 … … 108 108 #include "BuiltinExecutables.h" 109 109 #include "HeapInlines.h" 110 #include "IdentifierInlines.h"111 110 #include "Intrinsic.h" 112 111 #include "JSCellInlines.h" … … 151 150 152 151 153 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \152 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 154 153 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 155 154 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result
r221327 r221404 56 56 57 57 #define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(macro) \ 58 macro(builtinPromiseRejectPromiseCode, rejectPromise, s tatic_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \59 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s tatic_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \58 macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \ 59 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \ 60 60 61 61 #define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_FUNCTION_NAME(macro) \ … … 63 63 macro(rejectPromise) \ 64 64 65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 66 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 67 67 … … 108 108 #include "BuiltinExecutables.h" 109 109 #include "HeapInlines.h" 110 #include "IdentifierInlines.h"111 110 #include "Intrinsic.h" 112 111 #include "JSCellInlines.h" … … 150 149 151 150 152 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \151 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 153 152 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 154 153 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result
r221327 r221404 48 48 extern const int s_builtinPrototypeForEachCodeLength; 49 49 extern const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility; 50 extern const char* s_builtinPrototypeMatchCode;51 extern const int s_builtinPrototypeMatchCodeLength;52 extern const JSC::ConstructAbility s_builtinPrototypeMatchCodeConstructAbility;53 extern const char* s_builtinPrototypeTestCode;54 extern const int s_builtinPrototypeTestCodeLength;55 extern const JSC::ConstructAbility s_builtinPrototypeTestCodeConstructAbility;56 50 57 51 #define JSC_FOREACH_BUILTINPROTOTYPE_BUILTIN_DATA(macro) \ 58 52 macro(every, builtinPrototypeEvery, 1) \ 59 53 macro(forEach, builtinPrototypeForEach, 1) \ 60 macro(match, builtinPrototypeMatch, 1) \61 macro(test, builtinPrototypeTest, 1) \62 54 63 55 #define JSC_FOREACH_BUILTIN_CODE(macro) \ 64 macro(builtinPrototypeEveryCode, every, static_cast<const char*>(nullptr), s_builtinPrototypeEveryCodeLength) \ 65 macro(builtinPrototypeForEachCode, forEach, static_cast<const char*>(nullptr), s_builtinPrototypeForEachCodeLength) \ 66 macro(builtinPrototypeMatchCode, match, "[Symbol.match]", s_builtinPrototypeMatchCodeLength) \ 67 macro(builtinPrototypeTestCode, test, static_cast<const char*>(nullptr), s_builtinPrototypeTestCodeLength) \ 56 macro(builtinPrototypeEveryCode, every, s_builtinPrototypeEveryCodeLength) \ 57 macro(builtinPrototypeForEachCode, forEach, s_builtinPrototypeForEachCodeLength) \ 68 58 69 59 #define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \ 70 60 macro(every) \ 71 61 macro(forEach) \ 72 macro(match) \73 macro(test) \74 62 75 63 #define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \ 76 64 77 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 78 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 79 67 … … 120 108 #include "BuiltinExecutables.h" 121 109 #include "HeapInlines.h" 122 #include "IdentifierInlines.h"123 110 #include "Intrinsic.h" 124 111 #include "JSCellInlines.h" … … 186 173 ; 187 174 188 const JSC::ConstructAbility s_builtinPrototypeMatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;189 const int s_builtinPrototypeMatchCodeLength = 1198;190 static const JSC::Intrinsic s_builtinPrototypeMatchCodeIntrinsic = JSC::NoIntrinsic;191 const char* s_builtinPrototypeMatchCode =192 "(function (strArg)\n" \193 "{\n" \194 " \"use strict\";\n" \195 " if (!@isObject(this))\n" \196 " @throwTypeError(\"RegExp.prototype.@@match requires that |this| be an Object\");\n" \197 " let regexp = this;\n" \198 " if (!@hasObservableSideEffectsForRegExpMatch(regexp))\n" \199 " return @regExpMatchFast.@call(regexp, strArg);\n" \200 " let str = @toString(strArg);\n" \201 " if (!regexp.global)\n" \202 " return @regExpExec(regexp, str);\n" \203 " \n" \204 " let unicode = regexp.unicode;\n" \205 " regexp.lastIndex = 0;\n" \206 " let resultList = [];\n" \207 " const maximumReasonableMatchSize = 100000000;\n" \208 " while (true) {\n" \209 " let result = @regExpExec(regexp, str);\n" \210 " \n" \211 " if (result === null) {\n" \212 " if (resultList.length === 0)\n" \213 " return null;\n" \214 " return resultList;\n" \215 " }\n" \216 " if (resultList.length > maximumReasonableMatchSize)\n" \217 " @throwOutOfMemoryError();\n" \218 " if (!@isObject(result))\n" \219 " @throwTypeError(\"RegExp.prototype.@@match call to RegExp.exec didn't return null or an object\");\n" \220 " let resultString = @toString(result[0]);\n" \221 " if (!resultString.length)\n" \222 " regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);\n" \223 " resultList.@push(resultString);\n" \224 " }\n" \225 "})\n" \226 ;227 175 228 const JSC::ConstructAbility s_builtinPrototypeTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; 229 const int s_builtinPrototypeTestCodeLength = 456; 230 static const JSC::Intrinsic s_builtinPrototypeTestCodeIntrinsic = JSC::RegExpTestIntrinsic; 231 const char* s_builtinPrototypeTestCode = 232 "(function (strArg)\n" \ 233 "{\n" \ 234 " \"use strict\";\n" \ 235 " let regexp = this;\n" \ 236 " if (@isRegExpObject(regexp) && @tryGetById(regexp, \"exec\") === @regExpBuiltinExec)\n" \ 237 " return @regExpTestFast.@call(regexp, strArg);\n" \ 238 " if (!@isObject(regexp))\n" \ 239 " @throwTypeError(\"RegExp.prototype.test requires that |this| be an Object\");\n" \ 240 " let str = @toString(strArg);\n" \ 241 " let match = @regExpExec(regexp, str);\n" \ 242 " if (match !== null)\n" \ 243 " return true;\n" \ 244 " return false;\n" \ 245 "})\n" \ 246 ; 247 248 249 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ 176 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 250 177 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 251 178 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result
r221327 r221404 47 47 extern const int s_builtinPrototypeForEachCodeLength; 48 48 extern const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility; 49 extern const char* s_builtinPrototypeMatchCode;50 extern const int s_builtinPrototypeMatchCodeLength;51 extern const JSC::ConstructAbility s_builtinPrototypeMatchCodeConstructAbility;52 extern const char* s_builtinPrototypeTestCode;53 extern const int s_builtinPrototypeTestCodeLength;54 extern const JSC::ConstructAbility s_builtinPrototypeTestCodeConstructAbility;55 49 56 50 #define JSC_FOREACH_BUILTIN_PROTOTYPE_BUILTIN_DATA(macro) \ 57 51 macro(every, builtinPrototypeEvery, 1) \ 58 52 macro(forEach, builtinPrototypeForEach, 1) \ 59 macro(match, builtinPrototypeMatch, 1) \60 macro(test, builtinPrototypeTest, 1) \61 53 62 54 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_EVERY 1 63 55 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_FOREACH 1 64 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_MATCH 165 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_TEST 166 56 67 57 #define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(macro) \ 68 macro(builtinPrototypeEveryCode, every, static_cast<const char*>(nullptr), s_builtinPrototypeEveryCodeLength) \ 69 macro(builtinPrototypeForEachCode, forEach, static_cast<const char*>(nullptr), s_builtinPrototypeForEachCodeLength) \ 70 macro(builtinPrototypeMatchCode, match, "[Symbol.match]", s_builtinPrototypeMatchCodeLength) \ 71 macro(builtinPrototypeTestCode, test, static_cast<const char*>(nullptr), s_builtinPrototypeTestCodeLength) \ 58 macro(builtinPrototypeEveryCode, every, s_builtinPrototypeEveryCodeLength) \ 59 macro(builtinPrototypeForEachCode, forEach, s_builtinPrototypeForEachCodeLength) \ 72 60 73 61 #define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \ 74 62 macro(every) \ 75 63 macro(forEach) \ 76 macro(match) \77 macro(test) \78 64 79 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 80 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 81 67 … … 122 108 #include "BuiltinExecutables.h" 123 109 #include "HeapInlines.h" 124 #include "IdentifierInlines.h"125 110 #include "Intrinsic.h" 126 111 #include "JSCellInlines.h" … … 187 172 ; 188 173 189 const JSC::ConstructAbility s_builtinPrototypeMatchCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;190 const int s_builtinPrototypeMatchCodeLength = 1198;191 static const JSC::Intrinsic s_builtinPrototypeMatchCodeIntrinsic = JSC::NoIntrinsic;192 const char* s_builtinPrototypeMatchCode =193 "(function (strArg)\n" \194 "{\n" \195 " \"use strict\";\n" \196 " if (!@isObject(this))\n" \197 " @throwTypeError(\"RegExp.prototype.@@match requires that |this| be an Object\");\n" \198 " let regexp = this;\n" \199 " if (!@hasObservableSideEffectsForRegExpMatch(regexp))\n" \200 " return @regExpMatchFast.@call(regexp, strArg);\n" \201 " let str = @toString(strArg);\n" \202 " if (!regexp.global)\n" \203 " return @regExpExec(regexp, str);\n" \204 " \n" \205 " let unicode = regexp.unicode;\n" \206 " regexp.lastIndex = 0;\n" \207 " let resultList = [];\n" \208 " const maximumReasonableMatchSize = 100000000;\n" \209 " while (true) {\n" \210 " let result = @regExpExec(regexp, str);\n" \211 " \n" \212 " if (result === null) {\n" \213 " if (resultList.length === 0)\n" \214 " return null;\n" \215 " return resultList;\n" \216 " }\n" \217 " if (resultList.length > maximumReasonableMatchSize)\n" \218 " @throwOutOfMemoryError();\n" \219 " if (!@isObject(result))\n" \220 " @throwTypeError(\"RegExp.prototype.@@match call to RegExp.exec didn't return null or an object\");\n" \221 " let resultString = @toString(result[0]);\n" \222 " if (!resultString.length)\n" \223 " regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);\n" \224 " resultList.@push(resultString);\n" \225 " }\n" \226 "})\n" \227 ;228 174 229 const JSC::ConstructAbility s_builtinPrototypeTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; 230 const int s_builtinPrototypeTestCodeLength = 456; 231 static const JSC::Intrinsic s_builtinPrototypeTestCodeIntrinsic = JSC::RegExpTestIntrinsic; 232 const char* s_builtinPrototypeTestCode = 233 "(function (strArg)\n" \ 234 "{\n" \ 235 " \"use strict\";\n" \ 236 " let regexp = this;\n" \ 237 " if (@isRegExpObject(regexp) && @tryGetById(regexp, \"exec\") === @regExpBuiltinExec)\n" \ 238 " return @regExpTestFast.@call(regexp, strArg);\n" \ 239 " if (!@isObject(regexp))\n" \ 240 " @throwTypeError(\"RegExp.prototype.test requires that |this| be an Object\");\n" \ 241 " let str = @toString(strArg);\n" \ 242 " let match = @regExpExec(regexp, str);\n" \ 243 " if (match !== null)\n" \ 244 " return true;\n" \ 245 " return false;\n" \ 246 "})\n" \ 247 ; 248 249 250 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ 175 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 251 176 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 252 177 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result
r221327 r221404 53 53 54 54 #define JSC_FOREACH_BUILTIN_CODE(macro) \ 55 macro(builtinConstructorOfCode, of, s tatic_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \56 macro(builtinConstructorFromCode, from, s tatic_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \55 macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \ 56 macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \ 57 57 58 58 #define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \ … … 62 62 #define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \ 63 63 64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 65 65 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 66 66 … … 106 106 #include "BuiltinExecutables.h" 107 107 #include "HeapInlines.h" 108 #include "IdentifierInlines.h"109 108 #include "Intrinsic.h" 110 109 #include "JSCellInlines.h" … … 188 187 189 188 190 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \189 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 191 190 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 192 191 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result
r221327 r221404 55 55 56 56 #define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(macro) \ 57 macro(builtinConstructorOfCode, of, s tatic_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \58 macro(builtinConstructorFromCode, from, s tatic_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \57 macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \ 58 macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \ 59 59 60 60 #define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \ … … 62 62 macro(of) \ 63 63 64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 65 65 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 66 66 … … 106 106 #include "BuiltinExecutables.h" 107 107 #include "HeapInlines.h" 108 #include "IdentifierInlines.h"109 108 #include "Intrinsic.h" 110 109 #include "JSCellInlines.h" … … 187 186 188 187 189 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \188 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 190 189 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 191 190 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result
r221327 r221404 54 54 55 55 #define JSC_FOREACH_BUILTIN_CODE(macro) \ 56 macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \57 macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \56 macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s_internalClashingNamesIsReadableStreamLockedCodeLength) \ 57 macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s_internalClashingNamesIsReadableStreamLockedCodeLength) \ 58 58 59 59 #define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \ … … 62 62 #define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \ 63 63 64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 65 65 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 66 66 … … 107 107 #include "BuiltinExecutables.h" 108 108 #include "HeapInlines.h" 109 #include "IdentifierInlines.h"110 109 #include "Intrinsic.h" 111 110 #include "JSCellInlines.h" … … 138 137 139 138 140 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \139 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 141 140 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 142 141 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result
r221327 r221404 55 55 56 56 #define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \ 57 macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, s tatic_cast<const char*>(nullptr), s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \57 macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \ 58 58 59 59 #define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \ 60 60 macro(letsFetch) \ 61 61 62 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \62 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 63 63 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 64 64 … … 71 71 : m_vm(*vm) 72 72 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 73 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))73 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 74 74 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 75 75 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 77 77 } 78 78 79 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \79 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 80 80 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 81 81 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 92 92 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 93 93 94 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \94 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 95 95 JSC::SourceCode m_##name##Source;\ 96 96 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 100 100 }; 101 101 102 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \102 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 103 103 inline JSC::UnlinkedFunctionExecutable* AnotherGuardedInternalBuiltinBuiltinsWrapper::name##Executable() \ 104 104 {\ 105 if (!m_##name##Executable) {\ 106 JSC::Identifier executableName = functionName##PublicName();\ 107 if (overriddenName)\ 108 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 109 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 110 }\ 105 if (!m_##name##Executable)\ 106 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 111 107 return m_##name##Executable.get();\ 112 108 } … … 139 135 inline void AnotherGuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) 140 136 { 141 #define EXPORT_FUNCTION(codeName, functionName, overriddenName,length)\142 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create (m_vm, codeName##Generator(m_vm), &globalObject));137 #define EXPORT_FUNCTION(codeName, functionName, length)\ 138 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject)); 143 139 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION) 144 140 #undef EXPORT_FUNCTION … … 195 191 #include "WebCoreJSClientData.h" 196 192 #include <heap/HeapInlines.h> 197 #include <runtime/IdentifierInlines.h>198 193 #include <runtime/Intrinsic.h> 199 194 #include <runtime/JSCJSValueInlines.h> … … 216 211 217 212 218 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \213 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 219 214 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 220 215 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result
r221327 r221404 56 56 57 57 #define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(macro) \ 58 macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \58 macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \ 59 59 60 60 #define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(macro) \ 61 61 macro(isReadableStreamLocked) \ 62 62 63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 64 64 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 65 65 … … 72 72 : m_vm(*vm) 73 73 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 75 75 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 76 76 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 78 78 } 79 79 80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 81 81 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 82 82 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 93 93 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 94 94 95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 96 96 JSC::SourceCode m_##name##Source;\ 97 97 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 101 101 }; 102 102 103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 104 104 inline JSC::UnlinkedFunctionExecutable* ArbitraryConditionalGuardBuiltinsWrapper::name##Executable() \ 105 105 {\ 106 if (!m_##name##Executable) {\ 107 JSC::Identifier executableName = functionName##PublicName();\ 108 if (overriddenName)\ 109 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 110 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 111 }\ 106 if (!m_##name##Executable)\ 107 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 112 108 return m_##name##Executable.get();\ 113 109 } … … 165 161 #include "WebCoreJSClientData.h" 166 162 #include <heap/HeapInlines.h> 167 #include <runtime/IdentifierInlines.h>168 163 #include <runtime/Intrinsic.h> 169 164 #include <runtime/JSCJSValueInlines.h> … … 186 181 187 182 188 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \183 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 189 184 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 190 185 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result
r221327 r221404 56 56 57 57 #define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(macro) \ 58 macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_guardedBuiltinIsReadableStreamLockedCodeLength) \58 macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedBuiltinIsReadableStreamLockedCodeLength) \ 59 59 60 60 #define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \ 61 61 macro(isReadableStreamLocked) \ 62 62 63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 64 64 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 65 65 … … 72 72 : m_vm(*vm) 73 73 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 75 75 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 76 76 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 78 78 } 79 79 80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 81 81 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 82 82 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 93 93 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 94 94 95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 96 96 JSC::SourceCode m_##name##Source;\ 97 97 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 101 101 }; 102 102 103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 104 104 inline JSC::UnlinkedFunctionExecutable* GuardedBuiltinBuiltinsWrapper::name##Executable() \ 105 105 {\ 106 if (!m_##name##Executable) {\ 107 JSC::Identifier executableName = functionName##PublicName();\ 108 if (overriddenName)\ 109 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 110 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 111 }\ 106 if (!m_##name##Executable)\ 107 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 112 108 return m_##name##Executable.get();\ 113 109 } … … 165 161 #include "WebCoreJSClientData.h" 166 162 #include <heap/HeapInlines.h> 167 #include <runtime/IdentifierInlines.h>168 163 #include <runtime/Intrinsic.h> 169 164 #include <runtime/JSCJSValueInlines.h> … … 186 181 187 182 188 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \183 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 189 184 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 190 185 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result
r221327 r221404 56 56 57 57 #define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \ 58 macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \58 macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \ 59 59 60 60 #define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \ 61 61 macro(isReadableStreamLocked) \ 62 62 63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 64 64 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 65 65 … … 72 72 : m_vm(*vm) 73 73 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))74 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 75 75 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 76 76 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 78 78 } 79 79 80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 81 81 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 82 82 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 93 93 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 94 94 95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 96 96 JSC::SourceCode m_##name##Source;\ 97 97 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 101 101 }; 102 102 103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 104 104 inline JSC::UnlinkedFunctionExecutable* GuardedInternalBuiltinBuiltinsWrapper::name##Executable() \ 105 105 {\ 106 if (!m_##name##Executable) {\ 107 JSC::Identifier executableName = functionName##PublicName();\ 108 if (overriddenName)\ 109 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 110 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 111 }\ 106 if (!m_##name##Executable)\ 107 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 112 108 return m_##name##Executable.get();\ 113 109 } … … 140 136 inline void GuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) 141 137 { 142 #define EXPORT_FUNCTION(codeName, functionName, overriddenName,length)\143 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create (m_vm, codeName##Generator(m_vm), &globalObject));138 #define EXPORT_FUNCTION(codeName, functionName, length)\ 139 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject)); 144 140 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION) 145 141 #undef EXPORT_FUNCTION … … 197 193 #include "WebCoreJSClientData.h" 198 194 #include <heap/HeapInlines.h> 199 #include <runtime/IdentifierInlines.h>200 195 #include <runtime/Intrinsic.h> 201 196 #include <runtime/JSCJSValueInlines.h> … … 218 213 219 214 220 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \215 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 221 216 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 222 217 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result
r221327 r221404 54 54 55 55 #define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(macro) \ 56 macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s tatic_cast<const char*>(nullptr), s_unguardedBuiltinIsReadableStreamLockedCodeLength) \56 macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_unguardedBuiltinIsReadableStreamLockedCodeLength) \ 57 57 58 58 #define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \ 59 59 macro(isReadableStreamLocked) \ 60 60 61 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \61 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 62 62 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 63 63 … … 70 70 : m_vm(*vm) 71 71 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 72 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))72 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 73 73 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 74 74 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 76 76 } 77 77 78 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \78 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 79 79 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 80 80 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 91 91 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 92 92 93 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \93 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 94 94 JSC::SourceCode m_##name##Source;\ 95 95 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 99 99 }; 100 100 101 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \101 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 102 102 inline JSC::UnlinkedFunctionExecutable* UnguardedBuiltinBuiltinsWrapper::name##Executable() \ 103 103 {\ 104 if (!m_##name##Executable) {\ 105 JSC::Identifier executableName = functionName##PublicName();\ 106 if (overriddenName)\ 107 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 108 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 109 }\ 104 if (!m_##name##Executable)\ 105 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 110 106 return m_##name##Executable.get();\ 111 107 } … … 159 155 #include "WebCoreJSClientData.h" 160 156 #include <heap/HeapInlines.h> 161 #include <runtime/IdentifierInlines.h>162 157 #include <runtime/Intrinsic.h> 163 158 #include <runtime/JSCJSValueInlines.h> … … 180 175 181 176 182 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \177 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 183 178 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 184 179 {\ -
trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result
r221327 r221404 66 66 67 67 #define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(macro) \ 68 macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, s tatic_cast<const char*>(nullptr), s_xmlCasingTestXMLCasingTestCodeLength) \69 macro(xmlCasingTestCssCasingTestCode, cssCasingTest, s tatic_cast<const char*>(nullptr), s_xmlCasingTestCssCasingTestCodeLength) \70 macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, s tatic_cast<const char*>(nullptr), s_xmlCasingTestUrlCasingTestCodeLength) \68 macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, s_xmlCasingTestXMLCasingTestCodeLength) \ 69 macro(xmlCasingTestCssCasingTestCode, cssCasingTest, s_xmlCasingTestCssCasingTestCodeLength) \ 70 macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, s_xmlCasingTestUrlCasingTestCodeLength) \ 71 71 72 72 #define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(macro) \ … … 75 75 macro(xmlCasingTest) \ 76 76 77 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \77 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 78 78 JSC::FunctionExecutable* codeName##Generator(JSC::VM&); 79 79 … … 86 86 : m_vm(*vm) 87 87 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) 88 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { }))88 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length), { })) 89 89 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) 90 90 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS … … 92 92 } 93 93 94 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \94 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ 95 95 JSC::UnlinkedFunctionExecutable* name##Executable(); \ 96 96 const JSC::SourceCode& name##Source() const { return m_##name##Source; } … … 107 107 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) 108 108 109 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName,length) \109 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \ 110 110 JSC::SourceCode m_##name##Source;\ 111 111 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable; … … 115 115 }; 116 116 117 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName,length) \117 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \ 118 118 inline JSC::UnlinkedFunctionExecutable* xmlCasingTestBuiltinsWrapper::name##Executable() \ 119 119 {\ 120 if (!m_##name##Executable) {\ 121 JSC::Identifier executableName = functionName##PublicName();\ 122 if (overriddenName)\ 123 executableName = JSC::Identifier::fromString(&m_vm, overriddenName);\ 124 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ConstructAbility), this, &m_##name##Executable);\ 125 }\ 120 if (!m_##name##Executable)\ 121 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\ 126 122 return m_##name##Executable.get();\ 127 123 } … … 154 150 inline void xmlCasingTestBuiltinFunctions::init(JSC::JSGlobalObject& globalObject) 155 151 { 156 #define EXPORT_FUNCTION(codeName, functionName, overriddenName,length)\157 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::create (m_vm, codeName##Generator(m_vm), &globalObject));152 #define EXPORT_FUNCTION(codeName, functionName, length)\ 153 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject)); 158 154 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(EXPORT_FUNCTION) 159 155 #undef EXPORT_FUNCTION … … 211 207 #include "WebCoreJSClientData.h" 212 208 #include <heap/HeapInlines.h> 213 #include <runtime/IdentifierInlines.h>214 209 #include <runtime/Intrinsic.h> 215 210 #include <runtime/JSCJSValueInlines.h> … … 269 264 270 265 271 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName,argumentCount) \266 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \ 272 267 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ 273 268 {\
Note:
See TracChangeset
for help on using the changeset viewer.