mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 09:07:30 +09:00
Remove Unboxed Objects in ScalarReplacement
A note about the Scalar Replacement Changes: The M{Load,Store}Unboxed*
instructions in theory could be used to manipulate and analyze typed
arrays. However, TypedArrays should already be excluded from eligibility
because of the potential for cross-thread sharing in a SharedArrayBuffer
world, and so the only support in Scalar Replacement here is for Unboxed
Objects, meaning it can all be removed.
This commit is contained in:
parent
fb23522087
commit
d7714885d1
1 changed files with 0 additions and 112 deletions
|
|
@ -13,7 +13,6 @@
|
||||||
#include "jit/MIR.h"
|
#include "jit/MIR.h"
|
||||||
#include "jit/MIRGenerator.h"
|
#include "jit/MIRGenerator.h"
|
||||||
#include "jit/MIRGraph.h"
|
#include "jit/MIRGraph.h"
|
||||||
#include "vm/UnboxedObject.h"
|
|
||||||
|
|
||||||
#include "jsobjinlines.h"
|
#include "jsobjinlines.h"
|
||||||
|
|
||||||
|
|
@ -183,25 +182,6 @@ IsObjectEscaped(MInstruction* ins, JSObject* objDefault)
|
||||||
JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
|
JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case MDefinition::Op_LoadUnboxedScalar:
|
|
||||||
case MDefinition::Op_StoreUnboxedScalar:
|
|
||||||
case MDefinition::Op_LoadUnboxedObjectOrNull:
|
|
||||||
case MDefinition::Op_StoreUnboxedObjectOrNull:
|
|
||||||
case MDefinition::Op_LoadUnboxedString:
|
|
||||||
case MDefinition::Op_StoreUnboxedString:
|
|
||||||
// Not escaped if it is the first argument.
|
|
||||||
if (def->indexOf(*i) != 0) {
|
|
||||||
JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!def->getOperand(1)->isConstant()) {
|
|
||||||
JitSpewDef(JitSpew_Escape, "is addressed with unknown index\n", def);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MDefinition::Op_PostWriteBarrier:
|
case MDefinition::Op_PostWriteBarrier:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -305,12 +285,6 @@ class ObjectMemoryView : public MDefinitionVisitorDefaultNoop
|
||||||
void visitGuardShape(MGuardShape* ins);
|
void visitGuardShape(MGuardShape* ins);
|
||||||
void visitFunctionEnvironment(MFunctionEnvironment* ins);
|
void visitFunctionEnvironment(MFunctionEnvironment* ins);
|
||||||
void visitLambda(MLambda* ins);
|
void visitLambda(MLambda* ins);
|
||||||
void visitStoreUnboxedScalar(MStoreUnboxedScalar* ins);
|
|
||||||
void visitLoadUnboxedScalar(MLoadUnboxedScalar* ins);
|
|
||||||
void visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins);
|
|
||||||
void visitLoadUnboxedObjectOrNull(MLoadUnboxedObjectOrNull* ins);
|
|
||||||
void visitStoreUnboxedString(MStoreUnboxedString* ins);
|
|
||||||
void visitLoadUnboxedString(MLoadUnboxedString* ins);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void storeOffset(MInstruction* ins, size_t offset, MDefinition* value);
|
void storeOffset(MInstruction* ins, size_t offset, MDefinition* value);
|
||||||
|
|
@ -656,21 +630,6 @@ ObjectMemoryView::visitLambda(MLambda* ins)
|
||||||
ins->setIncompleteObject();
|
ins->setIncompleteObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t
|
|
||||||
GetOffsetOf(MDefinition* index, size_t width, int32_t baseOffset)
|
|
||||||
{
|
|
||||||
int32_t idx = index->toConstant()->toInt32();
|
|
||||||
MOZ_ASSERT(idx >= 0);
|
|
||||||
MOZ_ASSERT(baseOffset >= 0 && size_t(baseOffset) >= UnboxedPlainObject::offsetOfData());
|
|
||||||
return idx * width + baseOffset - UnboxedPlainObject::offsetOfData();
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t
|
|
||||||
GetOffsetOf(MDefinition* index, Scalar::Type type, int32_t baseOffset)
|
|
||||||
{
|
|
||||||
return GetOffsetOf(index, Scalar::byteSize(type), baseOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ObjectMemoryView::storeOffset(MInstruction* ins, size_t offset, MDefinition* value)
|
ObjectMemoryView::storeOffset(MInstruction* ins, size_t offset, MDefinition* value)
|
||||||
{
|
{
|
||||||
|
|
@ -700,77 +659,6 @@ ObjectMemoryView::loadOffset(MInstruction* ins, size_t offset)
|
||||||
ins->block()->discard(ins);
|
ins->block()->discard(ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitStoreUnboxedScalar(MStoreUnboxedScalar* ins)
|
|
||||||
{
|
|
||||||
// Skip stores made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), ins->storageType(), ins->offsetAdjustment());
|
|
||||||
storeOffset(ins, offset, ins->value());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitLoadUnboxedScalar(MLoadUnboxedScalar* ins)
|
|
||||||
{
|
|
||||||
// Skip loads made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Replace load by the slot value.
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), ins->storageType(), ins->offsetAdjustment());
|
|
||||||
loadOffset(ins, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins)
|
|
||||||
{
|
|
||||||
// Skip stores made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Clone the state and update the slot value.
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
|
|
||||||
storeOffset(ins, offset, ins->value());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitLoadUnboxedObjectOrNull(MLoadUnboxedObjectOrNull* ins)
|
|
||||||
{
|
|
||||||
// Skip loads made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Replace load by the slot value.
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
|
|
||||||
loadOffset(ins, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitStoreUnboxedString(MStoreUnboxedString* ins)
|
|
||||||
{
|
|
||||||
// Skip stores made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Clone the state and update the slot value.
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
|
|
||||||
storeOffset(ins, offset, ins->value());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ObjectMemoryView::visitLoadUnboxedString(MLoadUnboxedString* ins)
|
|
||||||
{
|
|
||||||
// Skip loads made on other objects.
|
|
||||||
if (ins->elements() != obj_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Replace load by the slot value.
|
|
||||||
size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
|
|
||||||
loadOffset(ins, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
IndexOf(MDefinition* ins, int32_t* res)
|
IndexOf(MDefinition* ins, int32_t* res)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue