Commit c0a31d7e authored by oliver@apple.com's avatar oliver@apple.com

fourthTier: GC's put_by_id transition fixpoint should converge more quickly

https://bugs.webkit.org/show_bug.cgi?id=117912

Reviewed by Mark Hahnenberg.

This was a rookie mistake. The GC does a classic forward data flow fixpoint. These work well so long as you
iterate the program in program order, or at least something close to program order. Because I enjoy reverse
loops ("while (n--) blah"), I ended up iterating in *reverse* of program order which ensured worst-case
pathologies every single time. And unsurprisingly, this slowed down a program, namely pdfjs.

Flipping the loops to iterate forward fixes a 90% regression in Octane/pdfjs and is otherwise neutral.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::propagateTransitions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c2eda9aa
2013-06-22 Filip Pizlo <fpizlo@apple.com>
fourthTier: GC's put_by_id transition fixpoint should converge more quickly
https://bugs.webkit.org/show_bug.cgi?id=117912
Reviewed by Mark Hahnenberg.
This was a rookie mistake. The GC does a classic forward data flow fixpoint. These work well so long as you
iterate the program in program order, or at least something close to program order. Because I enjoy reverse
loops ("while (n--) blah"), I ended up iterating in *reverse* of program order which ensured worst-case
pathologies every single time. And unsurprisingly, this slowed down a program, namely pdfjs.
Flipping the loops to iterate forward fixes a 90% regression in Octane/pdfjs and is otherwise neutral.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::propagateTransitions):
2013-06-21 Filip Pizlo <fpizlo@apple.com>
fourthTier: DFG should CSE MakeRope
......
......@@ -1972,7 +1972,7 @@ void CodeBlock::propagateTransitions(SlotVisitor& visitor)
Interpreter* interpreter = m_vm->interpreter;
if (jitType() == JITCode::InterpreterThunk) {
const Vector<unsigned>& propertyAccessInstructions = m_unlinkedCode->propertyAccessInstructions();
for (size_t i = propertyAccessInstructions.size(); i--;) {
for (size_t i = 0; i < propertyAccessInstructions.size(); ++i) {
Instruction* instruction = &instructions()[propertyAccessInstructions[i]];
switch (interpreter->getOpcodeID(instruction[0].u.opcode)) {
case op_put_by_id_transition_direct:
......@@ -1994,7 +1994,7 @@ void CodeBlock::propagateTransitions(SlotVisitor& visitor)
#if ENABLE(JIT)
if (JITCode::isJIT(jitType())) {
for (unsigned i = m_structureStubInfos.size(); i--;) {
for (unsigned i = 0; i < m_structureStubInfos.size(); ++i) {
StructureStubInfo& stubInfo = m_structureStubInfos[i];
switch (stubInfo.accessType) {
case access_put_by_id_transition_normal:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment