Fixed _thisfrag not being set in beginAssembly

This commit is contained in:
dvander@traceknight.local 2008-06-20 14:40:40 -07:00
commit 490d9eb8b5
3 changed files with 5 additions and 19 deletions

View File

@ -116,14 +116,6 @@ namespace nanojit
Assembler::Assembler(Fragmento* frago) Assembler::Assembler(Fragmento* frago)
: _frago(frago) : _frago(frago)
, _gc(frago->core()->gc) , _gc(frago->core()->gc)
, _thisfrag(NULL)
, _branchStateMap(NULL)
, _latestGuard(NULL)
, _functions(NULL)
, _nIns(NULL)
, _nExitIns(NULL)
, _nativePages(NULL)
, _nativeExitPages(NULL)
{ {
AvmCore *core = frago->core(); AvmCore *core = frago->core();
nInit(core); nInit(core);

View File

@ -46,7 +46,7 @@ namespace nanojit
/** /**
* This is the main control center for creating and managing fragments. * This is the main control center for creating and managing fragments.
*/ */
Fragmento::Fragmento(AvmCore* core) : _pageList(NULL), _allocList(core->GetGC()) Fragmento::Fragmento(AvmCore* core) : _allocList(core->GetGC())
{ {
_core = core; _core = core;
GC *gc = core->GetGC(); GC *gc = core->GetGC();

View File

@ -83,19 +83,13 @@ public:
inline void* inline void*
Alloc(uint32_t pages) Alloc(uint32_t pages)
{ {
#if defined DARWIN
return valloc(pages * kNativePageSize); return valloc(pages * kNativePageSize);
#else
void* p = malloc((pages + 1) * kNativePageSize);
p = (void*)(((int)(((char*)p) + kNativePageSize - 1)) & (~0xfff));
return p;
#endif
} }
inline void inline void
Free(void* p) Free(void* p)
{ {
// @todo: don't know how to free free(p);
} }
}; };
@ -108,13 +102,13 @@ public:
static inline void* static inline void*
Alloc(uint32_t bytes) Alloc(uint32_t bytes)
{ {
return malloc(bytes); return calloc(1, bytes);
} }
static inline void static inline void
Free(void* p) Free(void* p)
{ {
//free(p); free(p);
} }
static inline GCHeap* static inline GCHeap*
@ -127,7 +121,7 @@ public:
inline void* inline void*
operator new(size_t size, GC* gc) operator new(size_t size, GC* gc)
{ {
return malloc(size); return GC::Alloc(size);
} }
#define DWB(x) x #define DWB(x) x