Commit 112b8596 authored by barraclough@apple.com's avatar barraclough@apple.com

DFG JIT, Branch on integer can always be a 32-bit compare.

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

Reviewed by Sam Weinig.

if (shouldSpeculateInteger(node.child1()) && !isStrictInt32(node.child1())),
the JSVALUE64 JIT will currently compare all 64bits in the register, but in
these cases the DataFormat is always a JS boxed integer. In these cases we
can just compare the low 32bits anyway - no need to check the tag.
This allows the code to be unified with the JSVALUE32_64 JIT.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b8040b6e
2011-09-30 Gavin Barraclough <barraclough@apple.com>
DFG JIT, Branch on integer can always be a 32-bit compare.
https://bugs.webkit.org/show_bug.cgi?id=69174
Reviewed by Sam Weinig.
if (shouldSpeculateInteger(node.child1()) && !isStrictInt32(node.child1())),
the JSVALUE64 JIT will currently compare all 64bits in the register, but in
these cases the DataFormat is always a JS boxed integer. In these cases we
can just compare the low 32bits anyway - no need to check the tag.
This allows the code to be unified with the JSVALUE32_64 JIT.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
2011-09-30 Oliver Hunt <oliver@apple.com>
Need a sensible GGC policy
......@@ -1270,7 +1270,7 @@ void SpeculativeJIT::compile(Node& node)
case Branch:
if (isStrictInt32(node.child1()) || shouldSpeculateInteger(node.child1())) {
SpeculateStrictInt32Operand op(this, node.child1());
SpeculateIntegerOperand op(this, node.child1());
BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
......
......@@ -1363,8 +1363,8 @@ void SpeculativeJIT::compile(Node& node)
}
case Branch:
if (isStrictInt32(node.child1())) {
SpeculateStrictInt32Operand op(this, node.child1());
if (isStrictInt32(node.child1()) || shouldSpeculateInteger(node.child1())) {
SpeculateIntegerOperand op(this, node.child1());
BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
......@@ -1385,29 +1385,6 @@ void SpeculativeJIT::compile(Node& node)
noResult(m_compileIndex);
break;
}
if (shouldSpeculateInteger(node.child1())) {
SpeculateIntegerOperand op(this, node.child1());
BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
MacroAssembler::RelationalCondition condition = MacroAssembler::NotEqual;
if (taken == (m_block + 1)) {
condition = MacroAssembler::Equal;
BlockIndex tmp = taken;
taken = notTaken;
notTaken = tmp;
}
addBranch(m_jit.branchPtr(condition, op.gpr(), GPRInfo::tagTypeNumberRegister), taken);
if (notTaken != (m_block + 1))
addBranch(m_jit.jump(), notTaken);
noResult(m_compileIndex);
break;
}
emitBranch(node);
break;
......
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