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:
Nicolas B. Pierron 2015-08-29 01:32:35 +02:00
Родитель 843adc9871
Коммит d84b8525a0
3 изменённых файлов: 7 добавлений и 20 удалений

Просмотреть файл

@ -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)
{