Ignore:
Timestamp:
Aug 22, 2021, 6:06:11 PM (4 years ago)
Author:
[email protected]
Message:

[JSC] Remove already-shipped JS feature flags
https://bugs.webkit.org/show_bug.cgi?id=229387

Reviewed by Ross Kirsling.

JSTests:

  • microbenchmarks/class-fields-private/get-private-name.js:
  • microbenchmarks/class-fields-private/monomorphic-get-private-field.js:
  • microbenchmarks/class-fields-private/polymorphic-get-private-field.js:
  • microbenchmarks/class-fields-private/polymorphic-put-private-field.js:
  • microbenchmarks/class-fields-private/put-private-field.js:
  • stress/class-fields-private-as-function.js:
  • stress/class-fields-private-cached-bytecode.js:
  • stress/class-fields-private-freeze-out-of-line.js:
  • stress/class-fields-private-freeze.js:
  • stress/class-fields-private-harmony.js:
  • stress/class-fields-private-on-proxy.js:
  • stress/class-fields-private-out-of-line.js:
  • stress/class-fields-private-prevent-extensions-out-of-line.js:
  • stress/class-fields-private-prevent-extensions.js:
  • stress/class-fields-private-seal-out-of-line.js:
  • stress/class-fields-private-seal.js:
  • stress/class-fields-private-use-eval.js:
  • stress/class-fields-static-harmony.js:
  • stress/class-fields-static-private-harmony.js:
  • stress/class-fields-stress-instance.js:
  • stress/class-private-method-access.js:
  • stress/dfg-get-private-name-by-id-generic.js:
  • stress/dfg-get-private-name-by-id-osr-bad-identifier.js:
  • stress/dfg-get-private-name-by-id.js:
  • stress/dfg-get-private-name-by-offset-osr-bad-identifier.js:
  • stress/dfg-get-private-name-by-offset-osr-bad-structure.js:
  • stress/dfg-get-private-name-by-offset.js:
  • stress/dfg-get-private-name-by-val-generic.js:
  • stress/dfg-put-private-name-check-barrier-insertion.js:
  • stress/dfg-put-private-name-compiled-as-put-by-id-direct.js:
  • stress/dfg-put-private-name-compiled-as-put-private-name-by-id.js:
  • stress/ftl-get-private-name-by-id.js:
  • stress/ftl-get-private-name-by-offset-multi.js:
  • stress/get-private-name-cache-failure.js:
  • stress/get-private-name-with-constant-ident.js:
  • stress/get-private-name-with-constant-symbol.js:
  • stress/get-private-name-with-different-symbol.js:
  • stress/get-private-name-with-primitive.js:
  • stress/get-private-name.js:
  • stress/optional-chaining-and-private-fields.js:
  • stress/private-accesor-duplicate-name-early-errors.js:
  • stress/private-accessor-static-non-static.js:
  • stress/private-brand-installed-after-super-call-from-arrow-function.js:
  • stress/private-brand-installed-after-super-call-from-eval.js:
  • stress/private-getter-brand-check.js:
  • stress/private-getter-inner-class.js:
  • stress/private-in-error.js:
  • stress/private-in.js:
  • stress/private-members-get-and-set.js:
  • stress/private-method-and-field-named-constructor.js:
  • stress/private-method-brand-check.js:
  • stress/private-method-change-attribute-from-branded-structure.js:
  • stress/private-method-change-prototype-from-branded-structure.js:
  • stress/private-method-check-private-brand-ic.js:
  • stress/private-method-check-structure-miss.js:
  • stress/private-method-comparison.js:
  • stress/private-method-delete-property-from-branded-structure.js:
  • stress/private-method-extends-brand-check.js:
  • stress/private-method-get-and-call.js:
  • stress/private-method-invalid-multiple-brand-installation.js:
  • stress/private-method-invalidate-compiled-with-constant-symbol.js:
  • stress/private-method-nested-class.js:
  • stress/private-method-on-sealed-objects.js:
  • stress/private-method-on-uncacheable-dictionary.js:
  • stress/private-method-polymorphic-with-constant-symbol.js:
  • stress/private-method-set-brand-should-have-write-barrier.js:
  • stress/private-method-untyped-use.js:
  • stress/private-method-with-uncacheable-dictionary-transition.js:
  • stress/private-methods-and-accessors-postfix-node.js:
  • stress/private-methods-and-accessors-prefix-node.js:
  • stress/private-methods-inline-cache.js:
  • stress/private-methods-megamorphic-ic.js:
  • stress/private-methods-on-proxy.js:
  • stress/private-methods-poly-ic-multiple-classes.js:
  • stress/private-methods-poly-ic-single-class.js:
  • stress/private-name-access-in-computed-property.js:
  • stress/private-names-available-on-direct-eval.js:
  • stress/private-names-available-on-eval-during-field-initialization.js:
  • stress/private-setter-brand-check.js:
  • stress/private-setter-inner-class.js:
  • stress/put-by-val-direct-addprivate.js:
  • stress/put-by-val-direct-putprivate.js:
  • stress/put-private-name-by-id-set-do-not-add-structure-trasition.js:
  • stress/put-private-name-check-structure-miss.js:
  • stress/put-private-name-constant-folding-to-mult-put-by-offset.js:
  • stress/put-private-name-constant-folding-to-put-by-offset.js:
  • stress/put-private-name-generic.js:
  • stress/put-private-name-invalid-define.js:
  • stress/put-private-name-invalid-store.js:
  • stress/put-private-name-invalidate-compiled-with-constant-symbol.js:
  • stress/put-private-name-polymorphic-with-constant-symbol.js:
  • stress/put-private-name-untyped-use.js:
  • stress/put-private-name-with-constant-symbol.js:
  • stress/put-private-name-with-different-identifier.js:
  • stress/put-private-name-with-primitive.js:
  • stress/static-private-methods-and-accessor-inner-class.js:
  • stress/static-private-methods-and-accessor-multiple-evaluation.js:
  • stress/static-private-methods-and-accessors-postfix-node.js:
  • stress/static-private-methods-and-accessors-prefix-node.js:
  • stress/v8-cleanup-from-different-realm.js:
  • stress/v8-cleanup-proxy-from-different-realm.js:
  • stress/v8-finalization-registry-basics.js:
  • stress/v8-finalizationregistry-and-weakref.js:
  • stress/v8-finalizationregistry-keeps-holdings-alive.js:
  • stress/v8-finalizationregistry-scheduled-for-cleanup-multiple-times.js:
  • stress/v8-multiple-dirty-finalization-registries.js:
  • stress/v8-reentrant-gc-from-cleanup.js:
  • stress/v8-stress-finalizationregistry-dirty-enqueue.js:
  • stress/v8-undefined-holdings.js:
  • stress/v8-unregister-after-cleanup.js:
  • stress/v8-unregister-before-cleanup.js:
  • stress/v8-unregister-called-twice.js:
  • stress/v8-unregister-inside-cleanup2.js:
  • stress/v8-unregister-inside-cleanup3.js:
  • stress/v8-unregister-many.js:
  • stress/v8-weak-unregistertoken.js:
  • test262/config.yaml:

