mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 03:47:31 +09:00
Remove Unboxed Object code from jit, Part 3.
This commit is contained in:
parent
0c434f7244
commit
bc5121a769
6 changed files with 10 additions and 85 deletions
|
|
@ -42,8 +42,8 @@
|
|||
#include "jit/shared/Lowering-shared-inl.h"
|
||||
#include "vm/EnvironmentObject-inl.h"
|
||||
#include "vm/Interpreter-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/StringObject-inl.h"
|
||||
#include "vm/UnboxedObject-inl.h"
|
||||
|
||||
using mozilla::DebugOnly;
|
||||
|
||||
|
|
@ -732,11 +732,6 @@ LastPropertyForSetProp(JSObject* obj)
|
|||
if (obj->isNative())
|
||||
return obj->as<NativeObject>().lastProperty();
|
||||
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
|
||||
return expando ? expando->lastProperty() : nullptr;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -2666,18 +2661,6 @@ BaselineScript::noteArrayWriteHole(uint32_t pcOffset)
|
|||
// SetElem_DenseOrUnboxedArray
|
||||
//
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
EmitUnboxedPreBarrierForBaseline(MacroAssembler &masm, T address, JSValueType type)
|
||||
{
|
||||
if (type == JSVAL_TYPE_OBJECT)
|
||||
EmitPreBarrier(masm, address, MIRType::Object);
|
||||
else if (type == JSVAL_TYPE_STRING)
|
||||
EmitPreBarrier(masm, address, MIRType::String);
|
||||
else
|
||||
MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(type));
|
||||
}
|
||||
|
||||
bool
|
||||
ICSetElem_DenseOrUnboxedArray::Compiler::generateStubCode(MacroAssembler& masm)
|
||||
{
|
||||
|
|
@ -4124,18 +4107,7 @@ TryAttachSetValuePropStub(JSContext* cx, HandleScript script, jsbytecode* pc, IC
|
|||
return true;
|
||||
|
||||
if (!obj->isNative()) {
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
|
||||
if (expando) {
|
||||
shape = expando->lookup(cx, name);
|
||||
if (!shape)
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
size_t chainDepth;
|
||||
|
|
@ -4368,12 +4340,6 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
|
|||
return false;
|
||||
RootedReceiverGuard oldGuard(cx, ReceiverGuard(obj));
|
||||
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
MOZ_ASSERT(!oldShape);
|
||||
if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
|
||||
oldShape = expando->lastProperty();
|
||||
}
|
||||
|
||||
bool attached = false;
|
||||
// There are some reasons we can fail to attach a stub that are temporary.
|
||||
// We want to avoid calling noteUnoptimizableAccess() if the reason we
|
||||
|
|
@ -5538,7 +5504,7 @@ TryAttachCallStub(JSContext* cx, ICCall_Fallback* stub, HandleScript script, jsb
|
|||
if (!thisObject)
|
||||
return false;
|
||||
|
||||
if (thisObject->is<PlainObject>() || thisObject->is<UnboxedPlainObject>())
|
||||
if (thisObject->is<PlainObject>())
|
||||
templateObject = thisObject;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "jit/SharedICRegisters.h"
|
||||
#include "js/GCVector.h"
|
||||
#include "vm/ArrayObject.h"
|
||||
#include "vm/UnboxedObject.h"
|
||||
|
||||
namespace js {
|
||||
namespace jit {
|
||||
|
|
@ -1823,8 +1822,7 @@ class ICSetProp_Native : public ICUpdatedStub
|
|||
virtual int32_t getKey() const {
|
||||
return static_cast<int32_t>(engine_) |
|
||||
(static_cast<int32_t>(kind) << 1) |
|
||||
(static_cast<int32_t>(isFixedSlot_) << 17) |
|
||||
(static_cast<int32_t>(obj_->is<UnboxedPlainObject>()) << 18);
|
||||
(static_cast<int32_t>(isFixedSlot_) << 17);
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
|
||||
|
|
@ -1929,7 +1927,6 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler
|
|||
return static_cast<int32_t>(engine_) |
|
||||
(static_cast<int32_t>(kind) << 1) |
|
||||
(static_cast<int32_t>(isFixedSlot_) << 17) |
|
||||
(static_cast<int32_t>(obj_->is<UnboxedPlainObject>()) << 18) |
|
||||
(static_cast<int32_t>(protoChainDepth_) << 19);
|
||||
}
|
||||
|
||||
|
|
@ -1954,10 +1951,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler
|
|||
newGroup = nullptr;
|
||||
|
||||
RootedShape newShape(cx);
|
||||
if (obj_->isNative())
|
||||
newShape = obj_->as<NativeObject>().lastProperty();
|
||||
else
|
||||
newShape = obj_->as<UnboxedPlainObject>().maybeExpando()->lastProperty();
|
||||
|
||||
return newStub<ICSetProp_NativeAddImpl<ProtoChainDepth>>(
|
||||
space, getStubCode(), oldGroup_, shapes, newShape, newGroup, offset_);
|
||||
|
|
|
|||
|
|
@ -3384,11 +3384,6 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
|
|||
return false;
|
||||
|
||||
oldShape = obj->maybeShape();
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
MOZ_ASSERT(!oldShape);
|
||||
if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
|
||||
oldShape = expando->lastProperty();
|
||||
}
|
||||
}
|
||||
|
||||
RootedId id(cx);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include "jit/shared/Lowering-shared-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/StringObject-inl.h"
|
||||
#include "vm/UnboxedObject-inl.h"
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::AssertedCast;
|
||||
|
|
|
|||
|
|
@ -15,11 +15,9 @@
|
|||
#include "jit/JitcodeMap.h"
|
||||
#include "jit/JitSpewer.h"
|
||||
#include "js/TrackedOptimizationInfo.h"
|
||||
#include "vm/UnboxedObject.h"
|
||||
|
||||
#include "vm/ObjectGroup-inl.h"
|
||||
#include "vm/TypeInference-inl.h"
|
||||
#include "vm/UnboxedObject-inl.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
|
|
@ -846,8 +844,6 @@ MaybeConstructorFromType(TypeSet::Type ty)
|
|||
return nullptr;
|
||||
ObjectGroup* obj = ty.group();
|
||||
TypeNewScript* newScript = obj->newScript();
|
||||
if (!newScript && obj->maybeUnboxedLayout())
|
||||
newScript = obj->unboxedLayout().newScript();
|
||||
return newScript ? newScript->function() : nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1540,30 +1540,6 @@ RObjectState::recover(JSContext* cx, SnapshotIterator& iter) const
|
|||
RootedObject object(cx, &iter.read().toObject());
|
||||
RootedValue val(cx);
|
||||
|
||||
if (object->is<UnboxedPlainObject>()) {
|
||||
const UnboxedLayout& layout = object->as<UnboxedPlainObject>().layout();
|
||||
|
||||
RootedId id(cx);
|
||||
RootedValue receiver(cx, ObjectValue(*object));
|
||||
const UnboxedLayout::PropertyVector& properties = layout.properties();
|
||||
for (size_t i = 0; i < properties.length(); i++) {
|
||||
val = iter.read();
|
||||
|
||||
// This is the default placeholder value of MObjectState, when no
|
||||
// properties are defined yet.
|
||||
if (val.isUndefined())
|
||||
continue;
|
||||
|
||||
id = NameToId(properties[i].name);
|
||||
ObjectOpResult result;
|
||||
|
||||
// SetProperty can only fail due to OOM.
|
||||
if (!SetProperty(cx, object, id, val, receiver, result))
|
||||
return false;
|
||||
if (!result)
|
||||
return result.reportError(cx, object, id);
|
||||
}
|
||||
} else {
|
||||
RootedNativeObject nativeObject(cx, &object->as<NativeObject>());
|
||||
MOZ_ASSERT(nativeObject->slotSpan() == numSlots());
|
||||
|
||||
|
|
@ -1571,7 +1547,6 @@ RObjectState::recover(JSContext* cx, SnapshotIterator& iter) const
|
|||
val = iter.read();
|
||||
nativeObject->setSlot(i, val);
|
||||
}
|
||||
}
|
||||
|
||||
val.setObject(*object);
|
||||
iter.storeInstructionResult(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue