Ignore:
Timestamp:
Aug 30, 2017, 3:54:22 PM (8 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r221327.

This change caused test262 failures.

Reverted changeset:

"[JSC] Use reifying system for "name" property of builtin
JSFunction"
https://bugs.webkit.org/show_bug.cgi?id=175260
http://trac.webkit.org/changeset/221327

Location:
trunk/Source/JavaScriptCore/Scripts
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py

    r221327 r221404  
    124124            function_args = {
    125125                'funcName': function.function_name,
    126                 'overriddenName': function.overridden_name,
    127126                'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
    128127            }
    129128
    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)
    131130        return '\n'.join(lines)
    132131
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py

    r221327 r221404  
    9191            ),
    9292            (["JavaScriptCore", "WebCore"],
    93                 ("JavaScriptCore", "runtime/IdentifierInlines.h"),
    94             ),
    95             (["JavaScriptCore", "WebCore"],
    9693                ("JavaScriptCore", "runtime/Intrinsic.h"),
    9794            ),
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py

    r221327 r221404  
    173173            function_args = {
    174174                'funcName': function.function_name,
    175                 'overriddenName': function.overridden_name,
    176175                'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
    177176            }
    178177
    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)
    180179        return '\n'.join(lines)
    181180
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py

    r221327 r221404  
    103103            ),
    104104            (["JavaScriptCore", "WebCore"],
    105                 ("JavaScriptCore", "runtime/IdentifierInlines.h"),
    106             ),
    107             (["JavaScriptCore", "WebCore"],
    108105                ("JavaScriptCore", "runtime/Intrinsic.h"),
    109106            ),
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_model.py

    r221327 r221404  
    4343}
    4444
    45 functionHeadRegExp = re.compile(r"(?:@[\w|=\[\] \"\.]+\s*\n)*function\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL)
     45functionHeadRegExp = re.compile(r"(?:@[\w|=]+\s*\n)*function\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL)
    4646functionGlobalPrivateRegExp = re.compile(r".*^@globalPrivate", re.MULTILINE | re.DOTALL)
    4747functionIntrinsicRegExp = re.compile(r".*^@intrinsic=(\w+)", re.MULTILINE | re.DOTALL)
    4848functionIsConstructorRegExp = re.compile(r".*^@constructor", re.MULTILINE | re.DOTALL)
    49 functionIsGetterRegExp = re.compile(r".*^@getter", re.MULTILINE | re.DOTALL)
    5049functionNameRegExp = re.compile(r"function\s+(\w+)\s*\(", re.MULTILINE | re.DOTALL)
    51 functionOverriddenNameRegExp = re.compile(r".*^@overriddenName=(\".+\")$", re.MULTILINE | re.DOTALL)
    5250functionParameterFinder = re.compile(r"^function\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.DOTALL)
    5351
     
    10098
    10199class 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):
    103101        self.function_name = function_name
    104102        self.function_source = function_source
     
    107105        self.is_global_private = is_global_private
    108106        self.intrinsic = intrinsic
    109         self.overridden_name = overridden_name
    110107        self.object = None  # Set by the owning BuiltinObject
    111108
     
    120117            function_source = functionIntrinsicRegExp.sub("", function_source)
    121118
    122         overridden_name = None
    123         overriddenNameMatch = functionOverriddenNameRegExp.search(function_source)
    124         if overriddenNameMatch:
    125             overridden_name = overriddenNameMatch.group(1)
    126             function_source = functionOverriddenNameRegExp.sub("", function_source)
    127 
    128119        if os.getenv("CONFIGURATION", "Debug").startswith("Debug"):
    129120            function_source = lineWithOnlySingleLineCommentRegExp.sub("", function_source)
     
    133124        function_name = functionNameRegExp.findall(function_source)[0]
    134125        is_constructor = functionIsConstructorRegExp.match(function_source) != None
    135         is_getter = functionIsGetterRegExp.match(function_source) != None
    136126        is_global_private = functionGlobalPrivateRegExp.match(function_source) != None
    137127        parameters = [s.strip() for s in functionParameterFinder.findall(function_source)[0].split(',')]
     
    139129            parameters = []
    140130
    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)
    148132
    149133    def __str__(self):
  • trunk/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py

    r221327 r221404  
    6868
    6969    CombinedHeaderStaticMacros = (
    70     """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     70    """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    7171    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    7272
     
    7575
    7676    SeparateHeaderStaticMacros = (
    77     """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     77    """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    7878    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    7979
     
    8383    CombinedJSCImplementationStaticMacros = (
    8484    """
    85 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     85#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    8686JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
    8787{\\
     
    9494    SeparateJSCImplementationStaticMacros = (
    9595    """
    96 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     96#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    9797JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
    9898{\\
     
    105105    CombinedWebCoreImplementationStaticMacros = (
    106106        """
    107 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     107#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    108108JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
    109109{\\
     
    117117    SeparateWebCoreImplementationStaticMacros = (
    118118        """
    119 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \\
     119#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
    120120JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
    121121{\\
     
    133133        : m_vm(*vm)
    134134        ${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), { }))
    136136        ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    137137#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    139139    }
    140140
    141 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \\
     141#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \\
    142142    JSC::UnlinkedFunctionExecutable* name##Executable(); \\
    143143    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    154154    ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    155155
    156 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \\
     156#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \\
    157157    JSC::SourceCode m_##name##Source;\\
    158158    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    162162};
    163163
    164 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \\
     164#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \\
    165165inline JSC::UnlinkedFunctionExecutable* ${objectName}BuiltinsWrapper::name##Executable() \\
    166166{\\
    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);\\
    173169    return m_##name##Executable.get();\\
    174170}
     
    202198inline void ${objectName}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
    203199{
    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));
    206202    ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(EXPORT_FUNCTION)
    207203#undef EXPORT_FUNCTION
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js

    r221327 r221404  
    7777    }
    7878}
    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 in
    104     // RegExpObject::matchGlobal(). It's not clear if this is possible, since this loop has
    105     // effects. https://bugs.webkit.org/show_bug.cgi?id=158145
    106     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=RegExpTestIntrinsic
    133 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  
    7777    }
    7878}
    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 in
    104     // RegExpObject::matchGlobal(). It's not clear if this is possible, since this loop has
    105     // effects. https://bugs.webkit.org/show_bug.cgi?id=158145
    106     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=RegExpTestIntrinsic
    133 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  
    5454
    5555#define JSC_FOREACH_BUILTIN_CODE(macro) \
    56     macro(builtinPromiseRejectPromiseCode, rejectPromise, static_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \
    57     macro(builtinPromiseFulfillPromiseCode, fulfillPromise, static_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \
     56    macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \
     57    macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \
    5858
    5959#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
     
    6363#define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \
    6464
    65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6666    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6767
     
    108108#include "BuiltinExecutables.h"
    109109#include "HeapInlines.h"
    110 #include "IdentifierInlines.h"
    111110#include "Intrinsic.h"
    112111#include "JSCellInlines.h"
     
    151150
    152151
    153 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     152#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    154153JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    155154{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result

    r221327 r221404  
    5656
    5757#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(macro) \
    58     macro(builtinPromiseRejectPromiseCode, rejectPromise, static_cast<const char*>(nullptr), s_builtinPromiseRejectPromiseCodeLength) \
    59     macro(builtinPromiseFulfillPromiseCode, fulfillPromise, static_cast<const char*>(nullptr), s_builtinPromiseFulfillPromiseCodeLength) \
     58    macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \
     59    macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \
    6060
    6161#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_FUNCTION_NAME(macro) \
     
    6363    macro(rejectPromise) \
    6464
    65 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6666    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6767
     
    108108#include "BuiltinExecutables.h"
    109109#include "HeapInlines.h"
    110 #include "IdentifierInlines.h"
    111110#include "Intrinsic.h"
    112111#include "JSCellInlines.h"
     
    150149
    151150
    152 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     151#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    153152JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    154153{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result

    r221327 r221404  
    4848extern const int s_builtinPrototypeForEachCodeLength;
    4949extern 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;
    5650
    5751#define JSC_FOREACH_BUILTINPROTOTYPE_BUILTIN_DATA(macro) \
    5852    macro(every, builtinPrototypeEvery, 1) \
    5953    macro(forEach, builtinPrototypeForEach, 1) \
    60     macro(match, builtinPrototypeMatch, 1) \
    61     macro(test, builtinPrototypeTest, 1) \
    6254
    6355#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) \
    6858
    6959#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
    7060    macro(every) \
    7161    macro(forEach) \
    72     macro(match) \
    73     macro(test) \
    7462
    7563#define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \
    7664
    77 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    7866    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    7967
     
    120108#include "BuiltinExecutables.h"
    121109#include "HeapInlines.h"
    122 #include "IdentifierInlines.h"
    123110#include "Intrinsic.h"
    124111#include "JSCellInlines.h"
     
    186173;
    187174
    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 ;
    227175
    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) \
    250177JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    251178{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result

    r221327 r221404  
    4747extern const int s_builtinPrototypeForEachCodeLength;
    4848extern 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;
    5549
    5650#define JSC_FOREACH_BUILTIN_PROTOTYPE_BUILTIN_DATA(macro) \
    5751    macro(every, builtinPrototypeEvery, 1) \
    5852    macro(forEach, builtinPrototypeForEach, 1) \
    59     macro(match, builtinPrototypeMatch, 1) \
    60     macro(test, builtinPrototypeTest, 1) \
    6153
    6254#define JSC_BUILTIN_BUILTIN_PROTOTYPE_EVERY 1
    6355#define JSC_BUILTIN_BUILTIN_PROTOTYPE_FOREACH 1
    64 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_MATCH 1
    65 #define JSC_BUILTIN_BUILTIN_PROTOTYPE_TEST 1
    6656
    6757#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) \
    7260
    7361#define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \
    7462    macro(every) \
    7563    macro(forEach) \
    76     macro(match) \
    77     macro(test) \
    7864
    79 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    8066    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    8167
     
    122108#include "BuiltinExecutables.h"
    123109#include "HeapInlines.h"
    124 #include "IdentifierInlines.h"
    125110#include "Intrinsic.h"
    126111#include "JSCellInlines.h"
     
    187172;
    188173
    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 ;
    228174
    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) \
    251176JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    252177{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result

    r221327 r221404  
    5353
    5454#define JSC_FOREACH_BUILTIN_CODE(macro) \
    55     macro(builtinConstructorOfCode, of, static_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \
    56     macro(builtinConstructorFromCode, from, static_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \
     55    macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \
     56    macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \
    5757
    5858#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
     
    6262#define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \
    6363
    64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     64#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6565    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6666
     
    106106#include "BuiltinExecutables.h"
    107107#include "HeapInlines.h"
    108 #include "IdentifierInlines.h"
    109108#include "Intrinsic.h"
    110109#include "JSCellInlines.h"
     
    188187
    189188
    190 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     189#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    191190JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    192191{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result

    r221327 r221404  
    5555
    5656#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(macro) \
    57     macro(builtinConstructorOfCode, of, static_cast<const char*>(nullptr), s_builtinConstructorOfCodeLength) \
    58     macro(builtinConstructorFromCode, from, static_cast<const char*>(nullptr), s_builtinConstructorFromCodeLength) \
     57    macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \
     58    macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \
    5959
    6060#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \
     
    6262    macro(of) \
    6363
    64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     64#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6565    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6666
     
    106106#include "BuiltinExecutables.h"
    107107#include "HeapInlines.h"
    108 #include "IdentifierInlines.h"
    109108#include "Intrinsic.h"
    110109#include "JSCellInlines.h"
     
    187186
    188187
    189 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     188#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    190189JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    191190{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result

    r221327 r221404  
    5454
    5555#define JSC_FOREACH_BUILTIN_CODE(macro) \
    56     macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
    57     macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_internalClashingNamesIsReadableStreamLockedCodeLength) \
     56    macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s_internalClashingNamesIsReadableStreamLockedCodeLength) \
     57    macro(internalClashingNamesIsReadableStreamLockedCode, isReadableStreamLocked, s_internalClashingNamesIsReadableStreamLockedCodeLength) \
    5858
    5959#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
     
    6262#define JSC_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \
    6363
    64 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     64#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6565    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6666
     
    107107#include "BuiltinExecutables.h"
    108108#include "HeapInlines.h"
    109 #include "IdentifierInlines.h"
    110109#include "Intrinsic.h"
    111110#include "JSCellInlines.h"
     
    138137
    139138
    140 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     139#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    141140JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    142141{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result

    r221327 r221404  
    5555
    5656#define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
    57     macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, static_cast<const char*>(nullptr), s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \
     57    macro(anotherGuardedInternalBuiltinLetsFetchCode, letsFetch, s_anotherGuardedInternalBuiltinLetsFetchCodeLength) \
    5858
    5959#define WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
    6060    macro(letsFetch) \
    6161
    62 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     62#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6363    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6464
     
    7171        : m_vm(*vm)
    7272        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), { }))
    7474        WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    7575#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    7777    }
    7878
    79 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     79#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    8080    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    8181    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    9292    WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    9393
    94 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     94#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    9595    JSC::SourceCode m_##name##Source;\
    9696    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    100100};
    101101
    102 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     102#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    103103inline JSC::UnlinkedFunctionExecutable* AnotherGuardedInternalBuiltinBuiltinsWrapper::name##Executable() \
    104104{\
    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);\
    111107    return m_##name##Executable.get();\
    112108}
     
    139135inline void AnotherGuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
    140136{
    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));
    143139    WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
    144140#undef EXPORT_FUNCTION
     
    195191#include "WebCoreJSClientData.h"
    196192#include <heap/HeapInlines.h>
    197 #include <runtime/IdentifierInlines.h>
    198193#include <runtime/Intrinsic.h>
    199194#include <runtime/JSCJSValueInlines.h>
     
    216211
    217212
    218 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     213#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    219214JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    220215{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result

    r221327 r221404  
    5656
    5757#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(macro) \
    58     macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \
     58    macro(arbitraryConditionalGuardIsReadableStreamLockedCode, isReadableStreamLocked, s_arbitraryConditionalGuardIsReadableStreamLockedCodeLength) \
    5959
    6060#define WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(macro) \
    6161    macro(isReadableStreamLocked) \
    6262
    63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     63#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6464    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6565
     
    7272        : m_vm(*vm)
    7373        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), { }))
    7575        WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    7676#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    7878    }
    7979
    80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     80#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    8181    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    8282    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    9393    WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    9494
    95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     95#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    9696    JSC::SourceCode m_##name##Source;\
    9797    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    101101};
    102102
    103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     103#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    104104inline JSC::UnlinkedFunctionExecutable* ArbitraryConditionalGuardBuiltinsWrapper::name##Executable() \
    105105{\
    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);\
    112108    return m_##name##Executable.get();\
    113109}
     
    165161#include "WebCoreJSClientData.h"
    166162#include <heap/HeapInlines.h>
    167 #include <runtime/IdentifierInlines.h>
    168163#include <runtime/Intrinsic.h>
    169164#include <runtime/JSCJSValueInlines.h>
     
    186181
    187182
    188 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     183#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    189184JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    190185{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result

    r221327 r221404  
    5656
    5757#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(macro) \
    58     macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_guardedBuiltinIsReadableStreamLockedCodeLength) \
     58    macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedBuiltinIsReadableStreamLockedCodeLength) \
    5959
    6060#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
    6161    macro(isReadableStreamLocked) \
    6262
    63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     63#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6464    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6565
     
    7272        : m_vm(*vm)
    7373        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), { }))
    7575        WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    7676#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    7878    }
    7979
    80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     80#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    8181    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    8282    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    9393    WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    9494
    95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     95#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    9696    JSC::SourceCode m_##name##Source;\
    9797    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    101101};
    102102
    103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     103#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    104104inline JSC::UnlinkedFunctionExecutable* GuardedBuiltinBuiltinsWrapper::name##Executable() \
    105105{\
    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);\
    112108    return m_##name##Executable.get();\
    113109}
     
    165161#include "WebCoreJSClientData.h"
    166162#include <heap/HeapInlines.h>
    167 #include <runtime/IdentifierInlines.h>
    168163#include <runtime/Intrinsic.h>
    169164#include <runtime/JSCJSValueInlines.h>
     
    186181
    187182
    188 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     183#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    189184JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    190185{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result

    r221327 r221404  
    5656
    5757#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
    58     macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
     58    macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
    5959
    6060#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
    6161    macro(isReadableStreamLocked) \
    6262
    63 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     63#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6464    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6565
     
    7272        : m_vm(*vm)
    7373        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), { }))
    7575        WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    7676#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    7878    }
    7979
    80 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     80#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    8181    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    8282    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    9393    WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    9494
    95 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     95#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    9696    JSC::SourceCode m_##name##Source;\
    9797    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    101101};
    102102
    103 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     103#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    104104inline JSC::UnlinkedFunctionExecutable* GuardedInternalBuiltinBuiltinsWrapper::name##Executable() \
    105105{\
    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);\
    112108    return m_##name##Executable.get();\
    113109}
     
    140136inline void GuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
    141137{
    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));
    144140    WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
    145141#undef EXPORT_FUNCTION
     
    197193#include "WebCoreJSClientData.h"
    198194#include <heap/HeapInlines.h>
    199 #include <runtime/IdentifierInlines.h>
    200195#include <runtime/Intrinsic.h>
    201196#include <runtime/JSCJSValueInlines.h>
     
    218213
    219214
    220 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     215#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    221216JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    222217{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result

    r221327 r221404  
    5454
    5555#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(macro) \
    56     macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, static_cast<const char*>(nullptr), s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
     56    macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
    5757
    5858#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
    5959    macro(isReadableStreamLocked) \
    6060
    61 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     61#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    6262    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    6363
     
    7070        : m_vm(*vm)
    7171        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), { }))
    7373        WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    7474#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    7676    }
    7777
    78 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     78#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    7979    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    8080    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    9191    WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    9292
    93 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     93#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    9494    JSC::SourceCode m_##name##Source;\
    9595    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    9999};
    100100
    101 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     101#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    102102inline JSC::UnlinkedFunctionExecutable* UnguardedBuiltinBuiltinsWrapper::name##Executable() \
    103103{\
    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);\
    110106    return m_##name##Executable.get();\
    111107}
     
    159155#include "WebCoreJSClientData.h"
    160156#include <heap/HeapInlines.h>
    161 #include <runtime/IdentifierInlines.h>
    162157#include <runtime/Intrinsic.h>
    163158#include <runtime/JSCJSValueInlines.h>
     
    180175
    181176
    182 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     177#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    183178JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    184179{\
  • trunk/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result

    r221327 r221404  
    6666
    6767#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(macro) \
    68     macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestXMLCasingTestCodeLength) \
    69     macro(xmlCasingTestCssCasingTestCode, cssCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestCssCasingTestCodeLength) \
    70     macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, static_cast<const char*>(nullptr), s_xmlCasingTestUrlCasingTestCodeLength) \
     68    macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, s_xmlCasingTestXMLCasingTestCodeLength) \
     69    macro(xmlCasingTestCssCasingTestCode, cssCasingTest, s_xmlCasingTestCssCasingTestCodeLength) \
     70    macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, s_xmlCasingTestUrlCasingTestCodeLength) \
    7171
    7272#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(macro) \
     
    7575    macro(xmlCasingTest) \
    7676
    77 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     77#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    7878    JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
    7979
     
    8686        : m_vm(*vm)
    8787        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), { }))
    8989        WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
    9090#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
     
    9292    }
    9393
    94 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     94#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
    9595    JSC::UnlinkedFunctionExecutable* name##Executable(); \
    9696    const JSC::SourceCode& name##Source() const { return m_##name##Source; }
     
    107107    WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
    108108
    109 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
     109#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
    110110    JSC::SourceCode m_##name##Source;\
    111111    JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
     
    115115};
    116116
    117 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
     117#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
    118118inline JSC::UnlinkedFunctionExecutable* xmlCasingTestBuiltinsWrapper::name##Executable() \
    119119{\
    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);\
    126122    return m_##name##Executable.get();\
    127123}
     
    154150inline void xmlCasingTestBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
    155151{
    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));
    158154    WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(EXPORT_FUNCTION)
    159155#undef EXPORT_FUNCTION
     
    211207#include "WebCoreJSClientData.h"
    212208#include <heap/HeapInlines.h>
    213 #include <runtime/IdentifierInlines.h>
    214209#include <runtime/Intrinsic.h>
    215210#include <runtime/JSCJSValueInlines.h>
     
    269264
    270265
    271 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
     266#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
    272267JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
    273268{\
Note: See TracChangeset for help on using the changeset viewer.