2008-05-28 19:07:25 -07:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2008-06-03 14:48:47 -07:00
|
|
|
* vim: set ts=8 sw=4 et tw=79:
|
2008-05-28 19:07:25 -07:00
|
|
|
*
|
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla SpiderMonkey JavaScript 1.9 code, released
|
|
|
|
* May 28, 2008.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Brendan Eich <brendan@mozilla.org
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#define jstracer_cpp___
|
|
|
|
|
2008-06-21 14:55:32 -07:00
|
|
|
#include "nanojit/avmplus.h"
|
|
|
|
#include "nanojit/nanojit.h"
|
|
|
|
|
|
|
|
using namespace nanojit;
|
|
|
|
|
2008-05-28 19:07:25 -07:00
|
|
|
#include "jsinterp.cpp"
|
2008-05-30 10:11:56 -07:00
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
Tracker::Tracker()
|
2008-06-03 21:01:23 -07:00
|
|
|
{
|
2008-06-21 14:55:32 -07:00
|
|
|
pagelist = 0;
|
|
|
|
}
|
2008-06-10 21:40:47 -07:00
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
Tracker::~Tracker()
|
2008-06-21 14:55:32 -07:00
|
|
|
{
|
|
|
|
clear();
|
2008-06-03 21:01:23 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
long
|
|
|
|
Tracker::getPageBase(const void* v) const
|
2008-06-03 21:01:23 -07:00
|
|
|
{
|
2008-06-21 14:55:32 -07:00
|
|
|
return ((long)v) & (~(NJ_PAGE_SIZE-1));
|
2008-06-04 00:09:57 -07:00
|
|
|
}
|
2008-06-11 11:29:35 -07:00
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
struct Tracker::Page*
|
|
|
|
Tracker::findPage(const void* v) const
|
2008-06-11 11:29:35 -07:00
|
|
|
{
|
2008-06-21 14:55:32 -07:00
|
|
|
long base = getPageBase(v);
|
|
|
|
struct Tracker::Page* p = pagelist;
|
|
|
|
while (p) {
|
2008-06-22 23:42:54 -07:00
|
|
|
if (p->base == base)
|
2008-06-21 14:55:32 -07:00
|
|
|
return p;
|
|
|
|
p = p->next;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
struct Tracker::Page*
|
|
|
|
Tracker::addPage(const void* v) {
|
2008-06-21 14:55:32 -07:00
|
|
|
long base = getPageBase(v);
|
2008-06-26 20:44:23 -07:00
|
|
|
struct Tracker::Page* p = (struct Tracker::Page*)
|
|
|
|
GC::Alloc(sizeof(struct Tracker::Page) + (NJ_PAGE_SIZE >> 2) * sizeof(LInsp));
|
2008-06-21 14:55:32 -07:00
|
|
|
p->base = base;
|
|
|
|
p->next = pagelist;
|
|
|
|
pagelist = p;
|
|
|
|
return p;
|
2008-06-11 11:29:35 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
void
|
|
|
|
Tracker::clear()
|
2008-06-11 11:29:35 -07:00
|
|
|
{
|
2008-06-21 14:55:32 -07:00
|
|
|
while (pagelist) {
|
|
|
|
Page* p = pagelist;
|
|
|
|
pagelist = pagelist->next;
|
|
|
|
GC::Free(p);
|
|
|
|
}
|
2008-06-11 11:29:35 -07:00
|
|
|
}
|
2008-06-11 17:59:28 -07:00
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
LIns*
|
|
|
|
Tracker::get(const void* v) const
|
2008-06-21 14:55:32 -07:00
|
|
|
{
|
2008-06-26 20:44:23 -07:00
|
|
|
struct Tracker::Page* p = findPage(v);
|
2008-06-21 14:55:32 -07:00
|
|
|
JS_ASSERT(p != 0); /* we must have a page for the slot we are looking for */
|
2008-06-26 20:44:23 -07:00
|
|
|
LIns* i = p->map[(((long)v) & 0xfff) >> 2];
|
2008-06-22 19:58:24 -07:00
|
|
|
JS_ASSERT(i != 0);
|
|
|
|
return i;
|
2008-06-21 14:55:32 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 20:44:23 -07:00
|
|
|
void
|
|
|
|
Tracker::set(const void* v, LIns* ins)
|
2008-06-11 20:22:00 -07:00
|
|
|
{
|
2008-06-21 14:55:32 -07:00
|
|
|
struct Tracker::Page* p = findPage(v);
|
2008-06-22 23:42:54 -07:00
|
|
|
if (!p)
|
2008-06-21 14:55:32 -07:00
|
|
|
p = addPage(v);
|
2008-06-26 20:44:23 -07:00
|
|
|
p->map[(((long)v) & 0xfff) >> 2] = ins;
|
2008-06-11 20:22:00 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 22:19:11 -07:00
|
|
|
FrameStack::FrameStack(JSStackFrame& entryFrame)
|
|
|
|
{
|
|
|
|
depth = 0;
|
|
|
|
enter(entryFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
FrameStack::~FrameStack()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
FrameStack::enter(JSStackFrame& frame)
|
|
|
|
{
|
|
|
|
if (depth >= (sizeof(stack)/sizeof(JSStackFrame*)))
|
|
|
|
return false;
|
|
|
|
stack[depth++] = &frame;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
FrameStack::leave()
|
|
|
|
{
|
|
|
|
JS_ASSERT(depth > 0);
|
|
|
|
--depth;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Find the frame that this address belongs to (if any). */
|
|
|
|
JSStackFrame*
|
|
|
|
FrameStack::findFrame(void* p) const
|
|
|
|
{
|
|
|
|
for (uint32 n = 0; n < depth; ++n) {
|
|
|
|
JSStackFrame* fp = stack[n];
|
|
|
|
if ((p >= &fp->argv[0] && p < &fp->argv[fp->argc]) ||
|
|
|
|
(p >= &fp->vars[0] && p < &fp->vars[fp->nvars]) ||
|
|
|
|
(p >= &fp->spbase[0] && p < &fp->spbase[fp->script->depth]))
|
|
|
|
return fp;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Determine whether an address is part of a currently active frame. */
|
|
|
|
bool
|
|
|
|
FrameStack::contains(void* p) const
|
|
|
|
{
|
|
|
|
return findFrame(p) != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Determine the offset in the native frame (marshal) for an address
|
|
|
|
that is part of a currently active frame. */
|
|
|
|
int
|
|
|
|
FrameStack::nativeOffset(void* p) const
|
|
|
|
{
|
|
|
|
JSStackFrame* fp = findFrame(p);
|
|
|
|
JS_ASSERT(fp == stack[0]); // todo: calculate nested frame offsets
|
|
|
|
if (p >= &fp->argv[0] && p < &fp->argv[fp->argc])
|
2008-06-26 22:25:30 -07:00
|
|
|
return uint32_t((jsval*)p - &fp->argv[0]) * sizeof(long);
|
2008-06-26 22:19:11 -07:00
|
|
|
if (p >= &fp->vars[0] && p < &fp->vars[fp->nvars])
|
2008-06-26 22:25:30 -07:00
|
|
|
return (fp->argc + uint32_t((jsval*)p - &fp->vars[0])) * sizeof(long);
|
2008-06-26 22:19:11 -07:00
|
|
|
JS_ASSERT((p >= &fp->spbase[0] && p < &fp->spbase[fp->script->depth]));
|
2008-06-26 22:25:30 -07:00
|
|
|
return (fp->argc + fp->nvars + uint32_t((jsval*)p - &fp->spbase[0])) * sizeof(long);
|
2008-06-26 22:19:11 -07:00
|
|
|
}
|
|
|
|
|
2008-06-21 14:55:32 -07:00
|
|
|
using namespace avmplus;
|
|
|
|
using namespace nanojit;
|
|
|
|
|
|
|
|
static avmplus::AvmCore* core = new avmplus::AvmCore();
|
|
|
|
static GC gc = GC();
|
|
|
|
|
|
|
|
#define LO ARGSIZE_LO
|
|
|
|
#define F ARGSIZE_F
|
|
|
|
#define Q ARGSIZE_Q
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define NAME(op) ,#op
|
|
|
|
#else
|
|
|
|
#define NAME(op)
|
|
|
|
#endif
|
|
|
|
|
2008-06-22 19:58:24 -07:00
|
|
|
#define BUILTIN1(op, at0, atr, tr, t0, cse, fold) \
|
|
|
|
{ 0, (at0 | (atr << 2)), cse, fold NAME(op) },
|
|
|
|
#define BUILTIN2(op, at0, at1, atr, tr, t0, t1, cse, fold) \
|
|
|
|
{ 0, (at0 | (at1 << 2) | (atr << 4)), cse, fold NAME(op) },
|
|
|
|
#define BUILTIN3(op, at0, at1, at2, atr, tr, t0, t1, t2, cse, fold) \
|
|
|
|
{ 0, (at0 | (at1 << 2) | (at2 << 4) | (atr << 6)), cse, fold NAME(op) },
|
2008-06-21 14:55:32 -07:00
|
|
|
|
|
|
|
static struct CallInfo builtins[] = {
|
|
|
|
#include "builtins.tbl"
|
2008-06-22 23:42:54 -07:00
|
|
|
};
|
2008-06-21 14:55:32 -07:00
|
|
|
|
2008-06-22 23:42:54 -07:00
|
|
|
#undef NAME
|
2008-06-21 14:55:32 -07:00
|
|
|
#undef BUILTIN1
|
|
|
|
#undef BUILTIN2
|
2008-06-22 23:42:54 -07:00
|
|
|
#undef BUILTIN3
|
2008-06-21 14:55:32 -07:00
|
|
|
|
2008-06-26 22:33:33 -07:00
|
|
|
TraceRecorder::TraceRecorder(JSStackFrame& _stackFrame, JSFrameRegs& _entryState) :
|
|
|
|
frameStack(_stackFrame)
|
|
|
|
{
|
|
|
|
entryState = _entryState;
|
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::load(void* p)
|
2008-06-26 22:19:11 -07:00
|
|
|
{
|
2008-06-26 22:33:33 -07:00
|
|
|
JS_ASSERT(frameStack.contains(p));
|
|
|
|
tracker.set(p, lir->insLoadi(tracker.get(&entryState.sp), frameStack.nativeOffset(p)));
|
2008-06-26 22:19:11 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::init(void* p, LIns* i)
|
2008-06-26 22:41:10 -07:00
|
|
|
{
|
|
|
|
tracker.set(p, i);
|
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::set(void* p, LIns* i)
|
2008-06-26 22:41:10 -07:00
|
|
|
{
|
|
|
|
init(p, i);
|
|
|
|
if (frameStack.contains(p))
|
|
|
|
lir->insStorei(i, get(&entryState.sp), frameStack.nativeOffset(p));
|
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
LIns*
|
|
|
|
TraceRecorder::get(void* p)
|
2008-06-26 22:41:10 -07:00
|
|
|
{
|
|
|
|
return tracker.get(p);
|
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::copy(void* a, void* v)
|
|
|
|
{
|
|
|
|
set(v, get(a));
|
|
|
|
}
|
|
|
|
|
2008-06-27 00:22:16 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::imm(jsint i, void* v)
|
|
|
|
{
|
|
|
|
set(v, lir->insImm(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::imm(jsdouble d, void* v)
|
|
|
|
{
|
|
|
|
set(v, lir->insImmq(*(uint64_t*)&d));
|
|
|
|
}
|
|
|
|
|
2008-06-26 22:58:57 -07:00
|
|
|
void
|
|
|
|
TraceRecorder::unary(nanojit::LOpcode op, void* a, void* v)
|
|
|
|
{
|
|
|
|
set(v, lir->ins1(op, get(a)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::binary(nanojit::LOpcode op, void* a, void* b, void* v)
|
|
|
|
{
|
|
|
|
set(v, lir->ins2(op, get(a), get(b)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::call(int id, void* a, void* v)
|
|
|
|
{
|
|
|
|
LInsp args[] = { get(a) };
|
|
|
|
set(v, lir->insCall(id, args));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::call(int id, void* a, void* b, void* v)
|
|
|
|
{
|
|
|
|
LInsp args[] = { get(a), get(b) };
|
|
|
|
set(v, lir->insCall(id, args));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::call(int id, void* a, void* b, void* c, void* v)
|
|
|
|
{
|
|
|
|
LInsp args[] = { get(a), get(b), get(c) };
|
|
|
|
set(v, lir->insCall(id, args));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-06-27 00:22:16 -07:00
|
|
|
TraceRecorder::iinc(void* a, int incr, void* v, JSFrameRegs& regs)
|
|
|
|
{
|
|
|
|
LIns* ov = lir->ins2(LIR_add, get(a), lir->insImm(incr));
|
2008-06-27 00:34:50 -07:00
|
|
|
// This check is actually supposed to happen in can_do_inc_dec, however,
|
|
|
|
// we arrive at iinc only if can_do_inc_dec passed, so we know that this
|
|
|
|
// guard must evaluate to false in the trace. We delay setting v to the
|
|
|
|
// result of the calculation until after the guard to make sure the
|
|
|
|
// result is not communicated to the interpreter in case this guard
|
|
|
|
// fails (as it was supposed to execute _before_ the add, not after.)
|
|
|
|
guard_ov(false, a, regs);
|
2008-06-27 00:22:16 -07:00
|
|
|
set(v, ov);
|
|
|
|
}
|
|
|
|
|
|
|
|
SideExit*
|
|
|
|
TraceRecorder::snapshot(SideExit& exit, JSFrameRegs& regs)
|
|
|
|
{
|
|
|
|
memset(&exit, 0, sizeof(exit));
|
|
|
|
exit.from = fragment;
|
|
|
|
return &exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::guard_0(bool ok, void* a, JSFrameRegs& regs)
|
|
|
|
{
|
|
|
|
SideExit exit;
|
2008-06-27 00:34:50 -07:00
|
|
|
lir->insGuard(ok ? LIR_xf : LIR_xt,
|
|
|
|
get(a),
|
|
|
|
snapshot(exit, regs));
|
2008-06-27 00:22:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::guard_h(bool ok, void* a, JSFrameRegs& regs)
|
2008-06-26 22:58:57 -07:00
|
|
|
{
|
2008-06-27 00:22:16 -07:00
|
|
|
SideExit exit;
|
2008-06-27 00:34:50 -07:00
|
|
|
lir->insGuard(ok ? LIR_xf : LIR_xt,
|
|
|
|
lir->ins1(LIR_callh, get(a)),
|
|
|
|
snapshot(exit, regs));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
TraceRecorder::guard_ov(bool ok, void* a, JSFrameRegs& regs)
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
SideExit exit;
|
|
|
|
lir->insGuard(ok ? LIR_xf : LIR_xt,
|
|
|
|
lir->ins1(LIR_ov, get(a)),
|
|
|
|
snapshot(exit, regs));
|
|
|
|
#endif
|
2008-06-26 22:58:57 -07:00
|
|
|
}
|
|
|
|
|
2008-06-26 20:37:28 -07:00
|
|
|
bool
|
2008-06-22 09:30:04 -07:00
|
|
|
js_StartRecording(JSContext* cx, JSFrameRegs& regs)
|
2008-06-11 20:22:00 -07:00
|
|
|
{
|
2008-06-22 23:42:54 -07:00
|
|
|
JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx);
|
2008-06-26 20:37:28 -07:00
|
|
|
|
2008-06-21 14:55:32 -07:00
|
|
|
if (!tm->fragmento) {
|
2008-06-21 23:45:16 -07:00
|
|
|
Fragmento* fragmento = new (&gc) Fragmento(core);
|
2008-06-22 23:59:41 -07:00
|
|
|
#ifdef DEBUG
|
2008-06-21 23:45:16 -07:00
|
|
|
fragmento->labels = new (&gc) LabelMap(core, NULL);
|
2008-06-22 23:59:41 -07:00
|
|
|
#endif
|
2008-06-21 23:45:16 -07:00
|
|
|
fragmento->assm()->setCallTable(builtins);
|
|
|
|
tm->fragmento = fragmento;
|
2008-06-22 23:42:54 -07:00
|
|
|
}
|
2008-06-21 14:55:32 -07:00
|
|
|
|
2008-06-26 22:19:11 -07:00
|
|
|
TraceRecorder* recorder = new TraceRecorder(*cx->fp, regs);
|
2008-06-26 20:37:28 -07:00
|
|
|
tm->recorder = recorder;
|
2008-06-22 23:42:54 -07:00
|
|
|
|
2008-06-21 14:55:32 -07:00
|
|
|
InterpState state;
|
|
|
|
state.ip = NULL;
|
|
|
|
state.sp = NULL;
|
|
|
|
state.rp = NULL;
|
|
|
|
state.f = NULL;
|
|
|
|
|
|
|
|
Fragment* fragment = tm->fragmento->getLoop(state);
|
|
|
|
LirBuffer* lirbuf = new (&gc) LirBuffer(tm->fragmento, builtins);
|
2008-06-22 23:59:41 -07:00
|
|
|
#ifdef DEBUG
|
2008-06-21 23:45:16 -07:00
|
|
|
lirbuf->names = new (&gc) LirNameMap(&gc, builtins, tm->fragmento->labels);
|
2008-06-22 23:59:41 -07:00
|
|
|
#endif
|
2008-06-21 14:55:32 -07:00
|
|
|
fragment->lirbuf = lirbuf;
|
|
|
|
LirWriter* lir = new (&gc) LirBufWriter(lirbuf);
|
|
|
|
lir->ins0(LIR_trace);
|
|
|
|
fragment->param0 = lir->insImm8(LIR_param, Assembler::argRegs[0], 0);
|
|
|
|
fragment->param1 = lir->insImm8(LIR_param, Assembler::argRegs[1], 0);
|
2008-06-26 22:19:11 -07:00
|
|
|
|
|
|
|
recorder->fragment = fragment;
|
|
|
|
recorder->lir = lir;
|
2008-06-21 14:55:32 -07:00
|
|
|
|
2008-06-26 22:41:10 -07:00
|
|
|
recorder->init(cx, lir->insLoadi(fragment->param0, 0));
|
|
|
|
recorder->init(&recorder->entryState.sp, lir->insLoadi(fragment->param0, 4));
|
2008-06-21 14:55:32 -07:00
|
|
|
|
2008-06-26 22:19:11 -07:00
|
|
|
JSStackFrame* fp = cx->fp;
|
2008-06-21 14:55:32 -07:00
|
|
|
unsigned n;
|
|
|
|
for (n = 0; n < fp->argc; ++n)
|
2008-06-26 22:33:33 -07:00
|
|
|
recorder->load(&fp->argv[n]);
|
2008-06-26 20:37:28 -07:00
|
|
|
for (n = 0; n < fp->nvars; ++n)
|
2008-06-26 22:33:33 -07:00
|
|
|
recorder->load(&fp->vars[n]);
|
2008-06-21 14:55:32 -07:00
|
|
|
for (n = 0; n < (unsigned)(regs.sp - fp->spbase); ++n)
|
2008-06-26 22:33:33 -07:00
|
|
|
recorder->load(&fp->spbase[n]);
|
2008-06-22 23:42:54 -07:00
|
|
|
|
2008-06-26 20:37:28 -07:00
|
|
|
return true;
|
2008-06-11 20:22:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-06-22 09:30:04 -07:00
|
|
|
js_EndRecording(JSContext* cx, JSFrameRegs& regs)
|
2008-06-11 20:22:00 -07:00
|
|
|
{
|
2008-06-22 23:42:54 -07:00
|
|
|
JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx);
|
2008-06-26 20:37:28 -07:00
|
|
|
if (tm->recorder != NULL) {
|
2008-06-26 20:49:04 -07:00
|
|
|
TraceRecorder* recorder = tm->recorder;
|
2008-06-26 20:37:28 -07:00
|
|
|
recorder->fragment->lastIns = recorder->lir->ins0(LIR_loop);
|
|
|
|
compile(tm->fragmento->assm(), recorder->fragment);
|
|
|
|
delete recorder;
|
|
|
|
tm->recorder = NULL;
|
2008-06-22 09:30:04 -07:00
|
|
|
}
|
2008-06-11 17:59:28 -07:00
|
|
|
}
|