Skip to content

Commit a511792

Browse files
committed
r281485 was not sufficient in where it called disablePeepholeOptimization
https://bugs.webkit.org/show_bug.cgi?id=229582 <rdar://82346980> Reviewed by Yusuke Suzuki. JSTests: * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added. (foo): Source/JavaScriptCore: r281485 accidentally deleted a place where we called disablePeepholeOptimization that was necessary. Basically, after we seek where the current instruction in BytecodeGenerator is, we need to disablePeepholeOptimization. * bytecompiler/BytecodeGenerator.cpp: (JSC::ForInContext::finalize): Canonical link: https://commits.webkit.org/241018@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 41e2080 commit a511792

4 files changed

Lines changed: 40 additions & 2 deletions

File tree

JSTests/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2021-08-26 Saam Barati <sbarati@apple.com>
2+
3+
r281485 was not sufficient in where it called disablePeepholeOptimization
4+
https://bugs.webkit.org/show_bug.cgi?id=229582
5+
<rdar://82346980>
6+
7+
Reviewed by Yusuke Suzuki.
8+
9+
* stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added.
10+
(foo):
11+
112
2021-08-24 Yusuke Suzuki <ysuzuki@apple.com>
213

314
Update Intl tests to support ICU 68
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function foo() {
2+
for (var c in b) {
3+
if (b.hasOwnProperty(c)) {
4+
var e = b[c];
5+
c = "str";
6+
}
7+
}
8+
}
9+
10+
try {
11+
foo();
12+
} catch { }

Source/JavaScriptCore/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2021-08-26 Saam Barati <sbarati@apple.com>
2+
3+
r281485 was not sufficient in where it called disablePeepholeOptimization
4+
https://bugs.webkit.org/show_bug.cgi?id=229582
5+
<rdar://82346980>
6+
7+
Reviewed by Yusuke Suzuki.
8+
9+
r281485 accidentally deleted a place where we called disablePeepholeOptimization
10+
that was necessary. Basically, after we seek where the current instruction
11+
in BytecodeGenerator is, we need to disablePeepholeOptimization.
12+
13+
* bytecompiler/BytecodeGenerator.cpp:
14+
(JSC::ForInContext::finalize):
15+
116
2021-08-26 Per Arne Vollan <pvollan@apple.com>
217

318
[AppleWin] JSC build failure

Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5386,16 +5386,16 @@ void ForInContext::finalize(BytecodeGenerator& generator, UnlinkedCodeBlockGener
53865386
auto end = branchInstIndex + instruction->size();
53875387

53885388
generator.m_writer.seek(branchInstIndex);
5389+
generator.disablePeepholeOptimization();
53895390

53905391
OpJmp::emit(&generator, BoundLabel(static_cast<int>(newBranchTarget) - static_cast<int>(branchInstIndex)));
53915392

53925393
while (generator.m_writer.position() < end)
53935394
OpNop::emit<OpcodeSize::Narrow>(&generator);
53945395
}
53955396

5396-
generator.disablePeepholeOptimization(); // We might've just changed the last bytecode that was emitted.
5397-
53985397
generator.m_writer.seek(generator.m_writer.size());
5398+
generator.disablePeepholeOptimization(); // We might've just changed the last bytecode that was emitted.
53995399
}
54005400

54015401
void StaticPropertyAnalysis::record()

0 commit comments

Comments
 (0)