mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset fdd10e0e6e5e (bug 739512) due to 32-bit bustage.
This commit is contained in:
parent
12cb5ac08b
commit
8bdc9b2a07
@ -91,8 +91,7 @@ JSCompartment::JSCompartment(JSRuntime *rt)
|
||||
gcMallocBytes(0),
|
||||
debugModeBits(rt->debugMode ? DebugFromC : 0),
|
||||
mathCache(NULL),
|
||||
watchpointMap(NULL),
|
||||
scriptCountsMap(NULL)
|
||||
watchpointMap(NULL)
|
||||
{
|
||||
PodArrayZero(evalCache);
|
||||
setGCMaxMallocBytes(rt->gcMaxMallocBytes * 0.9);
|
||||
@ -112,7 +111,6 @@ JSCompartment::~JSCompartment()
|
||||
|
||||
Foreground::delete_(mathCache);
|
||||
Foreground::delete_(watchpointMap);
|
||||
Foreground::delete_(scriptCountsMap);
|
||||
|
||||
#ifdef DEBUG
|
||||
for (size_t i = 0; i < ArrayLength(evalCache); ++i)
|
||||
|
@ -463,8 +463,6 @@ struct JSCompartment
|
||||
|
||||
public:
|
||||
js::WatchpointMap *watchpointMap;
|
||||
|
||||
js::ScriptCountsMap *scriptCountsMap;
|
||||
};
|
||||
|
||||
#define JS_PROPERTY_TREE(cx) ((cx)->compartment->propertyTree)
|
||||
|
@ -1598,7 +1598,7 @@ extern JS_PUBLIC_API(void)
|
||||
JS_DumpPCCounts(JSContext *cx, JSScript *script)
|
||||
{
|
||||
#if defined(DEBUG)
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
Sprinter sprinter(cx);
|
||||
if (!sprinter.init())
|
||||
@ -1641,7 +1641,7 @@ JS_DumpCompartmentPCCounts(JSContext *cx)
|
||||
{
|
||||
for (CellIter i(cx->compartment, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
|
||||
JSScript *script = i.get<JSScript>();
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
JS_DumpPCCounts(cx, script);
|
||||
}
|
||||
}
|
||||
|
@ -2306,7 +2306,7 @@ MarkRuntime(JSTracer *trc, bool useSavedRoots = false)
|
||||
if (rt->profilingScripts) {
|
||||
for (CellIterUnderGC i(c, FINALIZE_SCRIPT); !i.done(); i.next()) {
|
||||
JSScript *script = i.get<JSScript>();
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
MarkScriptRoot(trc, &script, "profilingScripts");
|
||||
JS_ASSERT(script == i.get<JSScript>());
|
||||
}
|
||||
@ -4497,12 +4497,12 @@ StopPCCountProfiling(JSContext *cx)
|
||||
for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
|
||||
for (CellIter i(c, FINALIZE_SCRIPT); !i.done(); i.next()) {
|
||||
JSScript *script = i.get<JSScript>();
|
||||
if (script->hasScriptCounts && script->types) {
|
||||
ScriptAndCounts sac;
|
||||
sac.script = script;
|
||||
sac.scriptCounts.set(script->releaseScriptCounts());
|
||||
if (!vec->append(sac))
|
||||
sac.scriptCounts.destroy(rt->defaultFreeOp());
|
||||
if (script->scriptCounts && script->types) {
|
||||
ScriptAndCounts info;
|
||||
info.script = script;
|
||||
info.scriptCounts.steal(script->scriptCounts);
|
||||
if (!vec->append(info))
|
||||
info.scriptCounts.destroy(rt->defaultFreeOp());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1340,9 +1340,9 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
|
||||
JS_ASSERT(!cx->compartment->activeAnalysis);
|
||||
|
||||
#if JS_THREADED_INTERP
|
||||
#define CHECK_PCCOUNT_INTERRUPTS() JS_ASSERT_IF(script->hasScriptCounts, jumpTable == interruptJumpTable)
|
||||
#define CHECK_PCCOUNT_INTERRUPTS() JS_ASSERT_IF(script->scriptCounts, jumpTable == interruptJumpTable)
|
||||
#else
|
||||
#define CHECK_PCCOUNT_INTERRUPTS() JS_ASSERT_IF(script->hasScriptCounts, switchMask == -1)
|
||||
#define CHECK_PCCOUNT_INTERRUPTS() JS_ASSERT_IF(script->scriptCounts, switchMask == -1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1520,7 +1520,7 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
|
||||
script = (s); \
|
||||
if (script->hasAnyBreakpointsOrStepMode()) \
|
||||
ENABLE_INTERRUPTS(); \
|
||||
if (script->hasScriptCounts) \
|
||||
if (script->scriptCounts) \
|
||||
ENABLE_INTERRUPTS(); \
|
||||
JS_ASSERT_IF(interpMode == JSINTERP_SKIP_TRAP, \
|
||||
script->hasAnyBreakpointsOrStepMode()); \
|
||||
@ -1661,12 +1661,12 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
|
||||
bool moreInterrupts = false;
|
||||
|
||||
if (cx->runtime->profilingScripts) {
|
||||
if (!script->hasScriptCounts)
|
||||
if (!script->scriptCounts)
|
||||
script->initScriptCounts(cx);
|
||||
moreInterrupts = true;
|
||||
}
|
||||
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
PCCounts counts = script->getPCCounts(regs.pc);
|
||||
counts.get(PCCounts::BASE_INTERP)++;
|
||||
moreInterrupts = true;
|
||||
|
@ -315,7 +315,7 @@ PCCounts::countName(JSOp op, size_t which)
|
||||
JS_FRIEND_API(void)
|
||||
js_DumpPCCounts(JSContext *cx, JSScript *script, js::Sprinter *sp)
|
||||
{
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
jsbytecode *pc = script->code;
|
||||
while (pc < script->code + script->length) {
|
||||
@ -6056,8 +6056,8 @@ GetPCCountScriptSummary(JSContext *cx, size_t index)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ScriptAndCounts sac = (*rt->scriptAndCountsVector)[index];
|
||||
JSScript *script = sac.script;
|
||||
ScriptAndCounts info = (*rt->scriptAndCountsVector)[index];
|
||||
JSScript *script = info.script;
|
||||
|
||||
/*
|
||||
* OOM on buffer appends here will not be caught immediately, but since
|
||||
@ -6094,7 +6094,7 @@ GetPCCountScriptSummary(JSContext *cx, size_t index)
|
||||
double arithTotals[PCCounts::ARITH_LIMIT - PCCounts::BASE_LIMIT] = {0.0};
|
||||
|
||||
for (unsigned i = 0; i < script->length; i++) {
|
||||
PCCounts &counts = sac.getPCCounts(script->code + i);
|
||||
PCCounts &counts = info.getPCCounts(script->code + i);
|
||||
if (!counts)
|
||||
continue;
|
||||
|
||||
@ -6155,9 +6155,9 @@ struct AutoDestroyPrinter
|
||||
};
|
||||
|
||||
static bool
|
||||
GetPCCountJSON(JSContext *cx, const ScriptAndCounts &sac, StringBuffer &buf)
|
||||
GetPCCountJSON(JSContext *cx, const ScriptAndCounts &info, StringBuffer &buf)
|
||||
{
|
||||
JSScript *script = sac.script;
|
||||
JSScript *script = info.script;
|
||||
|
||||
buf.append('{');
|
||||
AppendJSONProperty(buf, "text", NO_COMMA);
|
||||
@ -6253,7 +6253,7 @@ GetPCCountJSON(JSContext *cx, const ScriptAndCounts &sac, StringBuffer &buf)
|
||||
buf.append(str);
|
||||
}
|
||||
|
||||
PCCounts &counts = sac.getPCCounts(pc);
|
||||
PCCounts &counts = info.getPCCounts(pc);
|
||||
unsigned numCounts = PCCounts::numCounts(op);
|
||||
|
||||
AppendJSONProperty(buf, "counts");
|
||||
@ -6289,8 +6289,8 @@ GetPCCountScriptContents(JSContext *cx, size_t index)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ScriptAndCounts &sac = (*rt->scriptAndCountsVector)[index];
|
||||
JSScript *script = sac.script;
|
||||
const ScriptAndCounts &info = (*rt->scriptAndCountsVector)[index];
|
||||
JSScript *script = info.script;
|
||||
|
||||
StringBuffer buf(cx);
|
||||
|
||||
@ -6302,7 +6302,7 @@ GetPCCountScriptContents(JSContext *cx, size_t index)
|
||||
if (!ac.enter(cx, script->function() ? (JSObject *) script->function() : script->global()))
|
||||
return NULL;
|
||||
|
||||
if (!GetPCCountJSON(cx, sac, buf))
|
||||
if (!GetPCCountJSON(cx, info, buf))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,7 @@ js::XDRScript(XDRState<XDR_DECODE> *xdr, JSScript **scriptp, JSScript *parentScr
|
||||
bool
|
||||
JSScript::initScriptCounts(JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(!hasScriptCounts);
|
||||
JS_ASSERT(!scriptCounts);
|
||||
|
||||
size_t n = 0;
|
||||
|
||||
@ -801,21 +801,8 @@ JSScript::initScriptCounts(JSContext *cx)
|
||||
if (!cursor)
|
||||
return false;
|
||||
|
||||
/* Create compartment's scriptCountsMap if necessary. */
|
||||
ScriptCountsMap *map = compartment()->scriptCountsMap;
|
||||
if (!map) {
|
||||
map = cx->new_<ScriptCountsMap>();
|
||||
if (!map || !map->init()) {
|
||||
cx->free_(cursor);
|
||||
cx->delete_(map);
|
||||
return false;
|
||||
}
|
||||
compartment()->scriptCountsMap = map;
|
||||
}
|
||||
|
||||
DebugOnly<char *> base = cursor;
|
||||
|
||||
ScriptCounts scriptCounts;
|
||||
scriptCounts.pcCountsVector = (PCCounts *) cursor;
|
||||
cursor += length * sizeof(PCCounts);
|
||||
|
||||
@ -829,13 +816,6 @@ JSScript::initScriptCounts(JSContext *cx)
|
||||
next = pc + GetBytecodeLength(pc);
|
||||
}
|
||||
|
||||
if (!map->putNew(this, scriptCounts)) {
|
||||
cx->free_(cursor);
|
||||
cx->delete_(map);
|
||||
return false;
|
||||
}
|
||||
hasScriptCounts = true; // safe to set this; we can't fail after this point
|
||||
|
||||
JS_ASSERT(size_t(cursor - base) == bytes);
|
||||
|
||||
/* Enable interrupts in any interpreter frames running on this script. */
|
||||
@ -846,37 +826,12 @@ JSScript::initScriptCounts(JSContext *cx)
|
||||
return true;
|
||||
}
|
||||
|
||||
js::PCCounts
|
||||
JSScript::getPCCounts(jsbytecode *pc) {
|
||||
JS_ASSERT(hasScriptCounts);
|
||||
JS_ASSERT(size_t(pc - code) < length);
|
||||
ScriptCountsMap *map = compartment()->scriptCountsMap;
|
||||
JS_ASSERT(map);
|
||||
ScriptCountsMap::Ptr p = map->lookup(this);
|
||||
JS_ASSERT(p);
|
||||
return p->value.pcCountsVector[pc - code];
|
||||
}
|
||||
|
||||
ScriptCounts
|
||||
JSScript::releaseScriptCounts()
|
||||
{
|
||||
JS_ASSERT(hasScriptCounts);
|
||||
ScriptCountsMap *map = compartment()->scriptCountsMap;
|
||||
JS_ASSERT(map);
|
||||
ScriptCountsMap::Ptr p = map->lookup(this);
|
||||
JS_ASSERT(p);
|
||||
ScriptCounts counts = p->value;
|
||||
map->remove(p);
|
||||
hasScriptCounts = false;
|
||||
return counts;
|
||||
}
|
||||
|
||||
void
|
||||
JSScript::destroyScriptCounts(FreeOp *fop)
|
||||
{
|
||||
if (hasScriptCounts) {
|
||||
ScriptCounts scriptCounts = releaseScriptCounts();
|
||||
if (scriptCounts) {
|
||||
fop->free_(scriptCounts.pcCountsVector);
|
||||
scriptCounts.pcCountsVector = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -305,20 +305,23 @@ class ScriptCounts
|
||||
PCCounts *pcCountsVector;
|
||||
|
||||
public:
|
||||
ScriptCounts() : pcCountsVector(NULL) { }
|
||||
|
||||
ScriptCounts() : pcCountsVector(NULL) {
|
||||
}
|
||||
|
||||
inline void destroy(FreeOp *fop);
|
||||
|
||||
void set(js::ScriptCounts counts) {
|
||||
pcCountsVector = counts.pcCountsVector;
|
||||
void steal(ScriptCounts &other) {
|
||||
*this = other;
|
||||
js::PodZero(&other);
|
||||
}
|
||||
|
||||
// Boolean conversion, for 'if (scriptCounts) ...'
|
||||
operator void*() const {
|
||||
return pcCountsVector;
|
||||
}
|
||||
};
|
||||
|
||||
typedef HashMap<JSScript *,
|
||||
ScriptCounts,
|
||||
DefaultHasher<JSScript *>,
|
||||
SystemAllocPolicy> ScriptCountsMap;
|
||||
|
||||
class DebugScript
|
||||
{
|
||||
friend struct ::JSScript;
|
||||
@ -436,6 +439,9 @@ struct JSScript : public js::gc::Cell
|
||||
*/
|
||||
js::HeapPtr<js::GlobalObject, JSScript*> globalObject;
|
||||
|
||||
/* Execution and profiling information for JIT code in the script. */
|
||||
js::ScriptCounts scriptCounts;
|
||||
|
||||
/* Persistent type information retained across GCs. */
|
||||
js::types::TypeScript *types;
|
||||
|
||||
@ -452,7 +458,6 @@ struct JSScript : public js::gc::Cell
|
||||
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:
|
||||
@ -469,10 +474,9 @@ struct JSScript : public js::gc::Cell
|
||||
// Unique identifier within the compartment for this script, used for
|
||||
// printing analysis information.
|
||||
uint32_t id_;
|
||||
#if JS_BITS_PER_WORD == 64
|
||||
private:
|
||||
uint32_t idpad64;
|
||||
#endif
|
||||
uint32_t idpad;
|
||||
public:
|
||||
#endif
|
||||
|
||||
// 16-bit fields.
|
||||
@ -539,8 +543,6 @@ struct JSScript : public js::gc::Cell
|
||||
#endif
|
||||
bool callDestroyHook:1;/* need to call destroy hook */
|
||||
bool isGenerator:1; /* is a generator */
|
||||
bool hasScriptCounts:1;/* script has an entry in
|
||||
JSCompartment::scriptCountsMap */
|
||||
|
||||
private:
|
||||
/* See comments below. */
|
||||
@ -692,10 +694,12 @@ struct JSScript : public js::gc::Cell
|
||||
#endif
|
||||
|
||||
public:
|
||||
js::PCCounts getPCCounts(jsbytecode *pc);
|
||||
js::PCCounts getPCCounts(jsbytecode *pc) {
|
||||
JS_ASSERT(size_t(pc - code) < length);
|
||||
return scriptCounts.pcCountsVector[pc - code];
|
||||
}
|
||||
|
||||
bool initScriptCounts(JSContext *cx);
|
||||
js::ScriptCounts releaseScriptCounts();
|
||||
void destroyScriptCounts(js::FreeOp *fop);
|
||||
|
||||
jsbytecode *main() {
|
||||
|
@ -1384,7 +1384,7 @@ static const JSC::MacroAssembler::RegisterID JSParamReg_Argc = JSC::MIPSRegiste
|
||||
/* Bump the stub call count for script/pc if they are being counted. */
|
||||
void bumpStubCount(JSScript *script, jsbytecode *pc, RegisterID scratch)
|
||||
{
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
PCCounts counts = script->getPCCounts(pc);
|
||||
double *count = &counts.get(PCCounts::BASE_METHODJIT_STUBS);
|
||||
bumpCount(count, scratch);
|
||||
|
@ -402,7 +402,7 @@ mjit::Compiler::scanInlineCalls(uint32_t index, uint32_t depth)
|
||||
CompileStatus
|
||||
mjit::Compiler::pushActiveFrame(JSScript *script, uint32_t argc)
|
||||
{
|
||||
if (cx->runtime->profilingScripts && !script->hasScriptCounts)
|
||||
if (cx->runtime->profilingScripts && !script->scriptCounts)
|
||||
script->initScriptCounts(cx);
|
||||
|
||||
ActiveFrame *newa = OffTheBooks::new_<ActiveFrame>(cx);
|
||||
@ -536,7 +536,7 @@ mjit::Compiler::performCompilation()
|
||||
CHECK_STATUS(scanInlineCalls(CrossScriptSSA::OUTER_FRAME, 0));
|
||||
CHECK_STATUS(pushActiveFrame(outerScript, 0));
|
||||
|
||||
if (outerScript->hasScriptCounts || Probes::wantNativeAddressInfo(cx)) {
|
||||
if (outerScript->scriptCounts || Probes::wantNativeAddressInfo(cx)) {
|
||||
size_t length = ssa.frameLength(ssa.numFrames() - 1);
|
||||
pcLengths = (PCLengthEntry *) OffTheBooks::calloc_(sizeof(pcLengths[0]) * length);
|
||||
if (!pcLengths)
|
||||
@ -2116,7 +2116,7 @@ mjit::Compiler::generateMethod()
|
||||
|
||||
JSValueType arithFirstUseType = JSVAL_TYPE_UNKNOWN;
|
||||
JSValueType arithSecondUseType = JSVAL_TYPE_UNKNOWN;
|
||||
if (script->hasScriptCounts && !!(js_CodeSpec[op].format & JOF_ARITH)) {
|
||||
if (script->scriptCounts && !!(js_CodeSpec[op].format & JOF_ARITH)) {
|
||||
if (GetUseCount(script, PC - script->code) == 1) {
|
||||
FrameEntry *use = frame.peek(-1);
|
||||
/*
|
||||
@ -2140,7 +2140,7 @@ mjit::Compiler::generateMethod()
|
||||
* miss them when taking the jump. This is delayed for other opcodes,
|
||||
* as we want to skip updating for ops we didn't generate any code for.
|
||||
*/
|
||||
if (script->hasScriptCounts && JOF_OPTYPE(op) == JOF_JUMP)
|
||||
if (script->scriptCounts && JOF_OPTYPE(op) == JOF_JUMP)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
|
||||
/**********************
|
||||
@ -2176,7 +2176,7 @@ mjit::Compiler::generateMethod()
|
||||
END_CASE(JSOP_POPV)
|
||||
|
||||
BEGIN_CASE(JSOP_RETURN)
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
emitReturn(frame.peek(-1));
|
||||
fallthrough = false;
|
||||
@ -2297,7 +2297,7 @@ mjit::Compiler::generateMethod()
|
||||
BEGIN_CASE(JSOP_EQ)
|
||||
BEGIN_CASE(JSOP_NE)
|
||||
{
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
updateArithCounts(PC, NULL, arithFirstUseType, arithSecondUseType);
|
||||
arithUpdated = true;
|
||||
}
|
||||
@ -2311,7 +2311,7 @@ mjit::Compiler::generateMethod()
|
||||
/* Get jump target, if any. */
|
||||
jsbytecode *target = NULL;
|
||||
if (fused != JSOP_NOP) {
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
target = next + GET_JUMP_OFFSET(next);
|
||||
fixDoubleTypes(target);
|
||||
@ -2534,7 +2534,7 @@ mjit::Compiler::generateMethod()
|
||||
|
||||
BEGIN_CASE(JSOP_GETELEM)
|
||||
BEGIN_CASE(JSOP_CALLELEM)
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updateElemCounts(PC, frame.peek(-2), frame.peek(-1));
|
||||
if (!jsop_getelem())
|
||||
return Compile_Error;
|
||||
@ -2546,7 +2546,7 @@ mjit::Compiler::generateMethod()
|
||||
|
||||
BEGIN_CASE(JSOP_SETELEM)
|
||||
{
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updateElemCounts(PC, frame.peek(-3), frame.peek(-2));
|
||||
jsbytecode *next = &PC[JSOP_SETELEM_LENGTH];
|
||||
bool pop = (JSOp(*next) == JSOP_POP && !analysis->jumpTarget(next));
|
||||
@ -2584,7 +2584,7 @@ mjit::Compiler::generateMethod()
|
||||
done = true;
|
||||
else if (status != Compile_InlineAbort)
|
||||
return status;
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
/* Code generated while inlining has been accounted for. */
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
}
|
||||
@ -2673,7 +2673,7 @@ mjit::Compiler::generateMethod()
|
||||
* double types, as we don't track types of slots in scripts with
|
||||
* switch statements (could be fixed).
|
||||
*/
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
#if defined JS_CPU_ARM /* Need to implement jump(BaseIndex) for ARM */
|
||||
frame.syncAndKillEverything();
|
||||
@ -2693,7 +2693,7 @@ mjit::Compiler::generateMethod()
|
||||
END_CASE(JSOP_TABLESWITCH)
|
||||
|
||||
BEGIN_CASE(JSOP_LOOKUPSWITCH)
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
frame.syncAndForgetEverything();
|
||||
masm.move(ImmPtr(PC), Registers::ArgReg1);
|
||||
@ -2722,7 +2722,7 @@ mjit::Compiler::generateMethod()
|
||||
|
||||
BEGIN_CASE(JSOP_STRICTEQ)
|
||||
BEGIN_CASE(JSOP_STRICTNE)
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
updateArithCounts(PC, NULL, arithFirstUseType, arithSecondUseType);
|
||||
arithUpdated = true;
|
||||
}
|
||||
@ -2737,7 +2737,7 @@ mjit::Compiler::generateMethod()
|
||||
BEGIN_CASE(JSOP_MOREITER)
|
||||
{
|
||||
/* At the byte level, this is always fused with IFNE or IFNEX. */
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
jsbytecode *target = &PC[JSOP_MOREITER_LENGTH];
|
||||
JSOp next = JSOp(*target);
|
||||
@ -2900,7 +2900,7 @@ mjit::Compiler::generateMethod()
|
||||
BEGIN_CASE(JSOP_DECARG)
|
||||
BEGIN_CASE(JSOP_ARGINC)
|
||||
BEGIN_CASE(JSOP_ARGDEC)
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
restoreVarType();
|
||||
FrameEntry *fe = frame.getArg(GET_SLOTNO(PC));
|
||||
if (fe->isTypeKnown())
|
||||
@ -2910,7 +2910,7 @@ mjit::Compiler::generateMethod()
|
||||
if (!jsop_arginc(op, GET_SLOTNO(PC)))
|
||||
return Compile_Retry;
|
||||
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
FrameEntry *fe = frame.getArg(GET_SLOTNO(PC));
|
||||
updateArithCounts(PC, fe, arithFirstUseType, JSVAL_TYPE_INT32);
|
||||
arithUpdated = true;
|
||||
@ -2921,7 +2921,7 @@ mjit::Compiler::generateMethod()
|
||||
BEGIN_CASE(JSOP_DECLOCAL)
|
||||
BEGIN_CASE(JSOP_LOCALINC)
|
||||
BEGIN_CASE(JSOP_LOCALDEC)
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
restoreVarType();
|
||||
FrameEntry *fe = frame.getLocal(GET_SLOTNO(PC));
|
||||
if (fe->isTypeKnown())
|
||||
@ -2931,7 +2931,7 @@ mjit::Compiler::generateMethod()
|
||||
if (!jsop_localinc(op, GET_SLOTNO(PC)))
|
||||
return Compile_Retry;
|
||||
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
FrameEntry *fe = frame.getLocal(GET_SLOTNO(PC));
|
||||
updateArithCounts(PC, fe, arithFirstUseType, JSVAL_TYPE_INT32);
|
||||
arithUpdated = true;
|
||||
@ -3113,7 +3113,7 @@ mjit::Compiler::generateMethod()
|
||||
END_CASE(JSOP_UINT24)
|
||||
|
||||
BEGIN_CASE(JSOP_STOP)
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
updatePCCounts(PC, &codeStart, &countsUpdated);
|
||||
emitReturn(NULL);
|
||||
goto done;
|
||||
@ -3191,7 +3191,7 @@ mjit::Compiler::generateMethod()
|
||||
}
|
||||
}
|
||||
|
||||
if (script->hasScriptCounts) {
|
||||
if (script->scriptCounts) {
|
||||
size_t length = masm.size() - masm.distanceOf(codeStart);
|
||||
bool typesUpdated = false;
|
||||
|
||||
@ -3244,7 +3244,7 @@ mjit::Compiler::generateMethod()
|
||||
void
|
||||
mjit::Compiler::updatePCCounts(jsbytecode *pc, Label *start, bool *updated)
|
||||
{
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
/*
|
||||
* Bump the METHODJIT count for the opcode, read the METHODJIT_CODE_LENGTH
|
||||
@ -3306,7 +3306,7 @@ HasPayloadType(types::TypeSet *types)
|
||||
void
|
||||
mjit::Compiler::updatePCTypes(jsbytecode *pc, FrameEntry *fe)
|
||||
{
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
/*
|
||||
* Get a temporary register, as for updatePCCounts. Don't overlap with
|
||||
@ -3398,7 +3398,7 @@ void
|
||||
mjit::Compiler::updateArithCounts(jsbytecode *pc, FrameEntry *fe,
|
||||
JSValueType firstUseType, JSValueType secondUseType)
|
||||
{
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
RegisterID reg = Registers::ReturnReg;
|
||||
masm.push(reg);
|
||||
@ -3435,7 +3435,7 @@ mjit::Compiler::updateArithCounts(jsbytecode *pc, FrameEntry *fe,
|
||||
void
|
||||
mjit::Compiler::updateElemCounts(jsbytecode *pc, FrameEntry *obj, FrameEntry *id)
|
||||
{
|
||||
JS_ASSERT(script->hasScriptCounts);
|
||||
JS_ASSERT(script->scriptCounts);
|
||||
|
||||
RegisterID reg = Registers::ReturnReg;
|
||||
masm.push(reg);
|
||||
@ -4649,7 +4649,7 @@ mjit::Compiler::jsop_setprop_slow(PropertyName *name)
|
||||
INLINE_STUBCALL(STRICT_VARIANT(stubs::SetName), REJOIN_FALLTHROUGH);
|
||||
JS_STATIC_ASSERT(JSOP_SETNAME_LENGTH == JSOP_SETPROP_LENGTH);
|
||||
frame.shimmy(1);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_OTHER);
|
||||
}
|
||||
|
||||
@ -4669,7 +4669,7 @@ mjit::Compiler::jsop_getprop_slow(PropertyName *name, bool forPrototype)
|
||||
frame.pop();
|
||||
frame.pushSynced(JSVAL_TYPE_UNKNOWN);
|
||||
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_OTHER);
|
||||
}
|
||||
|
||||
@ -4737,7 +4737,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
frame.learnType(fe, JSVAL_TYPE_INT32, false);
|
||||
frame.pop();
|
||||
frame.pushCopyOf(fe);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_STATIC);
|
||||
return true;
|
||||
}
|
||||
@ -4767,7 +4767,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
masm.loadPtr(Address(reg, JSObject::offsetOfElements()), result);
|
||||
masm.load32(Address(result, ObjectElements::offsetOfLength()), result);
|
||||
frame.pushTypedPayload(JSVAL_TYPE_INT32, result);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
if (!isObject)
|
||||
stubcc.rejoin(Changes(1));
|
||||
@ -4793,7 +4793,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
frame.pop();
|
||||
masm.loadPayload(Address(reg, TypedArray::lengthOffset()), reg);
|
||||
frame.pushTypedPayload(JSVAL_TYPE_INT32, reg);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
if (!isObject)
|
||||
stubcc.rejoin(Changes(1));
|
||||
@ -4807,7 +4807,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
if (types->isMagicArguments(cx)) {
|
||||
frame.pop();
|
||||
frame.pushWord(Address(JSFrameReg, StackFrame::offsetOfNumActual()), JSVAL_TYPE_INT32);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
return true;
|
||||
}
|
||||
@ -4831,7 +4831,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
frame.pop();
|
||||
frame.push(ObjectValue(*singleton));
|
||||
|
||||
if (script->hasScriptCounts && cx->typeInferenceEnabled())
|
||||
if (script->scriptCounts && cx->typeInferenceEnabled())
|
||||
bumpPropCount(PC, PCCounts::PROP_STATIC);
|
||||
|
||||
if (testObject)
|
||||
@ -4848,7 +4848,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
frame.learnType(fe, knownType, false);
|
||||
frame.pop();
|
||||
frame.pushCopyOf(fe);
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_STATIC);
|
||||
return true;
|
||||
}
|
||||
@ -4896,7 +4896,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
RegisterID reg = frame.tempRegForData(top);
|
||||
frame.pop();
|
||||
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
|
||||
Address address(reg, JSObject::getFixedSlotOffset(slot));
|
||||
@ -4915,7 +4915,7 @@ mjit::Compiler::jsop_getprop(PropertyName *name, JSValueType knownType,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_OTHER);
|
||||
|
||||
/*
|
||||
@ -5277,7 +5277,7 @@ mjit::Compiler::jsop_getprop_dispatch(PropertyName *name)
|
||||
frame.pop();
|
||||
frame.pushTypedPayload(JSVAL_TYPE_OBJECT, pushreg);
|
||||
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
|
||||
stubcc.rejoin(Changes(2));
|
||||
@ -5380,13 +5380,13 @@ mjit::Compiler::jsop_setprop(PropertyName *name, bool popGuaranteed)
|
||||
frame.shimmy(1);
|
||||
if (!isObject)
|
||||
stubcc.rejoin(Changes(1));
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_DEFINITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (script->hasScriptCounts)
|
||||
if (script->scriptCounts)
|
||||
bumpPropCount(PC, PCCounts::PROP_OTHER);
|
||||
|
||||
JSOp op = JSOp(*PC);
|
||||
|
Loading…
Reference in New Issue
Block a user