Add CallTree builtin.

This commit is contained in:
Andreas Gal
2008-08-06 15:56:31 -07:00
parent 12226c68d0
commit d5ca3eca00
2 changed files with 16 additions and 0 deletions

View File

@@ -56,6 +56,7 @@
#include "nanojit/avmplus.h"
#include "nanojit/nanojit.h"
using namespace avmplus;
using namespace nanojit;
jsdouble FASTCALL builtin_dmod(jsdouble a, jsdouble b)
@@ -301,6 +302,20 @@ builtin_CloseIterator(JSContext* cx, jsval v)
return js_CloseIterator(cx, v);
}
GuardRecord* FASTCALL
builtin_CallTree(InterpState* outer, Fragment* f)
{
InterpState state;
state.ip = f->ip;
state.sp = outer->sp;
state.rp = outer->rp;
state.gp = outer->gp;
state.cx = outer->cx;
union { NIns *code; GuardRecord* (FASTCALL *func)(InterpState*, Fragment*); } u;
u.code = f->code();
return u.func(&state, NULL);
}
#define LO ARGSIZE_LO
#define F ARGSIZE_F
#define Q ARGSIZE_Q