Bug 739512: Patch 11: change JSScript::useCount to uint32_t. r=dvander.

--HG--
extra : rebase_source : 408dd77b28b697140f6ba08680b24cb69c046390
This commit is contained in:
Nicholas Nethercote 2012-04-11 16:37:57 -07:00
parent 3e6dfb0349
commit 16972fac2e
2 changed files with 9 additions and 8 deletions

View File

@ -463,10 +463,6 @@ struct JSScript : public js::gc::Cell
private:
js::HeapPtrFunction function_;
size_t useCount; /* Number of times the script has been called
* or has had backedges taken. Reset if the
* script's JIT code is forcibly discarded. */
// 32-bit fields.
public:
@ -479,6 +475,11 @@ struct JSScript : public js::gc::Cell
uint32_t natoms; /* length of atoms array */
private:
uint32_t useCount; /* Number of times the script has been called
* or has had backedges taken. Reset if the
* script's JIT code is forcibly discarded. */
#ifdef DEBUG
// Unique identifier within the compartment for this script, used for
// printing analysis information.
@ -701,9 +702,9 @@ struct JSScript : public js::gc::Cell
inline void **nativeMap(bool constructing);
inline void *nativeCodeForPC(bool constructing, jsbytecode *pc);
size_t getUseCount() const { return useCount; }
size_t incUseCount() { return ++useCount; }
size_t *addressOfUseCount() { return &useCount; }
uint32_t getUseCount() const { return useCount; }
uint32_t incUseCount() { return ++useCount; }
uint32_t *addressOfUseCount() { return &useCount; }
void resetUseCount() { useCount = 0; }
/*

View File

@ -3890,7 +3890,7 @@ mjit::Compiler::recompileCheckHelper()
return;
}
size_t *addr = script->addressOfUseCount();
uint32_t *addr = script->addressOfUseCount();
masm.add32(Imm32(1), AbsoluteAddress(addr));
#if defined(JS_CPU_X86) || defined(JS_CPU_ARM)
Jump jump = masm.branch32(Assembler::GreaterThanOrEqual, AbsoluteAddress(addr),