Changeset 269939 in webkit


Ignore:
Timestamp:
Nov 17, 2020 7:19:04 PM (3 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Enable static public class fields
https://bugs.webkit.org/show_bug.cgi?id=219058

Reviewed by Saam Barati.

JSTests:

  • stress/big-int-as-property-name.js:
  • stress/class-fields-bytecode-cache.js:
  • stress/class-fields-computed-to-property-key.js:
  • stress/class-fields-function-name.js:
  • stress/class-fields-harmony.js:
  • stress/class-fields-private-use-eval.js:
  • stress/class-fields-proxy-define-property.js:
  • stress/class-fields-stress-instance.js:
  • stress/class-fields-to-property-key-const-string-ftl.js:
  • stress/class-fields-to-property-key-const-symbol-ftl.js:
  • stress/class-fields-to-property-key-slow-object-tostring-ftl.js:
  • stress/class-fields-to-property-key-slow-object-valueof-ftl.js:
  • stress/class-fields-to-property-key-string-object-ftl.js:
  • stress/class-fields-to-property-key-string-or-string-object-ftl.js:
  • stress/class-fields-with-special-names.js:
  • stress/generator-syntax.js:
  • stress/method-name.js:
  • stress/private-name-access-in-computed-property.js:
  • test262/config.yaml:

Source/JavaScriptCore:

Let's flip the runtime flag (usePublicStaticClassFields). And we drop usePublicClassFields flag since it is already shipped.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):

  • bytecompiler/NodesCodegen.cpp:

(JSC::FunctionCallValueNode::emitBytecode):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseClass):

  • runtime/OptionsList.h:
Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r269929 r269939  
     12020-11-17  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Enable static public class fields
     4        https://bugs.webkit.org/show_bug.cgi?id=219058
     5
     6        Reviewed by Saam Barati.
     7
     8        * stress/big-int-as-property-name.js:
     9        * stress/class-fields-bytecode-cache.js:
     10        * stress/class-fields-computed-to-property-key.js:
     11        * stress/class-fields-function-name.js:
     12        * stress/class-fields-harmony.js:
     13        * stress/class-fields-private-use-eval.js:
     14        * stress/class-fields-proxy-define-property.js:
     15        * stress/class-fields-stress-instance.js:
     16        * stress/class-fields-to-property-key-const-string-ftl.js:
     17        * stress/class-fields-to-property-key-const-symbol-ftl.js:
     18        * stress/class-fields-to-property-key-slow-object-tostring-ftl.js:
     19        * stress/class-fields-to-property-key-slow-object-valueof-ftl.js:
     20        * stress/class-fields-to-property-key-string-object-ftl.js:
     21        * stress/class-fields-to-property-key-string-or-string-object-ftl.js:
     22        * stress/class-fields-with-special-names.js:
     23        * stress/generator-syntax.js:
     24        * stress/method-name.js:
     25        * stress/private-name-access-in-computed-property.js:
     26        * test262/config.yaml:
     27
    1282020-11-17  Sergey Rubanov  <chi187@gmail.com>
    229
  • trunk/JSTests/stress/big-int-as-property-name.js

    r267330 r269939  
    1 //@ runDefault("--usePublicClassFields=true")
    2 
    31let assert = {
    42    sameValue(a, e) {
  • trunk/JSTests/stress/class-fields-bytecode-cache.js

    r258071 r269939  
    1 //@ runBytecodeCache("--usePublicClassFields=true")
    2 
    31function assert(a, e) {
    42    if (a !== e)
  • trunk/JSTests/stress/class-fields-computed-to-property-key.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=1")
    2 
    31function assert(a, message) {
    42    if (!a)
  • trunk/JSTests/stress/class-fields-function-name.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    2 
    31function assert(a, message) {
    42    if (!a)
  • trunk/JSTests/stress/class-fields-harmony.js

    r269922 r269939  
    1 //@ requireOptions("--usePublicClassFields=1")
    21//@ defaultNoEagerRun
    32
  • trunk/JSTests/stress/class-fields-private-use-eval.js

    r262613 r269939  
    1 //@ requireOptions("--usePrivateClassFields=1", "--usePublicClassFields=1")
     1//@ requireOptions("--usePrivateClassFields=1")
    22
    33function assert(a, message) {
  • trunk/JSTests/stress/class-fields-proxy-define-property.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=1")
    21//@ defaultNoEagerRun
    32
  • trunk/JSTests/stress/class-fields-stress-instance.js

    r262613 r269939  
    1 //@ requireOptions("--usePublicClassFields=true", "--usePrivateClassFields=true")
     1//@ requireOptions("--usePrivateClassFields=true")
    22
    33class A {
  • trunk/JSTests/stress/class-fields-to-property-key-const-string-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-to-property-key-const-symbol-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-to-property-key-slow-object-tostring-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-to-property-key-slow-object-valueof-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-to-property-key-string-object-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-to-property-key-string-or-string-object-ftl.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    21//@ if isFTLEnabled then runFTLNoCJIT else skip end
    32
  • trunk/JSTests/stress/class-fields-with-special-names.js

    r259216 r269939  
    1 //@ requireOptions("--usePublicClassFields=true")
    2 
    31function assertEquals(e, a) {
    42    if (a !== e)
  • trunk/JSTests/stress/generator-syntax.js

    r267306 r269939  
    1 //@ requireOptions("--usePublicClassFields=1")
    2 
    31function testSyntax(script) {
    42    try {
  • trunk/JSTests/stress/method-name.js

    r258071 r269939  
    1 //@ requireOptions("--usePublicClassFields=1")
    2 
    31function testSyntax(script) {
    42    try {
  • trunk/JSTests/stress/private-name-access-in-computed-property.js

    r262613 r269939  
    1 //@ requireOptions("--usePublicClassFields=1", "--usePrivateClassFields=1")
     1//@ requireOptions("--usePrivateClassFields=1")
    22
    33let assert = {
  • trunk/JSTests/test262/config.yaml

    r269922 r269939  
    44  WeakRef: useWeakRefs
    55  FinalizationRegistry: useWeakRefs
    6   class-fields-public: usePublicClassFields
    76  class-fields-private: usePrivateClassFields
    87  class-static-fields-public: usePublicStaticClassFields
  • trunk/Source/JavaScriptCore/ChangeLog

    r269933 r269939  
     12020-11-17  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Enable static public class fields
     4        https://bugs.webkit.org/show_bug.cgi?id=219058
     5
     6        Reviewed by Saam Barati.
     7
     8        Let's flip the runtime flag (usePublicStaticClassFields). And we drop usePublicClassFields flag since it is already shipped.
     9
     10        * bytecompiler/BytecodeGenerator.cpp:
     11        (JSC::BytecodeGenerator::BytecodeGenerator):
     12        * bytecompiler/NodesCodegen.cpp:
     13        (JSC::FunctionCallValueNode::emitBytecode):
     14        * parser/Parser.cpp:
     15        (JSC::Parser<LexerType>::parseClass):
     16        * runtime/OptionsList.h:
     17
    1182020-11-17  Michael Catanzaro  <mcatanzaro@gnome.org>
    219
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r269922 r269939  
    709709                case ConstructorKind::Base:
    710710                    emitCreateThis(&m_thisRegister);
    711                     if (Options::usePublicClassFields())
    712                         emitInstanceFieldInitializationIfNeeded(&m_thisRegister, &m_calleeRegister, m_scopeNode->position(), m_scopeNode->position(), m_scopeNode->position());
     711                    emitInstanceFieldInitializationIfNeeded(&m_thisRegister, &m_calleeRegister, m_scopeNode->position(), m_scopeNode->position(), m_scopeNode->position());
    713712                    break;
    714713                case ConstructorKind::Extends:
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r269922 r269939  
    10921092
    10931093        // Initialize instance fields after super-call.
    1094         if (Options::usePublicClassFields() && generator.needsClassFieldInitializer() == NeedsClassFieldInitializer::Yes) {
     1094        if (generator.needsClassFieldInitializer() == NeedsClassFieldInitializer::Yes) {
    10951095            ASSERT(generator.isConstructor() || generator.isDerivedConstructorContext());
    10961096            func = generator.emitLoadDerivedConstructor();
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r269931 r269939  
    29932993            property = parseGetterSetter(context, type, methodStart, ConstructorKind::None, tag);
    29942994            failIfFalse(property, "Cannot parse this method");
    2995         } else if (Options::usePublicClassFields() && !match(OPENPAREN) && (tag == ClassElementTag::Instance || Options::usePublicStaticClassFields()) && parseMode == SourceParseMode::MethodMode) {
     2995        } else if (!match(OPENPAREN) && (tag == ClassElementTag::Instance || Options::usePublicStaticClassFields()) && parseMode == SourceParseMode::MethodMode) {
    29962996            ASSERT(!isGetter && !isSetter);
    29972997            if (ident) {
  • trunk/Source/JavaScriptCore/runtime/OptionsList.h

    r269922 r269939  
    514514    v(Bool, forceOSRExitToLLInt, false, Normal, "If true, we always exit to the LLInt. If false, we exit to whatever is most convenient.") \
    515515    v(Unsigned, getByValICMaxNumberOfIdentifiers, 4, Normal, "Number of identifiers we see in the LLInt that could cause us to bail on generating an IC for get_by_val.") \
    516     v(Bool, usePublicClassFields, true, Normal, "If true, the parser will understand public data fields inside classes.") \
    517516    v(Bool, useRandomizingExecutableIslandAllocation, false, Normal, "For the arm64 ExecutableAllocator, if true, select which region to use randomly. This is useful for testing that jump islands work.") \
    518517    v(Bool, exposeProfilersOnGlobalObject, false, Normal, "If true, we will expose functions to enable/disable both the sampling profiler and the super sampler") \
     
    526525    v(Bool, exposeCustomSettersOnGlobalObjectForTesting, false, Normal, nullptr) \
    527526    v(Bool, useJITCage, canUseJITCage(), Normal, nullptr) \
    528     v(Bool, usePublicStaticClassFields, false, Normal, "If true, the parser will understand public static data fields inside classes.") \
     527    v(Bool, usePublicStaticClassFields, true, Normal, "If true, the parser will understand public static data fields inside classes.") \
    529528
    530529enum OptionEquivalence {
Note: See TracChangeset for help on using the changeset viewer.