PR144 (aligned patchers on x86_64)
[cacao.git] / src / vm / jit / x86_64 / codegen.h
index 4fa215d54d72f7cd4fed04f964900501a2edda81..19700d76cea55fdfd6118d1e2e4318334823cf9f 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/jit/x86_64/codegen.h - code generation macros for x86_64
 
-   Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
     } while (0)
 
 
+#define PATCH_ALIGNMENT(addr, offset, size) \
+       ((((addr)+(offset)+(size)-1) & ~((size)-1)) - ((addr)+(offset)))
+
+
 #define ICONST(r,c) \
     do { \
         if ((c) == 0) \
@@ -82,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          */
 
+/* These NOPs are never executed; they are only used as placeholders during
+ * code generation.
+ */
 #define BRANCH_NOPS \
     do { \
         M_NOP; \