mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 7 changesets (bug 905999, bug 909989) for Linux tp crashes on a CLOSED TREE.
Backed out changeset 3bb7a1c950a3 (bug 905999) Backed out changeset a95e00dbefea (bug 905999) Backed out changeset f66ece725f98 (bug 905999) Backed out changeset f7779522f6f6 (bug 905999) Backed out changeset 91b14e27101a (bug 909989) Backed out changeset f1842e91034d (bug 909989) Backed out changeset ccc30b7c2277 (bug 909989)
This commit is contained in:
parent
9948a99c52
commit
94f3ba03e7
@ -1,11 +0,0 @@
|
||||
// |jit-test| ion-eager
|
||||
function reportCompare (expected) {
|
||||
typeof expected;
|
||||
}
|
||||
var expect = 'No Crash';
|
||||
var array = new Array(10);
|
||||
for (var i = 0; i != array.length; ++i) {
|
||||
gc();
|
||||
}
|
||||
var expect = array.length;
|
||||
reportCompare(expect);
|
@ -79,10 +79,9 @@ class OutOfLineUpdateCache :
|
||||
}
|
||||
|
||||
// ICs' visit functions delegating the work to the CodeGen visit funtions.
|
||||
#define VISIT_CACHE_FUNCTION(op) \
|
||||
bool visit##op##IC(CodeGenerator *codegen) { \
|
||||
CodeGenerator::DataPtr<op##IC> ic(codegen, getCacheIndex()); \
|
||||
return codegen->visit##op##IC(this, ic); \
|
||||
#define VISIT_CACHE_FUNCTION(op) \
|
||||
bool visit##op##IC(CodeGenerator *codegen, op##IC *ic) { \
|
||||
return codegen->visit##op##IC(this, ic); \
|
||||
}
|
||||
|
||||
IONCACHE_KIND_LIST(VISIT_CACHE_FUNCTION)
|
||||
@ -96,7 +95,7 @@ class OutOfLineUpdateCache :
|
||||
bool
|
||||
CodeGeneratorShared::addCache(LInstruction *lir, size_t cacheIndex)
|
||||
{
|
||||
DataPtr<IonCache> cache(this, cacheIndex);
|
||||
IonCache *cache = static_cast<IonCache *>(getCache(cacheIndex));
|
||||
MInstruction *mir = lir->mirRaw()->toInstruction();
|
||||
if (mir->resumePoint())
|
||||
cache->setScriptedLocation(mir->block()->info().script(),
|
||||
@ -120,7 +119,8 @@ CodeGeneratorShared::addCache(LInstruction *lir, size_t cacheIndex)
|
||||
bool
|
||||
CodeGenerator::visitOutOfLineCache(OutOfLineUpdateCache *ool)
|
||||
{
|
||||
DataPtr<IonCache> cache(this, ool->getCacheIndex());
|
||||
size_t cacheIndex = ool->getCacheIndex();
|
||||
IonCache *cache = static_cast<IonCache *>(getCache(cacheIndex));
|
||||
|
||||
// Register the location of the OOL path in the IC.
|
||||
cache->setFallbackLabel(masm.labelForPatch());
|
||||
@ -5829,7 +5829,7 @@ const VMFunction CallsiteCloneIC::UpdateInfo =
|
||||
FunctionInfo<CallsiteCloneICFn>(CallsiteCloneIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitCallsiteCloneIC(OutOfLineUpdateCache *ool, DataPtr<CallsiteCloneIC> &ic)
|
||||
CodeGenerator::visitCallsiteCloneIC(OutOfLineUpdateCache *ool, CallsiteCloneIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -5861,7 +5861,7 @@ typedef bool (*NameICFn)(JSContext *, size_t, HandleObject, MutableHandleValue);
|
||||
const VMFunction NameIC::UpdateInfo = FunctionInfo<NameICFn>(NameIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitNameIC(OutOfLineUpdateCache *ool, DataPtr<NameIC> &ic)
|
||||
CodeGenerator::visitNameIC(OutOfLineUpdateCache *ool, NameIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -5925,17 +5925,9 @@ const VMFunction GetPropertyIC::UpdateInfo =
|
||||
FunctionInfo<GetPropertyICFn>(GetPropertyIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitGetPropertyIC(OutOfLineUpdateCache *ool, DataPtr<GetPropertyIC> &ic)
|
||||
CodeGenerator::visitGetPropertyIC(OutOfLineUpdateCache *ool, GetPropertyIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
|
||||
if (ic->idempotent()) {
|
||||
size_t numLocs;
|
||||
CacheLocationList &cacheLocs = lir->mirRaw()->toGetPropertyCache()->location();
|
||||
size_t locationBase = addCacheLocations(cacheLocs, &numLocs);
|
||||
ic->setLocationInfo(locationBase, numLocs);
|
||||
}
|
||||
|
||||
saveLive(lir);
|
||||
|
||||
pushArg(ic->object());
|
||||
@ -5955,7 +5947,7 @@ const VMFunction GetPropertyParIC::UpdateInfo =
|
||||
FunctionInfo<GetPropertyParICFn>(GetPropertyParIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitGetPropertyParIC(OutOfLineUpdateCache *ool, DataPtr<GetPropertyParIC> &ic)
|
||||
CodeGenerator::visitGetPropertyParIC(OutOfLineUpdateCache *ool, GetPropertyParIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -6014,7 +6006,7 @@ const VMFunction GetElementIC::UpdateInfo =
|
||||
FunctionInfo<GetElementICFn>(GetElementIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitGetElementIC(OutOfLineUpdateCache *ool, DataPtr<GetElementIC> &ic)
|
||||
CodeGenerator::visitGetElementIC(OutOfLineUpdateCache *ool, GetElementIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -6069,7 +6061,7 @@ const VMFunction SetElementIC::UpdateInfo =
|
||||
FunctionInfo<SetElementICFn>(SetElementIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitSetElementIC(OutOfLineUpdateCache *ool, DataPtr<SetElementIC> &ic)
|
||||
CodeGenerator::visitSetElementIC(OutOfLineUpdateCache *ool, SetElementIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -6092,7 +6084,7 @@ const VMFunction GetElementParIC::UpdateInfo =
|
||||
FunctionInfo<GetElementParICFn>(GetElementParIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitGetElementParIC(OutOfLineUpdateCache *ool, DataPtr<GetElementParIC> &ic)
|
||||
CodeGenerator::visitGetElementParIC(OutOfLineUpdateCache *ool, GetElementParIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -6124,7 +6116,7 @@ const VMFunction BindNameIC::UpdateInfo =
|
||||
FunctionInfo<BindNameICFn>(BindNameIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitBindNameIC(OutOfLineUpdateCache *ool, DataPtr<BindNameIC> &ic)
|
||||
CodeGenerator::visitBindNameIC(OutOfLineUpdateCache *ool, BindNameIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
@ -6212,7 +6204,7 @@ const VMFunction SetPropertyIC::UpdateInfo =
|
||||
FunctionInfo<SetPropertyICFn>(SetPropertyIC::update);
|
||||
|
||||
bool
|
||||
CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache *ool, DataPtr<SetPropertyIC> &ic)
|
||||
CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache *ool, SetPropertyIC *ic)
|
||||
{
|
||||
LInstruction *lir = ool->lir();
|
||||
saveLive(lir);
|
||||
|
@ -291,15 +291,15 @@ class CodeGenerator : public CodeGeneratorSpecific
|
||||
bool visitGetNameCache(LGetNameCache *ins);
|
||||
bool visitCallsiteCloneCache(LCallsiteCloneCache *ins);
|
||||
|
||||
bool visitGetPropertyIC(OutOfLineUpdateCache *ool, DataPtr<GetPropertyIC> &ic);
|
||||
bool visitGetPropertyParIC(OutOfLineUpdateCache *ool, DataPtr<GetPropertyParIC> &ic);
|
||||
bool visitSetPropertyIC(OutOfLineUpdateCache *ool, DataPtr<SetPropertyIC> &ic);
|
||||
bool visitGetElementIC(OutOfLineUpdateCache *ool, DataPtr<GetElementIC> &ic);
|
||||
bool visitGetElementParIC(OutOfLineUpdateCache *ool, DataPtr<GetElementParIC> &ic);
|
||||
bool visitSetElementIC(OutOfLineUpdateCache *ool, DataPtr<SetElementIC> &ic);
|
||||
bool visitBindNameIC(OutOfLineUpdateCache *ool, DataPtr<BindNameIC> &ic);
|
||||
bool visitNameIC(OutOfLineUpdateCache *ool, DataPtr<NameIC> &ic);
|
||||
bool visitCallsiteCloneIC(OutOfLineUpdateCache *ool, DataPtr<CallsiteCloneIC> &ic);
|
||||
bool visitGetPropertyIC(OutOfLineUpdateCache *ool, GetPropertyIC *ic);
|
||||
bool visitGetPropertyParIC(OutOfLineUpdateCache *ool, GetPropertyParIC *ic);
|
||||
bool visitSetPropertyIC(OutOfLineUpdateCache *ool, SetPropertyIC *ic);
|
||||
bool visitGetElementIC(OutOfLineUpdateCache *ool, GetElementIC *ic);
|
||||
bool visitGetElementParIC(OutOfLineUpdateCache *ool, GetElementParIC *ic);
|
||||
bool visitSetElementIC(OutOfLineUpdateCache *ool, SetElementIC *ic);
|
||||
bool visitBindNameIC(OutOfLineUpdateCache *ool, BindNameIC *ic);
|
||||
bool visitNameIC(OutOfLineUpdateCache *ool, NameIC *ic);
|
||||
bool visitCallsiteCloneIC(OutOfLineUpdateCache *ool, CallsiteCloneIC *ic);
|
||||
|
||||
bool visitAssertRangeI(LAssertRangeI *ins);
|
||||
bool visitAssertRangeD(LAssertRangeD *ins);
|
||||
|
@ -390,92 +390,6 @@ class InlineListReverseIterator
|
||||
Node *iter;
|
||||
};
|
||||
|
||||
/* This list type is more or less exactly an InlineForwardList without a sentinel
|
||||
* node. It is useful in cases where you are doing algorithms that deal with many
|
||||
* merging singleton lists, rather than often empty ones.
|
||||
*/
|
||||
template <typename T> class InlineConcatListIterator;
|
||||
template <typename T>
|
||||
class InlineConcatList
|
||||
{
|
||||
private:
|
||||
typedef InlineConcatList<T> Node;
|
||||
|
||||
InlineConcatList<T> *thisFromConstructor() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public:
|
||||
InlineConcatList() : next(NULL), tail(thisFromConstructor())
|
||||
{ }
|
||||
|
||||
typedef InlineConcatListIterator<T> iterator;
|
||||
|
||||
iterator begin() const {
|
||||
return iterator(this);
|
||||
}
|
||||
|
||||
iterator end() const {
|
||||
return iterator(NULL);
|
||||
}
|
||||
|
||||
void append(InlineConcatList<T> *adding)
|
||||
{
|
||||
JS_ASSERT(tail);
|
||||
JS_ASSERT(!tail->next);
|
||||
JS_ASSERT(adding->tail);
|
||||
JS_ASSERT(!adding->tail->next);
|
||||
|
||||
tail->next = adding;
|
||||
tail = adding->tail;
|
||||
adding->tail = NULL;
|
||||
}
|
||||
|
||||
protected:
|
||||
friend class InlineConcatListIterator<T>;
|
||||
Node *next;
|
||||
Node *tail;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class InlineConcatListIterator
|
||||
{
|
||||
private:
|
||||
friend class InlineConcatList<T>;
|
||||
|
||||
typedef InlineConcatList<T> Node;
|
||||
|
||||
InlineConcatListIterator(const Node *iter)
|
||||
: iter(const_cast<Node *>(iter))
|
||||
{ }
|
||||
|
||||
public:
|
||||
InlineConcatListIterator<T> & operator ++() {
|
||||
iter = iter->next;
|
||||
return *iter;
|
||||
}
|
||||
InlineConcatListIterator<T> operator ++(int) {
|
||||
InlineConcatListIterator<T> old(*this);
|
||||
iter = static_cast<Node *>(iter->next);
|
||||
return old;
|
||||
}
|
||||
T * operator *() const {
|
||||
return static_cast<T *>(iter);
|
||||
}
|
||||
T * operator ->() const {
|
||||
return static_cast<T *>(iter);
|
||||
}
|
||||
bool operator !=(const InlineConcatListIterator<T> &where) const {
|
||||
return iter != where.iter;
|
||||
}
|
||||
bool operator ==(const InlineConcatListIterator<T> &where) const {
|
||||
return iter == where.iter;
|
||||
}
|
||||
|
||||
private:
|
||||
Node *iter;
|
||||
};
|
||||
|
||||
} // namespace js
|
||||
|
||||
#endif /* jit_InlineList_h */
|
||||
|
@ -985,7 +985,7 @@ IonScript::copyCacheEntries(const uint32_t *caches, MacroAssembler &masm)
|
||||
// code, not the absolute positions of the jumps. Update according to the
|
||||
// final code address now.
|
||||
for (size_t i = 0; i < numCaches(); i++)
|
||||
getCacheFromIndex(i).updateBaseAddress(method_, masm);
|
||||
getCache(i).updateBaseAddress(method_, masm);
|
||||
}
|
||||
|
||||
const SafepointIndex *
|
||||
@ -1099,14 +1099,14 @@ IonScript::purgeCaches(Zone *zone)
|
||||
IonContext ictx(rt);
|
||||
AutoFlushCache afc("purgeCaches", rt->ionRuntime());
|
||||
for (size_t i = 0; i < numCaches(); i++)
|
||||
getCacheFromIndex(i).reset();
|
||||
getCache(i).reset();
|
||||
}
|
||||
|
||||
void
|
||||
IonScript::destroyCaches()
|
||||
{
|
||||
for (size_t i = 0; i < numCaches(); i++)
|
||||
getCacheFromIndex(i).destroy();
|
||||
getCache(i).destroy();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1118,7 +1118,9 @@ IonBuilder::traverseBytecode()
|
||||
return false;
|
||||
|
||||
pc += js_CodeSpec[op].length;
|
||||
#ifdef TRACK_SNAPSHOTS
|
||||
current->updateTrackedPc(pc);
|
||||
#endif
|
||||
}
|
||||
|
||||
return maybeAddOsrTypeBarriers();
|
||||
|
@ -1130,7 +1130,7 @@ CanAttachNativeGetProp(typename GetPropCache::Context cx, const GetPropCache &ca
|
||||
return GetPropertyIC::CanAttachReadSlot;
|
||||
}
|
||||
|
||||
if (cx->names().length == name && cache.allowArrayLength(cx, obj) &&
|
||||
if (cx->names().length == name &&
|
||||
IsCacheableArrayLength(cx, obj, name, cache.output()))
|
||||
{
|
||||
// The array length property is non-configurable, which means both that
|
||||
@ -1152,29 +1152,6 @@ CanAttachNativeGetProp(typename GetPropCache::Context cx, const GetPropCache &ca
|
||||
return GetPropertyIC::CanAttachNone;
|
||||
}
|
||||
|
||||
bool
|
||||
GetPropertyIC::allowArrayLength(Context cx, HandleObject obj) const
|
||||
{
|
||||
if (!idempotent())
|
||||
return true;
|
||||
|
||||
uint32_t locationIndex, numLocations;
|
||||
getLocationInfo(&locationIndex, &numLocations);
|
||||
|
||||
IonScript *ion = GetTopIonJSScript(cx)->ionScript();
|
||||
CacheLocation *locs = ion->getCacheLocs(locationIndex);
|
||||
for (size_t i = 0; i < numLocations; i++) {
|
||||
CacheLocation &curLoc = locs[i];
|
||||
types::StackTypeSet *bcTypes =
|
||||
types::TypeScript::BytecodeTypes(curLoc.script, curLoc.pc);
|
||||
|
||||
if (!bcTypes->hasType(types::Type::Int32Type()))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GetPropertyIC::canMonitorSingletonUndefinedSlot(HandleObject holder, HandleShape shape) const
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ class IonCacheVisitor
|
||||
{
|
||||
public:
|
||||
#define VISIT_INS(op) \
|
||||
virtual bool visit##op##IC(CodeGenerator *codegen) { \
|
||||
virtual bool visit##op##IC(CodeGenerator *codegen, op##IC *) { \
|
||||
MOZ_ASSUME_UNREACHABLE("NYI: " #op "IC"); \
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ class DispatchIonCache : public IonCache
|
||||
} \
|
||||
\
|
||||
bool accept(CodeGenerator *codegen, IonCacheVisitor *visitor) { \
|
||||
return visitor->visit##ickind##IC(codegen); \
|
||||
return visitor->visit##ickind##IC(codegen, this); \
|
||||
} \
|
||||
\
|
||||
static const VMFunction UpdateInfo;
|
||||
@ -499,24 +499,6 @@ class DispatchIonCache : public IonCache
|
||||
// Subclasses of IonCache for the various kinds of caches. These do not define
|
||||
// new data members; all caches must be of the same size.
|
||||
|
||||
// Helper for idempotent GetPropertyIC location tracking. Declared externally
|
||||
// to be forward declarable.
|
||||
//
|
||||
// Since all the scripts stored in CacheLocations are guaranteed to have been
|
||||
// Ion compiled, and are kept alive by function objects in jitcode, and since
|
||||
// the CacheLocations only have the lifespan of the jitcode, there is no need
|
||||
// to trace or mark any of the scripts. Since JSScripts are always allocated
|
||||
// tenured, and never moved, we can keep raw pointers, and there is no need
|
||||
// for HeapPtrScripts here.
|
||||
struct CacheLocation {
|
||||
jsbytecode *pc;
|
||||
JSScript *script;
|
||||
|
||||
CacheLocation(jsbytecode *pcin, JSScript *scriptin)
|
||||
: pc(pcin), script(scriptin)
|
||||
{ }
|
||||
};
|
||||
|
||||
class GetPropertyIC : public RepatchIonCache
|
||||
{
|
||||
protected:
|
||||
@ -527,11 +509,6 @@ class GetPropertyIC : public RepatchIonCache
|
||||
Register object_;
|
||||
PropertyName *name_;
|
||||
TypedOrValueRegister output_;
|
||||
|
||||
// Only valid if idempotent
|
||||
size_t locationsIndex_;
|
||||
size_t numLocations_;
|
||||
|
||||
bool allowGetters_ : 1;
|
||||
bool hasTypedArrayLengthStub_ : 1;
|
||||
bool hasStrictArgumentsLengthStub_ : 1;
|
||||
@ -547,8 +524,6 @@ class GetPropertyIC : public RepatchIonCache
|
||||
object_(object),
|
||||
name_(name),
|
||||
output_(output),
|
||||
locationsIndex_(0),
|
||||
numLocations_(0),
|
||||
allowGetters_(allowGetters),
|
||||
hasTypedArrayLengthStub_(false),
|
||||
hasStrictArgumentsLengthStub_(false),
|
||||
@ -583,19 +558,6 @@ class GetPropertyIC : public RepatchIonCache
|
||||
return hasGenericProxyStub_;
|
||||
}
|
||||
|
||||
void setLocationInfo(size_t locationsIndex, size_t numLocations) {
|
||||
JS_ASSERT(idempotent());
|
||||
JS_ASSERT(!numLocations_);
|
||||
JS_ASSERT(numLocations);
|
||||
locationsIndex_ = locationsIndex;
|
||||
numLocations_ = numLocations;
|
||||
}
|
||||
void getLocationInfo(uint32_t *index, uint32_t *num) const {
|
||||
JS_ASSERT(idempotent());
|
||||
*index = locationsIndex_;
|
||||
*num = numLocations_;
|
||||
}
|
||||
|
||||
enum NativeGetPropCacheability {
|
||||
CanAttachError,
|
||||
CanAttachNone,
|
||||
@ -614,7 +576,6 @@ class GetPropertyIC : public RepatchIonCache
|
||||
return idempotent();
|
||||
}
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject holder, HandleShape shape) const;
|
||||
bool allowArrayLength(Context cx, HandleObject obj) const;
|
||||
|
||||
// Attach the proper stub, if possible
|
||||
bool tryAttachStub(JSContext *cx, IonScript *ion, HandleObject obj,
|
||||
@ -751,7 +712,6 @@ class GetElementIC : public RepatchIonCache
|
||||
return JSObject::lookupProperty(cx, obj, name, holder, shape);
|
||||
}
|
||||
bool allowGetters() const { return false; }
|
||||
bool allowArrayLength(Context, HandleObject) const { return false; }
|
||||
bool lookupNeedsIdempotentChain() const { return false; }
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject holder, HandleShape shape) const {
|
||||
return monitoredResult();
|
||||
@ -1037,7 +997,6 @@ class GetPropertyParIC : public ParallelIonCache
|
||||
bool lookupNeedsIdempotentChain() const { return true; }
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject, HandleShape) const { return true; }
|
||||
bool allowGetters() const { return false; }
|
||||
bool allowArrayLength(Context, HandleObject) const { return true; }
|
||||
|
||||
bool attachReadSlot(LockedJSContext &cx, IonScript *ion, JSObject *obj, JSObject *holder,
|
||||
Shape *shape);
|
||||
@ -1097,7 +1056,6 @@ class GetElementParIC : public ParallelIonCache
|
||||
bool lookupNeedsIdempotentChain() const { return true; }
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject, HandleShape) const { return true; }
|
||||
bool allowGetters() const { return false; }
|
||||
bool allowArrayLength(Context, HandleObject) const { return false; }
|
||||
|
||||
bool attachReadSlot(LockedJSContext &cx, IonScript *ion, JSObject *obj, const Value &idval,
|
||||
PropertyName *name, JSObject *holder, Shape *shape);
|
||||
|
@ -148,7 +148,6 @@ class SafepointIndex;
|
||||
class OsiIndex;
|
||||
class IonCache;
|
||||
struct PatchableBackedgeInfo;
|
||||
struct CacheLocation;
|
||||
|
||||
// Describes a single AsmJSModule which jumps (via an FFI exit with the given
|
||||
// index) directly into an IonScript.
|
||||
@ -482,12 +481,9 @@ struct IonScript
|
||||
}
|
||||
const OsiIndex *getOsiIndex(uint32_t disp) const;
|
||||
const OsiIndex *getOsiIndex(uint8_t *retAddr) const;
|
||||
inline IonCache &getCacheFromIndex(uint32_t index) {
|
||||
inline IonCache &getCache(uint32_t index) {
|
||||
JS_ASSERT(index < cacheEntries_);
|
||||
uint32_t offset = cacheIndex()[index];
|
||||
return getCache(offset);
|
||||
}
|
||||
inline IonCache &getCache(uint32_t offset) {
|
||||
JS_ASSERT(offset < runtimeSize_);
|
||||
return *(IonCache *) &runtimeData()[offset];
|
||||
}
|
||||
@ -497,10 +493,6 @@ struct IonScript
|
||||
size_t runtimeSize() const {
|
||||
return runtimeSize_;
|
||||
}
|
||||
CacheLocation *getCacheLocs(uint32_t locIndex) {
|
||||
JS_ASSERT(locIndex < runtimeSize_);
|
||||
return (CacheLocation *) &runtimeData()[locIndex];
|
||||
}
|
||||
void toggleBarriers(bool enabled);
|
||||
void purgeCaches(JS::Zone *zone);
|
||||
void destroyCaches();
|
||||
|
@ -2397,24 +2397,6 @@ MGetPropertyPolymorphic::mightAlias(MDefinition *store)
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
MGetPropertyCache::setBlock(MBasicBlock *block)
|
||||
{
|
||||
MDefinition::setBlock(block);
|
||||
// Track where we started.
|
||||
if (!location_.pc) {
|
||||
location_.pc = block->trackedPc();
|
||||
location_.script = block->info().script();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
MGetPropertyCache::updateForReplacement(MDefinition *ins) {
|
||||
MGetPropertyCache *other = ins->toGetPropertyCache();
|
||||
location_.append(&other->location_);
|
||||
return true;
|
||||
}
|
||||
|
||||
MDefinition *
|
||||
MAsmJSUnsignedToDouble::foldsTo(bool useValueNumbers)
|
||||
{
|
||||
|
@ -304,6 +304,10 @@ class MDefinition : public MNode
|
||||
Total
|
||||
};
|
||||
|
||||
void setBlock(MBasicBlock *block) {
|
||||
block_ = block;
|
||||
}
|
||||
|
||||
bool hasFlags(uint32_t flags) const {
|
||||
return (flags_ & flags) == flags;
|
||||
}
|
||||
@ -313,12 +317,6 @@ class MDefinition : public MNode
|
||||
void setFlags(uint32_t flags) {
|
||||
flags_ |= flags;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void setBlock(MBasicBlock *block) {
|
||||
block_ = block;
|
||||
}
|
||||
|
||||
public:
|
||||
MDefinition()
|
||||
: id_(0),
|
||||
@ -5685,18 +5683,6 @@ class InlinePropertyTable : public TempObject
|
||||
void trimToTargets(AutoObjectVector &targets);
|
||||
};
|
||||
|
||||
class CacheLocationList : public InlineConcatList<CacheLocationList>
|
||||
{
|
||||
public:
|
||||
CacheLocationList()
|
||||
: pc(NULL),
|
||||
script(NULL)
|
||||
{ }
|
||||
|
||||
jsbytecode *pc;
|
||||
JSScript *script;
|
||||
};
|
||||
|
||||
class MGetPropertyCache
|
||||
: public MUnaryInstruction,
|
||||
public SingleObjectPolicy
|
||||
@ -5705,8 +5691,6 @@ class MGetPropertyCache
|
||||
bool idempotent_;
|
||||
bool allowGetters_;
|
||||
|
||||
CacheLocationList location_;
|
||||
|
||||
InlinePropertyTable *inlinePropertyTable_;
|
||||
|
||||
MGetPropertyCache(MDefinition *obj, HandlePropertyName name)
|
||||
@ -5714,7 +5698,6 @@ class MGetPropertyCache
|
||||
name_(name),
|
||||
idempotent_(false),
|
||||
allowGetters_(false),
|
||||
location_(),
|
||||
inlinePropertyTable_(NULL)
|
||||
{
|
||||
setResultType(MIRType_Value);
|
||||
@ -5765,9 +5748,6 @@ class MGetPropertyCache
|
||||
void setAllowGetters() {
|
||||
allowGetters_ = true;
|
||||
}
|
||||
CacheLocationList &location() {
|
||||
return location_;
|
||||
}
|
||||
TypePolicy *typePolicy() { return this; }
|
||||
|
||||
bool congruentTo(MDefinition *ins) const {
|
||||
@ -5789,8 +5769,6 @@ class MGetPropertyCache
|
||||
return AliasSet::Store(AliasSet::Any);
|
||||
}
|
||||
|
||||
void setBlock(MBasicBlock *block);
|
||||
bool updateForReplacement(MDefinition *ins);
|
||||
};
|
||||
|
||||
// Emit code to load a value from an object's slots if its shape matches
|
||||
|
@ -903,22 +903,5 @@ CodeGeneratorShared::jumpToBlock(MBasicBlock *mir, Assembler::Condition cond)
|
||||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
CodeGeneratorShared::addCacheLocations(const CacheLocationList &locs, size_t *numLocs)
|
||||
{
|
||||
size_t firstIndex = runtimeData_.length();
|
||||
size_t numLocations = 0;
|
||||
for (CacheLocationList::iterator iter = locs.begin(); iter != locs.end(); iter++) {
|
||||
// allocateData() ensures that sizeof(CacheLocation) is word-aligned.
|
||||
// If this changes, we will need to pad to ensure alignment.
|
||||
size_t curIndex = allocateData(sizeof(CacheLocation));
|
||||
new (&runtimeData_[curIndex]) CacheLocation(iter->pc, iter->script);
|
||||
numLocations++;
|
||||
}
|
||||
JS_ASSERT(numLocations != 0);
|
||||
*numLocs = numLocations;
|
||||
return firstIndex;
|
||||
}
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
@ -192,12 +192,12 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
|
||||
protected:
|
||||
// Ensure the cache is an IonCache while expecting the size of the derived
|
||||
// class. We only need the cache list at GC time. Everyone else can just take
|
||||
// runtimeData offsets.
|
||||
// class.
|
||||
size_t allocateCache(const IonCache &, size_t size) {
|
||||
size_t dataOffset = allocateData(size);
|
||||
size_t index = cacheList_.length();
|
||||
masm.propagateOOM(cacheList_.append(dataOffset));
|
||||
return dataOffset;
|
||||
return index;
|
||||
}
|
||||
|
||||
#ifdef CHECK_OSIPOINT_REGISTERS
|
||||
@ -206,31 +206,11 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
// When appending to runtimeData_, the vector might realloc, leaving pointers
|
||||
// int the origianl vector stale and unusable. DataPtr acts like a pointer,
|
||||
// but allows safety in the face of potentially realloc'ing vector appends.
|
||||
friend class DataPtr;
|
||||
template <typename T>
|
||||
class DataPtr
|
||||
{
|
||||
CodeGeneratorShared *cg_;
|
||||
size_t index_;
|
||||
|
||||
T *lookup() {
|
||||
return reinterpret_cast<T *>(&cg_->runtimeData_[index_]);
|
||||
}
|
||||
public:
|
||||
DataPtr(CodeGeneratorShared *cg, size_t index)
|
||||
: cg_(cg), index_(index) { }
|
||||
|
||||
T * operator ->() {
|
||||
return lookup();
|
||||
}
|
||||
T * operator *() {
|
||||
return lookup();
|
||||
}
|
||||
};
|
||||
// This is needed by addCache to update the cache with the jump
|
||||
// informations provided by the out-of-line path.
|
||||
IonCache *getCache(size_t index) {
|
||||
return reinterpret_cast<IonCache *>(&runtimeData_[cacheList_[index]]);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@ -245,8 +225,7 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
inline size_t allocateCache(const T &cache) {
|
||||
size_t index = allocateCache(cache, sizeof(mozilla::AlignedStorage2<T>));
|
||||
// Use the copy constructor on the allocated space.
|
||||
JS_ASSERT(index == cacheList_.back());
|
||||
new (&runtimeData_[index]) T(cache);
|
||||
new (&runtimeData_[cacheList_.back()]) T(cache);
|
||||
return index;
|
||||
}
|
||||
|
||||
@ -382,7 +361,6 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
}
|
||||
|
||||
bool addCache(LInstruction *lir, size_t cacheIndex);
|
||||
size_t addCacheLocations(const CacheLocationList &locs, size_t *numLocs);
|
||||
|
||||
protected:
|
||||
bool addOutOfLineCode(OutOfLineCode *code);
|
||||
|
Loading…
Reference in New Issue
Block a user