mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +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/MIRGenerator.h"
|
||||
#include "jit/MIRGraph.h"
|
||||
#include "vm/UnboxedObject.h"
|
||||
|
||||
#include "jsobjinlines.h"
|
||||
|
||||
|
|
@ -183,25 +182,6 @@ IsObjectEscaped(MInstruction* ins, JSObject* objDefault)
|
|||
JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
|
||||
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:
|
||||
break;
|
||||
|
||||
|
|
@ -305,12 +285,6 @@ class ObjectMemoryView : public MDefinitionVisitorDefaultNoop
|
|||
void visitGuardShape(MGuardShape* ins);
|
||||
void visitFunctionEnvironment(MFunctionEnvironment* 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:
|
||||
void storeOffset(MInstruction* ins, size_t offset, MDefinition* value);
|
||||
|
|
@ -656,21 +630,6 @@ ObjectMemoryView::visitLambda(MLambda* ins)
|
|||
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
|
||||
ObjectMemoryView::storeOffset(MInstruction* ins, size_t offset, MDefinition* value)
|
||||
{
|
||||
|
|
@ -700,77 +659,6 @@ ObjectMemoryView::loadOffset(MInstruction* ins, size_t offset)
|
|||
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
|
||||
IndexOf(MDefinition* ins, int32_t* res)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue