Browse Source

add jit_insn_mark_breakpoint_variable() function.

cache-refactoring
Aleksey Demakov 18 years ago
parent
commit
d0a978cb66
  1. 5
      ChangeLog
  2. 2
      include/jit/jit-insn.h
  3. 6
      jit/jit-debugger.c
  4. 46
      jit/jit-insn.c

5
ChangeLog

@ -1,3 +1,8 @@
2006-09-15 Radek Polak <psonek2@seznam.cz>
* include/jit/jit-insn.h, jit/jit-insn.c, jit/jit-debugger.c: new
instruction jit_insn_mark_breakpoint_variable.
2006-09-14 Aleksey Demakov <ademakov@gmail.com>
* jit/jit-reg-alloc.h, jit/jit-reg-alloc.c: remove "old" register

2
include/jit/jit-insn.h

@ -317,6 +317,8 @@ int jit_insn_mark_offset
(jit_function_t func, jit_int offset) JIT_NOTHROW;
int jit_insn_mark_breakpoint
(jit_function_t func, jit_nint data1, jit_nint data2) JIT_NOTHROW;
int jit_insn_mark_breakpoint_variable
(jit_function_t func, jit_value_t data1, jit_value_t data2) JIT_NOTHROW;
void jit_insn_iter_init(jit_insn_iter_t *iter, jit_block_t block) JIT_NOTHROW;
void jit_insn_iter_init_last

6
jit/jit-debugger.c

@ -125,6 +125,12 @@ of the event is set to the value of @code{stop_immediately} for the call.
A thread called @code{jit_debugger_detach_self}.
@end table
@deftypefun int jit_insn_mark_breakpoint_variable (jit_function_t func, jit_value_t data1, jit_value_t data2)
This function is similar to @code{jit_insn_mark_breakpoint} except that values
in @code{data1} and @code{data2} can be computed at runtime. You can use this
function for example to get address of local variable.
@end deftypefun
@*/
/*

46
jit/jit-insn.c

@ -8024,9 +8024,9 @@ int jit_insn_mark_offset(jit_function_t func, jit_int offset)
(func, jit_type_int, offset));
}
/* Documentation is in jit-debug.c */
int jit_insn_mark_breakpoint
(jit_function_t func, jit_nint data1, jit_nint data2)
/* Documentation is in jit-debugger.c */
int jit_insn_mark_breakpoint_variable
(jit_function_t func, jit_value_t data1, jit_value_t data2)
{
#if defined(JIT_BACKEND_INTERP)
/* Use the "mark_breakpoint" instruction for the interpreter */
@ -8034,11 +8034,7 @@ int jit_insn_mark_breakpoint
{
return 0;
}
return create_note(func, JIT_OP_MARK_BREAKPOINT,
jit_value_create_nint_constant
(func, jit_type_nint, data1),
jit_value_create_nint_constant
(func, jit_type_nint, data2));
return create_note(func, JIT_OP_MARK_BREAKPOINT, data1, data2);
#else
/* Insert a call to "_jit_debugger_hook" on native platforms */
jit_type_t params[3];
@ -8059,18 +8055,8 @@ int jit_insn_mark_breakpoint
jit_type_free(signature);
return 0;
}
if((values[1] = jit_value_create_nint_constant
(func, jit_type_nint, data1)) == 0)
{
jit_type_free(signature);
return 0;
}
if((values[2] = jit_value_create_nint_constant
(func, jit_type_nint, data2)) == 0)
{
jit_type_free(signature);
return 0;
}
values[1] = data1;
values[2] = data2;
jit_insn_call_native(func, "_jit_debugger_hook", (void *)_jit_debugger_hook,
signature, values, 3, JIT_CALL_NOTHROW);
jit_type_free(signature);
@ -8078,6 +8064,26 @@ int jit_insn_mark_breakpoint
#endif
}
/* Documentation is in jit-debugger.c */
int jit_insn_mark_breakpoint
(jit_function_t func, jit_nint data1, jit_nint data2)
{
jit_value_t value1;
jit_value_t value2;
value1 = jit_value_create_nint_constant(func, jit_type_nint, data1);
value2 = jit_value_create_nint_constant(func, jit_type_nint, data2);
if(value1 && value2)
{
return jit_insn_mark_breakpoint_variable(func, value1, value2);
}
else
{
return 0;
}
}
/*@
* @deftypefun void jit_insn_iter_init ({jit_insn_iter_t *} iter, jit_block_t block)
* Initialize an iterator to point to the first instruction in @code{block}.

Loading…
Cancel
Save