summaryrefslogtreecommitdiff
path: root/iseq.c
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.c
parent2b82e06aaf112d8ebb48c5424940cb08e738d9b4 (diff)
* 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.c')
-rw-r--r--iseq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/iseq.c b/iseq.c
index 327de57361..fedc00e1ab 100644
--- a/iseq.c
+++ b/iseq.c
@@ -19,6 +19,9 @@
#include "insns.inc"
#include "insns_info.inc"
+#define ISEQ_MAJOR_VERSION 1
+#define ISEQ_MINOR_VERSION 2
+
VALUE rb_cISeq;
#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
@@ -1331,8 +1334,8 @@ iseq_data_to_ary(rb_iseq_t *iseq)
* :catch_table, :bytecode]
*/
rb_ary_push(val, rb_str_new2("YARVInstructionSequence/SimpleDataFormat"));
- rb_ary_push(val, INT2FIX(1)); /* major */
- rb_ary_push(val, INT2FIX(2)); /* minor */
+ rb_ary_push(val, INT2FIX(ISEQ_MAJOR_VERSION)); /* major */
+ rb_ary_push(val, INT2FIX(ISEQ_MINOR_VERSION)); /* minor */
rb_ary_push(val, INT2FIX(1));
rb_ary_push(val, misc);
rb_ary_push(val, iseq->name);
@@ -1508,6 +1511,11 @@ Init_ISeq(void)
rb_define_method(rb_cISeq, "to_a", iseq_to_a, 0);
rb_define_method(rb_cISeq, "eval", iseq_eval, 0);
+#if 0 /* TBD */
+ rb_define_method(rb_cISeq, "marshal_dump", iseq_marshal_dump, 0);
+ rb_define_method(rb_cISeq, "marshal_load", iseq_marshal_load, 1);
+#endif
+
/* disable this feature because there is no verifier. */
/* rb_define_singleton_method(rb_cISeq, "load", iseq_s_load, -1); */
(void)iseq_s_load;