Bug 859446 - Fix GCC warnings from baseline compiler merge. r=bhackett

This commit is contained in:
Jan de Mooij 2013-04-10 16:41:00 +02:00
Родитель 3cc28cdf4a
Коммит 70db59a5d6
15 изменённых файлов: 358 добавлений и 244 удалений

Просмотреть файл

@ -42,6 +42,23 @@ BaselineCompiler::init()
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
BaselineCompiler::compile()
{

Просмотреть файл

@ -232,6 +232,8 @@ class BaselineCompiler : public BaselineCompilerSpecific
bool emitEnterBlock();
bool addPCMappingEntry(bool addIndexEntry);
Address getScopeCoordinateAddress(Register reg);
};

Просмотреть файл

@ -64,6 +64,18 @@ BaselineFrame::popBlock(JSContext *cx)
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 js

Просмотреть файл

@ -236,15 +236,7 @@ class BaselineFrame
return flags_ & HAS_CALL_OBJ;
}
CallObject &callObj() const {
JS_ASSERT(hasCallObj());
JS_ASSERT(fun()->isHeavyweight());
JSObject *obj = scopeChain();
while (!obj->isCall())
obj = obj->enclosingScope();
return obj->asCall();
}
inline CallObject &callObj() const;
void setFlags(uint32_t flags) {
flags_ = flags;

Просмотреть файл

@ -7019,5 +7019,252 @@ ICTypeOf_Typed::Compiler::generateStubCode(MacroAssembler &masm)
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 js

Просмотреть файл

@ -10,7 +10,7 @@
#include "jscntxt.h"
#include "jscompartment.h"
#include "jsgcinlines.h"
#include "jsgc.h"
#include "jsopcode.h"
#include "BaselineJIT.h"
#include "BaselineRegisters.h"
@ -1138,11 +1138,7 @@ class ICProfiler_PushFunction : public ICStub
const char *str_;
HeapPtrScript script_;
ICProfiler_PushFunction(IonCode *stubCode, const char *str, HandleScript script)
: ICStub(ICStub::Profiler_PushFunction, stubCode),
str_(str),
script_(script)
{ }
ICProfiler_PushFunction(IonCode *stubCode, const char *str, HandleScript script);
public:
static inline ICProfiler_PushFunction *New(ICStubSpace *space, IonCode *code,
@ -1488,10 +1484,7 @@ class ICTypeMonitor_SingleObject : public ICStub
HeapPtrObject obj_;
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj)
: ICStub(TypeMonitor_SingleObject, stubCode),
obj_(obj)
{ }
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj);
public:
static inline ICTypeMonitor_SingleObject *New(
@ -1533,10 +1526,7 @@ class ICTypeMonitor_TypeObject : public ICStub
HeapPtrTypeObject type_;
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type)
: ICStub(TypeMonitor_TypeObject, stubCode),
type_(type)
{ }
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type);
public:
static inline ICTypeMonitor_TypeObject *New(
@ -1657,10 +1647,7 @@ class ICTypeUpdate_SingleObject : public ICStub
HeapPtrObject obj_;
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj)
: ICStub(TypeUpdate_SingleObject, stubCode),
obj_(obj)
{ }
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj);
public:
static inline ICTypeUpdate_SingleObject *New(ICStubSpace *space, IonCode *code,
@ -1703,10 +1690,7 @@ class ICTypeUpdate_TypeObject : public ICStub
HeapPtrTypeObject type_;
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type)
: ICStub(TypeUpdate_TypeObject, stubCode),
type_(type)
{ }
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type);
public:
static inline ICTypeUpdate_TypeObject *New(ICStubSpace *space, IonCode *code,
@ -2785,14 +2769,9 @@ class ICGetElemNativeStub : public ICMonitoredStub
protected:
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;
}
bool isFixedSlot, uint32_t offset);
~ICGetElemNativeStub();
public:
HeapPtrShape &shape() {
@ -2853,12 +2832,7 @@ class ICGetElem_NativePrototype : public ICGetElemNativeStub
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)
{}
HandleObject holder, HandleShape holderShape);
public:
static inline ICGetElem_NativePrototype *New(ICStubSpace *space, IonCode *code,
@ -2969,10 +2943,7 @@ class ICGetElem_Dense : public ICMonitoredStub
HeapPtrShape shape_;
ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape)
: ICMonitoredStub(GetElem_Dense, stubCode, firstMonitorStub),
shape_(shape)
{}
ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape);
public:
static inline ICGetElem_Dense *New(ICStubSpace *space, IonCode *code,
@ -3018,13 +2989,7 @@ class ICGetElem_TypedArray : public ICStub
protected: // Protected to silence Clang warning.
HeapPtrShape shape_;
ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type)
: ICStub(GetElem_TypedArray, stubCode),
shape_(shape)
{
extra_ = uint16_t(type);
JS_ASSERT(extra_ == type);
}
ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type);
public:
static inline ICGetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
@ -3111,11 +3076,7 @@ class ICSetElem_Dense : public ICUpdatedStub
HeapPtrShape shape_;
HeapPtrTypeObject type_;
ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type)
: ICUpdatedStub(SetElem_Dense, stubCode),
shape_(shape),
type_(type)
{}
ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type);
public:
static inline ICSetElem_Dense *New(ICStubSpace *space, IonCode *code, HandleShape shape,
@ -3177,13 +3138,7 @@ class ICSetElem_DenseAdd : public ICUpdatedStub
protected:
HeapPtrTypeObject type_;
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;
}
ICSetElem_DenseAdd(IonCode *stubCode, types::TypeObject *type, size_t protoChainDepth);
public:
static size_t offsetOfType() {
@ -3268,10 +3223,7 @@ class ICSetElemDenseAddCompiler : public ICStubCompiler {
{}
template <size_t ProtoChainDepth>
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes) {
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, getStubCode(), obj_->getType(cx),
shapes);
}
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes);
ICUpdatedStub *getStub(ICStubSpace *space);
};
@ -3284,14 +3236,7 @@ class ICSetElem_TypedArray : public ICStub
HeapPtrShape shape_;
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);
}
bool expectOutOfBounds);
public:
static inline ICSetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
@ -3428,11 +3373,7 @@ class ICGetName_Global : public ICMonitoredStub
HeapPtrShape shape_;
uint32_t slot_;
ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, uint32_t slot)
: ICMonitoredStub(GetName_Global, stubCode, firstMonitorStub),
shape_(shape),
slot_(slot)
{}
ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, uint32_t slot);
public:
static inline ICGetName_Global *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
@ -3490,15 +3431,7 @@ class ICGetName_Scope : public ICMonitoredStub
uint32_t offset_;
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]);
}
AutoShapeVector *shapes, uint32_t offset);
static Kind GetStubKind() {
return (Kind) (GetName_Scope0 + NumHops);
@ -3632,10 +3565,8 @@ class ICGetIntrinsic_Constant : public ICStub
HeapValue value_;
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value)
: ICStub(GetIntrinsic_Constant, stubCode),
value_(value)
{}
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value);
~ICGetIntrinsic_Constant();
public:
static inline ICGetIntrinsic_Constant *New(ICStubSpace *space, IonCode *code,
@ -3786,11 +3717,7 @@ class ICGetProp_String : public ICMonitoredStub
uint32_t offset_;
ICGetProp_String(IonCode *stubCode, ICStub *firstMonitorStub,
HandleShape stringProtoShape, uint32_t offset)
: ICMonitoredStub(GetProp_String, stubCode, firstMonitorStub),
stringProtoShape_(stringProtoShape),
offset_(offset)
{}
HandleShape stringProtoShape, uint32_t offset);
public:
static inline ICGetProp_String *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
@ -3884,11 +3811,7 @@ class ICGetPropNativeStub : public ICMonitoredStub
protected:
ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
HandleShape shape, uint32_t offset)
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
shape_(shape),
offset_(offset)
{}
HandleShape shape, uint32_t offset);
public:
HeapPtrShape &shape() {
@ -3938,11 +3861,7 @@ class ICGetProp_NativePrototype : public ICGetPropNativeStub
HeapPtrShape holderShape_;
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)
{}
uint32_t offset, HandleObject holder, HandleShape holderShape);
public:
static inline ICGetProp_NativePrototype *New(ICStubSpace *space, IonCode *code,
@ -4035,16 +3954,7 @@ class ICGetPropCallGetter : public ICMonitoredStub
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);
}
HandleFunction getter, uint32_t pcOffset);
public:
HeapPtrShape &shape() {
@ -4247,12 +4157,7 @@ class ICSetProp_Native : public ICUpdatedStub
HeapPtrShape 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)
{}
ICSetProp_Native(IonCode *stubCode, HandleTypeObject type, HandleShape shape, uint32_t offset);
public:
static inline ICSetProp_Native *New(ICStubSpace *space, IonCode *code, HandleTypeObject type,
@ -4298,14 +4203,7 @@ class ICSetProp_Native : public ICUpdatedStub
offset_(offset)
{}
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;
}
ICUpdatedStub *getStub(ICStubSpace *space);
};
};
@ -4323,15 +4221,7 @@ class ICSetProp_NativeAdd : public ICUpdatedStub
uint32_t offset_;
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;
}
HandleShape newShape, uint32_t offset);
public:
size_t protoChainDepth() const {
@ -4371,13 +4261,7 @@ class ICSetProp_NativeAddImpl : public ICSetProp_NativeAdd
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]);
}
HandleShape newShape, uint32_t offset);
public:
static inline ICSetProp_NativeAddImpl *New(
@ -4417,16 +4301,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler {
public:
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);
}
size_t protoChainDepth, bool isFixedSlot, uint32_t offset);
template <size_t ProtoChainDepth>
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
@ -4461,16 +4336,7 @@ class ICSetPropCallSetter : public ICStub
uint32_t pcOffset_;
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);
}
HandleShape holderShape, HandleFunction setter, uint32_t pcOffset);
public:
HeapPtrShape &shape() {
@ -4706,11 +4572,7 @@ class ICCall_Scripted : public ICMonitoredStub
uint32_t pcOffset_;
ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub, HandleScript calleeScript,
uint32_t pcOffset)
: ICMonitoredStub(ICStub::Call_Scripted, stubCode, firstMonitorStub),
calleeScript_(calleeScript),
pcOffset_(pcOffset)
{ }
uint32_t pcOffset);
public:
static inline ICCall_Scripted *New(
@ -4810,11 +4672,7 @@ class ICCall_Native : public ICMonitoredStub
uint32_t pcOffset_;
ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub, HandleFunction callee,
uint32_t pcOffset)
: ICMonitoredStub(ICStub::Call_Native, stubCode, firstMonitorStub),
callee_(callee),
pcOffset_(pcOffset)
{ }
uint32_t pcOffset);
public:
static inline ICCall_Native *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,

