Bug 897137 - Remove unnecessary inlining for the Dump intrinsic in Ion. (r=nmatsakis)

This commit is contained in:
Shu-yu Guo 2013-07-24 07:19:05 -07:00
parent 698ca6737b
commit da8b104df2
14 changed files with 12 additions and 111 deletions

View File

@ -1219,19 +1219,6 @@ CodeGenerator::visitGuardThreadLocalObject(LGuardThreadLocalObject *lir)
return true;
}
bool
CodeGenerator::visitDumpPar(LDumpPar *lir)
{
ValueOperand value = ToValue(lir, 0);
masm.Push(value);
masm.movePtr(StackPointer, CallTempReg0);
masm.setupUnalignedABICall(1, CallTempReg1);
masm.passABIArg(CallTempReg0);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void *, DumpValuePar));
masm.freeStack(sizeof(Value));
return true;
}
bool
CodeGenerator::visitTypeBarrier(LTypeBarrier *lir)
{

View File

@ -182,7 +182,6 @@ class CodeGenerator : public CodeGeneratorSpecific
bool visitFunctionEnvironment(LFunctionEnvironment *lir);
bool visitForkJoinSlice(LForkJoinSlice *lir);
bool visitGuardThreadLocalObject(LGuardThreadLocalObject *lir);
bool visitDumpPar(LDumpPar *lir);
bool visitCallGetProperty(LCallGetProperty *lir);
bool visitCallGetElement(LCallGetElement *lir);
bool visitCallSetElement(LCallSetElement *lir);

View File

@ -4348,18 +4348,6 @@ class LGuardThreadLocalObject : public LCallInstructionHelper<0, 2, 1>
}
};
class LDumpPar : public LCallInstructionHelper<0, BOX_PIECES, 0>
{
public:
LIR_HEADER(DumpPar);
static const size_t Value = 0;
const LAllocation *value() {
return getOperand(0);
}
};
// Guard that a value is in a TypeSet.
class LTypeBarrier : public LInstructionHelper<0, BOX_PIECES, 1>
{

View File

@ -140,7 +140,6 @@
_(GuardObjectType) \
_(GuardClass) \
_(GuardThreadLocalObject) \
_(DumpPar) \
_(TypeBarrier) \
_(MonitorTypes) \
_(PostWriteBarrierO) \

View File

@ -1706,14 +1706,6 @@ LIRGenerator::visitCheckInterruptPar(MCheckInterruptPar *ins)
return true;
}
bool
LIRGenerator::visitDumpPar(MDumpPar *ins)
{
LDumpPar *lir = new LDumpPar();
useBoxFixed(lir, LDumpPar::Value, ins->value(), CallTempReg0, CallTempReg1);
return add(lir);
}
bool
LIRGenerator::visitNewPar(MNewPar *ins)
{

View File

@ -170,7 +170,6 @@ class LIRGenerator : public LIRGeneratorSpecific
bool visitForkJoinSlice(MForkJoinSlice *ins);
bool visitGuardThreadLocalObject(MGuardThreadLocalObject *ins);
bool visitCheckInterruptPar(MCheckInterruptPar *ins);
bool visitDumpPar(MDumpPar *ins);
bool visitStoreSlot(MStoreSlot *ins);
bool visitTypeBarrier(MTypeBarrier *ins);
bool visitMonitorTypes(MMonitorTypes *ins);

View File

@ -146,10 +146,6 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSNative native)
return inlineHaveSameClass(callInfo);
if (native == intrinsic_ToObject)
return inlineToObject(callInfo);
#ifdef DEBUG
if (native == intrinsic_Dump)
return inlineDump(callInfo);
#endif
return InliningStatus_NotInlined;
}
@ -1502,34 +1498,5 @@ IonBuilder::inlineToObject(CallInfo &callInfo)
return InliningStatus_Inlined;
}
IonBuilder::InliningStatus
IonBuilder::inlineDump(CallInfo &callInfo)
{
// In Parallel Execution, call DumpPar. We just need a debugging
// aid!
if (callInfo.constructing())
return InliningStatus_NotInlined;
ExecutionMode executionMode = info().executionMode();
switch (executionMode) {
case SequentialExecution:
return InliningStatus_NotInlined;
case ParallelExecution:
break;
}
callInfo.unwrapArgs();
JS_ASSERT(1 == callInfo.argc());
MDumpPar *dump = new MDumpPar(callInfo.getArg(0));
current->add(dump);
MConstant *udef = MConstant::New(UndefinedValue());
current->add(udef);
current->push(udef);
return InliningStatus_Inlined;
}
} // namespace ion
} // namespace js

