Bug 519575 - NJ merge: more LIR.h drift, r=gal.

This commit is contained in:
Graydon Hoare 2009-09-29 16:36:37 -07:00
parent 33e087f8b1
commit 718b7faceb
3 changed files with 5 additions and 24 deletions

View File

@ -3875,22 +3875,6 @@ TraceRecorder::snapshot(ExitType exitType)
}
}
if (sizeof(VMSideExit) + (stackSlots + ngslots) * sizeof(JSTraceType) >
LirBuffer::MAX_SKIP_PAYLOAD_SZB) {
/*
* ::snapshot() is infallible in the sense that callers don't
* expect errors; but this is a trace-aborting error condition. So
* mangle the request to consume zero slots, and mark the tree as
* to-be-trashed. This should be safe as the trace will be aborted
* before assembly or execution due to the call to
* trackNativeStackUse above.
*/
stackSlots = 0;
ngslots = 0;
typemap_size = 0;
trashSelf = true;
}
/* We couldn't find a matching side exit, so create a new one. */
VMSideExit* exit = (VMSideExit*)
traceMonitor->traceAlloc->alloc(sizeof(VMSideExit) +
@ -11148,8 +11132,6 @@ TraceRecorder::record_JSOP_GETELEM()
// The entry type map is not necessarily up-to-date, so we capture a new type map
// for this point in the code.
unsigned stackSlots = NativeStackSlots(cx, 0 /* callDepth */);
if (stackSlots * sizeof(JSTraceType) > LirBuffer::MAX_SKIP_PAYLOAD_SZB)
RETURN_STOP_A("|arguments| requires saving too much stack");
JSTraceType* typemap = new (*traceMonitor->traceAlloc) JSTraceType[stackSlots];
DetermineTypesVisitor detVisitor(*this, typemap);
VisitStackSlots(detVisitor, cx, 0);
@ -11631,8 +11613,6 @@ TraceRecorder::interpretedFunctionCall(jsval& fval, JSFunction* fun, uintN argc,
// Generate a type map for the outgoing frame and stash it in the LIR
unsigned stackSlots = NativeStackSlots(cx, 0 /* callDepth */);
if (sizeof(FrameInfo) + stackSlots * sizeof(JSTraceType) > LirBuffer::MAX_SKIP_PAYLOAD_SZB)
RETURN_STOP("interpreted function call requires saving too much stack");
FrameInfo* fi = (FrameInfo*)
traceMonitor->traceAlloc->alloc(sizeof(FrameInfo) +
stackSlots * sizeof(JSTraceType));

View File

@ -177,7 +177,6 @@ namespace nanojit
#endif
Assembler(CodeAlloc& codeAlloc, Allocator& alloc, AvmCore* core, LogControl* logc);
~Assembler() {}
void endAssembly(Fragment* frag);
void assemble(Fragment* frag);

View File

@ -1108,6 +1108,7 @@ namespace nanojit
class Entry
{
public:
Entry(int) : name(0), size(0), align(0) {}
Entry(char *n, size_t s, size_t a) : name(n),size(s),align(a) {}
char* name;
size_t size:29, align:3;
@ -1146,6 +1147,7 @@ namespace nanojit
class Entry
{
public:
Entry(int) : name(0) {}
Entry(char* n) : name(n) {}
char* name;
};
@ -1351,6 +1353,9 @@ namespace nanojit
LInsp state,param1,sp,rp;
LInsp savedRegs[NumSavedRegs];
protected:
friend class LirBufWriter;
/** each chunk is just a raw area of LIns instances, with no header
and no more than 8-byte alignment. The chunk size is somewhat arbitrary
as long as it's well larger than 2*sizeof(LInsSk) */
@ -1366,9 +1371,6 @@ namespace nanojit
* itself. */
static const size_t MAX_SKIP_PAYLOAD_SZB = MAX_LINS_SZB - sizeof(LInsSk);
protected:
friend class LirBufWriter;
/** get CHUNK_SZB more memory for LIR instructions */
void chunkAlloc();
void moveToNewChunk(uintptr_t addrOfLastLInsOnCurrentChunk);