diff --git a/src/compilation.h b/src/compilation.h index c69032220b838eea8b5339e67723c7c1fee6fdb4..fe6389af692924f5824ade83958fb6c63b20a1f2 100644 --- a/src/compilation.h +++ b/src/compilation.h @@ -1,5 +1,5 @@ /* - * $Id: compilation.h,v 1.9 1998/04/24 00:32:08 hubbe Exp $ + * $Id: compilation.h,v 1.10 1998/04/27 10:00:26 hubbe Exp $ * * Compilator state push / pop operator construction file * @@ -87,7 +87,6 @@ ZMEMBER(int,num_parse_error) ZMEMBER(struct compiler_frame *,compiler_frame) ZMEMBER(INT32,num_used_modules) - IMEMBER(int,comp_stackp) IMEMBER(int,compiler_pass) ZMEMBER(int,local_class_counter) ZMEMBER(int,catch_level) diff --git a/src/docode.c b/src/docode.c index ffa3b103cea614d6462e3e52630027cdac0e80aa..c94217a5bd86d433ab06fe3a9efbd6a39ddaf652 100644 --- a/src/docode.c +++ b/src/docode.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: docode.c,v 1.35 1998/04/06 03:51:54 hubbe Exp $"); +RCSID("$Id: docode.c,v 1.36 1998/04/27 10:00:26 hubbe Exp $"); #include "las.h" #include "program.h" #include "language.h" @@ -25,6 +25,8 @@ RCSID("$Id: docode.c,v 1.35 1998/04/06 03:51:54 hubbe Exp $"); #include "operators.h" #include "object.h" +static int do_docode2(node *n,int flags); + INT32 current_break=-1; INT32 current_continue=-1; @@ -44,48 +46,6 @@ INT32 read_int(int offset) } int store_linenumbers=1; - -/* - * A mechanism to remember addresses on a stack. - */ -int comp_stackp; -INT32 comp_stack[COMPILER_STACK_SIZE]; - -void push_address(void) -{ - if (comp_stackp >= COMPILER_STACK_SIZE) - { - yyerror("Compiler stack overflow"); - comp_stackp++; - return; - } - comp_stack[comp_stackp++] = PC; -} - -void push_explicit(INT32 address) -{ - if (comp_stackp >= COMPILER_STACK_SIZE) - { - yyerror("Compiler stack overflow"); - comp_stackp++; - return; - } - comp_stack[comp_stackp++] = address; -} - -INT32 pop_address(void) -{ - if (comp_stackp == 0) - fatal("Compiler stack underflow.\n"); - if (comp_stackp > COMPILER_STACK_SIZE) - { - --comp_stackp; - return 0; - } - return comp_stack[--comp_stackp]; -} - - static int label_no=0; int alloc_label(void) { return ++label_no; } @@ -97,8 +57,6 @@ int do_jump(int token,INT32 lbl) return lbl; } -static int do_docode2(node *n,int flags); - #define ins_label(L) do_jump(F_LABEL, L) void do_pop(int x) @@ -125,7 +83,6 @@ int do_docode(node *n,INT16 flags) return i; } - static int is_efun(node *n, c_fun fun) { return n && n->token == F_CONSTANT && diff --git a/src/docode.h b/src/docode.h index c37e2d609eddfaade6a9c7449431c4a77fc333ed..69e3a03377907813ebfdddb11d786f753e56fcd2 100644 --- a/src/docode.h +++ b/src/docode.h @@ -5,25 +5,17 @@ \*/ /* - * $Id: docode.h,v 1.5 1998/03/28 15:38:02 grubba Exp $ + * $Id: docode.h,v 1.6 1998/04/27 10:00:27 hubbe Exp $ */ #ifndef DOCODE_H #define DOCODE_H -/* - * The compiler stack is used when compiling to keep track of data. - * This value need too be large enough for the programs you compile. - */ -#define COMPILER_STACK_SIZE 8000 - #define DO_LVALUE 1 #define DO_NOT_COPY 2 #define DO_POP 4 extern int store_linenumbers; -extern int comp_stackp; -extern INT32 comp_stack[COMPILER_STACK_SIZE]; #define emit(X,Y) insert_opcode((X),(Y),lex.current_line, lex.current_file) #define emit2(X) insert_opcode2((X),lex.current_line, lex.current_file) diff --git a/src/language.yacc b/src/language.yacc index 761ce41cd304ba40c4533193773791d94fee2686..30cd82113fbaf37496f04e9ce513a213940281db 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -171,7 +171,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.89 1998/04/26 11:39:45 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.90 1998/04/27 10:00:27 hubbe Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -207,17 +207,6 @@ static int varargs; static INT32 current_modifiers; static struct pike_string *last_identifier=0; -void fix_comp_stack(int sp) -{ - if(comp_stackp>sp) - { - yyerror("Compiler stack fixed."); - comp_stackp=sp; - }else if(comp_stackp<sp){ - fatal("Compiler stack frame underflow."); - } -} - /* * Kludge for Bison not using prototypes. @@ -1038,7 +1027,6 @@ continue: F_CONTINUE { $$=mknode(F_CONTINUE,0,0); } ; lambda: F_LAMBDA { push_compiler_frame(); - $<number>$=comp_stackp; if(compiler_frame->current_return_type) free_string(compiler_frame->current_return_type); @@ -1051,9 +1039,6 @@ lambda: F_LAMBDA int f,e; struct pike_string *name; - fix_comp_stack($<number>2); - - $4=mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0)); type=find_return_type($4); @@ -1093,7 +1078,6 @@ lambda: F_LAMBDA $$=mkidentifiernode(f); free_string(name); free_string(type); - comp_stackp=$<number>2; pop_compiler_frame(); } ;