View File

@ -7379,28 +7379,6 @@ class MGuardThreadLocalObject
}
};
class MDumpPar
: public MUnaryInstruction,
public BoxPolicy<0>
{
public:
INSTRUCTION_HEADER(DumpPar);
MDumpPar(MDefinition *v)
: MUnaryInstruction(v)
{
setResultType(MIRType_None);
}
MDefinition *value() const {
return getOperand(0);
}
TypePolicy *typePolicy() {
return this;
}
};
// Given a value, guard that the value is in a particular TypeSet, then returns
// that value.
class MTypeBarrier

View File

@ -195,7 +195,6 @@ namespace ion {
_(RestPar) \
_(ForkJoinSlice) \
_(GuardThreadLocalObject) \
_(DumpPar) \
_(CheckInterruptPar)
// Forward declarations of MIR types.

View File

@ -163,14 +163,6 @@ ion::CheckInterruptPar(ForkJoinSlice *slice)
return true;
}
void
ion::DumpValuePar(Value *v)
{
#ifdef DEBUG
js_DumpValue(*v);
#endif
}
JSObject *
ion::PushPar(PushParArgs *args)
{

View File

@ -20,8 +20,6 @@ bool IsThreadLocalObject(ForkJoinSlice *context, JSObject *object);
bool CheckOverRecursedPar(ForkJoinSlice *slice);
bool CheckInterruptPar(ForkJoinSlice *context);
void DumpValuePar(Value *v);
// We pass the arguments to PushPar in a structure because, in code
// gen, it is convenient to store them on the stack to avoid
// constraining the reg alloc for the slow path.

View File

@ -251,7 +251,6 @@ class ParallelSafetyVisitor : public MInstructionVisitor
SAFE_OP(NewDenseArrayPar)
SAFE_OP(NewCallObjectPar)
SAFE_OP(LambdaPar)
SAFE_OP(DumpPar)
SAFE_OP(AbortPar)
UNSAFE_OP(ArrayConcat)
UNSAFE_OP(GetDOMProperty)

View File

@ -994,10 +994,6 @@ JSBool intrinsic_HaveSameClass(JSContext *cx, unsigned argc, Value *vp);
JSBool intrinsic_ShouldForceSequential(JSContext *cx, unsigned argc, Value *vp);
JSBool intrinsic_NewParallelArray(JSContext *cx, unsigned argc, Value *vp);
#ifdef DEBUG
JSBool intrinsic_Dump(JSContext *cx, unsigned argc, Value *vp);
#endif
} /* namespace js */
#ifdef _MSC_VER

View File

@ -319,15 +319,21 @@ intrinsic_SetScriptHints(JSContext *cx, unsigned argc, Value *vp)
* Dump(val): Dumps a value for debugging, even in parallel mode.
*/
JSBool
js::intrinsic_Dump(JSContext *cx, unsigned argc, Value *vp)
intrinsic_Dump(ThreadSafeContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RootedValue val(cx, args[0]);
js_DumpValue(val);
js_DumpValue(args[0]);
if (args[0].isObject()) {
fprintf(stderr, "\n");
js_DumpObject(&args[0].toObject());
}
args.rval().setUndefined();
return true;
}
const JSJitInfo intrinsic_Dump_jitInfo =
JS_JITINFO_NATIVE_PARALLEL(JSParallelNativeThreadSafeWrapper<intrinsic_Dump>);
JSBool
intrinsic_ParallelSpew(ThreadSafeContext *cx, unsigned argc, Value *vp)
{
@ -665,7 +671,9 @@ const JSFunctionSpec intrinsic_functions[] = {
JS_FN("regexp_test_no_statics", regexp_test_no_statics, 2,0),
#ifdef DEBUG
JS_FN("Dump", intrinsic_Dump, 1,0),
JS_FNINFO("Dump",
JSNativeThreadSafeWrapper<intrinsic_Dump>,
&intrinsic_Dump_jitInfo, 1,0),
JS_FNINFO("ParallelSpew",
JSNativeThreadSafeWrapper<intrinsic_ParallelSpew>,