diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-31 01:42:54 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-31 01:42:54 +0000 |
commit | b76fd8283aa28794c082c61615b57bc0e80acdc7 (patch) | |
tree | d84fa4c3e9c691b471cfe8d66cd4b40976eb0dc2 /vm_core.h | |
parent | 2b82e06aaf112d8ebb48c5424940cb08e738d9b4 (diff) | |
download | ruby-b76fd8283aa28794c082c61615b57bc0e80acdc7.tar.gz |
* vm_core.h: some refactoring.
- move decl. of rb_compile_option_struct to iseq.h.
- define enum iseq_type.
- define enum vm_special_object_type.
* compile.c: some refactoring.
- apply above changes.
- (struct iseq_link_element): change value of type.
- remove unused decl.
- fix comment.
- rename iseq_build_body and iseq_build_exception to
iseq_build_from_ary_body and iseq_build_from_ary_exception.
* iseq.h: define enum catch_type and enum defined_type.
* insns.def: apply above changes.
* iseq.c: define ISEQ_MAJOR_VERSION and ISEQ_MINOR_VERSION.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -122,17 +122,7 @@ typedef unsigned long rb_num_t; struct iseq_compile_data_ensure_node_stack; -typedef struct rb_compile_option_struct { - int inline_const_cache; - int peephole_optimization; - int tailcall_optimization; - int specialized_instruction; - int operands_unification; - int instructions_unification; - int stack_caching; - int trace_instruction; - int debug_level; -} rb_compile_option_t; +typedef struct rb_compile_option_struct rb_compile_option_t; struct iseq_inline_cache_entry { VALUE ic_vmstat; @@ -162,7 +152,18 @@ struct rb_iseq_struct { /* static data */ /***************/ - VALUE type; /* instruction sequence type */ + enum iseq_type { + ISEQ_TYPE_TOP, + ISEQ_TYPE_METHOD, + ISEQ_TYPE_BLOCK, + ISEQ_TYPE_CLASS, + ISEQ_TYPE_RESCUE, + ISEQ_TYPE_ENSURE, + ISEQ_TYPE_EVAL, + ISEQ_TYPE_MAIN, + ISEQ_TYPE_DEFINED_GUARD, + } type; /* instruction sequence type */ + VALUE name; /* String: iseq name */ VALUE filename; /* file information where this sequence from */ VALUE filepath; /* real file path or nil */ @@ -374,8 +375,7 @@ struct rb_unblock_callback { struct rb_mutex_struct; -typedef struct rb_thread_struct -{ +typedef struct rb_thread_struct { VALUE self; rb_vm_t *vm; @@ -552,9 +552,11 @@ typedef struct { #define VM_CALL_SUPER_BIT (0x01 << 7) #define VM_CALL_OPT_SEND_BIT (0x01 << 8) -#define VM_SPECIAL_OBJECT_VMCORE 0x01 -#define VM_SPECIAL_OBJECT_CBASE 0x02 -#define VM_SPECIAL_OBJECT_CONST_BASE 0x03 +enum vm_special_object_type { + VM_SPECIAL_OBJECT_VMCORE = 1, + VM_SPECIAL_OBJECT_CBASE, + VM_SPECIAL_OBJECT_CONST_BASE, +}; #define VM_FRAME_MAGIC_METHOD 0x11 #define VM_FRAME_MAGIC_BLOCK 0x21 |