зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1190454 part 1 - PCCounts use uint64_t instead of a double to count the number of hits. r=evilpie
This commit is contained in:
Родитель
843adc9871
Коммит
d84b8525a0
|
@ -808,17 +808,8 @@ BaselineCompiler::emitDebugTrap()
|
|||
void
|
||||
BaselineCompiler::emitCoverage(jsbytecode* pc)
|
||||
{
|
||||
double* counterAddr = &script->getPCCounts(pc).numExec();
|
||||
AllocatableRegisterSet regs(RegisterSet::Volatile());
|
||||
Register counterAddrReg = R2.scratchReg();
|
||||
FloatRegister counter = regs.takeAnyFloat();
|
||||
FloatRegister one = regs.takeAnyFloat();
|
||||
|
||||
masm.movePtr(ImmPtr(counterAddr), counterAddrReg);
|
||||
masm.loadDouble(Address(counterAddrReg, 0), counter);
|
||||
masm.loadConstantDouble(1.0, one);
|
||||
masm.addDouble(one, counter);
|
||||
masm.storeDouble(counter, Address(counterAddrReg, 0));
|
||||
uint64_t* counterAddr = &script->getPCCounts(pc).numExec();
|
||||
masm.inc64(AbsoluteAddress(counterAddr));
|
||||
}
|
||||
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
|
|
|
@ -1741,13 +1741,12 @@ js::GetPCCountScriptSummary(JSContext* cx, size_t index)
|
|||
}
|
||||
}
|
||||
|
||||
double total = 0.0;
|
||||
uint64_t total = 0;
|
||||
|
||||
jsbytecode* codeEnd = script->codeEnd();
|
||||
for (jsbytecode* pc = script->code(); pc < codeEnd; pc = GetNextPc(pc)) {
|
||||
PCCounts& counts = sac.getPCCounts(pc);
|
||||
double value = counts.numExec();
|
||||
total += value;
|
||||
total += counts.numExec();
|
||||
}
|
||||
|
||||
AppendJSONProperty(buf, "totals");
|
||||
|
|
|
@ -772,23 +772,20 @@ GetBytecodeInteger(jsbytecode* pc)
|
|||
*/
|
||||
class PCCounts
|
||||
{
|
||||
double numExec_;
|
||||
uint64_t numExec_;
|
||||
|
||||
public:
|
||||
|
||||
double& numExec() {
|
||||
uint64_t& numExec() {
|
||||
return numExec_;
|
||||
}
|
||||
double numExec() const {
|
||||
uint64_t numExec() const {
|
||||
return numExec_;
|
||||
}
|
||||
|
||||
static const char* numExecName;
|
||||
};
|
||||
|
||||
/* Necessary for alignment with the script. */
|
||||
JS_STATIC_ASSERT(sizeof(PCCounts) % sizeof(Value) == 0);
|
||||
|
||||
static inline jsbytecode*
|
||||
GetNextPc(jsbytecode* pc)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче