зеркало из https://github.com/mozilla/gecko-dev.git
Bug 859446 - Fix GCC warnings from baseline compiler merge. r=bhackett
This commit is contained in:
Родитель
3cc28cdf4a
Коммит
70db59a5d6
|
@ -42,6 +42,23 @@ BaselineCompiler::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BaselineCompiler::addPCMappingEntry(bool addIndexEntry)
|
||||||
|
{
|
||||||
|
// Don't add multiple entries for a single pc.
|
||||||
|
size_t nentries = pcMappingEntries_.length();
|
||||||
|
if (nentries > 0 && pcMappingEntries_[nentries - 1].pcOffset == unsigned(pc - script->code))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
PCMappingEntry entry;
|
||||||
|
entry.pcOffset = pc - script->code;
|
||||||
|
entry.nativeOffset = masm.currentOffset();
|
||||||
|
entry.slotInfo = getStackTopSlotInfo();
|
||||||
|
entry.addIndexEntry = addIndexEntry;
|
||||||
|
|
||||||
|
return pcMappingEntries_.append(entry);
|
||||||
|
}
|
||||||
|
|
||||||
MethodStatus
|
MethodStatus
|
||||||
BaselineCompiler::compile()
|
BaselineCompiler::compile()
|
||||||
{
|
{
|
||||||
|
|
|
@ -232,6 +232,8 @@ class BaselineCompiler : public BaselineCompilerSpecific
|
||||||
|
|
||||||
bool emitEnterBlock();
|
bool emitEnterBlock();
|
||||||
|
|
||||||
|
bool addPCMappingEntry(bool addIndexEntry);
|
||||||
|
|
||||||
Address getScopeCoordinateAddress(Register reg);
|
Address getScopeCoordinateAddress(Register reg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,18 @@ BaselineFrame::popBlock(JSContext *cx)
|
||||||
setBlockChain(*blockChain_->enclosingBlock());
|
setBlockChain(*blockChain_->enclosingBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline CallObject &
|
||||||
|
BaselineFrame::callObj() const
|
||||||
|
{
|
||||||
|
JS_ASSERT(hasCallObj());
|
||||||
|
JS_ASSERT(fun()->isHeavyweight());
|
||||||
|
|
||||||
|
JSObject *obj = scopeChain();
|
||||||
|
while (!obj->isCall())
|
||||||
|
obj = obj->enclosingScope();
|
||||||
|
return obj->asCall();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ion
|
} // namespace ion
|
||||||
} // namespace js
|
} // namespace js
|
||||||
|
|
||||||
|
|
|
@ -236,15 +236,7 @@ class BaselineFrame
|
||||||
return flags_ & HAS_CALL_OBJ;
|
return flags_ & HAS_CALL_OBJ;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallObject &callObj() const {
|
inline CallObject &callObj() const;
|
||||||
JS_ASSERT(hasCallObj());
|
|
||||||
JS_ASSERT(fun()->isHeavyweight());
|
|
||||||
|
|
||||||
JSObject *obj = scopeChain();
|
|
||||||
while (!obj->isCall())
|
|
||||||
obj = obj->enclosingScope();
|
|
||||||
return obj->asCall();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setFlags(uint32_t flags) {
|
void setFlags(uint32_t flags) {
|
||||||
flags_ = flags;
|
flags_ = flags;
|
||||||
|
|
|
@ -7019,5 +7019,252 @@ ICTypeOf_Typed::Compiler::generateStubCode(MacroAssembler &masm)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ICProfiler_PushFunction::ICProfiler_PushFunction(IonCode *stubCode, const char *str,
|
||||||
|
HandleScript script)
|
||||||
|
: ICStub(ICStub::Profiler_PushFunction, stubCode),
|
||||||
|
str_(str),
|
||||||
|
script_(script)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICTypeMonitor_SingleObject::ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj)
|
||||||
|
: ICStub(TypeMonitor_SingleObject, stubCode),
|
||||||
|
obj_(obj)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICTypeMonitor_TypeObject::ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
||||||
|
: ICStub(TypeMonitor_TypeObject, stubCode),
|
||||||
|
type_(type)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICTypeUpdate_SingleObject::ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj)
|
||||||
|
: ICStub(TypeUpdate_SingleObject, stubCode),
|
||||||
|
obj_(obj)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICTypeUpdate_TypeObject::ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
||||||
|
: ICStub(TypeUpdate_TypeObject, stubCode),
|
||||||
|
type_(type)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetElemNativeStub::ICGetElemNativeStub(ICStub::Kind kind, IonCode *stubCode,
|
||||||
|
ICStub *firstMonitorStub,
|
||||||
|
HandleShape shape, HandleValue idval,
|
||||||
|
bool isFixedSlot, uint32_t offset)
|
||||||
|
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
||||||
|
shape_(shape),
|
||||||
|
idval_(idval),
|
||||||
|
offset_(offset)
|
||||||
|
{
|
||||||
|
extra_ = isFixedSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICGetElemNativeStub::~ICGetElemNativeStub()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetElem_NativePrototype::ICGetElem_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
HandleShape shape, HandleValue idval,
|
||||||
|
bool isFixedSlot, uint32_t offset,
|
||||||
|
HandleObject holder, HandleShape holderShape)
|
||||||
|
: ICGetElemNativeStub(ICStub::GetElem_NativePrototype, stubCode, firstMonitorStub, shape,
|
||||||
|
idval, isFixedSlot, offset),
|
||||||
|
holder_(holder),
|
||||||
|
holderShape_(holderShape)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetElem_Dense::ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape)
|
||||||
|
: ICMonitoredStub(GetElem_Dense, stubCode, firstMonitorStub),
|
||||||
|
shape_(shape)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetElem_TypedArray::ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type)
|
||||||
|
: ICStub(GetElem_TypedArray, stubCode),
|
||||||
|
shape_(shape)
|
||||||
|
{
|
||||||
|
extra_ = uint16_t(type);
|
||||||
|
JS_ASSERT(extra_ == type);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetElem_Dense::ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type)
|
||||||
|
: ICUpdatedStub(SetElem_Dense, stubCode),
|
||||||
|
shape_(shape),
|
||||||
|
type_(type)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICSetElem_DenseAdd::ICSetElem_DenseAdd(IonCode *stubCode, types::TypeObject *type,
|
||||||
|
size_t protoChainDepth)
|
||||||
|
: ICUpdatedStub(SetElem_DenseAdd, stubCode),
|
||||||
|
type_(type)
|
||||||
|
{
|
||||||
|
JS_ASSERT(protoChainDepth <= MAX_PROTO_CHAIN_DEPTH);
|
||||||
|
extra_ = protoChainDepth;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <size_t ProtoChainDepth>
|
||||||
|
ICUpdatedStub *
|
||||||
|
ICSetElemDenseAddCompiler::getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
|
||||||
|
{
|
||||||
|
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, getStubCode(), obj_->getType(cx),
|
||||||
|
shapes);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetElem_TypedArray::ICSetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type,
|
||||||
|
bool expectOutOfBounds)
|
||||||
|
: ICStub(SetElem_TypedArray, stubCode),
|
||||||
|
shape_(shape)
|
||||||
|
{
|
||||||
|
extra_ = uint8_t(type);
|
||||||
|
JS_ASSERT(extra_ == type);
|
||||||
|
extra_ |= (static_cast<uint16_t>(expectOutOfBounds) << 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICGetName_Global::ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape,
|
||||||
|
uint32_t slot)
|
||||||
|
: ICMonitoredStub(GetName_Global, stubCode, firstMonitorStub),
|
||||||
|
shape_(shape),
|
||||||
|
slot_(slot)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
template <size_t NumHops>
|
||||||
|
ICGetName_Scope<NumHops>::ICGetName_Scope(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
AutoShapeVector *shapes, uint32_t offset)
|
||||||
|
: ICMonitoredStub(GetStubKind(), stubCode, firstMonitorStub),
|
||||||
|
offset_(offset)
|
||||||
|
{
|
||||||
|
JS_STATIC_ASSERT(NumHops <= MAX_HOPS);
|
||||||
|
JS_ASSERT(shapes->length() == NumHops + 1);
|
||||||
|
for (size_t i = 0; i < NumHops + 1; i++)
|
||||||
|
shapes_[i].init((*shapes)[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICGetIntrinsic_Constant::ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value)
|
||||||
|
: ICStub(GetIntrinsic_Constant, stubCode),
|
||||||
|
value_(value)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetIntrinsic_Constant::~ICGetIntrinsic_Constant()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetProp_String::ICGetProp_String(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
HandleShape stringProtoShape, uint32_t offset)
|
||||||
|
: ICMonitoredStub(GetProp_String, stubCode, firstMonitorStub),
|
||||||
|
stringProtoShape_(stringProtoShape),
|
||||||
|
offset_(offset)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetPropNativeStub::ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode,
|
||||||
|
ICStub *firstMonitorStub,
|
||||||
|
HandleShape shape, uint32_t offset)
|
||||||
|
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
||||||
|
shape_(shape),
|
||||||
|
offset_(offset)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetProp_NativePrototype::ICGetProp_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
HandleShape shape, uint32_t offset,
|
||||||
|
HandleObject holder, HandleShape holderShape)
|
||||||
|
: ICGetPropNativeStub(GetProp_NativePrototype, stubCode, firstMonitorStub, shape, offset),
|
||||||
|
holder_(holder),
|
||||||
|
holderShape_(holderShape)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICGetPropCallGetter::ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
HandleShape shape, HandleObject holder,
|
||||||
|
HandleShape holderShape,
|
||||||
|
HandleFunction getter, uint32_t pcOffset)
|
||||||
|
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
||||||
|
shape_(shape),
|
||||||
|
holder_(holder),
|
||||||
|
holderShape_(holderShape),
|
||||||
|
getter_(getter),
|
||||||
|
pcOffset_(pcOffset)
|
||||||
|
{
|
||||||
|
JS_ASSERT(kind == ICStub::GetProp_CallScripted || kind == ICStub::GetProp_CallNative);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetProp_Native::ICSetProp_Native(IonCode *stubCode, HandleTypeObject type, HandleShape shape,
|
||||||
|
uint32_t offset)
|
||||||
|
: ICUpdatedStub(SetProp_Native, stubCode),
|
||||||
|
type_(type),
|
||||||
|
shape_(shape),
|
||||||
|
offset_(offset)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICUpdatedStub *
|
||||||
|
ICSetProp_Native::Compiler::getStub(ICStubSpace *space)
|
||||||
|
{
|
||||||
|
RootedTypeObject type(cx, obj_->getType(cx));
|
||||||
|
RootedShape shape(cx, obj_->lastProperty());
|
||||||
|
ICUpdatedStub *stub = ICSetProp_Native::New(space, getStubCode(), type, shape, offset_);
|
||||||
|
if (!stub || !stub->initUpdatingChain(cx, space))
|
||||||
|
return NULL;
|
||||||
|
return stub;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetProp_NativeAdd::ICSetProp_NativeAdd(IonCode *stubCode, HandleTypeObject type,
|
||||||
|
size_t protoChainDepth,
|
||||||
|
HandleShape newShape, uint32_t offset)
|
||||||
|
: ICUpdatedStub(SetProp_NativeAdd, stubCode),
|
||||||
|
type_(type),
|
||||||
|
newShape_(newShape),
|
||||||
|
offset_(offset)
|
||||||
|
{
|
||||||
|
JS_ASSERT(protoChainDepth <= MAX_PROTO_CHAIN_DEPTH);
|
||||||
|
extra_ = protoChainDepth;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <size_t ProtoChainDepth>
|
||||||
|
ICSetProp_NativeAddImpl<ProtoChainDepth>::ICSetProp_NativeAddImpl(IonCode *stubCode,
|
||||||
|
HandleTypeObject type,
|
||||||
|
const AutoShapeVector *shapes,
|
||||||
|
HandleShape newShape,
|
||||||
|
uint32_t offset)
|
||||||
|
: ICSetProp_NativeAdd(stubCode, type, ProtoChainDepth, newShape, offset)
|
||||||
|
{
|
||||||
|
JS_ASSERT(shapes->length() == NumShapes);
|
||||||
|
for (size_t i = 0; i < NumShapes; i++)
|
||||||
|
shapes_[i].init((*shapes)[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetPropNativeAddCompiler::ICSetPropNativeAddCompiler(JSContext *cx, HandleObject obj,
|
||||||
|
HandleShape oldShape,
|
||||||
|
size_t protoChainDepth, bool isFixedSlot,
|
||||||
|
uint32_t offset)
|
||||||
|
: ICStubCompiler(cx, ICStub::SetProp_NativeAdd),
|
||||||
|
obj_(cx, obj),
|
||||||
|
oldShape_(cx, oldShape),
|
||||||
|
protoChainDepth_(protoChainDepth),
|
||||||
|
isFixedSlot_(isFixedSlot),
|
||||||
|
offset_(offset)
|
||||||
|
{
|
||||||
|
JS_ASSERT(protoChainDepth_ <= ICSetProp_NativeAdd::MAX_PROTO_CHAIN_DEPTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICSetPropCallSetter::ICSetPropCallSetter(Kind kind, IonCode *stubCode, HandleShape shape,
|
||||||
|
HandleObject holder, HandleShape holderShape,
|
||||||
|
HandleFunction setter, uint32_t pcOffset)
|
||||||
|
: ICStub(kind, stubCode),
|
||||||
|
shape_(shape),
|
||||||
|
holder_(holder),
|
||||||
|
holderShape_(holderShape),
|
||||||
|
setter_(setter),
|
||||||
|
pcOffset_(pcOffset)
|
||||||
|
{
|
||||||
|
JS_ASSERT(kind == ICStub::SetProp_CallScripted || kind == ICStub::SetProp_CallNative);
|
||||||
|
}
|
||||||
|
|
||||||
|
ICCall_Scripted::ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
|
HandleScript calleeScript, uint32_t pcOffset)
|
||||||
|
: ICMonitoredStub(ICStub::Call_Scripted, stubCode, firstMonitorStub),
|
||||||
|
calleeScript_(calleeScript),
|
||||||
|
pcOffset_(pcOffset)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
ICCall_Native::ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub, HandleFunction callee,
|
||||||
|
uint32_t pcOffset)
|
||||||
|
: ICMonitoredStub(ICStub::Call_Native, stubCode, firstMonitorStub),
|
||||||
|
callee_(callee),
|
||||||
|
pcOffset_(pcOffset)
|
||||||
|
{ }
|
||||||
|
|
||||||
} // namespace ion
|
} // namespace ion
|
||||||
} // namespace js
|
} // namespace js
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "jscntxt.h"
|
#include "jscntxt.h"
|
||||||
#include "jscompartment.h"
|
#include "jscompartment.h"
|
||||||
#include "jsgcinlines.h"
|
#include "jsgc.h"
|
||||||
#include "jsopcode.h"
|
#include "jsopcode.h"
|
||||||
#include "BaselineJIT.h"
|
#include "BaselineJIT.h"
|
||||||
#include "BaselineRegisters.h"
|
#include "BaselineRegisters.h"
|
||||||
|
@ -1138,11 +1138,7 @@ class ICProfiler_PushFunction : public ICStub
|
||||||
const char *str_;
|
const char *str_;
|
||||||
HeapPtrScript script_;
|
HeapPtrScript script_;
|
||||||
|
|
||||||
ICProfiler_PushFunction(IonCode *stubCode, const char *str, HandleScript script)
|
ICProfiler_PushFunction(IonCode *stubCode, const char *str, HandleScript script);
|
||||||
: ICStub(ICStub::Profiler_PushFunction, stubCode),
|
|
||||||
str_(str),
|
|
||||||
script_(script)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICProfiler_PushFunction *New(ICStubSpace *space, IonCode *code,
|
static inline ICProfiler_PushFunction *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -1488,10 +1484,7 @@ class ICTypeMonitor_SingleObject : public ICStub
|
||||||
|
|
||||||
HeapPtrObject obj_;
|
HeapPtrObject obj_;
|
||||||
|
|
||||||
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj)
|
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj);
|
||||||
: ICStub(TypeMonitor_SingleObject, stubCode),
|
|
||||||
obj_(obj)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICTypeMonitor_SingleObject *New(
|
static inline ICTypeMonitor_SingleObject *New(
|
||||||
|
@ -1533,10 +1526,7 @@ class ICTypeMonitor_TypeObject : public ICStub
|
||||||
|
|
||||||
HeapPtrTypeObject type_;
|
HeapPtrTypeObject type_;
|
||||||
|
|
||||||
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type);
|
||||||
: ICStub(TypeMonitor_TypeObject, stubCode),
|
|
||||||
type_(type)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICTypeMonitor_TypeObject *New(
|
static inline ICTypeMonitor_TypeObject *New(
|
||||||
|
@ -1657,10 +1647,7 @@ class ICTypeUpdate_SingleObject : public ICStub
|
||||||
|
|
||||||
HeapPtrObject obj_;
|
HeapPtrObject obj_;
|
||||||
|
|
||||||
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj)
|
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj);
|
||||||
: ICStub(TypeUpdate_SingleObject, stubCode),
|
|
||||||
obj_(obj)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICTypeUpdate_SingleObject *New(ICStubSpace *space, IonCode *code,
|
static inline ICTypeUpdate_SingleObject *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -1703,10 +1690,7 @@ class ICTypeUpdate_TypeObject : public ICStub
|
||||||
|
|
||||||
HeapPtrTypeObject type_;
|
HeapPtrTypeObject type_;
|
||||||
|
|
||||||
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type);
|
||||||
: ICStub(TypeUpdate_TypeObject, stubCode),
|
|
||||||
type_(type)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICTypeUpdate_TypeObject *New(ICStubSpace *space, IonCode *code,
|
static inline ICTypeUpdate_TypeObject *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -2785,14 +2769,9 @@ class ICGetElemNativeStub : public ICMonitoredStub
|
||||||
protected:
|
protected:
|
||||||
ICGetElemNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetElemNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
HandleShape shape, HandleValue idval,
|
HandleShape shape, HandleValue idval,
|
||||||
bool isFixedSlot, uint32_t offset)
|
bool isFixedSlot, uint32_t offset);
|
||||||
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
|
||||||
shape_(shape),
|
~ICGetElemNativeStub();
|
||||||
idval_(idval),
|
|
||||||
offset_(offset)
|
|
||||||
{
|
|
||||||
extra_ = isFixedSlot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape &shape() {
|
||||||
|
@ -2853,12 +2832,7 @@ class ICGetElem_NativePrototype : public ICGetElemNativeStub
|
||||||
ICGetElem_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetElem_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
HandleShape shape, HandleValue idval,
|
HandleShape shape, HandleValue idval,
|
||||||
bool isFixedSlot, uint32_t offset,
|
bool isFixedSlot, uint32_t offset,
|
||||||
HandleObject holder, HandleShape holderShape)
|
HandleObject holder, HandleShape holderShape);
|
||||||
: ICGetElemNativeStub(ICStub::GetElem_NativePrototype, stubCode, firstMonitorStub, shape,
|
|
||||||
idval, isFixedSlot, offset),
|
|
||||||
holder_(holder),
|
|
||||||
holderShape_(holderShape)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetElem_NativePrototype *New(ICStubSpace *space, IonCode *code,
|
static inline ICGetElem_NativePrototype *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -2969,10 +2943,7 @@ class ICGetElem_Dense : public ICMonitoredStub
|
||||||
|
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
|
|
||||||
ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape)
|
ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape);
|
||||||
: ICMonitoredStub(GetElem_Dense, stubCode, firstMonitorStub),
|
|
||||||
shape_(shape)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetElem_Dense *New(ICStubSpace *space, IonCode *code,
|
static inline ICGetElem_Dense *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -3018,13 +2989,7 @@ class ICGetElem_TypedArray : public ICStub
|
||||||
protected: // Protected to silence Clang warning.
|
protected: // Protected to silence Clang warning.
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
|
|
||||||
ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type)
|
ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type);
|
||||||
: ICStub(GetElem_TypedArray, stubCode),
|
|
||||||
shape_(shape)
|
|
||||||
{
|
|
||||||
extra_ = uint16_t(type);
|
|
||||||
JS_ASSERT(extra_ == type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
|
static inline ICGetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -3111,11 +3076,7 @@ class ICSetElem_Dense : public ICUpdatedStub
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
HeapPtrTypeObject type_;
|
HeapPtrTypeObject type_;
|
||||||
|
|
||||||
ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type)
|
ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type);
|
||||||
: ICUpdatedStub(SetElem_Dense, stubCode),
|
|
||||||
shape_(shape),
|
|
||||||
type_(type)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICSetElem_Dense *New(ICStubSpace *space, IonCode *code, HandleShape shape,
|
static inline ICSetElem_Dense *New(ICStubSpace *space, IonCode *code, HandleShape shape,
|
||||||
|
@ -3177,13 +3138,7 @@ class ICSetElem_DenseAdd : public ICUpdatedStub
|
||||||
protected:
|
protected:
|
||||||
HeapPtrTypeObject type_;
|
HeapPtrTypeObject type_;
|
||||||
|
|
||||||
ICSetElem_DenseAdd(IonCode *stubCode, types::TypeObject *type, size_t protoChainDepth)
|
ICSetElem_DenseAdd(IonCode *stubCode, types::TypeObject *type, size_t protoChainDepth);
|
||||||
: ICUpdatedStub(SetElem_DenseAdd, stubCode),
|
|
||||||
type_(type)
|
|
||||||
{
|
|
||||||
JS_ASSERT(protoChainDepth <= MAX_PROTO_CHAIN_DEPTH);
|
|
||||||
extra_ = protoChainDepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static size_t offsetOfType() {
|
static size_t offsetOfType() {
|
||||||
|
@ -3268,10 +3223,7 @@ class ICSetElemDenseAddCompiler : public ICStubCompiler {
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes) {
|
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes);
|
||||||
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, getStubCode(), obj_->getType(cx),
|
|
||||||
shapes);
|
|
||||||
}
|
|
||||||
|
|
||||||
ICUpdatedStub *getStub(ICStubSpace *space);
|
ICUpdatedStub *getStub(ICStubSpace *space);
|
||||||
};
|
};
|
||||||
|
@ -3284,14 +3236,7 @@ class ICSetElem_TypedArray : public ICStub
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
|
|
||||||
ICSetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type,
|
ICSetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type,
|
||||||
bool expectOutOfBounds)
|
bool expectOutOfBounds);
|
||||||
: ICStub(SetElem_TypedArray, stubCode),
|
|
||||||
shape_(shape)
|
|
||||||
{
|
|
||||||
extra_ = uint8_t(type);
|
|
||||||
JS_ASSERT(extra_ == type);
|
|
||||||
extra_ |= (static_cast<uint16_t>(expectOutOfBounds) << 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICSetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
|
static inline ICSetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -3428,11 +3373,7 @@ class ICGetName_Global : public ICMonitoredStub
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
uint32_t slot_;
|
uint32_t slot_;
|
||||||
|
|
||||||
ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, uint32_t slot)
|
ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, uint32_t slot);
|
||||||
: ICMonitoredStub(GetName_Global, stubCode, firstMonitorStub),
|
|
||||||
shape_(shape),
|
|
||||||
slot_(slot)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetName_Global *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
static inline ICGetName_Global *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
||||||
|
@ -3490,15 +3431,7 @@ class ICGetName_Scope : public ICMonitoredStub
|
||||||
uint32_t offset_;
|
uint32_t offset_;
|
||||||
|
|
||||||
ICGetName_Scope(IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetName_Scope(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
AutoShapeVector *shapes, uint32_t offset)
|
AutoShapeVector *shapes, uint32_t offset);
|
||||||
: ICMonitoredStub(GetStubKind(), stubCode, firstMonitorStub),
|
|
||||||
offset_(offset)
|
|
||||||
{
|
|
||||||
JS_STATIC_ASSERT(NumHops <= MAX_HOPS);
|
|
||||||
JS_ASSERT(shapes->length() == NumHops + 1);
|
|
||||||
for (size_t i = 0; i < NumHops + 1; i++)
|
|
||||||
shapes_[i].init((*shapes)[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Kind GetStubKind() {
|
static Kind GetStubKind() {
|
||||||
return (Kind) (GetName_Scope0 + NumHops);
|
return (Kind) (GetName_Scope0 + NumHops);
|
||||||
|
@ -3632,10 +3565,8 @@ class ICGetIntrinsic_Constant : public ICStub
|
||||||
|
|
||||||
HeapValue value_;
|
HeapValue value_;
|
||||||
|
|
||||||
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value)
|
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value);
|
||||||
: ICStub(GetIntrinsic_Constant, stubCode),
|
~ICGetIntrinsic_Constant();
|
||||||
value_(value)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetIntrinsic_Constant *New(ICStubSpace *space, IonCode *code,
|
static inline ICGetIntrinsic_Constant *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -3786,11 +3717,7 @@ class ICGetProp_String : public ICMonitoredStub
|
||||||
uint32_t offset_;
|
uint32_t offset_;
|
||||||
|
|
||||||
ICGetProp_String(IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetProp_String(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
HandleShape stringProtoShape, uint32_t offset)
|
HandleShape stringProtoShape, uint32_t offset);
|
||||||
: ICMonitoredStub(GetProp_String, stubCode, firstMonitorStub),
|
|
||||||
stringProtoShape_(stringProtoShape),
|
|
||||||
offset_(offset)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetProp_String *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
static inline ICGetProp_String *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
||||||
|
@ -3884,11 +3811,7 @@ class ICGetPropNativeStub : public ICMonitoredStub
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
HandleShape shape, uint32_t offset)
|
HandleShape shape, uint32_t offset);
|
||||||
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
|
||||||
shape_(shape),
|
|
||||||
offset_(offset)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape &shape() {
|
||||||
|
@ -3938,11 +3861,7 @@ class ICGetProp_NativePrototype : public ICGetPropNativeStub
|
||||||
HeapPtrShape holderShape_;
|
HeapPtrShape holderShape_;
|
||||||
|
|
||||||
ICGetProp_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape,
|
ICGetProp_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape,
|
||||||
uint32_t offset, HandleObject holder, HandleShape holderShape)
|
uint32_t offset, HandleObject holder, HandleShape holderShape);
|
||||||
: ICGetPropNativeStub(GetProp_NativePrototype, stubCode, firstMonitorStub, shape, offset),
|
|
||||||
holder_(holder),
|
|
||||||
holderShape_(holderShape)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICGetProp_NativePrototype *New(ICStubSpace *space, IonCode *code,
|
static inline ICGetProp_NativePrototype *New(ICStubSpace *space, IonCode *code,
|
||||||
|
@ -4035,16 +3954,7 @@ class ICGetPropCallGetter : public ICMonitoredStub
|
||||||
|
|
||||||
ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||||
HandleShape shape, HandleObject holder, HandleShape holderShape,
|
HandleShape shape, HandleObject holder, HandleShape holderShape,
|
||||||
HandleFunction getter, uint32_t pcOffset)
|
HandleFunction getter, uint32_t pcOffset);
|
||||||
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
|
||||||
shape_(shape),
|
|
||||||
holder_(holder),
|
|
||||||
holderShape_(holderShape),
|
|
||||||
getter_(getter),
|
|
||||||
pcOffset_(pcOffset)
|
|
||||||
{
|
|
||||||
JS_ASSERT(kind == ICStub::GetProp_CallScripted || kind == ICStub::GetProp_CallNative);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape &shape() {
|
||||||
|
@ -4247,12 +4157,7 @@ class ICSetProp_Native : public ICUpdatedStub
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
uint32_t offset_;
|
uint32_t offset_;
|
||||||
|
|
||||||
ICSetProp_Native(IonCode *stubCode, HandleTypeObject type, HandleShape shape, uint32_t offset)
|
ICSetProp_Native(IonCode *stubCode, HandleTypeObject type, HandleShape shape, uint32_t offset);
|
||||||
: ICUpdatedStub(SetProp_Native, stubCode),
|
|
||||||
type_(type),
|
|
||||||
shape_(shape),
|
|
||||||
offset_(offset)
|
|
||||||
{}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICSetProp_Native *New(ICStubSpace *space, IonCode *code, HandleTypeObject type,
|
static inline ICSetProp_Native *New(ICStubSpace *space, IonCode *code, HandleTypeObject type,
|
||||||
|
@ -4298,14 +4203,7 @@ class ICSetProp_Native : public ICUpdatedStub
|
||||||
offset_(offset)
|
offset_(offset)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ICUpdatedStub *getStub(ICStubSpace *space) {
|
ICUpdatedStub *getStub(ICStubSpace *space);
|
||||||
RootedTypeObject type(cx, obj_->getType(cx));
|
|
||||||
RootedShape shape(cx, obj_->lastProperty());
|
|
||||||
ICUpdatedStub *stub = ICSetProp_Native::New(space, getStubCode(), type, shape, offset_);
|
|
||||||
if (!stub || !stub->initUpdatingChain(cx, space))
|
|
||||||
return NULL;
|
|
||||||
return stub;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4323,15 +4221,7 @@ class ICSetProp_NativeAdd : public ICUpdatedStub
|
||||||
uint32_t offset_;
|
uint32_t offset_;
|
||||||
|
|
||||||
ICSetProp_NativeAdd(IonCode *stubCode, HandleTypeObject type, size_t protoChainDepth,
|
ICSetProp_NativeAdd(IonCode *stubCode, HandleTypeObject type, size_t protoChainDepth,
|
||||||
HandleShape newShape, uint32_t offset)
|
HandleShape newShape, uint32_t offset);
|
||||||
: ICUpdatedStub(SetProp_NativeAdd, stubCode),
|
|
||||||
type_(type),
|
|
||||||
newShape_(newShape),
|
|
||||||
offset_(offset)
|
|
||||||
{
|
|
||||||
JS_ASSERT(protoChainDepth <= MAX_PROTO_CHAIN_DEPTH);
|
|
||||||
extra_ = protoChainDepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
size_t protoChainDepth() const {
|
size_t protoChainDepth() const {
|
||||||
|
@ -4371,13 +4261,7 @@ class ICSetProp_NativeAddImpl : public ICSetProp_NativeAdd
|
||||||
|
|
||||||
ICSetProp_NativeAddImpl(IonCode *stubCode, HandleTypeObject type,
|
ICSetProp_NativeAddImpl(IonCode *stubCode, HandleTypeObject type,
|
||||||
const AutoShapeVector *shapes,
|
const AutoShapeVector *shapes,
|
||||||
HandleShape newShape, uint32_t offset)
|
HandleShape newShape, uint32_t offset);
|
||||||
: ICSetProp_NativeAdd(stubCode, type, ProtoChainDepth, newShape, offset)
|
|
||||||
{
|
|
||||||
JS_ASSERT(shapes->length() == NumShapes);
|
|
||||||
for (size_t i = 0; i < NumShapes; i++)
|
|
||||||
shapes_[i].init((*shapes)[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICSetProp_NativeAddImpl *New(
|
static inline ICSetProp_NativeAddImpl *New(
|
||||||
|
@ -4417,16 +4301,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ICSetPropNativeAddCompiler(JSContext *cx, HandleObject obj, HandleShape oldShape,
|
ICSetPropNativeAddCompiler(JSContext *cx, HandleObject obj, HandleShape oldShape,
|
||||||
size_t protoChainDepth, bool isFixedSlot, uint32_t offset)
|
size_t protoChainDepth, bool isFixedSlot, uint32_t offset);
|
||||||
: ICStubCompiler(cx, ICStub::SetProp_NativeAdd),
|
|
||||||
obj_(cx, obj),
|
|
||||||
oldShape_(cx, oldShape),
|
|
||||||
protoChainDepth_(protoChainDepth),
|
|
||||||
isFixedSlot_(isFixedSlot),
|
|
||||||
offset_(offset)
|
|
||||||
{
|
|
||||||
JS_ASSERT(protoChainDepth_ <= ICSetProp_NativeAdd::MAX_PROTO_CHAIN_DEPTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
|
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
|
||||||
|
@ -4461,16 +4336,7 @@ class ICSetPropCallSetter : public ICStub
|
||||||
uint32_t pcOffset_;
|
uint32_t pcOffset_;
|
||||||
|
|
||||||
ICSetPropCallSetter(Kind kind, IonCode *stubCode, HandleShape shape, HandleObject holder,
|
ICSetPropCallSetter(Kind kind, IonCode *stubCode, HandleShape shape, HandleObject holder,
|
||||||
HandleShape holderShape, HandleFunction setter, uint32_t pcOffset)
|
HandleShape holderShape, HandleFunction setter, uint32_t pcOffset);
|
||||||
: ICStub(kind, stubCode),
|
|
||||||
shape_(shape),
|
|
||||||
holder_(holder),
|
|
||||||
holderShape_(holderShape),
|
|
||||||
setter_(setter),
|
|
||||||
pcOffset_(pcOffset)
|
|
||||||
{
|
|
||||||
JS_ASSERT(kind == ICStub::SetProp_CallScripted || kind == ICStub::SetProp_CallNative);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape &shape() {
|
||||||
|
@ -4706,11 +4572,7 @@ class ICCall_Scripted : public ICMonitoredStub
|
||||||
uint32_t pcOffset_;
|
uint32_t pcOffset_;
|
||||||
|
|
||||||
ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub, HandleScript calleeScript,
|
ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub, HandleScript calleeScript,
|
||||||
uint32_t pcOffset)
|
uint32_t pcOffset);
|
||||||
: ICMonitoredStub(ICStub::Call_Scripted, stubCode, firstMonitorStub),
|
|
||||||
calleeScript_(calleeScript),
|
|
||||||
pcOffset_(pcOffset)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICCall_Scripted *New(
|
static inline ICCall_Scripted *New(
|
||||||
|
@ -4810,11 +4672,7 @@ class ICCall_Native : public ICMonitoredStub
|
||||||
uint32_t pcOffset_;
|
uint32_t pcOffset_;
|
||||||
|
|
||||||
ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub, HandleFunction callee,
|
ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub, HandleFunction callee,
|
||||||
uint32_t pcOffset)
|
uint32_t pcOffset);
|
||||||
: ICMonitoredStub(ICStub::Call_Native, stubCode, firstMonitorStub),
|
|
||||||
callee_(callee),
|
|
||||||
pcOffset_(pcOffset)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline ICCall_Native *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
static inline ICCall_Native *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
using namespace js;
|
using namespace js;
|
||||||
using namespace ion;
|
using namespace ion;
|
||||||
|
|
||||||
|
const char *
|
||||||
|
CompileInfo::filename() const
|
||||||
|
{
|
||||||
|
return script_->filename();
|
||||||
|
}
|
||||||
|
|
||||||
JSAtom *
|
JSAtom *
|
||||||
CompileInfo::getAtom(jsbytecode *pc) const
|
CompileInfo::getAtom(jsbytecode *pc) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,9 +80,8 @@ class CompileInfo
|
||||||
return script_->code + script_->length;
|
return script_->code + script_->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *filename() const {
|
inline const char *filename() const;
|
||||||
return script_->filename();
|
|
||||||
}
|
|
||||||
unsigned lineno() const {
|
unsigned lineno() const {
|
||||||
return script_->lineno;
|
return script_->lineno;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
|
|
||||||
#include "jscntxt.h"
|
#include "jscntxt.h"
|
||||||
#include "jscompartment.h"
|
#include "jscompartment.h"
|
||||||
|
#include "jsgc.h"
|
||||||
#include "ion/IonCode.h"
|
#include "ion/IonCode.h"
|
||||||
#include "ion/IonCompartment.h"
|
#include "ion/IonCompartment.h"
|
||||||
#include "assembler/jit/ExecutableAllocator.h"
|
#include "assembler/jit/ExecutableAllocator.h"
|
||||||
#include "ion/IonMacroAssembler.h"
|
#include "ion/IonMacroAssembler.h"
|
||||||
#include "jsgcinlines.h"
|
|
||||||
|
|
||||||
namespace js {
|
namespace js {
|
||||||
namespace ion {
|
namespace ion {
|
||||||
|
|
|
@ -18,6 +18,11 @@ using namespace js::ion;
|
||||||
using namespace js::types;
|
using namespace js::types;
|
||||||
using namespace js::analyze;
|
using namespace js::analyze;
|
||||||
|
|
||||||
|
TypeInferenceOracle::TypeInferenceOracle()
|
||||||
|
: cx(NULL),
|
||||||
|
script_(NULL)
|
||||||
|
{}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TypeInferenceOracle::init(JSContext *cx, JSScript *script, bool inlinedCall)
|
TypeInferenceOracle::init(JSContext *cx, JSScript *script, bool inlinedCall)
|
||||||
{
|
{
|
||||||
|
|
|
@ -247,7 +247,7 @@ class TypeInferenceOracle : public TypeOracle
|
||||||
Vector<JSScript*> &seen);
|
Vector<JSScript*> &seen);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TypeInferenceOracle() : cx(NULL), script_(NULL) {}
|
TypeInferenceOracle();
|
||||||
|
|
||||||
bool init(JSContext *cx, JSScript *script, bool inlinedCall);
|
bool init(JSContext *cx, JSScript *script, bool inlinedCall);
|
||||||
|
|
||||||
|
|
|
@ -113,33 +113,6 @@ class BaselineCompilerShared
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool addPCMappingEntry(uint32_t nativeOffset, PCMappingSlotInfo slotInfo, bool addIndexEntry) {
|
|
||||||
|
|
||||||
// Don't add multiple entries for a single pc.
|
|
||||||
size_t nentries = pcMappingEntries_.length();
|
|
||||||
if (nentries > 0 && pcMappingEntries_[nentries - 1].pcOffset == unsigned(pc - script->code))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
PCMappingEntry entry;
|
|
||||||
entry.pcOffset = pc - script->code;
|
|
||||||
entry.nativeOffset = nativeOffset;
|
|
||||||
entry.slotInfo = slotInfo;
|
|
||||||
entry.addIndexEntry = addIndexEntry;
|
|
||||||
|
|
||||||
IonSpew(IonSpew_BaselineOp, "PCMapping (%s:%u): %u => %u (%u:%u:%u)!",
|
|
||||||
script->filename(), script->lineno,
|
|
||||||
entry.pcOffset, entry.nativeOffset,
|
|
||||||
(entry.slotInfo.toByte() & 0x3),
|
|
||||||
((entry.slotInfo.toByte() >> 2) & 0x3),
|
|
||||||
((entry.slotInfo.toByte() >> 4) & 0x3));
|
|
||||||
|
|
||||||
return pcMappingEntries_.append(entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool addPCMappingEntry(bool addIndexEntry) {
|
|
||||||
return addPCMappingEntry(masm.currentOffset(), getStackTopSlotInfo(), addIndexEntry);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void pushArg(const T& t) {
|
void pushArg(const T& t) {
|
||||||
masm.Push(t);
|
masm.Push(t);
|
||||||
|
|
|
@ -5053,3 +5053,15 @@ AutoMaybeTouchDeadZones::~AutoMaybeTouchDeadZones()
|
||||||
|
|
||||||
runtime->gcManipulatingDeadZones = manipulatingDeadZones;
|
runtime->gcManipulatingDeadZones = manipulatingDeadZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AutoSuppressGC::AutoSuppressGC(JSContext *cx)
|
||||||
|
: suppressGC_(cx->runtime->mainThread.suppressGC)
|
||||||
|
{
|
||||||
|
suppressGC_++;
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoSuppressGC::AutoSuppressGC(JSCompartment *comp)
|
||||||
|
: suppressGC_(comp->rt->mainThread.suppressGC)
|
||||||
|
{
|
||||||
|
suppressGC_++;
|
||||||
|
}
|
||||||
|
|
|
@ -1255,6 +1255,26 @@ MaybeVerifyBarriers(JSContext *cx, bool always = false)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Instances of this class set the |JSRuntime::suppressGC| flag for the duration
|
||||||
|
* that they are live. Use of this class is highly discouraged. Please carefully
|
||||||
|
* read the comment in jscntxt.h above |suppressGC| and take all appropriate
|
||||||
|
* precautions before instantiating this class.
|
||||||
|
*/
|
||||||
|
class AutoSuppressGC
|
||||||
|
{
|
||||||
|
int32_t &suppressGC_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
AutoSuppressGC(JSContext *cx);
|
||||||
|
AutoSuppressGC(JSCompartment *comp);
|
||||||
|
|
||||||
|
~AutoSuppressGC()
|
||||||
|
{
|
||||||
|
suppressGC_--;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} /* namespace gc */
|
} /* namespace gc */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -513,35 +513,6 @@ NewGCThing(JSContext *cx, AllocKind kind, size_t thingSize, InitialHeap heap)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Instances of this class set the |JSRuntime::suppressGC| flag for the duration
|
|
||||||
* that they are live. Use of this class is highly discouraged. Please carefully
|
|
||||||
* read the comment in jscntxt.h above |suppressGC| and take all appropriate
|
|
||||||
* precautions before instantiating this class.
|
|
||||||
*/
|
|
||||||
class AutoSuppressGC
|
|
||||||
{
|
|
||||||
int32_t &suppressGC_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
AutoSuppressGC(JSContext *cx)
|
|
||||||
: suppressGC_(cx->runtime->mainThread.suppressGC)
|
|
||||||
{
|
|
||||||
suppressGC_++;
|
|
||||||
}
|
|
||||||
|
|
||||||
AutoSuppressGC(JSCompartment *comp)
|
|
||||||
: suppressGC_(comp->rt->mainThread.suppressGC)
|
|
||||||
{
|
|
||||||
suppressGC_++;
|
|
||||||
}
|
|
||||||
|
|
||||||
~AutoSuppressGC()
|
|
||||||
{
|
|
||||||
suppressGC_--;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} /* namespace gc */
|
} /* namespace gc */
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче