Bug 903193 - Part 7: Replace PushPar use in Ion with SetElementPar. (r=nmatsakis)

This commit is contained in:
Shu-yu Guo 2013-10-08 15:14:04 -07:00
parent 249dd7df96
commit 657815bb45
3 changed files with 28 additions and 2 deletions

View File

@ -4839,7 +4839,11 @@ CodeGenerator::visitStoreElementHoleV(LStoreElementHoleV *lir)
typedef bool (*SetObjectElementFn)(JSContext *, HandleObject, HandleValue, HandleValue,
bool strict);
static const VMFunction SetObjectElementInfo = FunctionInfo<SetObjectElementFn>(SetObjectElement);
typedef ParallelResult (*SetElementParFn)(ForkJoinSlice *, HandleObject, HandleValue,
HandleValue, bool);
static const VMFunctionsModal SetObjectElementInfo = VMFunctionsModal(
FunctionInfo<SetObjectElementFn>(SetObjectElement),
FunctionInfo<SetElementParFn>(SetElementPar));
bool
CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole *ool)
@ -4917,7 +4921,6 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole *ool)
else
pushArg(TypedOrValueRegister(MIRType_Int32, ToAnyRegister(index)));
pushArg(object);
// FIXME: Handle parallel case in upcoming patch.
if (!callVM(SetObjectElementInfo, ins))
return false;

View File

@ -159,6 +159,25 @@ jit::ExtendArrayPar(ForkJoinSlice *slice, JSObject *array, uint32_t length)
return array;
}
ParallelResult
jit::SetElementPar(ForkJoinSlice *slice, HandleObject obj, HandleValue index, HandleValue value,
bool strict)
{
RootedId id(slice);
if (!ValueToIdPure(index, id.address()))
return TP_RETRY_SEQUENTIALLY;
// SetObjectElementOperation, the sequential version, has several checks
// for certain deoptimizing behaviors, such as marking having written to
// holes and non-indexed element accesses. We don't do that here, as we
// can't modify any TI state anyways. If we need to add a new type, we
// would bail out.
RootedValue v(slice, value);
if (!baseops::SetPropertyHelper<ParallelExecution>(slice, obj, obj, id, 0, &v, strict))
return TP_RETRY_SEQUENTIALLY;
return TP_SUCCESS;
}
ParallelResult
jit::ConcatStringsPar(ForkJoinSlice *slice, HandleString left, HandleString right,
MutableHandleString out)

View File

@ -24,6 +24,10 @@ bool CheckInterruptPar(ForkJoinSlice *slice);
// generation.
JSObject *ExtendArrayPar(ForkJoinSlice *slice, JSObject *array, uint32_t length);
// Set properties and elements on thread local objects.
ParallelResult SetElementPar(ForkJoinSlice *slice, HandleObject obj, HandleValue index,
HandleValue value, bool strict);
// String related parallel functions. These tend to call existing VM functions
// that take a ThreadSafeContext.
ParallelResult ConcatStringsPar(ForkJoinSlice *slice, HandleString left, HandleString right,