Back out 80163a75cca5 (bug 865059) for talos and android jsreftest bustage

CLOSED TREE

--HG--
extra : rebase_source : a4e86eab90dcf4d30a180c0cffe5d5964d720481
This commit is contained in:
Phil Ringnalda 2013-04-29 15:12:09 -07:00
Родитель 4b79a9144e
Коммит d4b5d87748
17 изменённых файлов: 30 добавлений и 122 удалений

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

@ -4367,9 +4367,6 @@ EmitNormalFor(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
if (EmitJump(cx, bce, op, top - bce->offset()) < 0) if (EmitJump(cx, bce, op, top - bce->offset()) < 0)
return false; return false;
if (!bce->tryNoteList.append(JSTRY_LOOP, bce->stackDepth, top, bce->offset()))
return false;
/* Now fixup all breaks and continues. */ /* Now fixup all breaks and continues. */
return PopStatementBCE(cx, bce); return PopStatementBCE(cx, bce);
} }
@ -4556,9 +4553,6 @@ EmitDo(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
if (beq < 0) if (beq < 0)
return false; 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 * Be careful: We must set noteIndex2 before noteIndex in case the noteIndex
* note gets bigger. * note gets bigger.
@ -4615,9 +4609,6 @@ EmitWhile(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
if (beq < 0) if (beq < 0)
return false; return false;
if (!bce->tryNoteList.append(JSTRY_LOOP, bce->stackDepth, top, bce->offset()))
return false;
if (!SetSrcNoteOffset(cx, bce, noteIndex, 0, beq - jmp)) if (!SetSrcNoteOffset(cx, bce, noteIndex, 0, beq - jmp))
return false; return false;

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

@ -435,9 +435,6 @@ HandleException(JSContext *cx, const IonFrameIterator &frame, ResumeFromExceptio
break; break;
} }
case JSTRY_LOOP:
break;
default: default:
JS_NOT_REACHED("Invalid try note"); JS_NOT_REACHED("Invalid try note");
} }

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

