mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 04:44:39 +00:00
Branches: main Add float registers to the Mercury abstract machine, implemented as an array of MR_Float in the Mercury engine structure. Float registers are only useful if a Mercury `float' is wider than a word (i.e. when using double precision floats on 32-bit platforms) so we let them exist only then. In other cases floats may simply be passed via the regular registers, as before. Currently, higher order calls still require the use of the regular registers for all arguments. As all exported procedures are potentially the target of higher order calls, exported procedures must use only the regular registers for argument passing. This can lead to more (un)boxing than if floats were simply always boxed. Until this is solved, float registers must be enabled explicitly with the developer only option `--use-float-registers'. The other aspect of this change is using two consecutive stack slots to hold a single double variable. Without that, the benefit of passing unboxed floats via dedicated float registers would be largely eroded. compiler/options.m: Add developer option `--use-float-registers'. compiler/handle_options.m: Disable `--use-float-registers' if floats are not wider than words. compiler/make_hlds_passes.m: If `--use-float-registers' is in effect, enable a previous change that allows float constructor arguments to be stored unboxed in structures. compiler/hlds_llds.m: Move `reg_type' here from llds.m and `reg_f' option. Add stack slot width to `stack_slot' type. Add register type and stack slot width to `abs_locn' type. Remember next available float register in `abs_follow_vars'. compiler/hlds_pred.m: Add register type to `arg_loc' type. compiler/llds.m: Add a new kind of lval: double-width stack slots. These are used to hold double-precision floating point values only. Record setting of `--use-float-registers' in exprn_opts. Conform to addition of float registers and double stack slots. compiler/code_info.m: Make predicates take the register type as an argument, where it can no longer be assumed. Remember whether float registers are being used. Remember max float register for calls to MR_trace. Count double width stack slots as two slots. compiler/arg_info.m: Allocate float registers for procedure arguments when appropriate. Delete unused predicates. compiler/var_locn.m: Make predicates working with registers either take the register type as an argument, or handle both register types at once. Select float registers for variables when appropriate. compiler/call_gen.m: Explicitly use regular registers for all higher-order calls, which was implicit before. compiler/pragma_c_gen.m: Use float registers, when available, at the interface between Mercury code and C foreign_procs. compiler/export.m: Whether a float rval needs to be boxed/unboxed when assigned to/from a register depends on the register type. compiler/fact_table.m: Use float registers for arguments to predicates defined by fact tables. compiler/stack_alloc.m: Allocate two consecutive stack slots for float variables when appropriate. compiler/stack_layout.m: Represent double-width stack slots in procedure layout structures. Conform to changes. compiler/store_alloc.m: Allocate float registers (if they exist) for float variables. compiler/use_local_vars.m: Substitute float abstract machine registers with MR_Float local variables. compiler/llds_out_data.m: compiler/llds_out_instr.m: Output float registers and double stack slots. compiler/code_util.m: compiler/follow_vars.m: Count float registers separately from regular registers. compiler/layout.m: compiler/layout_out.m: compiler/trace_gen.m: Remember the max used float register for calls to MR_trace(). compiler/builtin_lib_types.m: Fix incorrect definition of float_type_ctor. compiler/bytecode_gen.m: compiler/continuation_info.m: compiler/disj_gen.m: compiler/dupelim.m: compiler/exprn_aux.m: compiler/global_data.m: compiler/hlds_out_goal.m: compiler/jumpopt.m: compiler/llds_to_x86_64.m: compiler/lookup_switch.m: compiler/opt_debug.m: compiler/opt_util.m: compiler/par_conj_gen.m: compiler/proc_gen.m: compiler/string_switch.m: compiler/tag_switch.m: compiler/tupling.m: compiler/x86_64_regs.m: Conform to changes. runtime/mercury_engine.h: Add an array of fake float "registers" to the Mercury engine structure, when MR_Float is wider than MR_Word. runtime/mercury_regs.h: Document float registers in the Mercury abstract machine. Add macros to access float registers in the Mercury engine. runtime/mercury_stack_layout.h: Add new MR_LongLval cases to represent double-width stack slots. MR_LONG_LVAL_TAGBITS had to be increased to accomodate the new cases, which increases the number of integers in [0, 2^MR_LONG_LVAL_TAGBITS) equal to 0 modulo 4. These are the new MR_LONG_LVAL_TYPE_CONS_n cases. Add max float register field to MR_ExecTrace. runtime/mercury_layout_util.c: runtime/mercury_layout_util.h: Extend MR_copy_regs_to_saved_regs and MR_copy_saved_regs_to_regs for float registers. Understand how to look up new kinds of MR_LongLval: MR_LONG_LVAL_TYPE_F (previously unused), MR_LONG_LVAL_TYPE_DOUBLE_STACKVAR, MR_LONG_LVAL_TYPE_DOUBLE_FRAMEVAR. Conform to the new MR_LONG_LVAL_TYPE_CONS_n cases. runtime/mercury_float.h: Delete redundant #ifdef. runtime/mercury_accurate_gc.c: runtime/mercury_agc_debug.c: Conform to changes (untested). trace/mercury_trace.c: trace/mercury_trace.h: trace/mercury_trace_declarative.c: trace/mercury_trace_external.c: trace/mercury_trace_internal.c: trace/mercury_trace_spy.c: trace/mercury_trace_vars.c: trace/mercury_trace_vars.h: Handle float registers in the trace subsystem. This is mostly a matter of saving/restoring them as with regular registers.
501 lines
16 KiB
C
501 lines
16 KiB
C
/*
|
|
** vim: ts=4 sw=4 expandtab
|
|
*/
|
|
/*
|
|
** Copyright (C) 1998-2007, 2009, 2011 The University of Melbourne.
|
|
** This file may only be copied under the terms of the GNU Library General
|
|
** Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
*/
|
|
|
|
/*
|
|
** Debugging support for the accurate garbage collector.
|
|
*/
|
|
|
|
#include "mercury_imp.h"
|
|
#include "mercury_layout_util.h"
|
|
#include "mercury_deep_copy.h"
|
|
#include "mercury_agc_debug.h"
|
|
|
|
#ifdef MR_NATIVE_GC
|
|
|
|
/*
|
|
** Function prototypes.
|
|
*/
|
|
static void MR_dump_long_value(MR_LongLval locn, MR_MemoryZone *heap_zone,
|
|
MR_Word * stack_pointer, MR_Word *current_frame,
|
|
MR_bool do_regs);
|
|
static void MR_dump_short_value(MR_ShortLval locn, MR_MemoryZone *heap_zone,
|
|
MR_Word * stack_pointer, MR_Word *current_frame,
|
|
MR_bool do_regs);
|
|
static void MR_dump_live_variables(const MR_LabelLayout *layout,
|
|
MR_MemoryZone *heap_zone, MR_bool top_frame,
|
|
MR_Word *stack_pointer, MR_Word *current_frame);
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/*
|
|
** Currently this variable is never modified by the Mercury runtime code,
|
|
** but it can be modified manually in gdb.
|
|
** XXX It would be nicer to set it based on a runtime option setting.
|
|
*/
|
|
|
|
#ifdef MR_DEBUG_AGC_PRINT_VARS
|
|
static MR_bool MR_debug_agc_print_vars = MR_TRUE;
|
|
#else
|
|
static MR_bool MR_debug_agc_print_vars = MR_FALSE;
|
|
#endif
|
|
|
|
void
|
|
MR_agc_dump_roots(MR_RootList roots)
|
|
{
|
|
#ifndef MR_HIGHLEVEL_CODE
|
|
MR_Word saved_regs[MR_MAX_FAKE_REG];
|
|
MR_Float saved_f_regs[MR_MAX_VIRTUAL_F_REG];
|
|
#endif
|
|
|
|
fflush(NULL);
|
|
fprintf(stderr, "Dumping roots\n");
|
|
|
|
if (MR_debug_agc_print_vars) {
|
|
while (roots != NULL) {
|
|
#ifndef MR_HIGHLEVEL_CODE
|
|
/*
|
|
** Restore the registers, because we need to save them to a more
|
|
** permanent backing store (we are going to call Mercury soon,
|
|
** and we don't want it messing with the saved registers).
|
|
*/
|
|
MR_restore_registers();
|
|
MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1, saved_regs,
|
|
MR_MAX_VIRTUAL_F_REG - 1, saved_f_regs);
|
|
|
|
MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
#endif /* !MR_HIGHLEVEL_CODE */
|
|
|
|
fflush(NULL);
|
|
MR_write_variable(roots->type_info, *roots->root);
|
|
fflush(NULL);
|
|
fprintf(stderr, "\n");
|
|
|
|
#ifndef MR_HIGHLEVEL_CODE
|
|
MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1, saved_regs);
|
|
MR_save_registers();
|
|
#endif /* !MR_HIGHLEVEL_CODE */
|
|
roots = roots->next;
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifndef MR_HIGHLEVEL_CODE
|
|
void
|
|
MR_agc_dump_nondet_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
|
|
MR_Word *stack_pointer, MR_Word *current_frame, MR_Word *max_frame)
|
|
{
|
|
MR_Code *success_ip;
|
|
int frame_size;
|
|
MR_bool registers_valid;
|
|
|
|
while (max_frame > MR_nondet_stack_trace_bottom) {
|
|
registers_valid = (max_frame == current_frame);
|
|
|
|
frame_size = max_frame - MR_prevfr_slot(max_frame);
|
|
if (frame_size == MR_NONDET_TEMP_SIZE) {
|
|
fprintf(stderr, "%p: nondet temp\n", max_frame);
|
|
fprintf(stderr, " redoip: ");
|
|
fflush(NULL);
|
|
MR_printlabel(stderr, MR_redoip_slot(max_frame));
|
|
fflush(NULL);
|
|
fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
|
|
|
|
label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
|
|
|
|
if (label && label->MR_internal_layout) {
|
|
MR_dump_live_variables(label->MR_internal_layout, heap_zone,
|
|
registers_valid, stack_pointer, MR_redofr_slot(max_frame));
|
|
}
|
|
|
|
} else if (frame_size == MR_DET_TEMP_SIZE) {
|
|
fprintf(stderr, "%p: nondet temp\n", max_frame);
|
|
fprintf(stderr, " redoip: ");
|
|
fflush(NULL);
|
|
MR_printlabel(stderr, MR_redoip_slot(max_frame));
|
|
fflush(NULL);
|
|
fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
|
|
fprintf(stderr, " detfr: %p\n", MR_tmp_detfr_slot(max_frame));
|
|
|
|
label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
|
|
|
|
if (label && label->MR_internal_layout) {
|
|
MR_dump_live_variables(label->MR_internal_layout, heap_zone,
|
|
registers_valid, MR_tmp_detfr_slot(max_frame), max_frame);
|
|
/*
|
|
** XXX should max_frame above be
|
|
** MR_redoip_slot(max_frame) instead?
|
|
*/
|
|
}
|
|
|
|
} else {
|
|
fprintf(stderr, "%p: nondet ordinary\n", max_frame);
|
|
fprintf(stderr, " redoip: ");
|
|
fflush(NULL);
|
|
MR_printlabel(stderr, MR_redoip_slot(max_frame));
|
|
fflush(NULL);
|
|
fprintf(stderr, " redofr: %p\n", MR_redofr_slot(max_frame));
|
|
fprintf(stderr, " succip: ");
|
|
fflush(NULL);
|
|
MR_printlabel(stderr, MR_succip_slot(max_frame));
|
|
fflush(NULL);
|
|
fprintf(stderr, " succfr: %p\n", MR_succfr_slot(max_frame));
|
|
|
|
/* XXX ??? */
|
|
label = MR_lookup_internal_by_addr(MR_redoip_slot(max_frame));
|
|
|
|
if (label != NULL && label->MR_internal_layout) {
|
|
MR_dump_live_variables(label->MR_internal_layout, heap_zone,
|
|
registers_valid, stack_pointer, MR_redofr_slot(max_frame));
|
|
fprintf(stderr, " this label: %s\n", label->MR_internal_name);
|
|
}
|
|
}
|
|
|
|
max_frame = MR_prevfr_slot(max_frame);
|
|
}
|
|
|
|
/* XXX Lookup the address (redoip?) and dump the variables */
|
|
|
|
fflush(NULL);
|
|
}
|
|
|
|
void
|
|
MR_agc_dump_stack_frames(MR_Internal *label, MR_MemoryZone *heap_zone,
|
|
MR_Word *stack_pointer, MR_Word *current_frame)
|
|
{
|
|
MR_Word saved_regs[MR_MAX_FAKE_REG];
|
|
int i;
|
|
int short_var_count;
|
|
int long_var_count;
|
|
MR_Word *type_params;
|
|
MR_TypeInfo type_info;
|
|
MR_Word value;
|
|
const MR_ProcLayout *entry_layout;
|
|
const MR_LabelLayout *layout;
|
|
const MR_Code *success_ip;
|
|
MR_bool top_frame;
|
|
|
|
layout = label->MR_internal_layout;
|
|
success_ip = label->MR_internal_addr;
|
|
entry_layout = layout->MR_sll_entry;
|
|
|
|
/*
|
|
** For each stack frame...
|
|
*/
|
|
|
|
top_frame = MR_TRUE;
|
|
while (MR_DETISM_DET_STACK(entry_layout->MR_sle_detism)) {
|
|
if (label->MR_internal_name != NULL) {
|
|
fprintf(stderr, " label: %s\n", label->MR_internal_name);
|
|
} else {
|
|
fprintf(stderr, " label: %p\n", label->MR_internal_addr);
|
|
}
|
|
|
|
if (success_ip == MR_stack_trace_bottom) {
|
|
break;
|
|
}
|
|
|
|
MR_dump_live_variables(layout, heap_zone, top_frame,
|
|
stack_pointer, current_frame);
|
|
/*
|
|
** Move to the next stack frame.
|
|
*/
|
|
{
|
|
MR_LongLval location;
|
|
MR_LongLvalType type;
|
|
int number;
|
|
|
|
location = entry_layout->MR_sle_succip_locn;
|
|
type = MR_LONG_LVAL_TYPE(location);
|
|
number = MR_LONG_LVAL_NUMBER(location);
|
|
if (type != MR_LONG_LVAL_TYPE_STACKVAR) {
|
|
MR_fatal_error("can only handle stackvars");
|
|
}
|
|
|
|
success_ip = (MR_Code *) MR_based_stackvar(stack_pointer, number);
|
|
stack_pointer = stack_pointer - entry_layout->MR_sle_stack_slots;
|
|
label = MR_lookup_internal_by_addr(success_ip);
|
|
}
|
|
|
|
top_frame = MR_FALSE;
|
|
layout = label->MR_internal_layout;
|
|
|
|
if (layout != NULL) {
|
|
entry_layout = layout->MR_sll_entry;
|
|
}
|
|
}
|
|
}
|
|
|
|
static void
|
|
MR_dump_live_variables(const MR_LabelLayout *label_layout,
|
|
MR_MemoryZone *heap_zone, MR_bool top_frame,
|
|
MR_Word *stack_pointer, MR_Word *current_frame)
|
|
{
|
|
int short_var_count;
|
|
int long_var_count;
|
|
int i;
|
|
MR_TypeInfo type_info;
|
|
MR_Word value;
|
|
MR_TypeInfoParams type_params;
|
|
MR_Word saved_regs[MR_MAX_FAKE_REG];
|
|
MR_Float saved_f_regs[MR_MAX_VIRTUAL_F_REG];
|
|
MR_Word *current_regs;
|
|
|
|
long_var_count = MR_long_desc_var_count(label_layout);
|
|
short_var_count = MR_short_desc_var_count(label_layout);
|
|
|
|
/*
|
|
** For the top stack frame, we should pass a pointer to a filled-in
|
|
** saved_regs instead of NULL. For other stack frames, passing NULL
|
|
** is fine, since output arguments are not live yet for any call
|
|
** except the top one.
|
|
*/
|
|
|
|
MR_restore_registers();
|
|
MR_copy_regs_to_saved_regs(MR_MAX_FAKE_REG - 1, saved_regs,
|
|
MR_MAX_VIRTUAL_F_REG - 1, saved_f_regs);
|
|
if (top_frame) {
|
|
current_regs = saved_regs;
|
|
} else {
|
|
current_regs = NULL;
|
|
}
|
|
type_params = MR_materialize_type_params_base(label_layout,
|
|
current_regs, stack_pointer, current_frame);
|
|
|
|
for (i = 0; i < long_var_count; i++) {
|
|
fprintf(stderr, "%-12s\t", "");
|
|
if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
|
|
MR_print_proc_id(stderr, label_layout->MR_sll_entry);
|
|
}
|
|
|
|
dump_long_value(MR_long_desc_var_locn(label_layout, i),
|
|
heap_zone, stack_pointer, current_frame, top_frame);
|
|
fprintf(stderr, "\n");
|
|
fflush(NULL);
|
|
|
|
if (MR_debug_agc_print_vars) {
|
|
/*
|
|
** Call Mercury but use the debugging heap.
|
|
*/
|
|
|
|
MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
|
|
if (MR_get_type_and_value_base(label_layout, i,
|
|
current_regs, stack_pointer, current_frame, type_params,
|
|
&type_info, &value)) {
|
|
printf("\t");
|
|
MR_write_variable(type_info, value);
|
|
printf("\n");
|
|
}
|
|
|
|
fflush(NULL);
|
|
}
|
|
}
|
|
|
|
for (i = 0; i < short_var_count; i++) {
|
|
fprintf(stderr, "%-12s\t", "");
|
|
if (MR_PROC_LAYOUT_HAS_PROC_ID(label_layout->MR_sll_entry)) {
|
|
MR_print_proc_id(stderr, label_layout->MR_sll_entry);
|
|
}
|
|
|
|
dump_short_value(MR_short_desc_var_locn(label_layout, i),
|
|
heap_zone, stack_pointer, current_frame, top_frame);
|
|
fprintf(stderr, "\n");
|
|
fflush(NULL);
|
|
|
|
if (MR_debug_agc_print_vars) {
|
|
/*
|
|
** Call Mercury but use the debugging heap.
|
|
*/
|
|
|
|
MR_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
MR_virtual_hp = MR_ENGINE(MR_eng_debug_heap_zone->MR_zone_min);
|
|
|
|
if (MR_get_type_and_value_base(label_layout, i,
|
|
current_regs, stack_pointer, current_frame, type_params,
|
|
&type_info, &value)) {
|
|
printf("\t");
|
|
MR_write_variable(type_info, value);
|
|
printf("\n");
|
|
}
|
|
|
|
fflush(NULL);
|
|
}
|
|
}
|
|
|
|
MR_copy_saved_regs_to_regs(MR_MAX_FAKE_REG - 1, saved_regs);
|
|
MR_save_registers();
|
|
MR_free(type_params);
|
|
}
|
|
|
|
static void
|
|
MR_dump_long_value(MR_LongLval locn, MR_MemoryZone *heap_zone,
|
|
MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
|
|
{
|
|
intw locn_num;
|
|
MR_Word value;
|
|
int difference;
|
|
MR_bool have_value;
|
|
|
|
value = 0;
|
|
have_value = MR_FALSE;
|
|
|
|
locn_num = MR_LONG_LVAL_NUMBER(locn);
|
|
switch (MR_LONG_LVAL_TYPE(locn)) {
|
|
case MR_LONG_LVAL_TYPE_R:
|
|
if (do_regs) {
|
|
value = MR_virtual_reg_value(locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "r%d\t", locn_num);
|
|
} else {
|
|
fprintf(stderr, "r%d (invalid)\t", locn_num);
|
|
}
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_F:
|
|
fprintf(stderr, "f%d\t", locn_num);
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_STACKVAR:
|
|
value = MR_based_stackvar(stack_pointer, locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "stackvar%d", locn_num);
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_FRAMEVAR:
|
|
value = MR_based_framevar(current_frame, locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "framevar%d", locn_num);
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_SUCCIP:
|
|
fprintf(stderr, "succip");
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_MAXFR:
|
|
fprintf(stderr, "maxfr");
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_CURFR:
|
|
fprintf(stderr, "curfr");
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_HP:
|
|
fprintf(stderr, "hp");
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_SP:
|
|
fprintf(stderr, "sp");
|
|
break;
|
|
|
|
case MR_LONG_LVAL_TYPE_INDIRECT:
|
|
fprintf(stderr, "offset %d from ",
|
|
MR_LONG_LVAL_INDIRECT_OFFSET(locn_num));
|
|
/* XXX Tyson will have to complete this */
|
|
/* based on what he wants this function to do */
|
|
|
|
case MR_LONG_LVAL_TYPE_UNKNOWN:
|
|
fprintf(stderr, "unknown");
|
|
break;
|
|
|
|
default:
|
|
fprintf(stderr, "LONG DEFAULT");
|
|
break;
|
|
}
|
|
if (have_value) {
|
|
if (value >= (MR_Word) heap_zone->MR_zone_min &&
|
|
value < (MR_Word) heap_zone->MR_zone_hardmax)
|
|
{
|
|
difference = (MR_Word *) value - (MR_Word *) heap_zone->MR_zone_min;
|
|
fprintf(stderr, "\thp[%d]\t(%lx)", difference, (long) value);
|
|
} else {
|
|
fprintf(stderr, "\t \t(%lx)", (long) value);
|
|
}
|
|
}
|
|
}
|
|
|
|
static void
|
|
MR_dump_short_value(MR_ShortLval locn, MR_MemoryZone *heap_zone,
|
|
MR_Word *stack_pointer, MR_Word *current_frame, MR_bool do_regs)
|
|
{
|
|
int locn_num;
|
|
MR_Word value;
|
|
int difference;
|
|
MR_bool have_value;
|
|
|
|
value = 0;
|
|
have_value = MR_FALSE;
|
|
locn_num = (int) locn >> MR_SHORT_LVAL_TAGBITS;
|
|
switch (MR_SHORT_LVAL_TYPE(locn)) {
|
|
case MR_SHORT_LVAL_TYPE_R:
|
|
if (do_regs) {
|
|
value = MR_virtual_reg_value(locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "r%d\t", locn_num);
|
|
} else {
|
|
fprintf(stderr, "r%d (invalid)\t", locn_num);
|
|
}
|
|
break;
|
|
|
|
case MR_SHORT_LVAL_TYPE_STACKVAR:
|
|
value = MR_based_stackvar(stack_pointer, locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "stackvar%d", locn_num);
|
|
break;
|
|
|
|
case MR_SHORT_LVAL_TYPE_FRAMEVAR:
|
|
value = MR_based_framevar(current_frame, locn_num);
|
|
have_value = MR_TRUE;
|
|
fprintf(stderr, "framevar%d", locn_num);
|
|
break;
|
|
|
|
case MR_SHORT_LVAL_TYPE_SPECIAL:
|
|
switch (locn_num) {
|
|
case MR_LONG_LVAL_TYPE_SUCCIP:
|
|
fprintf(stderr, "succip");
|
|
break;
|
|
case MR_LONG_LVAL_TYPE_MAXFR:
|
|
fprintf(stderr, "succip");
|
|
break;
|
|
case MR_LONG_LVAL_TYPE_CURFR:
|
|
fprintf(stderr, "curfr");
|
|
break;
|
|
case MR_LONG_LVAL_TYPE_HP:
|
|
fprintf(stderr, "hp");
|
|
break;
|
|
case MR_LONG_LVAL_TYPE_SP:
|
|
fprintf(stderr, "sp");
|
|
break;
|
|
default:
|
|
fprintf(stderr, "SPECIAL DEFAULT");
|
|
break;
|
|
}
|
|
break;
|
|
|
|
default:
|
|
fprintf(stderr, "SHORT DEFAULT");
|
|
break;
|
|
}
|
|
if (have_value) {
|
|
if (value >= (MR_Word) heap_zone->MR_zone_min &&
|
|
value < (MR_Word) heap_zone->MR_zone_hardmax)
|
|
{
|
|
difference = (MR_Word *) value - (MR_Word *) heap_zone->MR_zone_min;
|
|
fprintf(stderr, "\thp[%d]\t(%lx)", difference, (long) value);
|
|
} else {
|
|
fprintf(stderr, "\t \t(%lx)", (long) value);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif /* !MR_HIGHLEVEL_CODE */
|
|
|
|
#endif /* MR_NATIVE_GC */
|