Bug 877281 another followup for the Windows bustage. r=jandem pending

This commit is contained in:
Boris Zbarsky 2013-06-08 00:06:39 -04:00
parent 8aa1bc1906
commit 51217ccdd9
4 changed files with 33 additions and 19 deletions

View File

@ -1423,9 +1423,9 @@ CodeGenerator::visitCallDOMNative(LCallDOMNative *call)
// Now compute the argv value. Since StackPointer is pointing to &vp[0] and
// argv is &vp[2] we just need to add 2*sizeof(Value) to the current
// StackPointer.
JS_STATIC_ASSERT(JSJitMethodCallArgs::offsetOfArgv() == 0);
JS_STATIC_ASSERT(JSJitMethodCallArgs::offsetOfArgc() ==
IonDOMMethodExitFrameLayout::offsetOfArgcFromArgv());
JS_STATIC_ASSERT(JSJitMethodCallArgsTraits::offsetOfArgv == 0);
JS_STATIC_ASSERT(JSJitMethodCallArgsTraits::offsetOfArgc ==
IonDOMMethodExitFrameLayoutTraits::offsetOfArgcFromArgv);
masm.computeEffectiveAddress(Address(StackPointer, 2 * sizeof(Value)), argArgs);
// GetReservedSlot(obj, DOM_OBJECT_SLOT).toPrivate()

View File

@ -462,6 +462,8 @@ class IonDOMExitFrameLayout
}
};
struct IonDOMMethodExitFrameLayoutTraits;
class IonDOMMethodExitFrameLayout
{
IonExitFooterFrame footer_;
@ -477,6 +479,8 @@ class IonDOMMethodExitFrameLayout
uint32_t loCalleeResult_;
uint32_t hiCalleeResult_;
friend struct IonDOMMethodExitFrameLayoutTraits;
public:
static inline size_t Size() {
return sizeof(IonDOMMethodExitFrameLayout);
@ -485,10 +489,7 @@ class IonDOMMethodExitFrameLayout
static size_t offsetOfResult() {
return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
}
static size_t offsetOfArgcFromArgv() {
return offsetof(IonDOMMethodExitFrameLayout, argc_) -
offsetof(IonDOMMethodExitFrameLayout, argv_);
}
inline Value *vp() {
// The code in visitCallDOMNative depends on this static assert holding
JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
@ -503,6 +504,12 @@ class IonDOMMethodExitFrameLayout
}
};
struct IonDOMMethodExitFrameLayoutTraits {
static const size_t offsetOfArgcFromArgv =
offsetof(IonDOMMethodExitFrameLayout, argc_) -
offsetof(IonDOMMethodExitFrameLayout, argv_);
};
// An invalidation bailout stack is at the stack pointer for the callee frame.
class InvalidationBailoutStack
{

View File

@ -427,6 +427,8 @@ class IonDOMExitFrameLayout
}
};
struct IonDOMMethodExitFrameLayoutTraits;
class IonDOMMethodExitFrameLayout
{
protected: // only to silence a clang warning about unused private fields
@ -443,6 +445,8 @@ class IonDOMMethodExitFrameLayout
uint32_t loCalleeResult_;
uint32_t hiCalleeResult_;
friend struct IonDOMMethodExitFrameLayoutTraits;
public:
static inline size_t Size() {
return sizeof(IonDOMMethodExitFrameLayout);
@ -451,10 +455,6 @@ class IonDOMMethodExitFrameLayout
static size_t offsetOfResult() {
return offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_);
}
static size_t offsetOfArgcFromArgv() {
return offsetof(IonDOMMethodExitFrameLayout, argc_) -
offsetof(IonDOMMethodExitFrameLayout, argv_);
}
inline Value *vp() {
JS_STATIC_ASSERT(offsetof(IonDOMMethodExitFrameLayout, loCalleeResult_) ==
@ -469,6 +469,12 @@ class IonDOMMethodExitFrameLayout
}
};
struct IonDOMMethodExitFrameLayoutTraits {
static const size_t offsetOfArgcFromArgv =
offsetof(IonDOMMethodExitFrameLayout, argc_) -
offsetof(IonDOMMethodExitFrameLayout, argv_);
};
class IonOsrFrameLayout : public IonJSFrameLayout
{
public:

View File

@ -1480,6 +1480,8 @@ class JSJitSetterCallArgs : protected JS::MutableHandleValue
// Add get() or maybe hasDefined() as needed
};
struct JSJitMethodCallArgsTraits;
/*
* A class, expected to be passed by reference, which represents the CallArgs
* for a JSJitMethodOp.
@ -1488,6 +1490,7 @@ class JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUse
{
private:
typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;
friend struct JSJitMethodCallArgsTraits;
public:
explicit JSJitMethodCallArgs(const JS::CallArgs& args) {
@ -1509,17 +1512,15 @@ class JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUse
return Base::hasDefined(i);
}
static size_t offsetOfArgv() {
return offsetof(JSJitMethodCallArgs, argv_);
}
static size_t offsetOfArgc() {
return offsetof(JSJitMethodCallArgs, argc_);
}
// Add get() as needed
};
struct JSJitMethodCallArgsTraits
{
static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);
static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);
};
/*
* This struct contains metadata passed from the DOM to the JS Engine for JIT
* optimizations on DOM property accessors. Eventually, this should be made