Merge with be's last push.

This commit is contained in:
Andreas Gal 2008-06-11 18:13:43 -07:00
commit 448d1ba7e3
3 changed files with 20 additions and 11 deletions

View File

@ -54,18 +54,18 @@ js_GetRecorder(JSContext* cx)
JSBool ok =
#endif
JS_ExecuteScript(cx, JS_GetGlobalObject(cx), script, &result);
JS_ASSERT(ok && JSVAL_IS_OBJECT(result));
JS_ASSERT(ok && !JSVAL_IS_PRIMITIVE(result));
return tm->recorder = JSVAL_TO_OBJECT(result);
}
void
js_CallRecorder(JSContext* cx, const char* fn, uintN argc, jsval* argv)
js_CallRecorder(JSContext* cx, const char* name, uintN argc, jsval* argv)
{
jsval rval;
#ifdef DEBUG
JSBool ok =
#endif
JS_CallFunctionName(cx, js_GetRecorder(cx), fn, argc, argv, &rval);
JS_CallFunctionName(cx, js_GetRecorder(cx), name, argc, argv, &rval);
JS_ASSERT(ok);
}

View File

@ -59,20 +59,30 @@ struct JSTraceMonitor {
#define TRACE_TRIGGER_MASK 0x3f
void js_CallRecorder(JSContext* cx, const char* fn, uintN argc, jsval* argv);
void js_CallRecorder(JSContext* cx, const char* fn, jsval a);
void js_CallRecorder(JSContext* cx, const char* fn, jsval a, jsval b);
void
js_CallRecorder(JSContext* cx, const char* name, uintN argc, jsval* argv);
bool js_GetRecorderError(JSContext* cx);
void
js_CallRecorder(JSContext* cx, const char* name, jsval a);
void
js_CallRecorder(JSContext* cx, const char* name, jsval a, jsval b);
bool
js_GetRecorderError(JSContext* cx);
/*
* The recorder needs to keep track of native machine addresses. This mapping
* only works for aligned pointers.
* The recorder needs to keep track of native machine addresses, including
* bytecode addresses which are currently arbitrarily byte-aligned. Therefore
* we cannot use PRIVATE_TO_JSVAL, which assumes at least (0 mod 2) alignment
* and unconditionally sets the least significant (JSVAL_INT) bit. Instead, we
* risk lopping off the most significant bit (or bits on 64-bit systems).
*/
static inline jsval
native_pointer_to_jsval(void* p)
{
return INT_TO_JSVAL(((uint32)p) >> 2);
return INT_TO_JSVAL(JS_PTR_TO_UINT32(p));
}
#endif /* jstracer_h___ */

View File

@ -62,7 +62,6 @@
b); \
JS_END_MACRO
static inline void
prim_push_stack(JSContext* cx, JSFrameRegs& regs, jsval& v)
{