⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264748 in webkit


Ignore:
Timestamp:
Jul 23, 2020, 12:28:49 AM (6 years ago)
Author:
Alexey Shvayka
Message:

Remove emitIsUndefined() from ClassExprNode::emitBytecode()
https://bugs.webkit.org/show_bug.cgi?id=214645

Reviewed by Darin Adler.

This change removes superclass === undefined check because it's missing from
the spec [1] and isn't a common case. No behavior change: values except null are
passed to OpIsConstructor, resulting in the same error being thrown for undefined.

Test: LayoutTests/js/class-syntax-extends.html

[1]: https://tc39.es/ecma262/#sec-runtime-semantics-classdefinitionevaluation (step 5.e)

  • bytecompiler/NodesCodegen.cpp:

(JSC::ClassExprNode::emitBytecode):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r264746 r264748  
     12020-07-23  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Remove emitIsUndefined() from ClassExprNode::emitBytecode()
     4        https://bugs.webkit.org/show_bug.cgi?id=214645
     5
     6        Reviewed by Darin Adler.
     7
     8        This change removes `superclass === undefined` check because it's missing from
     9        the spec [1] and isn't a common case. No behavior change: values except `null` are
     10        passed to OpIsConstructor, resulting in the same error being thrown for `undefined`.
     11
     12        Test: LayoutTests/js/class-syntax-extends.html
     13
     14        [1]: https://tc39.es/ecma262/#sec-runtime-semantics-classdefinitionevaluation (step 5.e)
     15
     16        * bytecompiler/NodesCodegen.cpp:
     17        (JSC::ClassExprNode::emitBytecode):
     18
    1192020-07-22  Conrad Shultz  <conrad_shultz@apple.com>
    220
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r264504 r264748  
    48934893        RefPtr<RegisterID> tempRegister = generator.newTemporary();
    48944894
    4895         Ref<Label> superclassIsUndefinedLabel = generator.newLabel();
    4896         generator.emitJumpIfTrue(generator.emitIsUndefined(tempRegister.get(), superclass.get()), superclassIsUndefinedLabel.get());
    4897 
    48984895        Ref<Label> superclassIsNullLabel = generator.newLabel();
    48994896        generator.emitJumpIfTrue(generator.emitIsNull(tempRegister.get(), superclass.get()), superclassIsNullLabel.get());
     
    49014898        Ref<Label> superclassIsConstructorLabel = generator.newLabel();
    49024899        generator.emitJumpIfTrue(generator.emitIsConstructor(tempRegister.get(), superclass.get()), superclassIsConstructorLabel.get());
    4903         generator.emitLabel(superclassIsUndefinedLabel.get());
    49044900        generator.emitThrowTypeError("The superclass is not a constructor."_s);
    49054901        generator.emitLabel(superclassIsConstructorLabel.get());
Note: See TracChangeset for help on using the changeset viewer.