Browse Source

remove compiler point structure; rewinding in the middle of a function is currently not needed

pull/1/head
Sami Vaarala 12 years ago
parent
commit
ef02914f4c
  1. 2
      src/duk_forwdecl.h
  2. 29
      src/duk_js_compiler.h

2
src/duk_forwdecl.h

@ -48,7 +48,6 @@ struct duk_lexer_ctx;
struct duk_compiler_instr; struct duk_compiler_instr;
struct duk_compiler_func; struct duk_compiler_func;
struct duk_compiler_ctx; struct duk_compiler_ctx;
struct duk_compiler_point;
struct duk_re_matcher_ctx; struct duk_re_matcher_ctx;
struct duk_re_compiler_ctx; struct duk_re_compiler_ctx;
@ -92,7 +91,6 @@ typedef struct duk_lexer_ctx duk_lexer_ctx;
typedef struct duk_compiler_instr duk_compiler_instr; typedef struct duk_compiler_instr duk_compiler_instr;
typedef struct duk_compiler_func duk_compiler_func; typedef struct duk_compiler_func duk_compiler_func;
typedef struct duk_compiler_ctx duk_compiler_ctx; typedef struct duk_compiler_ctx duk_compiler_ctx;
typedef struct duk_compiler_point duk_compiler_point;
typedef struct duk_re_matcher_ctx duk_re_matcher_ctx; typedef struct duk_re_matcher_ctx duk_re_matcher_ctx;
typedef struct duk_re_compiler_ctx duk_re_compiler_ctx; typedef struct duk_re_compiler_ctx duk_re_compiler_ctx;

29
src/duk_js_compiler.h

@ -70,9 +70,6 @@ struct duk_compiler_instr {
* Compiler state * Compiler state
*/ */
#define DUK_COMPILER_SETPOINT(ctx,pt) duk_compiler_setpoint((ctx), (pt))
#define DUK_COMPILER_GETPOINT(ctx,pt) duk_compiler_getpoint((ctx), (pt))
#define MAX_MAPPED_REGS 128 /* max regs mapped to arguments and variables */ #define MAX_MAPPED_REGS 128 /* max regs mapped to arguments and variables */
#define MAX_ACTIVE_LABELS 64 #define MAX_ACTIVE_LABELS 64
@ -196,32 +193,6 @@ struct duk_compiler_ctx {
duk_compiler_func curr_func; duk_compiler_func curr_func;
}; };
/* A structure for 'snapshotting' a point for rewinding */
struct duk_compiler_point {
duk_lexer_point lex_point;
duk_token curr_token; /* note: tokens refer to value stack entries implicitly through lexer state */
duk_token prev_token;
/* these are restored on a rollback */
int code_length;
int consts_length;
int funcs_length;
int regs_count;
int labels_count;
int temp_reg;
int temp_max;
int catch_depth;
int nud_count;
int led_count;
/* Note: label rollbacks works because labels are only pushed during
* parsing of a function (never popped). If only active labels were
* tracked, rollback across a label boundary would need an actual
* copy of label state.
*/
};
/* /*
* Prototypes * Prototypes
*/ */

Loading…
Cancel
Save