backout 76c52c1ca95a bug 859446 because its suspected of regressing talos on win pgo

This commit is contained in:
Trevor Saunders 2013-04-11 22:43:19 -04:00
parent 8ff4cab9e0
commit 2a1c7e8745
15 changed files with 244 additions and 358 deletions

View File

@ -41,23 +41,6 @@ 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()
{

View File

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

View File

@ -63,18 +63,6 @@ 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

View File

@ -235,7 +235,15 @@ class BaselineFrame
return flags_ & HAS_CALL_OBJ;
}
inline CallObject &callObj() const;
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) {
flags_ = flags;

View File

@ -7018,252 +7018,5 @@ 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

View File

@ -9,7 +9,7 @@
#include "jscntxt.h"
#include "jscompartment.h"
#include "jsgc.h"
#include "jsgcinlines.h"
#include "jsopcode.h"
#include "BaselineJIT.h"
#include "BaselineRegisters.h"
@ -1137,7 +1137,11 @@ class ICProfiler_PushFunction : public ICStub
const char *str_;
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:
static inline ICProfiler_PushFunction *New(ICStubSpace *space, IonCode *code,
@ -1483,7 +1487,10 @@ class ICTypeMonitor_SingleObject : public ICStub
HeapPtrObject obj_;
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj);
ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj)
: ICStub(TypeMonitor_SingleObject, stubCode),
obj_(obj)
{ }
public:
static inline ICTypeMonitor_SingleObject *New(
@ -1525,7 +1532,10 @@ class ICTypeMonitor_TypeObject : public ICStub
HeapPtrTypeObject type_;
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type);
ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type)
: ICStub(TypeMonitor_TypeObject, stubCode),
type_(type)
{ }
public:
static inline ICTypeMonitor_TypeObject *New(
@ -1646,7 +1656,10 @@ class ICTypeUpdate_SingleObject : public ICStub
HeapPtrObject obj_;
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj);
ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj)
: ICStub(TypeUpdate_SingleObject, stubCode),
obj_(obj)
{ }
public:
static inline ICTypeUpdate_SingleObject *New(ICStubSpace *space, IonCode *code,
@ -1689,7 +1702,10 @@ class ICTypeUpdate_TypeObject : public ICStub
HeapPtrTypeObject type_;
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type);
ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type)
: ICStub(TypeUpdate_TypeObject, stubCode),
type_(type)
{ }
public:
static inline ICTypeUpdate_TypeObject *New(ICStubSpace *space, IonCode *code,
@ -2768,9 +2784,14 @@ class ICGetElemNativeStub : public ICMonitoredStub
protected:
ICGetElemNativeStub(ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
HandleShape shape, HandleValue idval,
bool isFixedSlot, uint32_t offset);
~ICGetElemNativeStub();
bool isFixedSlot, uint32_t offset)
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
shape_(shape),
idval_(idval),
offset_(offset)
{
extra_ = isFixedSlot;
}
public:
HeapPtrShape &shape() {
@ -2831,7 +2852,12 @@ class ICGetElem_NativePrototype : public ICGetElemNativeStub
ICGetElem_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
HandleShape shape, HandleValue idval,
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:
static inline ICGetElem_NativePrototype *New(ICStubSpace *space, IonCode *code,
@ -2942,7 +2968,10 @@ class ICGetElem_Dense : public ICMonitoredStub
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:
static inline ICGetElem_Dense *New(ICStubSpace *space, IonCode *code,
@ -2988,7 +3017,13 @@ class ICGetElem_TypedArray : public ICStub
protected: // Protected to silence Clang warning.
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:
static inline ICGetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
@ -3075,7 +3110,11 @@ class ICSetElem_Dense : public ICUpdatedStub
HeapPtrShape shape_;
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:
static inline ICSetElem_Dense *New(ICStubSpace *space, IonCode *code, HandleShape shape,
@ -3137,7 +3176,13 @@ class ICSetElem_DenseAdd : public ICUpdatedStub
protected:
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:
static size_t offsetOfType() {
@ -3222,7 +3267,10 @@ class ICSetElemDenseAddCompiler : public ICStubCompiler {
{}
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);
};
@ -3235,7 +3283,14 @@ class ICSetElem_TypedArray : public ICStub
HeapPtrShape shape_;
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:
static inline ICSetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
@ -3372,7 +3427,11 @@ class ICGetName_Global : public ICMonitoredStub
HeapPtrShape shape_;
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:
static inline ICGetName_Global *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
@ -3430,7 +3489,15 @@ class ICGetName_Scope : public ICMonitoredStub
uint32_t offset_;
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() {
return (Kind) (GetName_Scope0 + NumHops);
@ -3564,8 +3631,10 @@ class ICGetIntrinsic_Constant : public ICStub
HeapValue value_;
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value);
~ICGetIntrinsic_Constant();
ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value)
: ICStub(GetIntrinsic_Constant, stubCode),
value_(value)
{}
public:
static inline ICGetIntrinsic_Constant *New(ICStubSpace *space, IonCode *code,
@ -3716,7 +3785,11 @@ class ICGetProp_String : public ICMonitoredStub
uint32_t offset_;
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:
static inline ICGetProp_String *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,
@ -3810,7 +3883,11 @@ class ICGetPropNativeStub : public ICMonitoredStub
protected:
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:
HeapPtrShape &shape() {
@ -3860,7 +3937,11 @@ class ICGetProp_NativePrototype : public ICGetPropNativeStub
HeapPtrShape holderShape_;
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:
static inline ICGetProp_NativePrototype *New(ICStubSpace *space, IonCode *code,
@ -3953,7 +4034,16 @@ class ICGetPropCallGetter : public ICMonitoredStub
ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
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:
HeapPtrShape &shape() {
@ -4156,7 +4246,12 @@ class ICSetProp_Native : public ICUpdatedStub
HeapPtrShape shape_;
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:
static inline ICSetProp_Native *New(ICStubSpace *space, IonCode *code, HandleTypeObject type,
@ -4202,7 +4297,14 @@ class ICSetProp_Native : public ICUpdatedStub
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;
}
};
};
@ -4220,7 +4322,15 @@ class ICSetProp_NativeAdd : public ICUpdatedStub
uint32_t offset_;
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:
size_t protoChainDepth() const {
@ -4260,7 +4370,13 @@ class ICSetProp_NativeAddImpl : public ICSetProp_NativeAdd
ICSetProp_NativeAddImpl(IonCode *stubCode, HandleTypeObject type,
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:
static inline ICSetProp_NativeAddImpl *New(
@ -4300,7 +4416,16 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler {
public:
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>
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
@ -4335,7 +4460,16 @@ class ICSetPropCallSetter : public ICStub
uint32_t pcOffset_;
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:
HeapPtrShape &shape() {
@ -4571,7 +4705,11 @@ class ICCall_Scripted : public ICMonitoredStub
uint32_t pcOffset_;
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:
static inline ICCall_Scripted *New(
@ -4671,7 +4809,11 @@ class ICCall_Native : public ICMonitoredStub
uint32_t pcOffset_;
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:
static inline ICCall_Native *New(ICStubSpace *space, IonCode *code, ICStub *firstMonitorStub,

View File

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

View File

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

View File

@ -9,11 +9,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 {

View File

@ -17,11 +17,6 @@ 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)
{

View File

@ -246,7 +246,7 @@ class TypeInferenceOracle : public TypeOracle
Vector<JSScript*> &seen);
public:
TypeInferenceOracle();
TypeInferenceOracle() : cx(NULL), script_(NULL) {}
bool init(JSContext *cx, JSScript *script, bool inlinedCall);

View File

@ -112,6 +112,33 @@ 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);

View File

@ -5052,15 +5052,3 @@ 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_++;
}

View File

@ -1255,26 +1255,6 @@ 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

View File

@ -513,6 +513,35 @@ 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 */