projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR144 (aligned patchers on x86_64)
[cacao.git]
/
src
/
vm
/
jit
/
x86_64
/
codegen.h
diff --git
a/src/vm/jit/x86_64/codegen.h
b/src/vm/jit/x86_64/codegen.h
index ce8576e3d9bb421ef6e4e3ca246d2bad44bff592..19700d76cea55fdfd6118d1e2e4318334823cf9f 100644
(file)
--- a/
src/vm/jit/x86_64/codegen.h
+++ b/
src/vm/jit/x86_64/codegen.h
@@
-1,6
+1,6
@@
/* src/vm/jit/x86_64/codegen.h - code generation macros for x86_64
/* src/vm/jit/x86_64/codegen.h - code generation macros for x86_64
- Copyright (C) 1996-20
05, 2006, 2007, 2008
+ Copyright (C) 1996-20
11
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
@@
-50,11
+50,16
@@
#define ALIGNCODENOP \
do { \
#define ALIGNCODENOP \
do { \
- for (s1 = 0; s1 < (s4) (((ptrint) cd->mcodeptr) & 7); s1++) \
- M_NOP; \
+ int len = (-(ptrint) cd->mcodeptr) & 7; \
+ if (len) \
+ emit_nop(cd, len); \
} while (0)
} while (0)
+#define PATCH_ALIGNMENT(addr, offset, size) \
+ ((((addr)+(offset)+(size)-1) & ~((size)-1)) - ((addr)+(offset)))
+
+
#define ICONST(r,c) \
do { \
if ((c) == 0) \
#define ICONST(r,c) \
do { \
if ((c) == 0) \
@@
-81,6
+86,9
@@
#define BRANCH_UNCONDITIONAL_SIZE 5 /* size in bytes of a branch */
#define BRANCH_CONDITIONAL_SIZE 6 /* size in bytes of a branch */
#define BRANCH_UNCONDITIONAL_SIZE 5 /* size in bytes of a branch */
#define BRANCH_CONDITIONAL_SIZE 6 /* size in bytes of a branch */
+/* These NOPs are never executed; they are only used as placeholders during
+ * code generation.
+ */
#define BRANCH_NOPS \
do { \
M_NOP; \
#define BRANCH_NOPS \
do { \
M_NOP; \
@@
-98,8
+106,7
@@
#define PATCHER_NOPS \
do { \
#define PATCHER_NOPS \
do { \
- M_NOP; \
- M_NOP; \
+ emit_nop(cd, 2); \
} while (0)
} while (0)
@@
-335,6
+342,7
@@
/* system instructions ********************************************************/
/* system instructions ********************************************************/
+#define M_MFENCE emit_mfence(cd)
#define M_RDTSC emit_rdtsc(cd)
#define M_IINC_MEMBASE(a,b) emit_incl_membase(cd, (a), (b))
#define M_RDTSC emit_rdtsc(cd)
#define M_IINC_MEMBASE(a,b) emit_incl_membase(cd, (a), (b))
@@
-360,4
+368,5
@@
* c-basic-offset: 4
* tab-width: 4
* End:
* c-basic-offset: 4
* tab-width: 4
* End:
+ * vim:noexpandtab:sw=4:ts=4:
*/
*/