1998-04-06
1998-04-06 04:17:25 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
-
62d3e4a8b50a347bd41f16ec15ca31ce29ffb90e
(56 lines)
(+22/-34)
[
Show
| Annotate
]
Branch: 7.9
more debug added + STRICT_ARROW* removed on popular demand
Rev: src/interpret.c:1.74
4:
||| See the files COPYING and DISCLAIMER for more information.
\*/
#include "global.h"
- RCSID("$Id: interpret.c,v 1.73 1998/04/01 00:47:46 hubbe Exp $");
+ RCSID("$Id: interpret.c,v 1.74 1998/04/06 04:17:25 hubbe Exp $");
#include "interpret.h"
#include "object.h"
#include "program.h"
87: Inside #if defined(DEBUG)
#ifdef DEBUG
static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk)
{
+ struct frame *f;
debug_gc_xmark_svalues(evaluator_stack,sp-evaluator_stack-1,"interpreter stack");
-
+
+ for(f=fp;f;f=f->parent_frame)
+ {
+ if(f->context.parent)
+ gc_external_mark(f->context.parent);
+ gc_external_mark(f->current_object);
+ gc_external_mark(f->context.prog);
}
-
+
+ }
#endif
void init_interpreter(void)
96: Inside #if defined(USE_MMAP_FOR_STACK)
#ifdef USE_MMAP_FOR_STACK
static int fd = -1;
- #ifdef DEBUG
- static struct callback *spcb;
- if(!spcb)
- {
- spcb=add_gc_callback(gc_check_stack_callback,0,0);
- }
- #endif
+
#ifndef MAP_VARIABLE
#define MAP_VARIABLE 0
165:
sp=evaluator_stack;
mark_sp=mark_stack;
fp=0;
+
+ #ifdef DEBUG
+ {
+ static struct callback *spcb;
+ if(!spcb)
+ {
+ spcb=add_gc_callback(gc_check_stack_callback,0,0);
}
-
+ }
+ #endif
+ }
void check_stack(INT32 size)
{
1414:
push_array_items(sp->u.array);
break;
- CASE(F_STRICT_ARROW);
- if(sp[-1].type != T_OBJECT)
- error("Expected object for first argument to `->\n");
- if(!sp[-1].u.object->prog)
- error("`-> on destructed object.\n");
- sp[-1].subtype=GET_ARG();
- if(sp[-1].u.object->prog->id != EXTRACT_INT(pc))
- error("`->: Object not of specified type.\n");
- sp[-1].type=T_FUNCTION;
- pc+=sizeof(INT32);
- break;
-
- CASE(F_STRICT_ARROW_VARIABLE);
- if(sp[-1].type != T_OBJECT)
- error("Expected object for first argument to `->\n");
- if(!sp[-1].u.object->prog)
- error("`-> on destructed object.\n");
- instr=GET_ARG();
- if(sp[-1].u.object->prog->id != EXTRACT_INT(pc))
- error("`->: Object not of specified type.\n");
- pc+=sizeof(INT32);
- low_object_index_no_free(sp,sp[-1].u.object,instr);
- free_object(sp[-1].u.object);
- sp[-1]=*sp;
- break;
-
+
CASE(F_LOCAL_LOCAL_INDEX);
{
struct svalue *s=fp->locals+GET_ARG();