aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-31 01:42:54 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-31 01:42:54 +0000
commitb76fd8283aa28794c082c61615b57bc0e80acdc7 (patch)
treed84fa4c3e9c691b471cfe8d66cd4b40976eb0dc2 /iseq.h
parent2b82e06aaf112d8ebb48c5424940cb08e738d9b4 (diff)
downloadruby-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 'iseq.h')
-rw-r--r--iseq.h59
1 files changed, 32 insertions, 27 deletions
diff --git a/iseq.h b/iseq.h
index bc821ec00c..2f3c460e8e 100644
--- a/iseq.h
+++ b/iseq.h
@@ -26,22 +26,17 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
struct st_table *ruby_insn_make_insn_table(void);
-#define ISEQ_TYPE_TOP INT2FIX(1)
-#define ISEQ_TYPE_METHOD INT2FIX(2)
-#define ISEQ_TYPE_BLOCK INT2FIX(3)
-#define ISEQ_TYPE_CLASS INT2FIX(4)
-#define ISEQ_TYPE_RESCUE INT2FIX(5)
-#define ISEQ_TYPE_ENSURE INT2FIX(6)
-#define ISEQ_TYPE_EVAL INT2FIX(7)
-#define ISEQ_TYPE_MAIN INT2FIX(8)
-#define ISEQ_TYPE_DEFINED_GUARD INT2FIX(9)
-
-#define CATCH_TYPE_RESCUE ((int)INT2FIX(1))
-#define CATCH_TYPE_ENSURE ((int)INT2FIX(2))
-#define CATCH_TYPE_RETRY ((int)INT2FIX(3))
-#define CATCH_TYPE_BREAK ((int)INT2FIX(4))
-#define CATCH_TYPE_REDO ((int)INT2FIX(5))
-#define CATCH_TYPE_NEXT ((int)INT2FIX(6))
+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;
+};
struct iseq_insn_info_entry {
unsigned short position;
@@ -50,7 +45,14 @@ struct iseq_insn_info_entry {
};
struct iseq_catch_table_entry {
- VALUE type;
+ enum catch_type {
+ CATCH_TYPE_RESCUE,
+ CATCH_TYPE_ENSURE,
+ CATCH_TYPE_RETRY,
+ CATCH_TYPE_BREAK,
+ CATCH_TYPE_REDO,
+ CATCH_TYPE_NEXT,
+ } type;
VALUE iseq;
unsigned long start;
unsigned long end;
@@ -94,16 +96,19 @@ struct iseq_compile_data {
};
/* defined? */
-#define DEFINED_IVAR INT2FIX(1)
-#define DEFINED_IVAR2 INT2FIX(2)
-#define DEFINED_GVAR INT2FIX(3)
-#define DEFINED_CVAR INT2FIX(4)
-#define DEFINED_CONST INT2FIX(5)
-#define DEFINED_METHOD INT2FIX(6)
-#define DEFINED_YIELD INT2FIX(7)
-#define DEFINED_REF INT2FIX(8)
-#define DEFINED_ZSUPER INT2FIX(9)
-#define DEFINED_FUNC INT2FIX(10)
+
+enum defined_type {
+ DEFINED_IVAR = 1,
+ DEFINED_IVAR2,
+ DEFINED_GVAR,
+ DEFINED_CVAR,
+ DEFINED_CONST,
+ DEFINED_METHOD,
+ DEFINED_YIELD,
+ DEFINED_REF,
+ DEFINED_ZSUPER,
+ DEFINED_FUNC,
+};
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility pop