mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
merge
This commit is contained in:
commit
4889097dcc
@ -238,7 +238,6 @@ INSTALLED_HEADERS = \
|
|||||||
jsstdint.h \
|
jsstdint.h \
|
||||||
jsstr.h \
|
jsstr.h \
|
||||||
jstracer.h \
|
jstracer.h \
|
||||||
jshotloop.h \
|
|
||||||
jstypedarray.h \
|
jstypedarray.h \
|
||||||
jstypes.h \
|
jstypes.h \
|
||||||
jsutil.h \
|
jsutil.h \
|
||||||
|
@ -650,13 +650,6 @@ public:
|
|||||||
return Jump(m_assembler.jmp(ARMCondition(cond)));
|
return Jump(m_assembler.jmp(ARMCondition(cond)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Jump branchSub32(Condition cond, Imm32 imm, Address dest)
|
|
||||||
{
|
|
||||||
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
|
|
||||||
sub32(imm, dest);
|
|
||||||
return Jump(m_assembler.jmp(ARMCondition(cond)));
|
|
||||||
}
|
|
||||||
|
|
||||||
Jump branchNeg32(Condition cond, RegisterID srcDest)
|
Jump branchNeg32(Condition cond, RegisterID srcDest)
|
||||||
{
|
{
|
||||||
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
|
ASSERT((cond == Overflow) || (cond == Signed) || (cond == Zero) || (cond == NonZero));
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
*
|
|
||||||
* ***** BEGIN LICENSE BLOCK *****
|
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
||||||
* the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
||||||
* for the specific language governing rights and limitations under the
|
|
||||||
* License.
|
|
||||||
*
|
|
||||||
* The Original Code is the Mozilla SpiderMonkey JaegerMonkey implementation
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is
|
|
||||||
* Mozilla Foundation
|
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2002-2010
|
|
||||||
* the Initial Developer. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
|
||||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
||||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
||||||
* the provisions above, a recipient may use your version of this file under
|
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
||||||
*
|
|
||||||
* ***** END LICENSE BLOCK ***** */
|
|
||||||
|
|
||||||
#ifndef jshotloop_h___
|
|
||||||
#define jshotloop_h___
|
|
||||||
|
|
||||||
#include "jscntxt.h"
|
|
||||||
|
|
||||||
namespace js {
|
|
||||||
|
|
||||||
uint32
|
|
||||||
GetHotloop(JSContext *cx);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -6531,7 +6531,7 @@ ExecuteTree(JSContext* cx, TreeFragment* f, uintN& inlineCallCount,
|
|||||||
bool ok = !(state.builtinStatus & BUILTIN_ERROR);
|
bool ok = !(state.builtinStatus & BUILTIN_ERROR);
|
||||||
JS_ASSERT_IF(cx->throwing, !ok);
|
JS_ASSERT_IF(cx->throwing, !ok);
|
||||||
|
|
||||||
uintN iters = JS_THREAD_DATA(cx)->iterationCounter;
|
size_t iters = JS_THREAD_DATA(cx)->iterationCounter;
|
||||||
|
|
||||||
f->execs++;
|
f->execs++;
|
||||||
f->iters += iters;
|
f->iters += iters;
|
||||||
@ -6544,7 +6544,7 @@ ExecuteTree(JSContext* cx, TreeFragment* f, uintN& inlineCallCount,
|
|||||||
debug_only_printf(LC_TMMinimal, " [%.3f ms] Tree at line %u executed for %s%u iterations;"
|
debug_only_printf(LC_TMMinimal, " [%.3f ms] Tree at line %u executed for %s%u iterations;"
|
||||||
" executed %u times; leave for %s at %s:%u (%s)\n",
|
" executed %u times; leave for %s at %s:%u (%s)\n",
|
||||||
double(t1-t0) / PRMJ_USEC_PER_MSEC,
|
double(t1-t0) / PRMJ_USEC_PER_MSEC,
|
||||||
f->treeLineNumber, prefix, iters, f->execs,
|
f->treeLineNumber, prefix, (uintN)iters, f->execs,
|
||||||
getExitName(lr->exitType),
|
getExitName(lr->exitType),
|
||||||
fp->script()->filename,
|
fp->script()->filename,
|
||||||
js_FramePCToLineNumber(cx, fp),
|
js_FramePCToLineNumber(cx, fp),
|
||||||
@ -16346,29 +16346,19 @@ LoopProfile::LoopProfile(JSStackFrame *entryfp, jsbytecode *top, jsbytecode *bot
|
|||||||
top(top),
|
top(top),
|
||||||
bottom(bottom),
|
bottom(bottom),
|
||||||
hits(0),
|
hits(0),
|
||||||
undecided(false),
|
profiled(false),
|
||||||
expensive(false),
|
traceOK(false),
|
||||||
unprofitable(false)
|
execOK(false),
|
||||||
|
numAllOps(0),
|
||||||
|
numSelfOps(0),
|
||||||
|
numSelfOpsMult(0),
|
||||||
|
branchMultiplier(1),
|
||||||
|
shortLoop(false),
|
||||||
|
maybeShortLoop(false),
|
||||||
|
numInnerLoops(0),
|
||||||
|
loopStackDepth(0),
|
||||||
|
sp(0)
|
||||||
{
|
{
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
LoopProfile::reset()
|
|
||||||
{
|
|
||||||
profiled = false;
|
|
||||||
traceOK = false;
|
|
||||||
execOK = false;
|
|
||||||
numAllOps = 0;
|
|
||||||
numSelfOps = 0;
|
|
||||||
numSelfOpsMult = 0;
|
|
||||||
branchMultiplier = 1;
|
|
||||||
shortLoop = false;
|
|
||||||
maybeShortLoop = false;
|
|
||||||
numInnerLoops = 0;
|
|
||||||
loopStackDepth = 0;
|
|
||||||
sp = 0;
|
|
||||||
|
|
||||||
memset(allOps, 0, sizeof(allOps));
|
memset(allOps, 0, sizeof(allOps));
|
||||||
memset(selfOps, 0, sizeof(selfOps));
|
memset(selfOps, 0, sizeof(selfOps));
|
||||||
}
|
}
|
||||||
@ -16464,7 +16454,7 @@ LookupOrAddProfile(JSContext *cx, TraceMonitor *tm, void** traceData, uintN *tra
|
|||||||
|
|
||||||
JS_REQUIRES_STACK TracePointAction
|
JS_REQUIRES_STACK TracePointAction
|
||||||
MonitorTracePoint(JSContext *cx, uintN& inlineCallCount, bool* blacklist,
|
MonitorTracePoint(JSContext *cx, uintN& inlineCallCount, bool* blacklist,
|
||||||
void** traceData, uintN *traceEpoch, uint32 *loopCounter, uint32 hits)
|
void** traceData, uintN *traceEpoch)
|
||||||
{
|
{
|
||||||
if (!cx->profilingEnabled)
|
if (!cx->profilingEnabled)
|
||||||
return RecordTracePoint(cx, inlineCallCount, blacklist, true);
|
return RecordTracePoint(cx, inlineCallCount, blacklist, true);
|
||||||
@ -16485,8 +16475,7 @@ MonitorTracePoint(JSContext *cx, uintN& inlineCallCount, bool* blacklist,
|
|||||||
return TPA_Nothing;
|
return TPA_Nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
prof->hits += hits;
|
if (prof->hits++ < PROFILE_HOTLOOP)
|
||||||
if (prof->hits < PROFILE_HOTLOOP)
|
|
||||||
return TPA_Nothing;
|
return TPA_Nothing;
|
||||||
|
|
||||||
AutoRetBlacklist autoRetBlacklist(cx->regs->pc, blacklist);
|
AutoRetBlacklist autoRetBlacklist(cx->regs->pc, blacklist);
|
||||||
@ -16510,11 +16499,6 @@ MonitorTracePoint(JSContext *cx, uintN& inlineCallCount, bool* blacklist,
|
|||||||
|
|
||||||
JS_ASSERT(!cx->throwing);
|
JS_ASSERT(!cx->throwing);
|
||||||
|
|
||||||
if (prof->undecided) {
|
|
||||||
*loopCounter = 2000;
|
|
||||||
prof->reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
return TPA_RanStuff;
|
return TPA_RanStuff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16544,7 +16528,8 @@ LoopProfile::profileOperation(JSContext* cx, JSOp op)
|
|||||||
JSScript *script = fp->script();
|
JSScript *script = fp->script();
|
||||||
|
|
||||||
if (!PCWithinLoop(fp, pc, *this)) {
|
if (!PCWithinLoop(fp, pc, *this)) {
|
||||||
debug_only_printf(LC_TMProfiler, "Profiling complete (loop exit) at line %u\n",
|
debug_only_printf(LC_TMProfiler, "Profiling complete (loop exit) at %d (line %u)\n",
|
||||||
|
(int)(cx->regs->pc - script->code),
|
||||||
js_FramePCToLineNumber(cx, cx->fp()));
|
js_FramePCToLineNumber(cx, cx->fp()));
|
||||||
tm->profile->decide(cx);
|
tm->profile->decide(cx);
|
||||||
tm->profile = NULL;
|
tm->profile = NULL;
|
||||||
@ -16552,8 +16537,7 @@ LoopProfile::profileOperation(JSContext* cx, JSOp op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (loopStackDepth > 0 && !PCWithinLoop(fp, pc, loopStack[loopStackDepth-1])) {
|
while (loopStackDepth > 0 && !PCWithinLoop(fp, pc, loopStack[loopStackDepth-1])) {
|
||||||
debug_only_printf(LC_TMProfiler, "Profiler: Exiting inner loop at line %u\n",
|
debug_only_print0(LC_TMProfiler, "Profiler: Exiting inner loop\n");
|
||||||
js_FramePCToLineNumber(cx, cx->fp()));
|
|
||||||
loopStackDepth--;
|
loopStackDepth--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16566,8 +16550,7 @@ LoopProfile::profileOperation(JSContext* cx, JSOp op)
|
|||||||
return ProfComplete;
|
return ProfComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_only_printf(LC_TMProfiler, "Profiler: Entering inner loop at line %d\n",
|
debug_only_print0(LC_TMProfiler, "Profiler: Entering inner loop\n");
|
||||||
js_FramePCToLineNumber(cx, cx->fp()));
|
|
||||||
loopStack[loopStackDepth++] = InnerLoop(fp, pc, GetLoopBottom(cx));
|
loopStack[loopStackDepth++] = InnerLoop(fp, pc, GetLoopBottom(cx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16608,8 +16591,6 @@ LoopProfile::profileOperation(JSContext* cx, JSOp op)
|
|||||||
Value& lval = cx->regs->sp[op == JSOP_GETELEM ? -2 : -3];
|
Value& lval = cx->regs->sp[op == JSOP_GETELEM ? -2 : -3];
|
||||||
if (lval.isObject() && js_IsTypedArray(&lval.toObject()))
|
if (lval.isObject() && js_IsTypedArray(&lval.toObject()))
|
||||||
increment(OP_TYPED_ARRAY);
|
increment(OP_TYPED_ARRAY);
|
||||||
else if (lval.isObject() && lval.toObject().isDenseArray() && op == JSOP_GETELEM)
|
|
||||||
increment(OP_ARRAY_READ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op == JSOP_CALL) {
|
if (op == JSOP_CALL) {
|
||||||
@ -16739,26 +16720,36 @@ LookupLoopProfile(JSContext *cx, jsbytecode *pc)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if the loop would probably take a long time to compile. */
|
/*
|
||||||
|
* Returns true if the loop would probably take a long time to
|
||||||
|
* compile. Since this function recurses into nested loops, we
|
||||||
|
* pass a depth argument to ensure that we don't recurse too
|
||||||
|
* far and overflow the stack. Mostly, we're guarding against
|
||||||
|
* the possibility that we (incorrectly) track a loop as being
|
||||||
|
* nested inside itself, leading to infinite recursion.
|
||||||
|
*/
|
||||||
bool
|
bool
|
||||||
LoopProfile::isCompilationExpensive(JSContext *cx)
|
LoopProfile::isCompilationExpensive(JSContext *cx, uintN depth)
|
||||||
{
|
{
|
||||||
|
if (depth == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
/* Too many ops to compile? */
|
/* Too many ops to compile? */
|
||||||
if (numSelfOps == MAX_PROFILE_OPS)
|
if (numSelfOps == MAX_PROFILE_OPS)
|
||||||
expensive = true;
|
return true;
|
||||||
|
|
||||||
/* Is the code too branchy? */
|
/* Is the code too branchy? */
|
||||||
if (numSelfOpsMult > numSelfOps*100000)
|
if (numSelfOpsMult > numSelfOps*100000)
|
||||||
expensive = true;
|
return true;
|
||||||
|
|
||||||
/* Ensure that inner loops aren't too expensive. */
|
/* Ensure that inner loops aren't too expensive. */
|
||||||
for (uintN i=0; i<numInnerLoops; i++) {
|
for (uintN i=0; i<numInnerLoops; i++) {
|
||||||
LoopProfile *prof = LookupLoopProfile(cx, innerLoops[i].top);
|
LoopProfile *prof = LookupLoopProfile(cx, innerLoops[i].top);
|
||||||
if (prof && prof->expensive)
|
if (prof && prof->isCompilationExpensive(cx, depth-1))
|
||||||
expensive = true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return expensive;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -16768,31 +16759,29 @@ LoopProfile::isCompilationExpensive(JSContext *cx)
|
|||||||
* expensive.
|
* expensive.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
LoopProfile::isCompilationUnprofitable(JSContext *cx, uintN goodOps)
|
LoopProfile::isCompilationUnprofitable(JSContext *cx, uintN depth)
|
||||||
{
|
{
|
||||||
if (goodOps <= 20 && allOps[OP_FWDJUMP])
|
if (depth == 0)
|
||||||
unprofitable = true;
|
return true;
|
||||||
|
|
||||||
|
if (numAllOps < 15 && allOps[OP_FWDJUMP])
|
||||||
|
return true;
|
||||||
|
|
||||||
/* Ensure that inner loops aren't fleeting. */
|
/* Ensure that inner loops aren't fleeting. */
|
||||||
for (uintN i=0; i<numInnerLoops; i++) {
|
for (uintN i=0; i<numInnerLoops; i++) {
|
||||||
LoopProfile *prof = LookupLoopProfile(cx, innerLoops[i].top);
|
LoopProfile *prof = LookupLoopProfile(cx, innerLoops[i].top);
|
||||||
if (prof && prof->unprofitable)
|
if (prof && prof->isCompilationUnprofitable(cx, depth-1))
|
||||||
unprofitable = true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return unprofitable;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* After profiling is done, this method decides whether to trace the loop. */
|
/* After profiling is done, this method decides whether to trace the loop. */
|
||||||
void
|
void
|
||||||
LoopProfile::decide(JSContext *cx)
|
LoopProfile::decide(JSContext *cx)
|
||||||
{
|
{
|
||||||
bool wasUndecided = undecided;
|
|
||||||
profiled = true;
|
profiled = true;
|
||||||
undecided = false;
|
|
||||||
|
|
||||||
if (traceOK)
|
|
||||||
return; /* We must have enabled it from an outer loop already. */
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
uintN line = js_PCToLineNumber(cx, script, top);
|
uintN line = js_PCToLineNumber(cx, script, top);
|
||||||
@ -16814,7 +16803,6 @@ LoopProfile::decide(JSContext *cx)
|
|||||||
debug_only_printf(LC_TMProfiler, "FEATURE eval %d\n", allOps[OP_EVAL]);
|
debug_only_printf(LC_TMProfiler, "FEATURE eval %d\n", allOps[OP_EVAL]);
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE new %d\n", allOps[OP_NEW]);
|
debug_only_printf(LC_TMProfiler, "FEATURE new %d\n", allOps[OP_NEW]);
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE call %d\n", allOps[OP_CALL]);
|
debug_only_printf(LC_TMProfiler, "FEATURE call %d\n", allOps[OP_CALL]);
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE arrayread %d\n", allOps[OP_ARRAY_READ]);
|
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE typedarray %d\n", allOps[OP_TYPED_ARRAY]);
|
debug_only_printf(LC_TMProfiler, "FEATURE typedarray %d\n", allOps[OP_TYPED_ARRAY]);
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE fwdjump %d\n", allOps[OP_FWDJUMP]);
|
debug_only_printf(LC_TMProfiler, "FEATURE fwdjump %d\n", allOps[OP_FWDJUMP]);
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE recursive %d\n", allOps[OP_RECURSIVE]);
|
debug_only_printf(LC_TMProfiler, "FEATURE recursive %d\n", allOps[OP_RECURSIVE]);
|
||||||
@ -16838,15 +16826,12 @@ LoopProfile::decide(JSContext *cx)
|
|||||||
debug_only_print0(LC_TMProfiler, "NOTRACE: >3 inner loops\n");
|
debug_only_print0(LC_TMProfiler, "NOTRACE: >3 inner loops\n");
|
||||||
} else if (shortLoop) {
|
} else if (shortLoop) {
|
||||||
debug_only_print0(LC_TMProfiler, "NOTRACE: short\n");
|
debug_only_print0(LC_TMProfiler, "NOTRACE: short\n");
|
||||||
} else if (isCompilationExpensive(cx)) {
|
|
||||||
debug_only_print0(LC_TMProfiler, "NOTRACE: expensive\n");
|
|
||||||
} else if (maybeShortLoop && numInnerLoops < 2) {
|
} else if (maybeShortLoop && numInnerLoops < 2) {
|
||||||
if (wasUndecided) {
|
|
||||||
debug_only_print0(LC_TMProfiler, "NOTRACE: maybe short\n");
|
debug_only_print0(LC_TMProfiler, "NOTRACE: maybe short\n");
|
||||||
} else {
|
} else if (isCompilationExpensive(cx, 4)) {
|
||||||
debug_only_print0(LC_TMProfiler, "UNDECIDED: maybe short\n");
|
debug_only_print0(LC_TMProfiler, "NOTRACE: expensive\n");
|
||||||
undecided = true; /* Profile the loop again to see if it's still short. */
|
} else if (isCompilationUnprofitable(cx, 4)) {
|
||||||
}
|
debug_only_print0(LC_TMProfiler, "NOTRACE: unprofitable\n");
|
||||||
} else {
|
} else {
|
||||||
uintN goodOps = 0;
|
uintN goodOps = 0;
|
||||||
|
|
||||||
@ -16861,9 +16846,7 @@ LoopProfile::decide(JSContext *cx)
|
|||||||
|
|
||||||
debug_only_printf(LC_TMProfiler, "FEATURE goodOps %u\n", goodOps);
|
debug_only_printf(LC_TMProfiler, "FEATURE goodOps %u\n", goodOps);
|
||||||
|
|
||||||
if (isCompilationUnprofitable(cx, goodOps))
|
if (goodOps >= numAllOps)
|
||||||
debug_only_print0(LC_TMProfiler, "NOTRACE: unprofitable\n");
|
|
||||||
else if (goodOps >= numAllOps)
|
|
||||||
traceOK = true;
|
traceOK = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16890,7 +16873,7 @@ LoopProfile::decide(JSContext *cx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!traceOK && !undecided) {
|
if (!traceOK) {
|
||||||
debug_only_printf(LC_TMProfiler, "Blacklisting at %d\n", line);
|
debug_only_printf(LC_TMProfiler, "Blacklisting at %d\n", line);
|
||||||
Blacklist(top);
|
Blacklist(top);
|
||||||
}
|
}
|
||||||
@ -16918,7 +16901,7 @@ MonitorLoopEdge(JSContext* cx, uintN& inlineCallCount)
|
|||||||
if (prof->hits++ < PROFILE_HOTLOOP)
|
if (prof->hits++ < PROFILE_HOTLOOP)
|
||||||
return MONITOR_NOT_RECORDING;
|
return MONITOR_NOT_RECORDING;
|
||||||
|
|
||||||
if (prof->profiled || prof->undecided) {
|
if (prof->profiled) {
|
||||||
if (prof->traceOK)
|
if (prof->traceOK)
|
||||||
return RecordLoopEdge(cx, inlineCallCount, prof->execOK);
|
return RecordLoopEdge(cx, inlineCallCount, prof->execOK);
|
||||||
return MONITOR_NOT_RECORDING;
|
return MONITOR_NOT_RECORDING;
|
||||||
@ -16941,7 +16924,6 @@ AbortProfiling(JSContext *cx)
|
|||||||
tm->profile->profiled = true;
|
tm->profile->profiled = true;
|
||||||
tm->profile->traceOK = false;
|
tm->profile->traceOK = false;
|
||||||
tm->profile->execOK = false;
|
tm->profile->execOK = false;
|
||||||
tm->profile->undecided = false;
|
|
||||||
Blacklist(tm->profile->top);
|
Blacklist(tm->profile->top);
|
||||||
tm->profile = NULL;
|
tm->profile = NULL;
|
||||||
}
|
}
|
||||||
@ -16956,16 +16938,5 @@ MonitorLoopEdge(JSContext* cx, uintN& inlineCallCount)
|
|||||||
|
|
||||||
#endif /* JS_METHODJIT */
|
#endif /* JS_METHODJIT */
|
||||||
|
|
||||||
uint32
|
|
||||||
GetHotloop(JSContext *cx)
|
|
||||||
{
|
|
||||||
#ifdef JS_METHODJIT
|
|
||||||
if (cx->profilingEnabled)
|
|
||||||
return PROFILE_HOTLOOP;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
@ -666,7 +666,6 @@ public:
|
|||||||
OP_FWDJUMP, // Jumps with positive delta
|
OP_FWDJUMP, // Jumps with positive delta
|
||||||
OP_NEW, // JSOP_NEW instructions
|
OP_NEW, // JSOP_NEW instructions
|
||||||
OP_RECURSIVE, // Recursive calls
|
OP_RECURSIVE, // Recursive calls
|
||||||
OP_ARRAY_READ, // Reads from dense arrays
|
|
||||||
OP_TYPED_ARRAY, // Accesses to typed arrays
|
OP_TYPED_ARRAY, // Accesses to typed arrays
|
||||||
OP_LIMIT
|
OP_LIMIT
|
||||||
};
|
};
|
||||||
@ -686,9 +685,6 @@ public:
|
|||||||
/* Whether we have run a complete profile of the loop. */
|
/* Whether we have run a complete profile of the loop. */
|
||||||
bool profiled;
|
bool profiled;
|
||||||
|
|
||||||
/* Sometimes we can't decide in one profile run whether to trace, so we set undecided. */
|
|
||||||
bool undecided;
|
|
||||||
|
|
||||||
/* If we have profiled the loop, this saves the decision of whether to trace it. */
|
/* If we have profiled the loop, this saves the decision of whether to trace it. */
|
||||||
bool traceOK;
|
bool traceOK;
|
||||||
|
|
||||||
@ -730,10 +726,6 @@ public:
|
|||||||
/* Set to true if the loop may be short (has few iterations at profiling time). */
|
/* Set to true if the loop may be short (has few iterations at profiling time). */
|
||||||
bool maybeShortLoop;
|
bool maybeShortLoop;
|
||||||
|
|
||||||
/* These are memoized versions of isCompilationExpensive/Unprofitable. */
|
|
||||||
bool expensive;
|
|
||||||
bool unprofitable;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When we hit a nested loop while profiling, we record where it occurs
|
* When we hit a nested loop while profiling, we record where it occurs
|
||||||
* and how many iterations we execute it.
|
* and how many iterations we execute it.
|
||||||
@ -798,8 +790,6 @@ public:
|
|||||||
|
|
||||||
LoopProfile(JSStackFrame *entryfp, jsbytecode *top, jsbytecode *bottom);
|
LoopProfile(JSStackFrame *entryfp, jsbytecode *top, jsbytecode *bottom);
|
||||||
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
enum ProfileAction {
|
enum ProfileAction {
|
||||||
ProfContinue,
|
ProfContinue,
|
||||||
ProfComplete
|
ProfComplete
|
||||||
@ -822,8 +812,8 @@ public:
|
|||||||
ProfileAction profileOperation(JSContext *cx, JSOp op);
|
ProfileAction profileOperation(JSContext *cx, JSOp op);
|
||||||
|
|
||||||
/* Once a loop's profile is done, these decide whether it should be traced. */
|
/* Once a loop's profile is done, these decide whether it should be traced. */
|
||||||
bool isCompilationExpensive(JSContext *cx);
|
bool isCompilationExpensive(JSContext *cx, uintN depth);
|
||||||
bool isCompilationUnprofitable(JSContext *cx, uintN goodOps);
|
bool isCompilationUnprofitable(JSContext *cx, uintN depth);
|
||||||
void decide(JSContext *cx);
|
void decide(JSContext *cx);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1671,7 +1661,7 @@ RecordTracePoint(JSContext*, uintN& inlineCallCount, bool* blacklist);
|
|||||||
|
|
||||||
extern JS_REQUIRES_STACK TracePointAction
|
extern JS_REQUIRES_STACK TracePointAction
|
||||||
MonitorTracePoint(JSContext*, uintN& inlineCallCount, bool* blacklist,
|
MonitorTracePoint(JSContext*, uintN& inlineCallCount, bool* blacklist,
|
||||||
void** traceData, uintN *traceEpoch, uint32 *loopCounter, uint32 hits);
|
void** traceData, uintN *traceEpoch);
|
||||||
|
|
||||||
extern JS_REQUIRES_STACK TraceRecorder::AbortResult
|
extern JS_REQUIRES_STACK TraceRecorder::AbortResult
|
||||||
AbortRecording(JSContext* cx, const char* reason);
|
AbortRecording(JSContext* cx, const char* reason);
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
#include "jscompartment.h"
|
#include "jscompartment.h"
|
||||||
#include "jsobjinlines.h"
|
#include "jsobjinlines.h"
|
||||||
#include "jsopcodeinlines.h"
|
#include "jsopcodeinlines.h"
|
||||||
#include "jshotloop.h"
|
|
||||||
|
|
||||||
#include "jsautooplen.h"
|
#include "jsautooplen.h"
|
||||||
|
|
||||||
@ -601,8 +600,6 @@ mjit::Compiler::finishThisUp(JITScript **jitp)
|
|||||||
scriptTICs[i].hasSlowTraceHint = traceICs[i].slowTraceHint.isSet();
|
scriptTICs[i].hasSlowTraceHint = traceICs[i].slowTraceHint.isSet();
|
||||||
if (traceICs[i].slowTraceHint.isSet())
|
if (traceICs[i].slowTraceHint.isSet())
|
||||||
scriptTICs[i].slowTraceHint = stubCode.locationOf(traceICs[i].slowTraceHint.get());
|
scriptTICs[i].slowTraceHint = stubCode.locationOf(traceICs[i].slowTraceHint.get());
|
||||||
scriptTICs[i].loopCounterStart = GetHotloop(cx);
|
|
||||||
scriptTICs[i].loopCounter = scriptTICs[i].loopCounterStart;
|
|
||||||
|
|
||||||
stubCode.patch(traceICs[i].addrLabel, &scriptTICs[i]);
|
stubCode.patch(traceICs[i].addrLabel, &scriptTICs[i]);
|
||||||
}
|
}
|
||||||
@ -4771,11 +4768,6 @@ mjit::Compiler::jumpAndTrace(Jump j, jsbytecode *target, Jump *slow)
|
|||||||
# if JS_MONOIC
|
# if JS_MONOIC
|
||||||
ic.addrLabel = stubcc.masm.moveWithPatch(ImmPtr(NULL), Registers::ArgReg1);
|
ic.addrLabel = stubcc.masm.moveWithPatch(ImmPtr(NULL), Registers::ArgReg1);
|
||||||
traceICs[index] = ic;
|
traceICs[index] = ic;
|
||||||
|
|
||||||
Jump nonzero = stubcc.masm.branchSub32(Assembler::NonZero, Imm32(1),
|
|
||||||
Address(Registers::ArgReg1,
|
|
||||||
offsetof(TraceICInfo, loopCounter)));
|
|
||||||
stubcc.jumpInScript(nonzero, target);
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Save and restore compiler-tracked PC, so cx->regs is right in InvokeTracer. */
|
/* Save and restore compiler-tracked PC, so cx->regs is right in InvokeTracer. */
|
||||||
@ -4790,10 +4782,11 @@ mjit::Compiler::jumpAndTrace(Jump j, jsbytecode *target, Jump *slow)
|
|||||||
|
|
||||||
Jump no = stubcc.masm.branchTestPtr(Assembler::Zero, Registers::ReturnReg,
|
Jump no = stubcc.masm.branchTestPtr(Assembler::Zero, Registers::ReturnReg,
|
||||||
Registers::ReturnReg);
|
Registers::ReturnReg);
|
||||||
if (!stubcc.jumpInScript(no, target))
|
|
||||||
return false;
|
|
||||||
restoreFrameRegs(stubcc.masm);
|
restoreFrameRegs(stubcc.masm);
|
||||||
stubcc.masm.jump(Registers::ReturnReg);
|
stubcc.masm.jump(Registers::ReturnReg);
|
||||||
|
no.linkTo(stubcc.masm.label(), &stubcc.masm);
|
||||||
|
if (!stubcc.jumpInScript(stubcc.masm.jump(), target))
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -973,26 +973,17 @@ RunTracer(VMFrame &f)
|
|||||||
uintN inlineCallCount = 0;
|
uintN inlineCallCount = 0;
|
||||||
void **traceData;
|
void **traceData;
|
||||||
uintN *traceEpoch;
|
uintN *traceEpoch;
|
||||||
uint32 *loopCounter;
|
|
||||||
uint32 hits;
|
|
||||||
#if JS_MONOIC
|
#if JS_MONOIC
|
||||||
traceData = &tic.traceData;
|
traceData = &tic.traceData;
|
||||||
traceEpoch = &tic.traceEpoch;
|
traceEpoch = &tic.traceEpoch;
|
||||||
loopCounter = &tic.loopCounter;
|
|
||||||
*loopCounter = 1;
|
|
||||||
hits = tic.loopCounterStart;
|
|
||||||
#else
|
#else
|
||||||
traceData = NULL;
|
traceData = NULL;
|
||||||
traceEpoch = NULL;
|
traceEpoch = NULL;
|
||||||
loopCounter = NULL;
|
|
||||||
hits = 1;
|
|
||||||
#endif
|
#endif
|
||||||
tpa = MonitorTracePoint(f.cx, inlineCallCount, &blacklist, traceData, traceEpoch,
|
tpa = MonitorTracePoint(f.cx, inlineCallCount, &blacklist, traceData, traceEpoch);
|
||||||
loopCounter, hits);
|
|
||||||
JS_ASSERT(!TRACE_RECORDER(cx));
|
JS_ASSERT(!TRACE_RECORDER(cx));
|
||||||
|
|
||||||
#if JS_MONOIC
|
#if JS_MONOIC
|
||||||
tic.loopCounterStart = *loopCounter;
|
|
||||||
if (blacklist)
|
if (blacklist)
|
||||||
DisableTraceHint(f, tic);
|
DisableTraceHint(f, tic);
|
||||||
#endif
|
#endif
|
||||||
|
@ -153,8 +153,6 @@ struct TraceICInfo {
|
|||||||
/* This data is used by the tracing JIT. */
|
/* This data is used by the tracing JIT. */
|
||||||
void *traceData;
|
void *traceData;
|
||||||
uintN traceEpoch;
|
uintN traceEpoch;
|
||||||
uint32 loopCounter;
|
|
||||||
uint32 loopCounterStart;
|
|
||||||
|
|
||||||
bool hasSlowTraceHint : 1;
|
bool hasSlowTraceHint : 1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user