Просмотреть файл

@ -14,6 +14,12 @@
using namespace js;
using namespace ion;
const char *
CompileInfo::filename() const
{
return script_->filename();
}
JSAtom *
CompileInfo::getAtom(jsbytecode *pc) const
{

Просмотреть файл

@ -80,9 +80,8 @@ class CompileInfo
return script_->code + script_->length;
}
const char *filename() const {
return script_->filename();
}
inline const char *filename() const;
unsigned lineno() const {
return script_->lineno;
}

Просмотреть файл

@ -10,11 +10,11 @@
#include "jscntxt.h"
#include "jscompartment.h"
#include "jsgc.h"
#include "ion/IonCode.h"
#include "ion/IonCompartment.h"
#include "assembler/jit/ExecutableAllocator.h"
#include "ion/IonMacroAssembler.h"
#include "jsgcinlines.h"
namespace js {
namespace ion {

Просмотреть файл

@ -18,6 +18,11 @@ using namespace js::ion;
using namespace js::types;
using namespace js::analyze;
TypeInferenceOracle::TypeInferenceOracle()
: cx(NULL),
script_(NULL)
{}
bool
TypeInferenceOracle::init(JSContext *cx, JSScript *script, bool inlinedCall)
{

Просмотреть файл

@ -247,7 +247,7 @@ class TypeInferenceOracle : public TypeOracle
Vector<JSScript*> &seen);
public:
TypeInferenceOracle() : cx(NULL), script_(NULL) {}
TypeInferenceOracle();
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>
void pushArg(const T& t) {
masm.Push(t);

Просмотреть файл

@ -5053,3 +5053,15 @@ AutoMaybeTouchDeadZones::~AutoMaybeTouchDeadZones()
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
/*
* 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 */
void

Просмотреть файл

@ -513,35 +513,6 @@ NewGCThing(JSContext *cx, AllocKind kind, size_t thingSize, InitialHeap heap)
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 js */