Title: [190435] trunk/Source/_javascript_Core
- Revision
- 190435
- Author
- [email protected]
- Date
- 2015-10-01 16:21:39 -0700 (Thu, 01 Oct 2015)
Log Message
Remove unnecessary SpecialFastCaseProfiles.
https://bugs.webkit.org/show_bug.cgi?id=149729
Reviewed by Saam Barati.
The current baseline code creates special fast case profiles records for
bytecodes that don't need them. This was done to keep the DFG from crashing when
it searches for such a profile and don't find one. Instead, we will fix the code
to check for the existence of the profile before dereferencing it to get a count.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::specialFastCaseProfileCountForBytecodeOffset):
(JSC::CodeBlock::couldTakeSpecialFastCase):
(JSC::CodeBlock::likelyToTakeDeepestSlowCase):
(JSC::CodeBlock::numberOfArrayProfiles):
(JSC::CodeBlock::arrayProfiles):
(JSC::CodeBlock::addArrayProfile):
(JSC::CodeBlock::likelyToTakeSpecialFastCase): Deleted. Not used.
(JSC::CodeBlock::likelyToTakeAnySlowCase): Deleted. Not used.
* jit/JITArithmetic.cpp:
(JSC::JIT::compileBinaryArithOp):
- Only op_mul needs the profile. So, only allocate it in the op_mul case.
(JSC::JIT::emit_op_mul):
- These op_mul cases create the profile but never increments its counter.
Hence, we can get rid of these.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (190434 => 190435)
--- trunk/Source/_javascript_Core/ChangeLog 2015-10-01 22:32:56 UTC (rev 190434)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-10-01 23:21:39 UTC (rev 190435)
@@ -1,3 +1,33 @@
+2015-10-01 Mark Lam <[email protected]>
+
+ Remove unnecessary SpecialFastCaseProfiles.
+ https://bugs.webkit.org/show_bug.cgi?id=149729
+
+ Reviewed by Saam Barati.
+
+ The current baseline code creates special fast case profiles records for
+ bytecodes that don't need them. This was done to keep the DFG from crashing when
+ it searches for such a profile and don't find one. Instead, we will fix the code
+ to check for the existence of the profile before dereferencing it to get a count.
+
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::specialFastCaseProfileCountForBytecodeOffset):
+ (JSC::CodeBlock::couldTakeSpecialFastCase):
+ (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
+ (JSC::CodeBlock::numberOfArrayProfiles):
+ (JSC::CodeBlock::arrayProfiles):
+ (JSC::CodeBlock::addArrayProfile):
+ (JSC::CodeBlock::likelyToTakeSpecialFastCase): Deleted. Not used.
+ (JSC::CodeBlock::likelyToTakeAnySlowCase): Deleted. Not used.
+ * jit/JITArithmetic.cpp:
+
+ (JSC::JIT::compileBinaryArithOp):
+ - Only op_mul needs the profile. So, only allocate it in the op_mul case.
+
+ (JSC::JIT::emit_op_mul):
+ - These op_mul cases create the profile but never increments its counter.
+ Hence, we can get rid of these.
+
2015-10-01 Keith Miller <[email protected]>
[ES6] Add TypedArray.prototype functionality.
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (190434 => 190435)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2015-10-01 22:32:56 UTC (rev 190434)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h 2015-10-01 23:21:39 UTC (rev 190435)
@@ -438,20 +438,19 @@
m_specialFastCaseProfiles, m_specialFastCaseProfiles.size(), bytecodeOffset,
getRareCaseProfileBytecodeOffset);
}
-
- bool likelyToTakeSpecialFastCase(int bytecodeOffset)
+ unsigned specialFastCaseProfileCountForBytecodeOffset(int bytecodeOffset)
{
- if (!hasBaselineJITProfiling())
- return false;
- unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
- return specialFastCaseCount >= Options::likelyToTakeSlowCaseMinimumCount();
+ RareCaseProfile* profile = ""
+ if (!profile)
+ return 0;
+ return profile->m_counter;
}
bool couldTakeSpecialFastCase(int bytecodeOffset)
{
if (!hasBaselineJITProfiling())
return false;
- unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
+ unsigned specialFastCaseCount = specialFastCaseProfileCountForBytecodeOffset(bytecodeOffset);
return specialFastCaseCount >= Options::couldTakeSlowCaseMinimumCount();
}
@@ -460,21 +459,11 @@
if (!hasBaselineJITProfiling())
return false;
unsigned slowCaseCount = rareCaseProfileCountForBytecodeOffset(bytecodeOffset);
- unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
+ unsigned specialFastCaseCount = specialFastCaseProfileCountForBytecodeOffset(bytecodeOffset);
unsigned value = slowCaseCount - specialFastCaseCount;
return value >= Options::likelyToTakeSlowCaseMinimumCount();
}
- bool likelyToTakeAnySlowCase(int bytecodeOffset)
- {
- if (!hasBaselineJITProfiling())
- return false;
- unsigned slowCaseCount = rareCaseProfileCountForBytecodeOffset(bytecodeOffset);
- unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
- unsigned value = slowCaseCount + specialFastCaseCount;
- return value >= Options::likelyToTakeSlowCaseMinimumCount();
- }
-
unsigned numberOfArrayProfiles() const { return m_arrayProfiles.size(); }
const ArrayProfileVector& arrayProfiles() { return m_arrayProfiles; }
ArrayProfile* addArrayProfile(unsigned bytecodeOffset)
Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (190434 => 190435)
--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-10-01 22:32:56 UTC (rev 190434)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp 2015-10-01 23:21:39 UTC (rev 190435)
@@ -666,7 +666,6 @@
emitGetVirtualRegisters(op1, regT0, op2, regT1);
emitJumpSlowCaseIfNotInt(regT0);
emitJumpSlowCaseIfNotInt(regT1);
- RareCaseProfile* profile = ""
if (opcodeID == op_add)
addSlowCase(branchAdd32(Overflow, regT1, regT0));
else if (opcodeID == op_sub)
@@ -688,7 +687,7 @@
// We only get here if we have a genuine negative zero. Record this,
// so that the speculative JIT knows that we failed speculation
// because of a negative zero.
- add32(TrustedImm32(1), AbsoluteAddress(&profile->m_counter));
+ add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset)->m_counter));
addSlowCase(jump());
done.link(this);
move(regT2, regT0);
@@ -836,15 +835,11 @@
// For now, only plant a fast int case if the constant operand is greater than zero.
int32_t value;
if (isOperandConstantInt(op1) && ((value = getOperandConstantInt(op1)) > 0)) {
- // Add a special fast case profile because the DFG JIT will expect one.
- m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset);
emitGetVirtualRegister(op2, regT0);
emitJumpSlowCaseIfNotInt(regT0);
addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1));
emitTagInt(regT1, regT0);
} else if (isOperandConstantInt(op2) && ((value = getOperandConstantInt(op2)) > 0)) {
- // Add a special fast case profile because the DFG JIT will expect one.
- m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset);
emitGetVirtualRegister(op1, regT0);
emitJumpSlowCaseIfNotInt(regT0);
addSlowCase(branchMul32(Overflow, Imm32(value), regT0, regT1));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes