summaryrefslogtreecommitdiff
path: root/yarvcore.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 18:04:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-30 18:04:35 +0000
commit6a69ad4df1719516a2da8b95872d3a44deae026c (patch)
tree805550c7516a6296d4d0a660c4e374b045e9c54b /yarvcore.h
parenteb9aaa4c4fdaee9225e1843a71b5cdefaf179db6 (diff)
* yarvcore.h: some refactoring on rb_iseq_t.
rename some variable names, add comments, etc. * compile.c, iseq.c, proc.c, vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.h')
-rw-r--r--yarvcore.h77
1 files changed, 41 insertions, 36 deletions
diff --git a/yarvcore.h b/yarvcore.h
index 85842a00a4e..9bd74624456 100644
--- a/yarvcore.h
+++ b/yarvcore.h
@@ -234,50 +234,50 @@ typedef struct rb_iseq_profile_struct {
struct rb_iseq_struct;
struct rb_iseq_struct {
- /* instruction sequence type */
- VALUE type;
-
- VALUE self;
- VALUE name; /* String: iseq name */
- VALUE *iseq; /* iseq */
- VALUE *iseq_encoded;
+ /***************/
+ /* static data */
+ /***************/
+
+ VALUE type; /* instruction sequence type */
+ VALUE name; /* String: iseq name */
+ VALUE filename; /* file information where this sequence from */
+ VALUE *iseq; /* iseq (insn number and openrads) */
+ VALUE *iseq_encoded; /* encoded iseq */
+ unsigned long iseq_size;
VALUE iseq_mark_ary; /* Array: includes operands which should be GC marked */
- /* sequence size */
- unsigned long size;
/* insn info, must be freed */
- struct insn_info_struct *insn_info_tbl;
-
- /* insn info size, this value shows also instruction count */
- unsigned int insn_info_size;
-
- /* file information where this sequence from */
- VALUE filename;
+ struct insn_info_struct *insn_info_table;
+ unsigned long insn_info_size;
ID *local_table; /* must free */
int local_table_size;
/* method, class frame: sizeof(vars) + 1, block frame: sizeof(vars) */
- int local_size;
-
- /* jit compiled or not */
- void *jit_compiled;
- void *iseq_orig;
+ int local_size;
/**
* argument information
*
- * def m(a1, a2, ..., aM, b1=(...), b2=(...), ..., bN=(...), *c, &d)
+ * def m(a1, a2, ..., aM, # mandatory
+ * b1=(...), b2=(...), ..., bN=(...), # optinal
+ * *c, # rest
+ * d1, d2, ..., dO, # post
+ * &e) # block
* =>
*
- * argc = M
- * arg_rest = M+N + 1 // if no rest arguments, rest is 0
- * arg_opts = N
- * arg_opts_tbl = [ (N entries) ]
- * arg_block = M+N + 1 (rest) + 1 (block)
- * check:
- * M <= num
+ * argc = M
+ * arg_rest = M+N+1 // or -1 if no rest arg
+ * arg_opts = N
+ * arg_opts_tbl = [ (N entries) ]
+ * arg_post_len = O // 0 if no post arguments
+ * arg_post_start = M+N+2
+ * arg_block = M+N + 1 + O + 1 // -1 if no block arg
+ * arg_simple = 0 if not simple arguments.
+ * = 1 if no opt, rest, post, block.
+ * = 2 if ambiguos block parameter ({|a|}).
+ * arg_size = argument size.
*/
int argc;
@@ -288,15 +288,9 @@ struct rb_iseq_struct {
int arg_post_len;
int arg_post_start;
int arg_size;
-
VALUE *arg_opt_tbl;
- /* for stack overflow check */
- int stack_max;
-
- /* klass/module nest information stack (cref) */
- NODE *cref_stack;
- VALUE klass;
+ int stack_max; /* for stack overflow check */
/* catch table */
struct catch_table_entry *catch_table;
@@ -306,16 +300,27 @@ struct rb_iseq_struct {
struct rb_iseq_struct *parent_iseq;
struct rb_iseq_struct *local_iseq;
+ /****************/
+ /* dynamic data */
+ /****************/
+
+ VALUE self;
+
/* block inlining */
NODE *node;
void *special_block_builder;
void *cached_special_block_builder;
VALUE cached_special_block;
+ /* klass/module nest information stack (cref) */
+ NODE *cref_stack;
+ VALUE klass;
+
/* misc */
ID defined_method_id; /* for define_method */
rb_iseq_profile_t profile;
+ /* used at compile time */
struct iseq_compile_data *compile_data;
};