Bug 904827 - Part 1: Rename OOLNativeGetterExitFrame to OOLNativeExitFrame. (r=djvj)

This commit is contained in:
Eric Faust 2013-08-30 18:50:36 -07:00
parent 53284975f1
commit 537d180e30
6 changed files with 57 additions and 45 deletions

View File

@ -854,8 +854,6 @@ EmitGetterCall(JSContext *cx, MacroAssembler &masm,
// TODO: ensure stack is aligned?
DebugOnly<uint32_t> initialStack = masm.framePushed();
attacher.pushStubCodePointer(masm);
if (callNative) {
JS_ASSERT(shape->hasGetterValue() && shape->getterValue().isObject() &&
shape->getterValue().toObject().is<JSFunction>());
@ -880,9 +878,13 @@ EmitGetterCall(JSContext *cx, MacroAssembler &masm,
masm.move32(Imm32(0), argUintNReg);
masm.movePtr(StackPointer, argVpReg);
// Push marking data for later use.
masm.Push(argUintNReg);
attacher.pushStubCodePointer(masm);
if (!masm.buildOOLFakeExitFrame(returnAddr))
return false;
masm.enterFakeExitFrame(ION_FRAME_OOL_NATIVE_GETTER);
masm.enterFakeExitFrame(ION_FRAME_OOL_NATIVE);
// Construct and execute call.
masm.setupUnalignedABICall(3, scratchReg);
@ -896,7 +898,7 @@ EmitGetterCall(JSContext *cx, MacroAssembler &masm,
// Load the outparam vp[0] into output register(s).
masm.loadValue(
Address(StackPointer, IonOOLNativeGetterExitFrameLayout::offsetOfResult()),
Address(StackPointer, IonOOLNativeExitFrameLayout::offsetOfResult()),
JSReturnOperand);
} else {
Register argObjReg = argUintNReg;
@ -904,6 +906,10 @@ EmitGetterCall(JSContext *cx, MacroAssembler &masm,
PropertyOp target = shape->getterOp();
JS_ASSERT(target);
// Push stubCode for marking.
attacher.pushStubCodePointer(masm);
// JSPropertyOp: bool fn(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp)
// Push args on stack first so we can take pointers to make handles.
@ -952,7 +958,7 @@ EmitGetterCall(JSContext *cx, MacroAssembler &masm,
// Move the StackPointer back to its original location, unwinding the native exit frame.
if (callNative)
masm.adjustStack(IonOOLNativeGetterExitFrameLayout::Size());
masm.adjustStack(IonOOLNativeExitFrameLayout::Size(0));
else
masm.adjustStack(IonOOLPropertyOpExitFrameLayout::Size());
JS_ASSERT(masm.framePushed() == initialStack);

View File

@ -143,7 +143,7 @@ class IonFrameIterator
return type_ == IonFrame_BaselineStub;
}
bool isNative() const;
bool isOOLNativeGetter() const;
bool isOOLNative() const;
bool isOOLPropertyOp() const;
bool isOOLProxyGet() const;
bool isDOMExit() const;

View File

@ -117,11 +117,11 @@ IonFrameIterator::isNative() const
}
bool
IonFrameIterator::isOOLNativeGetter() const
IonFrameIterator::isOOLNative() const
{
if (type_ != IonFrame_Exit)
return false;
return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_NATIVE;
}
bool
@ -906,11 +906,12 @@ MarkIonExitFrame(JSTracer *trc, const IonFrameIterator &frame)
return;
}
if (frame.isOOLNativeGetter()) {
IonOOLNativeGetterExitFrameLayout *oolgetter = frame.exitFrame()->oolNativeGetterExit();
gc::MarkIonCodeRoot(trc, oolgetter->stubCode(), "ion-ool-getter-code");
gc::MarkValueRoot(trc, oolgetter->vp(), "ion-ool-getter-callee");
gc::MarkValueRoot(trc, oolgetter->thisp(), "ion-ool-getter-this");
if (frame.isOOLNative()) {
IonOOLNativeExitFrameLayout *oolnative = frame.exitFrame()->oolNativeExit();
gc::MarkIonCodeRoot(trc, oolnative->stubCode(), "ion-ool-native-code");
gc::MarkValueRoot(trc, oolnative->vp(), "iol-ool-native-vp");
size_t len = oolnative->argc() + 1;
gc::MarkValueRootRange(trc, len, oolnative->thisp(), "ion-ool-native-thisargs");
return;
}

View File

@ -190,7 +190,7 @@ class IonBaselineStubFrameLayout : public IonCommonFrameLayout
};
class IonNativeExitFrameLayout;
class IonOOLNativeGetterExitFrameLayout;
class IonOOLNativeExitFrameLayout;
class IonOOLPropertyOpExitFrameLayout;
class IonOOLProxyGetExitFrameLayout;
class IonDOMExitFrameLayout;
@ -229,8 +229,8 @@ class IonExitFrameLayout : public IonCommonFrameLayout
inline bool isNativeExit() {
return footer()->ionCode() == NULL;
}
inline bool isOOLNativeGetterExit() {
return footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
inline bool isOOLNativeExit() {
return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
}
inline bool isOOLPropertyOpExit() {
return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
@ -251,9 +251,9 @@ class IonExitFrameLayout : public IonCommonFrameLayout
JS_ASSERT(isNativeExit());
return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
}
inline IonOOLNativeGetterExitFrameLayout *oolNativeGetterExit() {
JS_ASSERT(isOOLNativeGetterExit());
return reinterpret_cast<IonOOLNativeGetterExitFrameLayout *>(footer());
inline IonOOLNativeExitFrameLayout *oolNativeExit() {
JS_ASSERT(isOOLNativeExit());
return reinterpret_cast<IonOOLNativeExitFrameLayout *>(footer());
}
inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
JS_ASSERT(isOOLPropertyOpExit());
@ -298,30 +298,33 @@ class IonNativeExitFrameLayout
}
};
class IonOOLNativeGetterExitFrameLayout
class IonOOLNativeExitFrameLayout
{
IonExitFooterFrame footer_;
IonExitFrameLayout exit_;
// pointer to root the stub's IonCode
IonCode *stubCode_;
uintptr_t argc_;
// We need to split the Value into 2 fields of 32 bits, otherwise the C++
// compiler may add some padding between the fields.
uint32_t loCalleeResult_;
uint32_t hiCalleeResult_;
// The frame includes the object argument.
// Split Value for |this| and args above.
uint32_t loThis_;
uint32_t hiThis_;
// pointer to root the stub's IonCode
IonCode *stubCode_;
public:
static inline size_t Size() {
return sizeof(IonOOLNativeGetterExitFrameLayout);
static inline size_t Size(size_t argc) {
// The frame accounts for the callee/result and |this|, so we only need args.
return sizeof(IonOOLNativeExitFrameLayout) + (argc * sizeof(Value));
}
static size_t offsetOfResult() {
return offsetof(IonOOLNativeGetterExitFrameLayout, loCalleeResult_);
return offsetof(IonOOLNativeExitFrameLayout, loCalleeResult_);
}
inline IonCode **stubCode() {
@ -334,7 +337,7 @@ class IonOOLNativeGetterExitFrameLayout
return reinterpret_cast<Value*>(&loThis_);
}
inline uintptr_t argc() const {
return 0;
return argc_;
}
};

View File

@ -10,7 +10,7 @@
#define ION_FRAME_DOMGETTER ((IonCode *)0x1)
#define ION_FRAME_DOMSETTER ((IonCode *)0x2)
#define ION_FRAME_DOMMETHOD ((IonCode *)0x3)
#define ION_FRAME_OOL_NATIVE_GETTER ((IonCode *)0x4)
#define ION_FRAME_OOL_NATIVE ((IonCode *)0x4)
#define ION_FRAME_OOL_PROPERTY_OP ((IonCode *)0x5)
#define ION_FRAME_OOL_PROXY_GET ((IonCode *)0x6)

View File

@ -156,7 +156,7 @@ class IonExitFooterFrame
};
class IonNativeExitFrameLayout;
class IonOOLNativeGetterExitFrameLayout;
class IonOOLNativeExitFrameLayout;
class IonOOLPropertyOpExitFrameLayout;
class IonOOLProxyGetExitFrameLayout;
class IonDOMExitFrameLayout;
@ -194,8 +194,8 @@ class IonExitFrameLayout : public IonCommonFrameLayout
inline bool isNativeExit() {
return footer()->ionCode() == NULL;
}
inline bool isOOLNativeGetterExit() {
return footer()->ionCode() == ION_FRAME_OOL_NATIVE_GETTER;
inline bool isOOLNativeExit() {
return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
}
inline bool isOOLPropertyOpExit() {
return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
@ -216,9 +216,9 @@ class IonExitFrameLayout : public IonCommonFrameLayout
JS_ASSERT(isNativeExit());
return reinterpret_cast<IonNativeExitFrameLayout *>(footer());
}
inline IonOOLNativeGetterExitFrameLayout *oolNativeGetterExit() {
JS_ASSERT(isOOLNativeGetterExit());
return reinterpret_cast<IonOOLNativeGetterExitFrameLayout *>(footer());
inline IonOOLNativeExitFrameLayout *oolNativeExit() {
JS_ASSERT(isOOLNativeExit());
return reinterpret_cast<IonOOLNativeExitFrameLayout *>(footer());
}
inline IonOOLPropertyOpExitFrameLayout *oolPropertyOpExit() {
JS_ASSERT(isOOLPropertyOpExit());
@ -262,31 +262,34 @@ class IonNativeExitFrameLayout
}
};
class IonOOLNativeGetterExitFrameLayout
class IonOOLNativeExitFrameLayout
{
protected: // only to silence a clang warning about unused private fields
IonExitFooterFrame footer_;
IonExitFrameLayout exit_;
// pointer to root the stub's IonCode
IonCode *stubCode_;
uintptr_t argc_;
// We need to split the Value into 2 fields of 32 bits, otherwise the C++
// compiler may add some padding between the fields.
uint32_t loCalleeResult_;
uint32_t hiCalleeResult_;
// The frame includes the object argument.
// Split Value for |this| and args above.
uint32_t loThis_;
uint32_t hiThis_;
// pointer to root the stub's IonCode
IonCode *stubCode_;
public:
static inline size_t Size() {
return sizeof(IonOOLNativeGetterExitFrameLayout);
static inline size_t Size(size_t argc) {
// The Frame accounts for the callee/result and |this|, so we only needs args.
return sizeof(IonOOLNativeExitFrameLayout) + (argc * sizeof(Value));
}
static size_t offsetOfResult() {
return offsetof(IonOOLNativeGetterExitFrameLayout, loCalleeResult_);
return offsetof(IonOOLNativeExitFrameLayout, loCalleeResult_);
}
inline IonCode **stubCode() {
@ -298,9 +301,8 @@ class IonOOLNativeGetterExitFrameLayout
inline Value *thisp() {
return reinterpret_cast<Value*>(&loThis_);
}
inline uintptr_t argc() const {
return 0;
return argc_;
}
};