Title: [264748] trunk/Source/_javascript_Core
Revision
264748
Author
shvaikal...@gmail.com
Date
2020-07-23 00:28:49 -0700 (Thu, 23 Jul 2020)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (264747 => 264748)


--- trunk/Source/_javascript_Core/ChangeLog	2020-07-23 04:52:32 UTC (rev 264747)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-07-23 07:28:49 UTC (rev 264748)
@@ -1,3 +1,21 @@
+2020-07-23  Alexey Shvayka  <shvaikal...@gmail.com>
+
+        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):
+
 2020-07-22  Conrad Shultz  <conrad_shu...@apple.com>
 
         Update macOS Version macros

Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (264747 => 264748)


--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2020-07-23 04:52:32 UTC (rev 264747)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2020-07-23 07:28:49 UTC (rev 264748)
@@ -4892,15 +4892,11 @@
 
         RefPtr<RegisterID> tempRegister = generator.newTemporary();
 
-        Ref<Label> superclassIsUndefinedLabel = generator.newLabel();
-        generator.emitJumpIfTrue(generator.emitIsUndefined(tempRegister.get(), superclass.get()), superclassIsUndefinedLabel.get());
-
         Ref<Label> superclassIsNullLabel = generator.newLabel();
         generator.emitJumpIfTrue(generator.emitIsNull(tempRegister.get(), superclass.get()), superclassIsNullLabel.get());
 
         Ref<Label> superclassIsConstructorLabel = generator.newLabel();
         generator.emitJumpIfTrue(generator.emitIsConstructor(tempRegister.get(), superclass.get()), superclassIsConstructorLabel.get());
-        generator.emitLabel(superclassIsUndefinedLabel.get());
         generator.emitThrowTypeError("The superclass is not a constructor."_s);
         generator.emitLabel(superclassIsConstructorLabel.get());
         generator.emitGetById(protoParent.get(), superclass.get(), generator.propertyNames().prototype);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to