Bug 897866 - Move types::IsInlinableCall() to Ion.h as ion::IsIonInlinablePC() (r=h4writer)

This commit is contained in:
Eric Faust 2013-07-25 03:49:32 -07:00
parent cf79b171a3
commit f7422ed3c0
5 changed files with 12 additions and 23 deletions

View File

@ -1007,7 +1007,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
// Write out actual arguments (and thisv), copied from unpacked stack of BaselineJS frame. // Write out actual arguments (and thisv), copied from unpacked stack of BaselineJS frame.
// Arguments are reversed on the BaselineJS frame's stack values. // Arguments are reversed on the BaselineJS frame's stack values.
JS_ASSERT(isCall || IsGetterPC(pc) || IsSetterPC(pc)); JS_ASSERT(IsIonInlinablePC(pc));
unsigned actualArgc; unsigned actualArgc;
if (needToSaveArgs) { if (needToSaveArgs) {
// For FUNAPPLY or an accessor, the arguments are not on the stack anymore, // For FUNAPPLY or an accessor, the arguments are not on the stack anymore,

View File

@ -346,6 +346,14 @@ IsEnabled(JSContext *cx)
cx->typeInferenceEnabled(); cx->typeInferenceEnabled();
} }
inline bool
IsIonInlinablePC(jsbytecode *pc) {
// CALL, FUNCALL, FUNAPPLY, EVAL, NEW (JOF_INVOKE callsites)
// GETPROP, CALLPROP, and LENGTH. (Inlined Getters)
// SETPROP, SETNAME, SETGNAME (Inlined Setters)
return js_CodeSpec[*pc].format & JOF_INVOKE || IsGetterPC(pc) || IsSetterPC(pc);
}
void ForbidCompilation(JSContext *cx, JSScript *script); void ForbidCompilation(JSContext *cx, JSScript *script);
void ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode); void ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode);
uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc); uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc);

View File

@ -3429,7 +3429,7 @@ bool
IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target) IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target)
{ {
JS_ASSERT(target->isInterpreted()); JS_ASSERT(target->isInterpreted());
JS_ASSERT(types::IsInlinableCall(pc)); JS_ASSERT(IsIonInlinablePC(pc));
// Remove any MPassArgs. // Remove any MPassArgs.
if (callInfo.isWrapped()) if (callInfo.isWrapped())
@ -4095,7 +4095,7 @@ IonBuilder::inlineCalls(CallInfo &callInfo, AutoObjectVector &targets,
MGetPropertyCache *maybeCache) MGetPropertyCache *maybeCache)
{ {
// Only handle polymorphic inlining. // Only handle polymorphic inlining.
JS_ASSERT(types::IsInlinableCall(pc)); JS_ASSERT(IsIonInlinablePC(pc));
JS_ASSERT(choiceSet.length() == targets.length()); JS_ASSERT(choiceSet.length() == targets.length());
JS_ASSERT_IF(!maybeCache, targets.length() >= 2); JS_ASSERT_IF(!maybeCache, targets.length() >= 2);
JS_ASSERT_IF(maybeCache, targets.length() >= 1); JS_ASSERT_IF(maybeCache, targets.length() >= 1);

View File

@ -1313,8 +1313,7 @@ InlineFrameIteratorMaybeGC<allowGC>::findNextFrame()
// before reading inner ones. // before reading inner ones.
unsigned remaining = start_.frameCount() - framesRead_ - 1; unsigned remaining = start_.frameCount() - framesRead_ - 1;
for (unsigned i = 0; i < remaining; i++) { for (unsigned i = 0; i < remaining; i++) {
JS_ASSERT(js_CodeSpec[*pc_].format & JOF_INVOKE || JS_ASSERT(IsIonInlinablePC(pc_));
IsGetterPC(pc_) || IsSetterPC(pc_));
// Recover the number of actual arguments from the script. // Recover the number of actual arguments from the script.
if (JSOp(*pc_) != JSOP_FUNAPPLY) if (JSOp(*pc_) != JSOP_FUNAPPLY)

View File

@ -301,24 +301,6 @@ TypeIdString(jsid id)
#endif #endif
} }
/* Assert code to know which PCs are reasonable to be considering inlining on. */
inline bool
IsInlinableCall(jsbytecode *pc)
{
JSOp op = JSOp(*pc);
// CALL, FUNCALL, FUNAPPLY, EVAL (Standard callsites)
// NEW (IonMonkey-only callsite)
// GETPROP, CALLPROP, and LENGTH. (Inlined Getters)
// SETPROP, SETNAME, SETGNAME (Inlined Setters)
return op == JSOP_CALL || op == JSOP_FUNCALL || op == JSOP_FUNAPPLY || op == JSOP_EVAL ||
#ifdef JS_ION
op == JSOP_NEW ||
#endif
op == JSOP_GETPROP || op == JSOP_CALLPROP || op == JSOP_LENGTH ||
op == JSOP_SETPROP || op == JSOP_SETGNAME || op == JSOP_SETNAME;
}
/* /*
* Structure for type inference entry point functions. All functions which can * Structure for type inference entry point functions. All functions which can
* change type information must use this, and functions which depend on * change type information must use this, and functions which depend on