|
| 1 | +2017-08-31 Yusuke Suzuki < [email protected]> |
| 2 | + |
| 3 | + [JSC] Use reifying system for "name" property of builtin JSFunction |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=175260 |
| 5 | + |
| 6 | + Reviewed by Saam Barati. |
| 7 | + |
| 8 | + Currently builtin JSFunction uses direct property for "name", which is different |
| 9 | + from usual JSFunction. Usual JSFunction uses reifying system for "name". We would like |
| 10 | + to apply this reifying mechanism to builtin JSFunction to simplify code and drop |
| 11 | + JSFunction::createBuiltinFunction. |
| 12 | + |
| 13 | + We would like to store the "correct" name in FunctionExecutable. For example, |
| 14 | + we would like to store the name like "get [Symbol.species]" to FunctionExecutable |
| 15 | + instead of specifying name when creating JSFunction. To do so, we add a new |
| 16 | + annotations, @getter and @overriddenName. When @getter is specified, the name of |
| 17 | + the function becomes "get xxx". And when @overriddenName="xxx" is specified, |
| 18 | + the name of the function becomes "xxx". |
| 19 | + |
| 20 | + We also treat @xxx as anonymous builtin functions that cannot be achieved in |
| 21 | + the current JS without privilege. |
| 22 | + |
| 23 | + * Scripts/builtins/builtins_generate_combined_header.py: |
| 24 | + (generate_section_for_code_table_macro): |
| 25 | + * Scripts/builtins/builtins_generate_combined_implementation.py: |
| 26 | + (BuiltinsCombinedImplementationGenerator.generate_secondary_header_includes): |
| 27 | + * Scripts/builtins/builtins_generate_separate_header.py: |
| 28 | + (generate_section_for_code_table_macro): |
| 29 | + * Scripts/builtins/builtins_generate_separate_implementation.py: |
| 30 | + (BuiltinsSeparateImplementationGenerator.generate_secondary_header_includes): |
| 31 | + * Scripts/builtins/builtins_model.py: |
| 32 | + (BuiltinFunction.__init__): |
| 33 | + (BuiltinFunction.fromString): |
| 34 | + * Scripts/builtins/builtins_templates.py: |
| 35 | + * Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js: |
| 36 | + (overriddenName.string_appeared_here.match): |
| 37 | + (intrinsic.RegExpTestIntrinsic.test): |
| 38 | + * Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Separate.js: |
| 39 | + (overriddenName.string_appeared_here.match): |
| 40 | + (intrinsic.RegExpTestIntrinsic.test): |
| 41 | + * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result: |
| 42 | + * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result: |
| 43 | + * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result: |
| 44 | + * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result: |
| 45 | + * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result: |
| 46 | + * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result: |
| 47 | + * Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result: |
| 48 | + * Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result: |
| 49 | + * Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result: |
| 50 | + * Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result: |
| 51 | + * Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result: |
| 52 | + * Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result: |
| 53 | + * Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result: |
| 54 | + * builtins/AsyncIteratorPrototype.js: |
| 55 | + (symbolAsyncIteratorGetter): Deleted. |
| 56 | + * builtins/BuiltinExecutables.cpp: |
| 57 | + (JSC::BuiltinExecutables::BuiltinExecutables): |
| 58 | + * builtins/BuiltinExecutables.h: |
| 59 | + * builtins/BuiltinNames.h: |
| 60 | + * builtins/FunctionPrototype.js: |
| 61 | + (symbolHasInstance): Deleted. |
| 62 | + * builtins/GlobalOperations.js: |
| 63 | + (globalPrivate.speciesGetter): Deleted. |
| 64 | + * builtins/IteratorPrototype.js: |
| 65 | + (symbolIteratorGetter): Deleted. |
| 66 | + * builtins/PromiseConstructor.js: |
| 67 | + (all.newResolveElement.return.resolve): |
| 68 | + (all.newResolveElement): |
| 69 | + (all): |
| 70 | + * builtins/PromiseOperations.js: |
| 71 | + (globalPrivate.newPromiseCapability.executor): |
| 72 | + (globalPrivate.newPromiseCapability): |
| 73 | + (globalPrivate.createResolvingFunctions.resolve): |
| 74 | + (globalPrivate.createResolvingFunctions.reject): |
| 75 | + (globalPrivate.createResolvingFunctions): |
| 76 | + * builtins/RegExpPrototype.js: |
| 77 | + (match): Deleted. |
| 78 | + (replace): Deleted. |
| 79 | + (search): Deleted. |
| 80 | + (split): Deleted. |
| 81 | + * jsc.cpp: |
| 82 | + (functionCreateBuiltin): |
| 83 | + * runtime/AsyncIteratorPrototype.cpp: |
| 84 | + (JSC::AsyncIteratorPrototype::finishCreation): |
| 85 | + * runtime/FunctionPrototype.cpp: |
| 86 | + (JSC::FunctionPrototype::addFunctionProperties): |
| 87 | + * runtime/IteratorPrototype.cpp: |
| 88 | + (JSC::IteratorPrototype::finishCreation): |
| 89 | + * runtime/JSFunction.cpp: |
| 90 | + (JSC::JSFunction::finishCreation): |
| 91 | + (JSC::JSFunction::getOwnNonIndexPropertyNames): |
| 92 | + (JSC::JSFunction::reifyLazyBoundNameIfNeeded): |
| 93 | + (JSC::JSFunction::createBuiltinFunction): Deleted. |
| 94 | + * runtime/JSFunction.h: |
| 95 | + * runtime/JSGlobalObject.cpp: |
| 96 | + (JSC::JSGlobalObject::init): |
| 97 | + * runtime/JSObject.cpp: |
| 98 | + (JSC::JSObject::putDirectBuiltinFunction): |
| 99 | + (JSC::JSObject::putDirectBuiltinFunctionWithoutTransition): |
| 100 | + * runtime/JSTypedArrayViewPrototype.cpp: |
| 101 | + (JSC::JSTypedArrayViewPrototype::finishCreation): |
| 102 | + * runtime/Lookup.cpp: |
| 103 | + (JSC::reifyStaticAccessor): |
| 104 | + * runtime/MapPrototype.cpp: |
| 105 | + (JSC::MapPrototype::finishCreation): |
| 106 | + * runtime/RegExpPrototype.cpp: |
| 107 | + (JSC::RegExpPrototype::finishCreation): |
| 108 | + * runtime/SetPrototype.cpp: |
| 109 | + (JSC::SetPrototype::finishCreation): |
| 110 | + |
1 | 111 | 2017-08-30 Ryan Haddad < [email protected]>
|
2 | 112 |
|
3 | 113 | Unreviewed, rolling out r221327.
|
|
0 commit comments