Bug 1493189 - Collapse ICCacheIR_UpdatedStub into ICUpdatedStub. r=mgaudet

Collapsed ICUpdatedStup into ICCacheIR_Updated.

Differential Revision: https://phabricator.services.mozilla.com/D25288

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Adam Holm 2019-04-03 20:27:07 +00:00
parent 855136af7f
commit bef3ba4a24
3 changed files with 46 additions and 55 deletions

View File

@ -975,7 +975,7 @@ bool BaselineCacheIRCompiler::callTypeUpdateIC(
masm.push(ICTailCallReg);
}
masm.push(ICStubReg);
masm.loadPtr(Address(ICStubReg, ICUpdatedStub::offsetOfFirstUpdateStub()),
masm.loadPtr(Address(ICStubReg, ICCacheIR_Updated::offsetOfFirstUpdateStub()),
ICStubReg);
masm.call(Address(ICStubReg, ICStub::offsetOfStubCode()));
masm.pop(ICStubReg);
@ -1001,8 +1001,8 @@ bool BaselineCacheIRCompiler::callTypeUpdateIC(
masm.loadPtr(Address(BaselineFrameReg, 0), scratch);
masm.pushBaselineFramePtr(scratch, scratch);
using Fn = bool (*)(JSContext*, BaselineFrame*, ICUpdatedStub*, HandleValue,
HandleValue);
using Fn = bool (*)(JSContext*, BaselineFrame*, ICCacheIR_Updated*,
HandleValue, HandleValue);
callVM<Fn, DoTypeUpdateFallback>(masm);
masm.PopRegsInMask(saveRegs);

View File

@ -1040,7 +1040,7 @@ void ICTypeMonitor_Fallback::resetMonitorStubChain(Zone* zone) {
}
}
void ICUpdatedStub::resetUpdateStubChain(Zone* zone) {
void ICCacheIR_Updated::resetUpdateStubChain(Zone* zone) {
while (!firstUpdateStub_->isTypeUpdate_Fallback()) {
if (zone->needsIncrementalBarrier()) {
// We are removing edges from update stubs to gcthings (JitCode).
@ -1096,7 +1096,7 @@ bool ICMonitoredFallbackStub::addMonitorStubForValue(JSContext* cx,
return typeMonitorFallback->addMonitorStubForValue(cx, frame, types, val);
}
bool ICUpdatedStub::initUpdatingChain(JSContext* cx, ICStubSpace* space) {
bool ICCacheIR_Updated::initUpdatingChain(JSContext* cx, ICStubSpace* space) {
MOZ_ASSERT(firstUpdateStub_ == nullptr);
FallbackStubAllocator alloc(cx, *space);
@ -1625,11 +1625,11 @@ bool ICTypeMonitor_AnyValue::Compiler::generateStubCode(MacroAssembler& masm) {
return true;
}
bool ICUpdatedStub::addUpdateStubForValue(JSContext* cx,
HandleScript outerScript,
HandleObject obj,
HandleObjectGroup group, HandleId id,
HandleValue val) {
bool ICCacheIR_Updated::addUpdateStubForValue(JSContext* cx,
HandleScript outerScript,
HandleObject obj,
HandleObjectGroup group,
HandleId id, HandleValue val) {
EnsureTrackPropertyTypes(cx, obj, id);
// Make sure that undefined values are explicitly included in the property
@ -1770,7 +1770,7 @@ bool ICUpdatedStub::addUpdateStubForValue(JSContext* cx,
// TypeUpdate_Fallback
//
bool DoTypeUpdateFallback(JSContext* cx, BaselineFrame* frame,
ICUpdatedStub* stub, HandleValue objval,
ICCacheIR_Updated* stub, HandleValue objval,
HandleValue value) {
// This can get called from optimized stubs. Therefore it is not allowed to
// gc.

View File

@ -356,7 +356,6 @@ class ICScript {
class ICMonitoredStub;
class ICMonitoredFallbackStub;
class ICUpdatedStub;
// Constant iterator that traverses arbitrary chains of ICStubs.
// No requirements are made of the ICStub used to construct this
@ -622,14 +621,14 @@ class ICStub {
return reinterpret_cast<ICMonitoredFallbackStub*>(this);
}
inline const ICUpdatedStub* toUpdatedStub() const {
inline const ICCacheIR_Updated* toUpdatedStub() const {
MOZ_ASSERT(isUpdated());
return reinterpret_cast<const ICUpdatedStub*>(this);
return reinterpret_cast<const ICCacheIR_Updated*>(this);
}
inline ICUpdatedStub* toUpdatedStub() {
inline ICCacheIR_Updated* toUpdatedStub() {
MOZ_ASSERT(isUpdated());
return reinterpret_cast<ICUpdatedStub*>(this);
return reinterpret_cast<ICCacheIR_Updated*>(this);
}
#define KIND_METHODS(kindName) \
@ -892,22 +891,43 @@ class ICCacheIR_Monitored : public ICMonitoredStub,
uint8_t* stubDataStart();
};
// Updated stubs are IC stubs that use a TypeUpdate IC to track
// the status of heap typesets that need to be updated.
class ICUpdatedStub : public ICStub {
protected:
static const uint32_t MAX_OPTIMIZED_STUBS = 8;
class ICCacheIR_Updated : public ICStub,
public ICCacheIR_Trait<ICCacheIR_Updated> {
uint32_t numOptimizedStubs_;
GCPtrObjectGroup updateStubGroup_;
GCPtrId updateStubId_;
// Pointer to the start of the type updating stub chain.
ICStub* firstUpdateStub_;
ICUpdatedStub(Kind kind, JitCode* stubCode)
: ICStub(kind, ICStub::Updated, stubCode),
numOptimizedStubs_(0),
firstUpdateStub_(nullptr) {}
static const uint32_t MAX_OPTIMIZED_STUBS = 8;
public:
ICCacheIR_Updated(JitCode* stubCode, const CacheIRStubInfo* stubInfo)
: ICStub(ICStub::CacheIR_Updated, ICStub::Updated, stubCode),
ICCacheIR_Trait(stubInfo),
numOptimizedStubs_(0),
updateStubGroup_(nullptr),
updateStubId_(JSID_EMPTY),
firstUpdateStub_(nullptr) {}
GCPtrObjectGroup& updateStubGroup() { return updateStubGroup_; }
GCPtrId& updateStubId() { return updateStubId_; }
uint8_t* stubDataStart();
inline ICStub* firstUpdateStub() const { return firstUpdateStub_; }
static inline size_t offsetOfFirstUpdateStub() {
return offsetof(ICCacheIR_Updated, firstUpdateStub_);
}
inline uint32_t numOptimizedStubs() const { return numOptimizedStubs_; }
void notePreliminaryObject() { extra_ = 1; }
bool hasPreliminaryObject() const { return extra_; }
MOZ_MUST_USE bool initUpdatingChain(JSContext* cx, ICStubSpace* space);
MOZ_MUST_USE bool addUpdateStubForValue(JSContext* cx, HandleScript script,
@ -933,8 +953,6 @@ class ICUpdatedStub : public ICStub {
numOptimizedStubs_++;
}
inline ICStub* firstUpdateStub() const { return firstUpdateStub_; }
void resetUpdateStubChain(Zone* zone);
bool hasTypeUpdateStub(ICStub::Kind kind) {
@ -949,33 +967,6 @@ class ICUpdatedStub : public ICStub {
return false;
}
inline uint32_t numOptimizedStubs() const { return numOptimizedStubs_; }
static inline size_t offsetOfFirstUpdateStub() {
return offsetof(ICUpdatedStub, firstUpdateStub_);
}
};
class ICCacheIR_Updated : public ICUpdatedStub,
public ICCacheIR_Trait<ICCacheIR_Updated> {
GCPtrObjectGroup updateStubGroup_;
GCPtrId updateStubId_;
public:
ICCacheIR_Updated(JitCode* stubCode, const CacheIRStubInfo* stubInfo)
: ICUpdatedStub(ICStub::CacheIR_Updated, stubCode),
ICCacheIR_Trait(stubInfo),
updateStubGroup_(nullptr),
updateStubId_(JSID_EMPTY) {}
GCPtrObjectGroup& updateStubGroup() { return updateStubGroup_; }
GCPtrId& updateStubId() { return updateStubId_; }
void notePreliminaryObject() { extra_ = 1; }
bool hasPreliminaryObject() const { return extra_; }
uint8_t* stubDataStart();
};
// Base class for stubcode compilers.
@ -2371,7 +2362,7 @@ void StoreToTypedArray(JSContext* cx, MacroAssembler& masm, Scalar::Type type,
Register scratch, Label* failure);
extern bool DoTypeUpdateFallback(JSContext* cx, BaselineFrame* frame,
ICUpdatedStub* stub, HandleValue objval,
ICCacheIR_Updated* stub, HandleValue objval,
HandleValue value);
extern bool DoWarmUpCounterFallbackOSR(JSContext* cx, BaselineFrame* frame,