@ -405,7 +405,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
if (catchOffset > forwardCatch) if (catchOffset > forwardCatch)
forwardCatch = catchOffset; forwardCatch = catchOffset;
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) { if (tn->kind != JSTRY_ITER) {
if (!addJump(cx, catchOffset, &nextOffset, &forwardJump, &forwardLoop, stackDepth)) if (!addJump(cx, catchOffset, &nextOffset, &forwardJump, &forwardLoop, stackDepth))
return; return;
getCode(catchOffset).exceptionEntry = true; getCode(catchOffset).exceptionEntry = true;
@ -1507,7 +1507,7 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
if (startOffset == offset + 1) { if (startOffset == offset + 1) {
unsigned catchOffset = startOffset + tn->length; 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); checkBranchTarget(cx, catchOffset, branchTargets, values, stackDepth);
checkExceptionTarget(cx, catchOffset, exceptionTargets); checkExceptionTarget(cx, catchOffset, exceptionTargets);
} }

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

@ -1751,7 +1751,6 @@ struct JSContext : js::ContextFriendFields,
#endif #endif
inline bool typeInferenceEnabled() const; inline bool typeInferenceEnabled() const;
inline bool jaegerCompilationAllowed() const;
void updateJITEnabled(); void updateJITEnabled();

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

@ -411,12 +411,6 @@ JSContext::typeInferenceEnabled() const
return compartment->zone()->types.inferenceEnabled; return compartment->zone()->types.inferenceEnabled;
} }
inline bool
JSContext::jaegerCompilationAllowed() const
{
return compartment->zone()->types.jaegerCompilationAllowed;
}
inline js::Handle<js::GlobalObject*> inline js::Handle<js::GlobalObject*>
JSContext::global() const JSContext::global() const
{ {

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

@ -2467,12 +2467,10 @@ TypeZone::init(JSContext *cx)
!cx->hasOption(JSOPTION_TYPE_INFERENCE) || !cx->hasOption(JSOPTION_TYPE_INFERENCE) ||
!cx->runtime->jitSupportsFloatingPoint) !cx->runtime->jitSupportsFloatingPoint)
{ {
jaegerCompilationAllowed = true;
return; return;
} }
inferenceEnabled = true; inferenceEnabled = true;
jaegerCompilationAllowed = cx->hasOption(JSOPTION_METHODJIT);
} }
TypeObject * TypeObject *
@ -2694,28 +2692,13 @@ types::UseNewTypeForInitializer(JSContext *cx, JSScript *script, jsbytecode *pc,
if (key != JSProto_Object && !(key >= JSProto_Int8Array && key <= JSProto_Uint8ClampedArray)) if (key != JSProto_Object && !(key >= JSProto_Int8Array && key <= JSProto_Uint8ClampedArray))
return GenericObject; return GenericObject;
/* AutoEnterAnalysis enter(cx);
* All loops in the script will have a JSTRY_ITER or JSTRY_LOOP try note
* indicating their boundary.
*/
if (!script->hasTrynotes()) if (!script->ensureRanAnalysis(cx))
return SingletonObject; return GenericObject;
unsigned offset = pc - script->code; if (script->analysis()->getCode(pc).inLoop)
return GenericObject;
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;
}
return SingletonObject; return SingletonObject;
} }
@ -5669,16 +5652,8 @@ types::MarkIteratorUnknownSlow(JSContext *cx)
if (JSOp(*pc) != JSOP_ITER) if (JSOp(*pc) != JSOP_ITER)
return; return;
if (IgnoreTypeChanges(cx, script))
return;
AutoEnterAnalysis enter(cx); 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 * 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 * 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) types::TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc, Type type)
{ {
JS_ASSERT(cx->typeInferenceEnabled()); JS_ASSERT(cx->typeInferenceEnabled());
if (IgnoreTypeChanges(cx, script))
return;
AutoEnterAnalysis enter(cx); AutoEnterAnalysis enter(cx);
/* Directly update associated type sets for applicable bytecodes. */ /* 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)) if (!(js_CodeSpec[*pc].format & JOF_TYPESET))
return; return;
if (IgnoreTypeChanges(cx, script))
return;
AutoEnterAnalysis enter(cx); AutoEnterAnalysis enter(cx);
if (!script->ensureRanAnalysis(cx)) { if (!script->ensureRanAnalysis(cx)) {

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

@ -1466,13 +1466,6 @@ struct TypeZone
/* Whether type inference is enabled in this compartment. */ /* Whether type inference is enabled in this compartment. */
bool inferenceEnabled; 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(JS::Zone *zone);
~TypeZone(); ~TypeZone();
void init(JSContext *cx); void init(JSContext *cx);

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

@ -573,21 +573,6 @@ MarkIteratorUnknown(JSContext *cx)
MarkIteratorUnknownSlow(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, void TypeMonitorCallSlow(JSContext *cx, JSObject *callee, const CallArgs &args,
bool constructing); bool constructing);
@ -601,8 +586,6 @@ TypeMonitorCall(JSContext *cx, const js::CallArgs &args, bool constructing)
if (args.callee().isFunction()) { if (args.callee().isFunction()) {
JSFunction *fun = args.callee().toFunction(); JSFunction *fun = args.callee().toFunction();
if (fun->isInterpreted()) { if (fun->isInterpreted()) {
if (IgnoreTypeChanges(cx, fun->nonLazyScript()))
return true;
if (!fun->nonLazyScript()->ensureRanAnalysis(cx)) if (!fun->nonLazyScript()->ensureRanAnalysis(cx))
return false; return false;
if (cx->typeInferenceEnabled()) 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)) if (!cx->stack.pushExecuteFrame(cx, script, thisv, scopeChain, type, evalInFrame, &efg))
return false; return false;
if (!types::IgnoreTypeChanges(cx, script)) { if (!script->ensureRanAnalysis(cx))
if (!script->ensureRanAnalysis(cx)) return false;
return false; TypeScript::SetThis(cx, script, efg.fp()->thisValue());
TypeScript::SetThis(cx, script, efg.fp()->thisValue());
}
Probes::startExecution(script); Probes::startExecution(script);
bool ok = RunScript(cx, efg.fp()); bool ok = RunScript(cx, efg.fp());
@ -3368,11 +3366,7 @@ END_CASE(JSOP_ARRAYPUSH)
regs.sp -= 1; regs.sp -= 1;
if (!ok) if (!ok)
goto error; goto error;
break;
} }
case JSTRY_LOOP:
break;
} }
} }

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

@ -1511,12 +1511,8 @@ js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject
} }
if (res && cx->typeInferenceEnabled()) { if (res && cx->typeInferenceEnabled()) {
JSScript *script = callee->toFunction()->nonLazyScript(); RootedScript script(cx, callee->toFunction()->nonLazyScript());
if (!types::IgnoreTypeChanges(cx, script)) { TypeScript::SetThis(cx, script, types::Type::ObjectType(res));
if (!script->ensureRanAnalysis(cx))
return NULL;
TypeScript::SetThis(cx, script, types::Type::ObjectType(res));
}
} }
return res; return res;

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

@ -51,15 +51,12 @@ namespace analyze {
/* /*
* Type of try note associated with each catch or finally block, and also with * 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-in loops.
* for exception unwinding, but storing their boundaries here is helpful for
* heuristics that need to know whether a given op is inside a loop.
*/ */
typedef enum JSTryNoteKind { typedef enum JSTryNoteKind {
JSTRY_CATCH, JSTRY_CATCH,
JSTRY_FINALLY, JSTRY_FINALLY,
JSTRY_ITER, JSTRY_ITER
JSTRY_LOOP
} JSTryNoteKind; } JSTryNoteKind;
/* /*
@ -69,9 +66,9 @@ struct JSTryNote {
uint8_t kind; /* one of JSTryNoteKind */ uint8_t kind; /* one of JSTryNoteKind */
uint8_t padding; /* explicit padding on uint16_t boundary */ uint8_t padding; /* explicit padding on uint16_t boundary */
uint16_t stackDepth; /* stack depth upon exception handler entry */ 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 */ 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 { namespace js {

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

@ -121,8 +121,6 @@ mjit::Compiler::Compiler(JSContext *cx, JSScript *outerScript,
gcNumber(cx->runtime->gcNumber), gcNumber(cx->runtime->gcNumber),
pcLengths(NULL) pcLengths(NULL)
{ {
JS_ASSERT(cx->jaegerCompilationAllowed());
if (!IsIonEnabled(cx)) { if (!IsIonEnabled(cx)) {
/* Once a script starts getting really hot we will inline calls in it. */ /* Once a script starts getting really hot we will inline calls in it. */
if (!debugMode() && cx->typeInferenceEnabled() && globalObj && if (!debugMode() && cx->typeInferenceEnabled() && globalObj &&
@ -996,9 +994,6 @@ mjit::CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
if (!cx->methodJitEnabled) if (!cx->methodJitEnabled)
return Compile_Abort; return Compile_Abort;
if (!cx->jaegerCompilationAllowed())
return Compile_Abort;
#ifdef JS_ION #ifdef JS_ION
if (ion::IsBaselineEnabled(cx) || ion::IsEnabled(cx)) if (ion::IsBaselineEnabled(cx) || ion::IsEnabled(cx))
return Compile_Abort; return Compile_Abort;

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

@ -115,11 +115,7 @@ FindExceptionHandler(JSContext *cx)
cx->regs().sp -= 1; cx->regs().sp -= 1;
if (!ok) if (!ok)
goto error; goto error;
break;
} }
case JSTRY_LOOP:
break;
} }
} }
} else { } else {

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

@ -4927,6 +4927,11 @@ ProcessArgs(JSContext *cx, JSObject *obj_, OptionParser *op)
if (op->getBoolOption('s')) if (op->getBoolOption('s'))
JS_ToggleOptions(cx, JSOPTION_STRICT); JS_ToggleOptions(cx, JSOPTION_STRICT);
if (op->getBoolOption("no-jm")) {
enableMethodJit = false;
JS_ToggleOptions(cx, JSOPTION_METHODJIT);
}
if (op->getBoolOption('d')) { if (op->getBoolOption('d')) {
JS_SetRuntimeDebugMode(JS_GetRuntime(cx), true); JS_SetRuntimeDebugMode(JS_GetRuntime(cx), true);
JS_SetDebugMode(cx, true); JS_SetDebugMode(cx, true);
@ -5116,17 +5121,13 @@ Shell(JSContext *cx, OptionParser *op, char **envp)
JSAutoRequest ar(cx); JSAutoRequest ar(cx);
/* /*
* First check to see if type inference and JM are enabled. These flags * First check to see if type inference is enabled. This flag must be set
* must be set on the compartment when it is constructed. * on the compartment when it is constructed.
*/ */
if (op->getBoolOption("no-ti")) { if (op->getBoolOption("no-ti")) {
enableTypeInference = false; enableTypeInference = false;
JS_ToggleOptions(cx, JSOPTION_TYPE_INFERENCE); JS_ToggleOptions(cx, JSOPTION_TYPE_INFERENCE);
} }
if (op->getBoolOption("no-jm")) {
enableMethodJit = false;
JS_ToggleOptions(cx, JSOPTION_METHODJIT);
}
RootedObject glob(cx); RootedObject glob(cx);
glob = NewGlobalObject(cx, NULL); glob = NewGlobalObject(cx, NULL);

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

@ -22,6 +22,10 @@ user_pref("browser.cache.check_doc_frequency", 1);
user_pref("extensions.checkCompatibility", false); user_pref("extensions.checkCompatibility", false);
user_pref("extensions.checkUpdateSecurity", false); user_pref("extensions.checkUpdateSecurity", false);
user_pref("browser.EULA.override", true); 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.strict", false);
user_pref("javascript.options.werror", false); user_pref("javascript.options.werror", false);
user_pref("toolkit.startup.max_resumed_crashes", -1); user_pref("toolkit.startup.max_resumed_crashes", -1);

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

@ -26,7 +26,7 @@ namespace js {
* and saved versions. If deserialization fails, the data should be * and saved versions. If deserialization fails, the data should be
* invalidated if possible. * 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 { class XDRBuffer {
public: public:

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

@ -779,8 +779,8 @@ pref("javascript.options.strict", false);
#ifdef DEBUG #ifdef DEBUG
pref("javascript.options.strict.debug", true); pref("javascript.options.strict.debug", true);
#endif #endif
pref("javascript.options.methodjit.content", false); pref("javascript.options.methodjit.content", true);
pref("javascript.options.methodjit.chrome", false); pref("javascript.options.methodjit.chrome", true);
pref("javascript.options.baselinejit.content", true); pref("javascript.options.baselinejit.content", true);
pref("javascript.options.baselinejit.chrome", true); pref("javascript.options.baselinejit.chrome", true);
pref("javascript.options.ion.content", true); pref("javascript.options.ion.content", true);