// Include machine dependent headers.
#include "md.h"
-#include "mm/dumpmemory.h"
+#include "mm/dumpmemory.hpp"
-#include "vm/method.h"
+#include "vm/method.hpp"
#include "vm/options.h"
#include "vm/jit/abi.h"
-#include "vm/jit/code.h"
-#include "vm/jit/codegen-common.h"
+#include "vm/jit/code.hpp"
+#include "vm/jit/codegen-common.hpp"
#include "vm/jit/disass.h"
-#include "vm/jit/emit-common.h"
-#include "vm/jit/jit.h"
-#include "vm/jit/show.h"
+#include "vm/jit/emit-common.hpp"
+#include "vm/jit/jit.hpp"
+#include "vm/jit/show.hpp"
#include "vm/jit/stubs.hpp"
codegendata *cd;
ptrint *d; /* pointer to data memory */
u1 *c; /* pointer to code memory */
- int32_t dumpmarker;
- /* mark dump memory */
-
- DMARKER;
+ // Create new dump memory area.
+ DumpMemoryArea dma;
/* allocate required data structures */
- jd = DNEW(jitdata);
+ jd = (jitdata*) DumpMemory::allocate(sizeof(jitdata));
jd->m = m;
- jd->cd = DNEW(codegendata);
+ jd->cd = (codegendata*) DumpMemory::allocate(sizeof(codegendata));
jd->flags = 0;
/* get required compiler data */
md_cacheflush(cd->mcodebase, 2 * SIZEOF_VOID_P + get_code_size());
#endif
- /* release dump memory */
-
- DRELEASE;
-
/* return native stub code */
return c;
jitdata *jd;
codeinfo *code;
int skipparams;
- int32_t dumpmarker;
-
- /* mark dump memory */
- DMARKER;
+ // Create new dump memory area.
+ DumpMemoryArea dma;
/* Create JIT data structure. */
dseg_display(jd);
}
#endif /* !defined(NDEBUG) && defined(ENABLE_DISASSEMBLER) */
-
- /* release memory */
-
- DRELEASE;
}
methoddesc *md;
methoddesc *nmd;
int skipparams;
- int32_t dumpmarker;
- /* mark dump memory */
-
- DMARKER;
+ // Create new dump memory area.
+ DumpMemoryArea dma;
/* Create JIT data structure. */
else
skipparams = 1;
- nmd = (methoddesc *) DMNEW(u1, sizeof(methoddesc) - sizeof(typedesc) +
- md->paramcount * sizeof(typedesc) +
- skipparams * sizeof(typedesc));
+ nmd = (methoddesc*) DumpMemory::allocate(sizeof(methoddesc) - sizeof(typedesc) +
+ md->paramcount * sizeof(typedesc) +
+ skipparams * sizeof(typedesc));
nmd->paramcount = md->paramcount + skipparams;
- nmd->params = DMNEW(paramdesc, nmd->paramcount);
+ nmd->params = (paramdesc*) DumpMemory::allocate(sizeof(paramdesc) * nmd->paramcount);
nmd->paramtypes[0].type = TYPE_ADR; /* add environment pointer */
}
#endif /* !defined(NDEBUG) && defined(ENABLE_DISASSEMBLER) */
- /* release memory */
-
- DRELEASE;
-
/* return native stub code */
return code;
}
-// Legacy C interface.
-
-extern "C" {
- void* CompilerStub_generate(methodinfo* m) { return CompilerStub::generate(m); }
- void CompilerStub_remove(void* stub) { CompilerStub::remove(stub); }
-
- void BuiltinStub_generate(methodinfo* m, builtintable_entry* bte) { BuiltinStub::generate(m, bte); }
-
- codeinfo* NativeStub_generate(methodinfo* m, functionptr f) { return NativeStub::generate(m, f); }
- void NativeStub_remove(void* stub) { NativeStub::remove(stub); }
-}
-
-
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where