зеркало из https://github.com/mozilla/gecko-dev.git
Back out 80163a75cca5 (bug 865059) for talos and android jsreftest bustage
CLOSED TREE --HG-- extra : rebase_source : a4e86eab90dcf4d30a180c0cffe5d5964d720481
This commit is contained in:
Родитель
4b79a9144e
Коммит
d4b5d87748
|
@ -4367,9 +4367,6 @@ EmitNormalFor(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
|
|||
if (EmitJump(cx, bce, op, top - bce->offset()) < 0)
|
||||
return false;
|
||||
|
||||
if (!bce->tryNoteList.append(JSTRY_LOOP, bce->stackDepth, top, bce->offset()))
|
||||
return false;
|
||||
|
||||
/* Now fixup all breaks and continues. */
|
||||
return PopStatementBCE(cx, bce);
|
||||
}
|
||||
|
@ -4556,9 +4553,6 @@ EmitDo(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
if (beq < 0)
|
||||
return false;
|
||||
|
||||
if (!bce->tryNoteList.append(JSTRY_LOOP, bce->stackDepth, top, bce->offset()))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Be careful: We must set noteIndex2 before noteIndex in case the noteIndex
|
||||
* note gets bigger.
|
||||
|
@ -4615,9 +4609,6 @@ EmitWhile(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
|
|||
if (beq < 0)
|
||||
return false;
|
||||
|
||||
if (!bce->tryNoteList.append(JSTRY_LOOP, bce->stackDepth, top, bce->offset()))
|
||||
return false;
|
||||
|
||||
if (!SetSrcNoteOffset(cx, bce, noteIndex, 0, beq - jmp))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -435,9 +435,6 @@ HandleException(JSContext *cx, const IonFrameIterator &frame, ResumeFromExceptio
|
|||
break;
|
||||
}
|
||||
|
||||
case JSTRY_LOOP:
|
||||
break;
|
||||
|
||||
default:
|
||||
JS_NOT_REACHED("Invalid try note");
|
||||
}
|
||||
|
|
|
@ -405,7 +405,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
|||
if (catchOffset > forwardCatch)
|
||||
forwardCatch = catchOffset;
|
||||
|
||||
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
|
||||
if (tn->kind != JSTRY_ITER) {
|
||||
if (!addJump(cx, catchOffset, &nextOffset, &forwardJump, &forwardLoop, stackDepth))
|
||||
return;
|
||||
getCode(catchOffset).exceptionEntry = true;
|
||||
|
@ -1507,7 +1507,7 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
|
|||
if (startOffset == offset + 1) {
|
||||
unsigned catchOffset = startOffset + tn->length;
|
||||
|
||||
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
|
||||
if (tn->kind != JSTRY_ITER) {
|
||||
checkBranchTarget(cx, catchOffset, branchTargets, values, stackDepth);
|
||||
checkExceptionTarget(cx, catchOffset, exceptionTargets);
|
||||
}
|
||||
|
|
|
@ -1751,7 +1751,6 @@ struct JSContext : js::ContextFriendFields,
|
|||
#endif
|
||||
|
||||
inline bool typeInferenceEnabled() const;
|
||||
inline bool jaegerCompilationAllowed() const;
|
||||
|
||||
void updateJITEnabled();
|
||||
|
||||
|
|
|
@ -411,12 +411,6 @@ JSContext::typeInferenceEnabled() const
|
|||
return compartment->zone()->types.inferenceEnabled;
|
||||
}
|
||||
|
||||
inline bool
|
||||
JSContext::jaegerCompilationAllowed() const
|
||||
{
|
||||
return compartment->zone()->types.jaegerCompilationAllowed;
|
||||
}
|
||||
|
||||
inline js::Handle<js::GlobalObject*>
|
||||
JSContext::global() const
|
||||
{
|
||||
|
|
|
@ -2467,12 +2467,10 @@ TypeZone::init(JSContext *cx)
|
|||
!cx->hasOption(JSOPTION_TYPE_INFERENCE) ||
|
||||
!cx->runtime->jitSupportsFloatingPoint)
|
||||
{
|
||||
jaegerCompilationAllowed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
inferenceEnabled = true;
|
||||
jaegerCompilationAllowed = cx->hasOption(JSOPTION_METHODJIT);
|
||||
}
|
||||
|
||||
TypeObject *
|
||||
|
@ -2694,28 +2692,13 @@ types::UseNewTypeForInitializer(JSContext *cx, JSScript *script, jsbytecode *pc,
|
|||
if (key != JSProto_Object && !(key >= JSProto_Int8Array && key <= JSProto_Uint8ClampedArray))
|
||||
return GenericObject;
|
||||
|
||||
/*
|
||||
* All loops in the script will have a JSTRY_ITER or JSTRY_LOOP try note
|
||||
* indicating their boundary.
|
||||
*/
|
||||
AutoEnterAnalysis enter(cx);
|
||||
|
||||
if (!script->hasTrynotes())
|
||||
return SingletonObject;
|
||||
if (!script->ensureRanAnalysis(cx))
|
||||
return GenericObject;
|
||||
|
||||
unsigned offset = pc - script->code;
|
||||
|
||||
JSTryNote *tn = script->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP)
|
||||
continue;
|
||||
|
||||
unsigned startOffset = script->mainOffset + tn->start;
|
||||
unsigned endOffset = startOffset + tn->length;
|
||||
|
||||
if (offset >= startOffset && offset < endOffset)
|
||||
return GenericObject;
|
||||
}
|
||||
if (script->analysis()->getCode(pc).inLoop)
|
||||
return GenericObject;
|
||||
|
||||
return SingletonObject;
|
||||
}
|
||||
|
@ -5669,16 +5652,8 @@ types::MarkIteratorUnknownSlow(JSContext *cx)
|
|||
if (JSOp(*pc) != JSOP_ITER)
|
||||
return;
|
||||
|
||||
if (IgnoreTypeChanges(cx, script))
|
||||
return;
|
||||
|
||||
AutoEnterAnalysis enter(cx);
|
||||
|
||||
if (!script->ensureRanAnalysis(cx)) {
|
||||
cx->compartment->types.setPendingNukeTypes(cx);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* This script is iterating over an actual Iterator or Generator object, or
|
||||
* an object with a custom __iterator__ hook. In such cases 'for in' loops
|
||||
|
@ -5762,10 +5737,6 @@ void
|
|||
types::TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc, Type type)
|
||||
{
|
||||
JS_ASSERT(cx->typeInferenceEnabled());
|
||||
|
||||
if (IgnoreTypeChanges(cx, script))
|
||||
return;
|
||||
|
||||
AutoEnterAnalysis enter(cx);
|
||||
|
||||
/* Directly update associated type sets for applicable bytecodes. */
|
||||
|
@ -5871,9 +5842,6 @@ types::TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc, const
|
|||
if (!(js_CodeSpec[*pc].format & JOF_TYPESET))
|
||||
return;
|
||||
|
||||
if (IgnoreTypeChanges(cx, script))
|
||||
return;
|
||||
|
||||
AutoEnterAnalysis enter(cx);
|
||||
|
||||
if (!script->ensureRanAnalysis(cx)) {
|
||||
|
|
|
@ -1466,13 +1466,6 @@ struct TypeZone
|
|||
/* Whether type inference is enabled in this compartment. */
|
||||
bool inferenceEnabled;
|
||||
|
||||
/*
|
||||
* JM compilation is allowed only if script analysis has been used to
|
||||
* monitor the behavior of all scripts in this zone since its creation.
|
||||
* OSR in JM requires this property.
|
||||
*/
|
||||
bool jaegerCompilationAllowed;
|
||||
|
||||
TypeZone(JS::Zone *zone);
|
||||
~TypeZone();
|
||||
void init(JSContext *cx);
|
||||
|
|
|
@ -573,21 +573,6 @@ MarkIteratorUnknown(JSContext *cx)
|
|||
MarkIteratorUnknownSlow(cx);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return whether new type information in the specified script should be
|
||||
* ignored. Tracking new types in a script requires the script to be analyzed,
|
||||
* which can consume a large amount of memory when dealing with scripts that
|
||||
* don't run long enough to be compiled (as is the case for the majority of
|
||||
* executed scripts in web code).
|
||||
*/
|
||||
inline bool
|
||||
IgnoreTypeChanges(JSContext *cx, JSScript *script)
|
||||
{
|
||||
return !script->hasAnalysis() &&
|
||||
!cx->jaegerCompilationAllowed() &&
|
||||
script->analyzedArgsUsage();
|
||||
}
|
||||
|
||||
void TypeMonitorCallSlow(JSContext *cx, JSObject *callee, const CallArgs &args,
|
||||
bool constructing);
|
||||
|
||||
|
@ -601,8 +586,6 @@ TypeMonitorCall(JSContext *cx, const js::CallArgs &args, bool constructing)
|
|||
if (args.callee().isFunction()) {
|
||||
JSFunction *fun = args.callee().toFunction();
|
||||
if (fun->isInterpreted()) {
|
||||
if (IgnoreTypeChanges(cx, fun->nonLazyScript()))
|
||||
return true;
|
||||
if (!fun->nonLazyScript()->ensureRanAnalysis(cx))
|
||||
return false;
|
||||
if (cx->typeInferenceEnabled())
|
||||
|
|
|
@ -565,11 +565,9 @@ js::ExecuteKernel(JSContext *cx, HandleScript script, JSObject &scopeChainArg, c
|
|||
if (!cx->stack.pushExecuteFrame(cx, script, thisv, scopeChain, type, evalInFrame, &efg))
|
||||
return false;
|
||||
|
||||
if (!types::IgnoreTypeChanges(cx, script)) {
|
||||
if (!script->ensureRanAnalysis(cx))
|
||||
return false;
|
||||
TypeScript::SetThis(cx, script, efg.fp()->thisValue());
|
||||
}
|
||||
if (!script->ensureRanAnalysis(cx))
|
||||
return false;
|
||||
TypeScript::SetThis(cx, script, efg.fp()->thisValue());
|
||||
|
||||
Probes::startExecution(script);
|
||||
bool ok = RunScript(cx, efg.fp());
|
||||
|
@ -3368,11 +3366,7 @@ END_CASE(JSOP_ARRAYPUSH)
|
|||
regs.sp -= 1;
|
||||
if (!ok)
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
|
||||
case JSTRY_LOOP:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1511,12 +1511,8 @@ js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject
|
|||
}
|
||||
|
||||
if (res && cx->typeInferenceEnabled()) {
|
||||
JSScript *script = callee->toFunction()->nonLazyScript();
|
||||
if (!types::IgnoreTypeChanges(cx, script)) {
|
||||
if (!script->ensureRanAnalysis(cx))
|
||||
return NULL;
|
||||
TypeScript::SetThis(cx, script, types::Type::ObjectType(res));
|
||||
}
|
||||
RootedScript script(cx, callee->toFunction()->nonLazyScript());
|
||||
TypeScript::SetThis(cx, script, types::Type::ObjectType(res));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -51,15 +51,12 @@ namespace analyze {
|
|||
|
||||
/*
|
||||
* Type of try note associated with each catch or finally block, and also with
|
||||
* for-in and other kinds of loops. Non-for-in loops do not need these notes
|
||||
* for exception unwinding, but storing their boundaries here is helpful for
|
||||
* heuristics that need to know whether a given op is inside a loop.
|
||||
* for-in loops.
|
||||
*/
|
||||
typedef enum JSTryNoteKind {
|
||||
JSTRY_CATCH,
|
||||
JSTRY_FINALLY,
|
||||
JSTRY_ITER,
|
||||
JSTRY_LOOP
|
||||
JSTRY_ITER
|
||||
} JSTryNoteKind;
|
||||
|
||||
/*
|
||||
|
@ -69,9 +66,9 @@ struct JSTryNote {
|
|||
uint8_t kind; /* one of JSTryNoteKind */
|
||||
uint8_t padding; /* explicit padding on uint16_t boundary */
|
||||
uint16_t stackDepth; /* stack depth upon exception handler entry */
|
||||
uint32_t start; /* start of the try statement or loop
|
||||
uint32_t start; /* start of the try statement or for-in loop
|
||||
relative to script->main */
|
||||
uint32_t length; /* length of the try statement or loop */
|
||||
uint32_t length; /* length of the try statement or for-in loop */
|
||||
};
|
||||
|
||||
namespace js {
|
||||
|
|
|
@ -121,8 +121,6 @@ mjit::Compiler::Compiler(JSContext *cx, JSScript *outerScript,
|
|||
gcNumber(cx->runtime->gcNumber),
|
||||
pcLengths(NULL)
|
||||
{
|
||||
JS_ASSERT(cx->jaegerCompilationAllowed());
|
||||
|
||||
if (!IsIonEnabled(cx)) {
|
||||
/* Once a script starts getting really hot we will inline calls in it. */
|
||||
if (!debugMode() && cx->typeInferenceEnabled() && globalObj &&
|
||||
|
@ -996,9 +994,6 @@ mjit::CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
|
|||
if (!cx->methodJitEnabled)
|
||||
return Compile_Abort;
|
||||
|
||||
if (!cx->jaegerCompilationAllowed())
|
||||
return Compile_Abort;
|
||||
|
||||
#ifdef JS_ION
|
||||
if (ion::IsBaselineEnabled(cx) || ion::IsEnabled(cx))
|
||||
return Compile_Abort;
|
||||
|
|
|
@ -115,11 +115,7 @@ FindExceptionHandler(JSContext *cx)
|
|||
cx->regs().sp -= 1;
|
||||
if (!ok)
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
|
||||
case JSTRY_LOOP:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -4927,6 +4927,11 @@ ProcessArgs(JSContext *cx, JSObject *obj_, OptionParser *op)
|
|||
if (op->getBoolOption('s'))
|
||||
JS_ToggleOptions(cx, JSOPTION_STRICT);
|
||||
|
||||
if (op->getBoolOption("no-jm")) {
|
||||
enableMethodJit = false;
|
||||
JS_ToggleOptions(cx, JSOPTION_METHODJIT);
|
||||
}
|
||||
|
||||
if (op->getBoolOption('d')) {
|
||||
JS_SetRuntimeDebugMode(JS_GetRuntime(cx), true);
|
||||
JS_SetDebugMode(cx, true);
|
||||
|
@ -5116,17 +5121,13 @@ Shell(JSContext *cx, OptionParser *op, char **envp)
|
|||
JSAutoRequest ar(cx);
|
||||
|
||||
/*
|
||||
* First check to see if type inference and JM are enabled. These flags
|
||||
* must be set on the compartment when it is constructed.
|
||||
* First check to see if type inference is enabled. This flag must be set
|
||||
* on the compartment when it is constructed.
|
||||
*/
|
||||
if (op->getBoolOption("no-ti")) {
|
||||
enableTypeInference = false;
|
||||
JS_ToggleOptions(cx, JSOPTION_TYPE_INFERENCE);
|
||||
}
|
||||
if (op->getBoolOption("no-jm")) {
|
||||
enableMethodJit = false;
|
||||
JS_ToggleOptions(cx, JSOPTION_METHODJIT);
|
||||
}
|
||||
|
||||
RootedObject glob(cx);
|
||||
glob = NewGlobalObject(cx, NULL);
|
||||
|
|
|
@ -22,6 +22,10 @@ user_pref("browser.cache.check_doc_frequency", 1);
|
|||
user_pref("extensions.checkCompatibility", false);
|
||||
user_pref("extensions.checkUpdateSecurity", false);
|
||||
user_pref("browser.EULA.override", true);
|
||||
user_pref("javascript.options.methodjit.chrome", true);
|
||||
user_pref("javascript.options.methodjit.content", true);
|
||||
user_pref("javascript.options.ion.content", true);
|
||||
user_pref("javascript.options.methodjit_always", false);
|
||||
user_pref("javascript.options.strict", false);
|
||||
user_pref("javascript.options.werror", false);
|
||||
user_pref("toolkit.startup.max_resumed_crashes", -1);
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace js {
|
|||
* and saved versions. If deserialization fails, the data should be
|
||||
* invalidated if possible.
|
||||
*/
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 142);
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 141);
|
||||
|
||||
class XDRBuffer {
|
||||
public:
|
||||
|
|
|
@ -779,8 +779,8 @@ pref("javascript.options.strict", false);
|
|||
#ifdef DEBUG
|
||||
pref("javascript.options.strict.debug", true);
|
||||
#endif
|
||||
pref("javascript.options.methodjit.content", false);
|
||||
pref("javascript.options.methodjit.chrome", false);
|
||||
pref("javascript.options.methodjit.content", true);
|
||||
pref("javascript.options.methodjit.chrome", true);
|
||||
pref("javascript.options.baselinejit.content", true);
|
||||
pref("javascript.options.baselinejit.chrome", true);
|
||||
pref("javascript.options.ion.content", true);
|
||||
|
|
Загрузка…
Ссылка в новой задаче