Diff
Modified: branches/safari-603-branch/JSTests/ChangeLog (217674 => 217675)
--- branches/safari-603-branch/JSTests/ChangeLog 2017-06-01 19:46:09 UTC (rev 217674)
+++ branches/safari-603-branch/JSTests/ChangeLog 2017-06-01 19:51:51 UTC (rev 217675)
@@ -1,3 +1,17 @@
+2017-06-01 Matthew Hanson <[email protected]>
+
+ Cherry-pick r216459. rdar://problem/32119857
+
+ 2017-05-08 Mark Lam <[email protected]>
+
+ op_throw_static_error's use of its first operand should be reflected in DFG BytecodeUseDef as well.
+ https://bugs.webkit.org/show_bug.cgi?id=171786
+ <rdar://problem/32051023>
+
+ Reviewed by Saam Barati.
+
+ * stress/bug-171786.js: Added.
+
2017-05-25 Saam Barati <[email protected]>
Cherry-pick r217438. rdar://problem/32385704
Added: branches/safari-603-branch/JSTests/stress/bug-171786.js (0 => 217675)
--- branches/safari-603-branch/JSTests/stress/bug-171786.js (rev 0)
+++ branches/safari-603-branch/JSTests/stress/bug-171786.js 2017-06-01 19:51:51 UTC (rev 217675)
@@ -0,0 +1,15 @@
+
+function foo(i, x) {
+ return String.prototype.big.call(x);
+}
+noInline(foo);
+
+for (var i = 0; i < 1000; i++) {
+ try {
+ if (i < 200)
+ foo(i, "hello");
+ else
+ foo(i, undefined);
+ } catch(e) {
+ }
+}
Modified: branches/safari-603-branch/Source/_javascript_Core/ChangeLog (217674 => 217675)
--- branches/safari-603-branch/Source/_javascript_Core/ChangeLog 2017-06-01 19:46:09 UTC (rev 217674)
+++ branches/safari-603-branch/Source/_javascript_Core/ChangeLog 2017-06-01 19:51:51 UTC (rev 217675)
@@ -1,3 +1,32 @@
+2017-06-01 Matthew Hanson <[email protected]>
+
+ Cherry-pick r216459. rdar://problem/32119857
+
+ 2017-05-08 Mark Lam <[email protected]>
+
+ op_throw_static_error's use of its first operand should be reflected in DFG BytecodeUseDef as well.
+ https://bugs.webkit.org/show_bug.cgi?id=171786
+ <rdar://problem/32051023>
+
+ Reviewed by Saam Barati.
+
+ * bytecode/BytecodeDumper.cpp:
+ (JSC::BytecodeDumper<Block>::dumpBytecode):
+ - Fix BytecodeDumper to dump op_throw_static_error correctly. Previously,
+ it was expecting op1 to always be a constant. r206870 changed it to take a
+ variable string as well.
+
+ * bytecode/BytecodeUseDef.h:
+ (JSC::computeUsesForBytecodeOffset):
+ - Fix the bug.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ - Move the Phantom of op1 after the ThrowStaticError node, because technically,
+ the ThrowStaticError represents op_throw_static_error, and op_throw_static_error
+ uses op1. In practice, this probably doesn't matter, but let's have the code
+ accurately communicate the behavior we're expecting.
+
2017-05-25 Saam Barati <[email protected]>
Cherry-pick r217438. rdar://problem/32385704
Modified: branches/safari-603-branch/Source/_javascript_Core/bytecode/BytecodeUseDef.h (217674 => 217675)
--- branches/safari-603-branch/Source/_javascript_Core/bytecode/BytecodeUseDef.h 2017-06-01 19:46:09 UTC (rev 217674)
+++ branches/safari-603-branch/Source/_javascript_Core/bytecode/BytecodeUseDef.h 2017-06-01 19:51:51 UTC (rev 217675)
@@ -40,7 +40,6 @@
// No uses.
case op_new_regexp:
case op_new_array_buffer:
- case op_throw_static_error:
case op_debug:
case op_jneq_ptr:
case op_loop_hint:
@@ -71,7 +70,8 @@
case op_jneq_null:
case op_dec:
case op_inc:
- case op_log_shadow_chicken_prologue: {
+ case op_log_shadow_chicken_prologue:
+ case op_throw_static_error: {
ASSERT(opcodeLengths[opcodeID] > 1);
functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
return;
Modified: branches/safari-603-branch/Source/_javascript_Core/bytecode/CodeBlock.cpp (217674 => 217675)
--- branches/safari-603-branch/Source/_javascript_Core/bytecode/CodeBlock.cpp 2017-06-01 19:46:09 UTC (rev 217674)
+++ branches/safari-603-branch/Source/_javascript_Core/bytecode/CodeBlock.cpp 2017-06-01 19:51:51 UTC (rev 217675)
@@ -1672,10 +1672,10 @@
break;
}
case op_throw_static_error: {
- int k0 = (++it)->u.operand;
+ int r0 = (++it)->u.operand;
ErrorType k1 = static_cast<ErrorType>((++it)->u.unsignedValue);
printLocationAndOp(out, exec, location, it, "throw_static_error");
- out.printf("%s, ", constantName(k0).data());
+ out.printf("%s, ", registerName(r0).data());
out.print(k1);
break;
}
Modified: branches/safari-603-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (217674 => 217675)
--- branches/safari-603-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2017-06-01 19:46:09 UTC (rev 217674)
+++ branches/safari-603-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2017-06-01 19:51:51 UTC (rev 217675)
@@ -4857,8 +4857,8 @@
LAST_OPCODE(op_throw);
case op_throw_static_error:
+ addToGraph(ThrowStaticError);
addToGraph(Phantom, get(VirtualRegister(currentInstruction[1].u.operand))); // Keep argument live.
- addToGraph(ThrowStaticError);
flushForTerminal();
addToGraph(Unreachable);
LAST_OPCODE(op_throw_static_error);