mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891215 (part 10) - Slim down IonFrames-inl.h. r=terrence.
--HG-- extra : rebase_source : 4f47ec9244cbfa8e359d792e5ba825bfaad2db57
This commit is contained in:
parent
1edc87a1fd
commit
f7f6c920e8
@ -110,7 +110,10 @@ class IonFrameIterator
|
||||
return current_;
|
||||
}
|
||||
|
||||
inline IonCommonFrameLayout *current() const;
|
||||
IonCommonFrameLayout *current() const {
|
||||
return (IonCommonFrameLayout *)current_;
|
||||
}
|
||||
|
||||
inline uint8_t *returnAddress() const;
|
||||
|
||||
IonJSFrameLayout *jsFrame() const {
|
||||
@ -177,7 +180,10 @@ class IonFrameIterator
|
||||
|
||||
// Returns the stack space used by the current frame, in bytes. This does
|
||||
// not include the size of its fixed header.
|
||||
inline size_t frameSize() const;
|
||||
size_t frameSize() const {
|
||||
JS_ASSERT(type_ != IonFrame_Exit);
|
||||
return frameSize_;
|
||||
}
|
||||
|
||||
// Functions used to iterate on frames. When prevType is IonFrame_Entry,
|
||||
// the current frame is the last frame.
|
||||
|
@ -26,37 +26,6 @@ SafepointIndex::resolve()
|
||||
resolved = true;
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
SizeOfFramePrefix(FrameType type)
|
||||
{
|
||||
switch (type) {
|
||||
case IonFrame_Entry:
|
||||
return IonEntryFrameLayout::Size();
|
||||
case IonFrame_BaselineJS:
|
||||
case IonFrame_OptimizedJS:
|
||||
case IonFrame_Unwound_OptimizedJS:
|
||||
return IonJSFrameLayout::Size();
|
||||
case IonFrame_BaselineStub:
|
||||
return IonBaselineStubFrameLayout::Size();
|
||||
case IonFrame_Rectifier:
|
||||
return IonRectifierFrameLayout::Size();
|
||||
case IonFrame_Unwound_Rectifier:
|
||||
return IonUnwoundRectifierFrameLayout::Size();
|
||||
case IonFrame_Exit:
|
||||
return IonExitFrameLayout::Size();
|
||||
case IonFrame_Osr:
|
||||
return IonOsrFrameLayout::Size();
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("unknown frame type");
|
||||
}
|
||||
}
|
||||
|
||||
inline IonCommonFrameLayout *
|
||||
IonFrameIterator::current() const
|
||||
{
|
||||
return (IonCommonFrameLayout *)current_;
|
||||
}
|
||||
|
||||
inline uint8_t *
|
||||
IonFrameIterator::returnAddress() const
|
||||
{
|
||||
@ -96,45 +65,6 @@ IonFrameIterator::exitFrame() const
|
||||
return (IonExitFrameLayout *) fp();
|
||||
}
|
||||
|
||||
size_t
|
||||
IonFrameIterator::frameSize() const
|
||||
{
|
||||
JS_ASSERT(type_ != IonFrame_Exit);
|
||||
return frameSize_;
|
||||
}
|
||||
|
||||
// Returns the JSScript associated with the topmost Ion frame.
|
||||
inline JSScript *
|
||||
GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
|
||||
{
|
||||
IonFrameIterator iter(pt->ionTop);
|
||||
JS_ASSERT(iter.type() == IonFrame_Exit);
|
||||
++iter;
|
||||
|
||||
// If needed, grab the safepoint index.
|
||||
if (safepointIndexOut)
|
||||
*safepointIndexOut = iter.safepoint();
|
||||
|
||||
JS_ASSERT(iter.returnAddressToFp() != NULL);
|
||||
if (returnAddrOut)
|
||||
*returnAddrOut = (void *) iter.returnAddressToFp();
|
||||
|
||||
if (iter.isBaselineStub()) {
|
||||
++iter;
|
||||
JS_ASSERT(iter.isBaselineJS());
|
||||
}
|
||||
|
||||
JS_ASSERT(iter.isScripted());
|
||||
return iter.script();
|
||||
}
|
||||
|
||||
|
||||
inline JSScript *
|
||||
GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
|
||||
{
|
||||
return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut);
|
||||
}
|
||||
|
||||
inline BaselineFrame *
|
||||
GetTopBaselineFrame(JSContext *cx)
|
||||
{
|
||||
|
@ -233,6 +233,31 @@ IonFrameIterator::actualArgs() const
|
||||
return jsFrame()->argv() + 1;
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
SizeOfFramePrefix(FrameType type)
|
||||
{
|
||||
switch (type) {
|
||||
case IonFrame_Entry:
|
||||
return IonEntryFrameLayout::Size();
|
||||
case IonFrame_BaselineJS:
|
||||
case IonFrame_OptimizedJS:
|
||||
case IonFrame_Unwound_OptimizedJS:
|
||||
return IonJSFrameLayout::Size();
|
||||
case IonFrame_BaselineStub:
|
||||
return IonBaselineStubFrameLayout::Size();
|
||||
case IonFrame_Rectifier:
|
||||
return IonRectifierFrameLayout::Size();
|
||||
case IonFrame_Unwound_Rectifier:
|
||||
return IonUnwoundRectifierFrameLayout::Size();
|
||||
case IonFrame_Exit:
|
||||
return IonExitFrameLayout::Size();
|
||||
case IonFrame_Osr:
|
||||
return IonOsrFrameLayout::Size();
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("unknown frame type");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
IonFrameIterator::prevFp() const
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
|
||||
#include "jscntxt.h"
|
||||
#include "jsfun.h"
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
@ -284,6 +285,37 @@ MakeFrameDescriptor(uint32_t frameSize, FrameType type)
|
||||
return (frameSize << FRAMESIZE_SHIFT) | type;
|
||||
}
|
||||
|
||||
// Returns the JSScript associated with the topmost Ion frame.
|
||||
inline JSScript *
|
||||
GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
|
||||
{
|
||||
IonFrameIterator iter(pt->ionTop);
|
||||
JS_ASSERT(iter.type() == IonFrame_Exit);
|
||||
++iter;
|
||||
|
||||
// If needed, grab the safepoint index.
|
||||
if (safepointIndexOut)
|
||||
*safepointIndexOut = iter.safepoint();
|
||||
|
||||
JS_ASSERT(iter.returnAddressToFp() != NULL);
|
||||
if (returnAddrOut)
|
||||
*returnAddrOut = (void *) iter.returnAddressToFp();
|
||||
|
||||
if (iter.isBaselineStub()) {
|
||||
++iter;
|
||||
JS_ASSERT(iter.isBaselineJS());
|
||||
}
|
||||
|
||||
JS_ASSERT(iter.isScripted());
|
||||
return iter.script();
|
||||
}
|
||||
|
||||
inline JSScript *
|
||||
GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
|
||||
{
|
||||
return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut);
|
||||
}
|
||||
|
||||
} // namespace ion
|
||||
} // namespace js
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user