summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1e64951)
an executionstate from the trap handler. Fixes -XX:+TestReplacement again.
* src/vm/jit/replace.hpp: Likewise.
* src/vm/jit/trap.cpp (trap_handle): Adapted to above change.
/* src/vm/jit/replace.cpp - on-stack replacement of methods
/* src/vm/jit/replace.cpp - on-stack replacement of methods
- Copyright (C) 1996-2005, 2006, 2007, 2008
+ Copyright (C) 1996-2005, 2006, 2007, 2008, 2009
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.
-/* replace_me_wrapper **********************************************************
+/* replace_handler *************************************************************
This function is called by the signal handler. It determines if there
is an active replacement point pending at the given PC and returns
This function is called by the signal handler. It determines if there
is an active replacement point pending at the given PC and returns
IN:
pc...............the program counter that triggered the replacement.
IN:
pc...............the program counter that triggered the replacement.
- context..........the context (machine state) to which the
+ es...............the execution state (machine state) to which the
replacement should be applied.
OUT:
replacement should be applied.
OUT:
- context..........the context after replacement finished.
+ es...............the execution state after replacement finished.
RETURN VALUE:
true.............replacement done, everything went ok
RETURN VALUE:
true.............replacement done, everything went ok
- false............no replacement done, context unchanged
+ false............no replacement done, execution state unchanged
*******************************************************************************/
*******************************************************************************/
-bool replace_me_wrapper(u1 *pc, void *context)
+bool replace_handler(u1 *pc, executionstate_t *es)
{
codeinfo *code;
rplpoint *rp;
{
codeinfo *code;
rplpoint *rp;
#if defined(ENABLE_RT_TIMING)
struct timespec time_start, time_end;
#endif
#if defined(ENABLE_RT_TIMING)
struct timespec time_start, time_end;
#endif
DOLOG( printf("valid replacement point\n"); );
DOLOG( printf("valid replacement point\n"); );
-#if !defined(NDEBUG)
- executionstate_sanity_check(context);
-#endif
-
/* set codeinfo pointer in execution state */
/* set codeinfo pointer in execution state */
- es.code = code;
-
- /* read execution state from current context */
-
- md_executionstate_read(&es, context);
-
- DOLOG( printf("REPLACEMENT READ: ");
- executionstate_println(&es); );
/* do the actual replacement */
/* do the actual replacement */
RT_TIMING_GET_TIME(time_start);
#endif
RT_TIMING_GET_TIME(time_start);
#endif
#if defined(ENABLE_RT_TIMING)
RT_TIMING_GET_TIME(time_end);
RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_REPLACE);
#endif
#if defined(ENABLE_RT_TIMING)
RT_TIMING_GET_TIME(time_end);
RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_REPLACE);
#endif
- /* write execution state to current context */
-
- md_executionstate_write(&es, context);
-
- DOLOG( printf("REPLACEMENT WRITE: ");
- executionstate_println(&es); );
-
/* new code is entered after returning */
DOLOG( printf("JUMPING IN!\n"); fflush(stdout); );
/* new code is entered after returning */
DOLOG( printf("JUMPING IN!\n"); fflush(stdout); );
+#include "vm/jit/executionstate.h"
#include "vm/jit/reg.h"
#include "vm/jit/stacktrace.hpp"
#include "vm/jit/reg.h"
#include "vm/jit/stacktrace.hpp"
void replace_activate_replacement_points(codeinfo *code, bool mappable);
void replace_deactivate_replacement_points(codeinfo *code);
void replace_activate_replacement_points(codeinfo *code, bool mappable);
void replace_deactivate_replacement_points(codeinfo *code);
-bool replace_me_wrapper(u1 *pc, void *context);
+bool replace_handler(u1 *pc, executionstate_t *es);
#if !defined(NDEBUG)
void replace_show_replacement_points(codeinfo *code);
#if !defined(NDEBUG)
void replace_show_replacement_points(codeinfo *code);
case TRAP_PATCHER:
p = NULL;
#if defined(ENABLE_REPLACEMENT)
case TRAP_PATCHER:
p = NULL;
#if defined(ENABLE_REPLACEMENT)
- was_replaced = replace_me_wrapper((uint8_t*) xpc, context);
+ was_replaced = replace_handler((uint8_t*) xpc, &es);
if (was_replaced)
break;
#endif
if (was_replaced)
break;
#endif
# warning Port the below stuff to use the patching subsystem.
case TRAP_COUNTDOWN:
p = NULL;
# warning Port the below stuff to use the patching subsystem.
case TRAP_COUNTDOWN:
p = NULL;
- (void) replace_me_wrapper((uint8_t*) xpc - 13, context);
+ (void) replace_handler((uint8_t*) xpc - 13, &es);