27 #define REPLACE_HPP_ 1
47 #if !defined(ENABLE_REPLACEMENT)
51 #define REPLACEMENT_POINTS_INIT(cd, jd)
52 #define REPLACEMENT_POINTS_RESET(cd, jd)
53 #define REPLACEMENT_POINT_BLOCK_START(cd, bptr)
54 #define REPLACEMENT_POINT_INLINE_START(cd, iptr)
55 #define REPLACEMENT_POINT_INLINE_BODY(cd, iptr)
56 #define REPLACEMENT_POINT_RETURN(cd, iptr)
57 #define REPLACEMENT_POINT_INVOKE(cd, iptr)
58 #define REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr)
59 #define REPLACEMENT_POINT_FORGC_BUILTIN(cd, iptr)
60 #define REPLACEMENT_POINT_FORGC_BUILTIN_RETURN(cd, iptr)
66 #define RPLALLOC_STACK -1
67 #define RPLALLOC_PARAM -2
68 #define RPLALLOC_SYNC -3
81 #error value of INMEMORY is too big to fit in rplalloc.flags
85 #define RPLPOINT_CHECK(type) , rplpoint::TYPE_##type
86 #define RPLPOINT_CHECK_BB(bptr) , (bptr)->type
88 #define RPLPOINT_CHECK(type)
89 #define RPLPOINT_CHECK_BB(bptr)
112 FLAG_COUNTDOWN = 0x02,
122 unsigned int regalloccount:20;
124 unsigned int flags:8;
128 union replace_val_t {
142 struct sourceframe_t {
150 replace_val_t instance;
152 replace_val_t *javastack;
156 replace_val_t *javalocals;
160 replace_val_t *syncslots;
177 #define REPLACE_IS_NATIVE_FRAME(frame) ((frame)->sfi != NULL)
178 #define REPLACE_IS_JAVA_FRAME(frame) ((frame)->sfi == NULL)
181 struct sourcestate_t {
182 sourceframe_t *frames;
188 #define REPLACEMENT_POINTS_INIT(cd, jd) \
189 if (!replace_create_replacement_points(jd)) \
191 (cd)->replacementpoint = (jd)->code->rplpoints;
193 #define REPLACEMENT_POINTS_RESET(cd, jd) \
194 (cd)->replacementpoint = (jd)->code->rplpoints;
196 #define REPLACEMENT_POINT_BLOCK_START(cd, bptr) \
197 if ((bptr)->bitflags & BBFLAG_REPLACEMENT) \
198 codegen_set_replacement_point((cd) RPLPOINT_CHECK_BB(bptr));
200 #define REPLACEMENT_POINT_INLINE_START(cd, iptr) \
201 codegen_set_replacement_point(cd RPLPOINT_CHECK(INLINE));
203 #define REPLACEMENT_POINT_INLINE_BODY(cd, iptr) \
204 codegen_set_replacement_point_notrap(cd RPLPOINT_CHECK(BODY));
206 #define REPLACEMENT_POINT_RETURN(cd, iptr) \
207 codegen_set_replacement_point(cd RPLPOINT_CHECK(RETURN));
209 #define REPLACEMENT_POINT_INVOKE(cd, iptr) \
210 codegen_set_replacement_point(cd RPLPOINT_CHECK(CALL));
212 #define REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr) \
213 if (iptr->opc != ICMD_BUILTIN) \
214 cd->replacementpoint[-1].callsize = (cd->mcodeptr - cd->mcodebase)\
215 - (ptrint) cd->replacementpoint[-1].pc;
220 #if defined(ENABLE_GC_CACAO)
222 #define REPLACEMENT_POINT_FORGC_BUILTIN(cd, iptr) \
223 codegen_set_replacement_point(cd RPLPOINT_CHECK(CALL));
225 #define REPLACEMENT_POINT_FORGC_BUILTIN_RETURN(cd, iptr) \
226 if (iptr->opc == ICMD_BUILTIN) \
227 cd->replacementpoint[-1].callsize = (cd->mcodeptr - cd->mcodebase)\
228 - (ptrint) cd->replacementpoint[-1].pc;
230 #else // ENABLE_GC_CACAO
232 #define REPLACEMENT_POINT_FORGC_BUILTIN(cd, iptr)
233 #define REPLACEMENT_POINT_FORGC_BUILTIN_RETURN(cd, iptr)
235 #endif // ENABLE_GC_CACAO
258 #if defined(ENABLE_JIT)
259 void md_patch_replacement_point(
u1 *
pc,
u1 *savedmcode,
bool revert);
262 #endif // ENABLE_REPLACEMENT
264 #endif // REPLACE_HPP_
void replace_replacement_point_println(rplpoint *rp, int depth)
void replace_show_replacement_points(codeinfo *code)
void replace_free_replacement_points(codeinfo *code)
void replace_activate_replacement_points(codeinfo *code, bool mappable)
void replace_deactivate_replacement_points(codeinfo *code)
bool replace_create_replacement_points(jitdata *jd)
void replace_sourcestate_println_short(sourcestate_t *ss)
void replace_sourcestate_println(sourcestate_t *ss)
jlong jlong jlong jlong jint depth
JNIEnv jthread jmethodID method
void replace_source_frame_println(sourceframe_t *frame)
Type
Types used internally by JITTED code.
bool regalloc(jitdata *jd)
bool replace_handler(u1 *pc, executionstate_t *es)