Stricter typing of the tracker code path which now only accepts jsval as suggested by Brendan.

This commit is contained in:
Andreas Gal 2008-07-09 00:29:23 -07:00
parent 19a2dcb6f5
commit 05554d05b3
2 changed files with 12 additions and 12 deletions

View File

@ -496,7 +496,7 @@ TraceRecorder::getCallDepth() const
/* Find the frame that this address belongs to (if any). */
JSStackFrame*
TraceRecorder::findFrame(void* p) const
TraceRecorder::findFrame(jsval* p) const
{
jsval* vp = (jsval*) p;
JSStackFrame* fp = cx->fp;
@ -517,14 +517,14 @@ TraceRecorder::findFrame(void* p) const
/* Determine whether an address is part of a currently active frame (or the global scope). */
bool
TraceRecorder::onFrame(void* p) const
TraceRecorder::onFrame(jsval* p) const
{
return isGlobal(p) || findFrame(p) != NULL;
}
/* Determine whether an address points to a global variable (gvar). */
bool
TraceRecorder::isGlobal(void* p) const
TraceRecorder::isGlobal(jsval* p) const
{
JSObject* varobj = global->varobj;
@ -558,7 +558,7 @@ TraceRecorder::nativeFrameSlots(JSStackFrame* fp, JSFrameRegs& regs) const
/* Determine the offset in the native frame (marshal) for an address
that is part of a currently active frame. */
size_t
TraceRecorder::nativeFrameOffset(void* p) const
TraceRecorder::nativeFrameOffset(jsval* p) const
{
JSStackFrame* currentFrame = cx->fp;
size_t offset = 0;
@ -735,7 +735,7 @@ TraceRecorder::import(jsval* p, uint8& t, char *prefix, int index)
/* Update the tracker. If the value is part of any argv/vars/stack of any
currently active frame (onFrame), then issue a write back store. */
void
TraceRecorder::set(void* p, LIns* i)
TraceRecorder::set(jsval* p, LIns* i)
{
tracker.set(p, i);
if (onFrame(p))
@ -743,7 +743,7 @@ TraceRecorder::set(void* p, LIns* i)
}
LIns*
TraceRecorder::get(void* p)
TraceRecorder::get(jsval* p)
{
return tracker.get(p);
}

View File

@ -127,18 +127,18 @@ class TraceRecorder {
nanojit::SideExit exit;
bool recompileFlag;
JSStackFrame* findFrame(void* p) const;
bool onFrame(void* p) const;
bool isGlobal(void* p) const;
JSStackFrame* findFrame(jsval* p) const;
bool onFrame(jsval* p) const;
bool isGlobal(jsval* p) const;
unsigned nativeFrameSlots(JSStackFrame* fp, JSFrameRegs& regs) const;
size_t nativeFrameOffset(void* p) const;
size_t nativeFrameOffset(jsval* p) const;
void import(jsval* p, uint8& t, char *prefix, int index);
void trackNativeFrameUse(unsigned slots);
unsigned getCallDepth() const;
void guard(bool expected, nanojit::LIns* cond);
void set(void* p, nanojit::LIns* l);
void set(jsval* p, nanojit::LIns* l);
bool checkType(jsval& v, uint8& type);
bool verifyTypeStability(JSStackFrame* entryFrame, JSStackFrame* currentFrame, uint8* m);
@ -201,7 +201,7 @@ public:
nanojit::Fragment* getFragment() const;
nanojit::SideExit* snapshot();
nanojit::LIns* get(void* p);
nanojit::LIns* get(jsval* p);
bool loopEdge();
void stop();