<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[266106] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/266106">266106</a></dd>
<dt>Author</dt> <dd>shvaikalesh@gmail.com</dd>
<dt>Date</dt> <dd>2020-08-25 00:45:00 -0700 (Tue, 25 Aug 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implementation of the class "extends" clause incorrectly uses __proto__ for setting prototypes
https://bugs.webkit.org/show_bug.cgi?id=205848

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/class-derived-creation.js: Added.
* test262/expectations.yaml: Mark 4 test cases as passing.

Source/JavaScriptCore:

To prevent `class extends` from breaking if Object.prototype.__proto__ is overridden
or removed, this patch replaces OpPutById bytecodes in ClassExprNode::emitBytecode()
with JSObject::setPrototypeDirect() invocations via OpCall.

Since the spec sets [[Prototype]] values directly [1], we are safe to skip method
table lookups and cycle checks.

Although this approach adds 4 `mov` ops to emitted bytecode for `class extends` creation,
increasing instruction count to 35, I prefer it over introducing a slow path only op.
To avoid emitting 2 extra `mov` ops, globalFuncSetPrototypeDirect() uses thisRegister().

Aligns JSC with V8 and SpiderMonkey. Derived class creation microbenchmark is neutral.

[1]: https://tc39.es/ecma262/#sec-createbuiltinfunction (step 7)

* builtins/BuiltinNames.h:
* bytecode/BytecodeDumper.cpp:
(JSC::CodeBlockBytecodeDumper<Block>::dumpConstants): Fix typo.
* bytecode/LinkTimeConstant.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitSetPrototypeOf):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ClassExprNode::emitBytecode):
* parser/Nodes.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkJSTeststest262expectationsyaml">trunk/JSTests/test262/expectations.yaml</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinNamesh">trunk/Source/JavaScriptCore/builtins/BuiltinNames.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeDumpercpp">trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeLinkTimeConstanth">trunk/Source/JavaScriptCore/bytecode/LinkTimeConstant.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionsh">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkJSTestsmicrobenchmarksclassderivedcreationjs">trunk/JSTests/microbenchmarks/class-derived-creation.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog  2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/JSTests/ChangeLog     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2020-08-25  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Implementation of the class "extends" clause incorrectly uses __proto__ for setting prototypes
+        https://bugs.webkit.org/show_bug.cgi?id=205848
+
+        Reviewed by Keith Miller.
+
+        * microbenchmarks/class-derived-creation.js: Added.
+        * test262/expectations.yaml: Mark 4 test cases as passing.
+
</ins><span class="cx"> 2020-08-24  Keith Miller  <keith_miller@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Update test262 (mid Aug 2020 edition)
</span></span></pre></div>
<a id="trunkJSTestsmicrobenchmarksclassderivedcreationjs"></a>
<div class="addfile"><h4>Added: trunk/JSTests/microbenchmarks/class-derived-creation.js (0 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/microbenchmarks/class-derived-creation.js                          (rev 0)
+++ trunk/JSTests/microbenchmarks/class-derived-creation.js     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+class A {};
+for (var i = 0; i < 1e4; ++i) {
+    class B extends A {};
+    class C extends B {};
+    class D extends C {};
+}
</ins></span></pre></div>
<a id="trunkJSTeststest262expectationsyaml"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/test262/expectations.yaml (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/test262/expectations.yaml  2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/JSTests/test262/expectations.yaml     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -2155,9 +2155,6 @@
</span><span class="cx"> test/language/expressions/class/ident-name-method-def-with-escaped.js:
</span><span class="cx">   default: "SyntaxError: Unexpected escaped characters in keyword token: 'w\\u0069th'"
</span><span class="cx">   strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'w\\u0069th'"
</span><del>-test/language/expressions/class/poisoned-underscore-proto.js:
-  default: 'Test262Error: should not be called'
-  strict mode: 'Test262Error: should not be called'
</del><span class="cx"> test/language/expressions/compound-assignment/S11.13.2_A5.10_T1.js:
</span><span class="cx">   default: "ReferenceError: Can't find variable: x"
</span><span class="cx"> test/language/expressions/compound-assignment/S11.13.2_A5.10_T2.js:
</span><span class="lines">@@ -3049,9 +3046,6 @@
</span><span class="cx"> test/language/statements/class/ident-name-method-def-with-escaped.js:
</span><span class="cx">   default: "SyntaxError: Unexpected escaped characters in keyword token: 'w\\u0069th'"
</span><span class="cx">   strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'w\\u0069th'"
</span><del>-test/language/statements/class/poisoned-underscore-proto.js:
-  default: 'Test262Error: should not be called'
-  strict mode: 'Test262Error: should not be called'
</del><span class="cx"> test/language/statements/class/subclass/builtin-objects/ArrayBuffer/regular-subclassing.js:
</span><span class="cx">   default: 'Test262Error: Expected true but got false'
</span><span class="cx">   strict mode: 'Test262Error: Expected true but got false'
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/ChangeLog       2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2020-08-25  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Implementation of the class "extends" clause incorrectly uses __proto__ for setting prototypes
+        https://bugs.webkit.org/show_bug.cgi?id=205848
+
+        Reviewed by Keith Miller.
+
+        To prevent `class extends` from breaking if Object.prototype.__proto__ is overridden
+        or removed, this patch replaces OpPutById bytecodes in ClassExprNode::emitBytecode()
+        with JSObject::setPrototypeDirect() invocations via OpCall.
+
+        Since the spec sets [[Prototype]] values directly [1], we are safe to skip method
+        table lookups and cycle checks.
+
+        Although this approach adds 4 `mov` ops to emitted bytecode for `class extends` creation,
+        increasing instruction count to 35, I prefer it over introducing a slow path only op.
+        To avoid emitting 2 extra `mov` ops, globalFuncSetPrototypeDirect() uses thisRegister().
+
+        Aligns JSC with V8 and SpiderMonkey. Derived class creation microbenchmark is neutral.
+
+        [1]: https://tc39.es/ecma262/#sec-createbuiltinfunction (step 7)
+
+        * builtins/BuiltinNames.h:
+        * bytecode/BytecodeDumper.cpp:
+        (JSC::CodeBlockBytecodeDumper<Block>::dumpConstants): Fix typo.
+        * bytecode/LinkTimeConstant.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::emitSetPrototypeOf):
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::ClassExprNode::emitBytecode):
+        * parser/Nodes.h:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+
</ins><span class="cx"> 2020-08-24  Keith Miller  <keith_miller@apple.com>
</span><span class="cx"> 
</span><span class="cx">         DFG should always run CFG Simplification after Constant Folding.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinNames.h (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinNames.h      2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinNames.h 2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -138,6 +138,7 @@
</span><span class="cx">     macro(setBucketHead) \
</span><span class="cx">     macro(setBucketNext) \
</span><span class="cx">     macro(setBucketKey) \
</span><ins>+    macro(setPrototypeDirect) \
</ins><span class="cx">     macro(regExpBuiltinExec) \
</span><span class="cx">     macro(regExpMatchFast) \
</span><span class="cx">     macro(regExpProtoFlagsGetter) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeDumpercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.cpp (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.cpp  2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeDumper.cpp     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">                 sourceCodeRepresentationDescription = "";
</span><span class="cx">                 break;
</span><span class="cx">             case SourceCodeRepresentation::LinkTimeConstant:
</span><del>-                sourceCodeRepresentationDescription = ": in source as linke-time-constant";
</del><ins>+                sourceCodeRepresentationDescription = ": in source as link-time-constant";
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             this->m_out.printf("   k%u = %s%s\n", static_cast<unsigned>(i), toCString(constant.get()).data(), sourceCodeRepresentationDescription);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeLinkTimeConstanth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/LinkTimeConstant.h (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/LinkTimeConstant.h  2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/bytecode/LinkTimeConstant.h     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     v(setBucketHead, nullptr) \
</span><span class="cx">     v(setBucketNext, nullptr) \
</span><span class="cx">     v(setBucketKey, nullptr) \
</span><ins>+    v(setPrototypeDirect, nullptr) \
</ins><span class="cx">     v(propertyIsEnumerable, nullptr) \
</span><span class="cx">     v(ownKeys, nullptr) \
</span><span class="cx">     v(enqueueJob, nullptr) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp   2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp      2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -2692,6 +2692,18 @@
</span><span class="cx">     return dst;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RegisterID* BytecodeGenerator::emitDirectSetPrototypeOf(RegisterID* dst, RegisterID* base, RegisterID* prototype, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+{
+    RefPtr<RegisterID> setPrototypeDirect = moveLinkTimeConstant(nullptr, LinkTimeConstant::setPrototypeDirect);
+
+    CallArguments args(*this, nullptr, 1);
+    move(args.thisRegister(), base);
+    move(args.argumentRegister(0), prototype);
+
+    emitCall(newTemporary(), setPrototypeDirect.get(), NoExpectedFunction, args, divot, divotStart, divotEnd, DebuggableCall::No);
+    return dst;
+}
+
</ins><span class="cx"> RegisterID* BytecodeGenerator::emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value)
</span><span class="cx"> {
</span><span class="cx">     OpPutByVal::emit(this, base, property, value, ecmaMode());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h     2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -812,6 +812,7 @@
</span><span class="cx">         RegisterID* emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
</span><span class="cx">         RegisterID* emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* thisValue, RegisterID* property);
</span><span class="cx">         RegisterID* emitGetPrototypeOf(RegisterID* dst, RegisterID* value);
</span><ins>+        RegisterID* emitDirectSetPrototypeOf(RegisterID* dst, RegisterID* base, RegisterID* prototype, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
</ins><span class="cx">         RegisterID* emitPutByVal(RegisterID* base, RegisterID* property, RegisterID* value);
</span><span class="cx">         RegisterID* emitPutByVal(RegisterID* base, RegisterID* thisValue, RegisterID* property, RegisterID* value);
</span><span class="cx">         RegisterID* emitDirectGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp   2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -4908,9 +4908,9 @@
</span><span class="cx">         generator.emitThrowTypeError("The value of the superclass's prototype property is not an object or null."_s);
</span><span class="cx">         generator.emitLabel(protoParentIsObjectOrNullLabel.get());
</span><span class="cx"> 
</span><del>-        generator.emitDirectPutById(constructor.get(), generator.propertyNames().underscoreProto, superclass.get(), PropertyNode::Unknown);
</del><ins>+        generator.emitDirectSetPrototypeOf(tempRegister.get(), constructor.get(), superclass.get(), divot(), divotStart(), divotEnd());
</ins><span class="cx">         generator.emitLabel(superclassIsNullLabel.get());
</span><del>-        generator.emitDirectPutById(prototype.get(), generator.propertyNames().underscoreProto, protoParent.get(), PropertyNode::Unknown);
</del><ins>+        generator.emitDirectSetPrototypeOf(tempRegister.get(), prototype.get(), protoParent.get(), divot(), divotStart(), divotEnd());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (needsHomeObject)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h       2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h  2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -2323,7 +2323,7 @@
</span><span class="cx">         Type m_type;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    class ClassExprNode final : public ExpressionNode, public VariableEnvironmentNode {
</del><ins>+    class ClassExprNode final : public ExpressionNode, public ThrowableExpressionData, public VariableEnvironmentNode {
</ins><span class="cx">         JSC_MAKE_PARSER_ARENA_DELETABLE_ALLOCATED(ClassExprNode);
</span><span class="cx">     public:
</span><span class="cx">         ClassExprNode(const JSTokenLocation&, const Identifier&, const SourceCode& classSource,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp   2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp      2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -1231,6 +1231,9 @@
</span><span class="cx">     m_linkTimeConstants[static_cast<unsigned>(LinkTimeConstant::sameValue)].initLater([] (const Initializer<JSCell>& init) {
</span><span class="cx">             init.set(JSFunction::create(init.vm, jsCast<JSGlobalObject*>(init.owner), 2, String(), objectConstructorIs, ObjectIsIntrinsic));
</span><span class="cx">         });
</span><ins>+    m_linkTimeConstants[static_cast<unsigned>(LinkTimeConstant::setPrototypeDirect)].initLater([] (const Initializer<JSCell>& init) {
+            init.set(JSFunction::create(init.vm, jsCast<JSGlobalObject*>(init.owner), 2, String(), globalFuncSetPrototypeDirect));
+        });
</ins><span class="cx"> 
</span><span class="cx">     // RegExp.prototype helpers.
</span><span class="cx">     m_linkTimeConstants[static_cast<unsigned>(LinkTimeConstant::regExpCreate)].initLater([] (const Initializer<JSCell>& init) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp  2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp     2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -730,6 +730,19 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL globalFuncSetPrototypeDirect(JSGlobalObject* globalObject, CallFrame* callFrame)
+{
+    VM& vm = globalObject->vm();
+
+    JSValue value = callFrame->uncheckedArgument(0);
+    ASSERT(value.isObject() || value.isNull());
+
+    JSObject* object = asObject(callFrame->thisValue());
+    object->setPrototypeDirect(vm, value);
+
+    return { };
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncHostPromiseRejectionTracker(JSGlobalObject* globalObject, CallFrame* callFrame)
</span><span class="cx"> {
</span><span class="cx">     VM& vm = globalObject->vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h (266105 => 266106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h    2020-08-25 07:42:49 UTC (rev 266105)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h       2020-08-25 07:45:00 UTC (rev 266106)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncMakeTypeError(JSGlobalObject*, CallFrame*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoGetter(JSGlobalObject*, CallFrame*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoSetter(JSGlobalObject*, CallFrame*);
</span><ins>+EncodedJSValue JSC_HOST_CALL globalFuncSetPrototypeDirect(JSGlobalObject*, CallFrame*);
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncHostPromiseRejectionTracker(JSGlobalObject*, CallFrame*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncBuiltinLog(JSGlobalObject*, CallFrame*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncBuiltinDescribe(JSGlobalObject*, CallFrame*);
</span></span></pre>
</div>
</div>

</body>
</html>