Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id$
-
*/
#include "config.h"
}
-/* replace_read_executionstate *************************************************
+/* replace_new_sourceframe *****************************************************
- Read the given executions state and translate it to a source frame.
+ Allocate a new source frame and insert it at the front of the frame list.
IN:
ss...............the source state
OUT:
- ss->frames.......set to new frame
+ ss->frames.......set to new frame (the new head of the frame list).
RETURN VALUE:
returns the new frame
/* replace_read_executionstate *************************************************
- Read the given executions state and translate it to a source frame.
+ Read a source frame from the given executions state.
+ The new source frame is pushed to the front of the frame list of the
+ source state.
IN:
rp...............replacement point at which `es` was taken
es...............execution state
- ss...............where to put the source state
+ ss...............the source state to add the source frame to
+ topframe.........true, if the first (top-most) source frame on the
+ stack is to be read
OUT:
- *ss..............the source state derived from the execution state
+ *ss..............the source state with the newly created source frame
+ added
*******************************************************************************/
/* replace_write_executionstate ************************************************
- Translate the given source state into an execution state.
-
+ Pop a source frame from the front of the frame list of the given source state
+ and write its values into the execution state.
+
IN:
rp...............replacement point for which execution state should be
- creates
- es...............where to put the execution state
+ created
+ es...............the execution state to modify
ss...............the given source state
+ topframe.........true, if this is the last (top-most) source frame to be
+ translated
OUT:
*es..............the execution state derived from the source state
sourceframe_t *callerframe,
sourceframe_t *calleeframe)
{
- u1 *patchpos;
- methodptr entrypoint;
- methodptr oldentrypoint;
- bool atentry;
- stackframeinfo sfi;
- codeinfo *calleecode;
- methodinfo *calleem;
- java_objectheader *obj;
- vftbl_t *vftbl;
+ u1 *patchpos;
+ methodptr entrypoint;
+ methodptr oldentrypoint;
+ bool atentry;
+ stackframeinfo sfi;
+ codeinfo *calleecode;
+ methodinfo *calleem;
+ java_object_t *obj;
+ vftbl_t *vftbl;
assert(ra);
assert(callerframe->down == calleeframe);
}
+/* replace_me_wrapper **********************************************************
+
+ TODO: Document me!
+
+*******************************************************************************/
+
+bool replace_me_wrapper(u1 *pc)
+{
+ codeinfo *code;
+ rplpoint *rp;
+ executionstate_t es;
+
+ /* search the codeinfo for the given PC */
+
+ code = code_find_codeinfo_for_pc(pc);
+ assert(code);
+
+ /* search for a replacement point at the given PC */
+
+#if 0
+ rp = replace_find_replacement_point_for_pc(code, pc);
+ assert(rp == NULL || rp->pc == pc);
+#else
+ {
+ int i;
+ rplpoint *rp2;
+ rp = NULL;
+ for (i=0,rp2=code->rplpoints; i<code->rplpointcount; i++,rp2++) {
+ if (rp2->pc == pc)
+ rp = rp2;
+ }
+ }
+#endif
+
+ /* check if the replacement point is active */
+
+ if (rp != NULL && (rp->flags & RPLPOINT_FLAG_ACTIVE)) {
+
+ /*md_replace_executionstate_read(&es, context);*/
+
+ replace_me(rp, &es);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+
/* replace_me ******************************************************************
This function is called by asm_replacement_out when a thread reaches
/* call the assembler code for the last phase of replacement */
#if (defined(__I386__) || defined(__X86_64__) || defined(__ALPHA__) || defined(__POWERPC__) || defined(__MIPS__) || defined(__S390__)) && defined(ENABLE_JIT)
- asm_replacement_in(&(safestack->es), safestack);
+ /*asm_replacement_in(&(safestack->es), safestack);*/
#endif
abort(); /* NOT REACHED */
#if !defined(NDEBUG)
static void java_value_print(s4 type, replace_val_t value)
{
- java_objectheader *obj;
- utf *u;
+ java_object_t *obj;
+ utf *u;
printf("%016llx",(unsigned long long) value.l);