Source/JavaScriptCore:

These features are already shipped. So removing these runtime flags to clean up source code and
remove untested path.

  • API/JSObjectRef.cpp:

(JSObjectMakeError):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):

  • bytecompiler/NodesCodegen.cpp:

(JSC::FunctionCallValueNode::emitBytecode):

  • parser/Lexer.cpp:

(JSC::Lexer<T>::lexWithoutClearingLineTerminator):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseForStatement):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseBinaryExpression):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseUnaryExpression):

  • runtime/AggregateErrorConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

  • runtime/ErrorConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

  • runtime/JSGlobalObject.h:
  • runtime/NativeErrorConstructor.cpp:

(JSC::NativeErrorConstructor<errorType>::constructImpl):
(JSC::NativeErrorConstructor<errorType>::callImpl):

  • runtime/Options.cpp:

(JSC::Options::recomputeDependentOptions):

  • runtime/OptionsList.h:
  • wasm/js/WebAssemblyCompileErrorConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

  • wasm/js/WebAssemblyLinkErrorConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

  • wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

Tools:

  • Scripts/run-jsc-benchmarks:

LayoutTests:

  • js/script-tests/weakref-async-is-collected.js:
  • js/script-tests/weakref-eventually-collects-values.js:
  • js/script-tests/weakref-finalizationregistry.js:
  • js/script-tests/weakref-microtasks-dont-collect.js:
  • js/script-tests/weakref-weakset-consistency.js:
  • js/weakref-async-is-collected.html:
  • js/weakref-eventually-collects-values.html:
  • js/weakref-finalizationregistry.html:
  • js/weakref-microtasks-dont-collect.html:
  • js/weakref-weakset-consistency.html:
  • webaudio/finished-audio-buffer-source-nodes-should-be-collectable.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r279448 r281429  
    297297        return makeUnexpected(hasError() ? m_errorMessage : "Parser error"_s);
    298298
    299     if (Options::usePrivateClassFields() && !m_lexer->isReparsingFunction() && m_seenPrivateNameUseInNonReparsingFunctionMode) {
     299    if (!m_lexer->isReparsingFunction() && m_seenPrivateNameUseInNonReparsingFunctionMode) {
    300300        String errorMessage;
    301301        scope->forEachUsedVariable([&] (UniquedStringImpl* impl) {
     
    13861386
    13871387    if (match(AWAIT)) {
    1388         semanticFailIfFalse(currentScope()->isAsyncFunction() || (isModuleParseMode(sourceParseMode()) && Options::useTopLevelAwait()), "for-await-of can only be used in an async function or async generator");
     1388        semanticFailIfFalse(currentScope()->isAsyncFunction() || isModuleParseMode(sourceParseMode()), "for-await-of can only be used in an async function or async generator");
    13891389        isAwaitFor = true;
    13901390        next();
     
    30163016            ASSERT(ident);
    30173017            next();
    3018             if (parseMode == SourceParseMode::MethodMode && !escaped && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(BIGINT) || match(OPENBRACKET) || (Options::usePrivateMethods() && match(PRIVATENAME)))) {
     3018            if (parseMode == SourceParseMode::MethodMode && !escaped && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(BIGINT) || match(OPENBRACKET) || match(PRIVATENAME))) {
    30193019                isGetter = *ident == propertyNames.get;
    30203020                isSetter = *ident == propertyNames.set;
     
    30363036            break;
    30373037        case PRIVATENAME: {
    3038             ASSERT(Options::usePrivateClassFields());
    30393038            ident = m_token.m_data.ident;
    3040             if (!Options::usePrivateStaticClassFields())
    3041                 failIfTrue(tag == ClassElementTag::Static, "Static class element cannot be private");
    30423039            failIfTrue(isGetter || isSetter, "Cannot parse class method with private name");
    30433040            ASSERT(ident);
    30443041            next();
    3045             if (Options::usePrivateMethods() && match(OPENPAREN)) {
     3042            if (match(OPENPAREN)) {
    30463043                semanticFailIfTrue(classScope->declarePrivateMethod(*ident, tag) & DeclarationResult::InvalidDuplicateDeclaration, "Cannot declare private method twice");
    30473044                semanticFailIfTrue(*ident == propertyNames.constructorPrivateField, "Cannot declare a private method named '#constructor'");
     
    30693066        TreeProperty property;
    30703067        if (isGetter || isSetter) {
    3071             if (Options::usePrivateMethods() && match(PRIVATENAME)) {
     3068            if (match(PRIVATENAME)) {
    30723069                ident = m_token.m_data.ident;
    30733070
     
    30923089            property = parseGetterSetter(context, type, methodStart, ConstructorKind::None, tag);
    30933090            failIfFalse(property, "Cannot parse this method");
    3094         } else if (!match(OPENPAREN) && (tag == ClassElementTag::Instance || Options::usePublicStaticClassFields()) && parseMode == SourceParseMode::MethodMode) {
     3091        } else if (!match(OPENPAREN) && parseMode == SourceParseMode::MethodMode) {
    30953092            ASSERT(!isGetter && !isSetter);
    30963093            if (ident) {
     
    42484245
    42494246        TreeExpression current = 0;
    4250         if (Options::usePrivateIn() && match(PRIVATENAME)) {
     4247        if (match(PRIVATENAME)) {
    42514248            const Identifier* ident = m_token.m_data.ident;
    42524249            ASSERT(ident);
     
    45154512
    45164513    bool matchesPrivateName = match(PRIVATENAME);
    4517     if (matchSpecIdentifier() || match(STRING) || (Options::usePrivateMethods() && matchesPrivateName) || m_token.m_type & KeywordTokenFlag) {
     4514    if (matchSpecIdentifier() || match(STRING) || matchesPrivateName || m_token.m_type & KeywordTokenFlag) {
    45184515        stringPropertyName = m_token.m_data.ident;
    45194516        semanticFailIfTrue(tag == ClassElementTag::Static && *stringPropertyName == m_vm.propertyNames->prototype,
     
    48604857        if (m_parserState.functionParsePhase == FunctionParsePhase::Parameters)
    48614858            semanticFailIfFalse(m_parserState.allowAwait, "Cannot use 'await' within a parameter default expression");
    4862         else if (currentFunctionScope()->isAsyncFunctionBoundary() || (isModuleParseMode(sourceParseMode()) && Options::useTopLevelAwait()))
     4859        else if (currentFunctionScope()->isAsyncFunctionBoundary() || isModuleParseMode(sourceParseMode()))
    48634860            return parseAwaitExpression(context);
    48644861
     
    53665363    unsigned lastOperator = 0;
    53675364
    5368     if (UNLIKELY(match(AWAIT) && (currentFunctionScope()->isAsyncFunctionBoundary() || (isModuleParseMode(sourceParseMode()) && Options::useTopLevelAwait()))))
     5365    if (UNLIKELY(match(AWAIT) && (currentFunctionScope()->isAsyncFunctionBoundary() || isModuleParseMode(sourceParseMode()))))
    53695366        return parseAwaitExpression(context);
    53705367
Note: See TracChangeset for help on using the changeset viewer.