Граф коммитов

183 Коммитов

Автор SHA1 Сообщение Дата
nobu f6003894b9 * compile.c (new_child_iseq): adjust argument types.
* iseq.c (prepare_iseq_build, rb_iseq_new),
  (rb_iseq_new_with_bopt_and_opt, rb_iseq_new_with_opt),
  (rb_iseq_new_with_bopt): ditto.
* compile.c (iseq_set_exception_table): suppress warnings.
* insns.def (putspecialobject, defined): ditto.
* iseq.c (iseq_load): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31 13:11:02 +00:00
ko1 b76fd8283a * 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
2010-10-31 01:42:54 +00:00
ko1 340bb04efe * iseq.c (iseq_s_compile): fix optional argument.
a patch from Yutaka HARA [ruby-core:32953] [Ruby 1.9-Bug#4001]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-29 15:36:33 +00:00
nobu e8e2ea4866 * iseq.c (insn_operand_intern): fix format specifier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15 14:11:26 +00:00
ko1 559fd3e439 * insns.def, iseq.c, vm_insnhelper.c: rename variable name
(ip -> iseq).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-14 13:19:30 +00:00
nobu e69bba13a0 * iseq.c (insn_operand_intern, rb_iseq_disasm): fix format specifiers.
* vm.c (thread_free): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 14:07:22 +00:00
nobu d410639a6d * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer),
  (run_final), hash.c (rb_hash_aref, rb_hash_lookup2),
  (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i),
  iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink),
  thread.c (rb_thread_local_aref),
  variable.c (generic_ivar_remove, ivar_get, rb_const_get_0),
  (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method),
  vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method),
  ext/iconv/iconv.c (map_charset): use st_data_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 14:47:23 +00:00
nobu 17c48bebf8 * compile.c (iseq_build_body), insns.def (getglobal, setglobal),
iseq.c (iseq_load, iseq_data_to_ary), util.c (valid_filename):
  use VALUE.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12 14:35:40 +00:00
naruse 7175a9073e * class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
clean unused-value warnings.

* cont.c, process.c, vm_exec.h: clean cast warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27 07:13:43 +00:00
nobu 25b9eb5e57 * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
add parent member.

* error.c (rb_typeddata_inherited_p): new function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18 07:31:54 +00:00
mame 2db572514c * load.c (rb_load_internal): remove call to rb_realpath_internal
within rb_load_internal which caused big performance degradation.
  Instead, call rb_realpath_internal in the caller of
  rb_load_internal.  [ruby-dev:41502] [ruby-dev:41610]

* vm.c (rb_vm_call_cfunc): ditto.

* eval_intern.h (rb_vm_call_cfunc): ditto.

* ruby.c (process_options): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-17 14:32:20 +00:00
nobu df54a2e6be * cont.c (fiber_set_stack_location), iseq.c (prepare_iseq_build),
node.c (dump_node): suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-16 02:46:16 +00:00
wanabe c6896436d8 * iseq.c (iseq_load): allow filepath to be nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02 03:06:44 +00:00
mame e02f7f79c2 * iseq.c (set_relation): do not use top_wrapper as bottom of cref,
which caused constant lookup error when "wrapped load" is used;
  instead, use Object as bottom, and push top_wrapper on Object.
  [ruby-core:25039]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27 13:42:29 +00:00
mame 6ff75042db * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute
path field into rb_iseq_t.  The field contains a string representing
  a path to corresponding source file. or nil when the iseq is created
  from -e, stdin, eval, etc.  This field is used for require_relative.
  [ruby-dev:40004]

* load.c (rb_f_require_relative): add C implementation of
  require_relative.

* prelude.rb (require_relative): get rid of Ruby implementation of
  require_relative.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16 17:40:00 +00:00
nobu a3d0a213dc * compile.c (insn_data_to_s_detail), iseq.c (insn_operand_intern):
fixed format specifiers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-14 00:50:10 +00:00
shugo e3c25091cd * iseq.c (rb_iseq_clone): sets local_iseq and klass properly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-10 16:07:06 +00:00
ko1 d3f73f45d8 * insns.def: Change the operand type of setinlinecache
(OFFSET to IC).  This IC must be same as corresponding
  getinlinecache instruction's IC operand.
  This change is for a little performance improvement
  (getting IC directly) and is for the AOT compilation development.
* compile.c, iseq.c, insns.def: Change the approach to handling inline
  cahce (IC) type operand to enable the above change.
  This change also affects ISeq#to_a method.  The inline cache operand
  will be dumped by fixnum, the index of inline cache, in other words,
  inline cache identity.
* template/insns_info.inc.tmpl, tool/instruction.rb: No need to count
  inline cache size (insn_iclen()).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24 17:06:15 +00:00
nobu 03a284b8bd * iseq.c (iseq_s_disasm): check for proc first. based on the
patch by Roger Pack in [ruby-core:27626].  [ruby-core:27227]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-20 23:45:05 +00:00
yugui 295bc2fe25 removes the dtrace support. reverts r26239, r26238 and r26235.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-05 05:59:23 +00:00
yugui 72b199940d * trace.h: new file. wraps tracing mechanisms.
* defs/dtrace.d: new file. defined a dtrace provider "ruby".

* include/ruby/ruby.h (LIKELY): moved from vm.c.
  (UNLIKELY): ditto.
  (OBJSETUP): probe "object-create".
  (RUBY_EVENT_RESCUE): new event.

* vm_exec.c (DEBUG_ENTER_INSN): embeded a probe insn-entry into it.
  (DEBUG_END_INSN): insn-return.

* vm.c (LIKELY): moved into ruby.h.
  (UNLIKELY): ditto.
  (Init_BareVM): embeded a probe "raise" into it.

* variable.c (rb_class2name_without_alloc): new utility function.

* tool/rbinstall.rb (install?(:ext, :arch, :'ext-arch')): installs 
  dtrace.d if necessary.

* thread_pthread.c (add_signal_thread_list): probe "raise".
  (rb_thread_create_timer_thread): ditto.

* thread.c (rb_thread_schedule_rec): probes "thread-enter" and
  "thread-leave",
  (thread_start_func_2): ditto.
  (thread_cleanup_func): probe "thread-term"

* lib/mkmf.rb: supports dtrace postprocessor on making an extension.

* iseq.c (rb_vm_insn_name): new utility function.
  (rb_vm_insn_len): ditto.

* insns.def (hook): probes "method-etnry", "method-return", "line",
  and "rescue".

* compile.c (iseq_compile_each): adds a trace op for "rescue" probe.

* gc.c (garbage_collect): probes "gc-begin" and "gc-end".
  (obj_free): probe "object-free"
  (garbage_collect_with_gvl): probe "raise"
  (negative_size_allocation_error): ditto.
  (rb_memerror): ditto.

* eval.c (rb_rescue2): probe "rescue"
  (rb_longjmp): probe "raise"

* ext/probe/probe.c: new extension for application defined probes.

* ext/probe/extconf.rb: ditto.

* configure.in (--with-tracing-model): new option to choose a tracing
  mechanism.
  (DTRACE): new substitution. name of dtrace(1).
  (RUBY_TRACING_MODEL): new substitution.
  (DTRACE_OBJ): ditto.
  (MINIDTRACE_OBJ): ditto.
  (GOLFDTRACE_OBJ): ditto.
  (LIBRUBY_DTRACE_OBJ): ditto.
  (RUBY_DTRACE_POSTPROCESS): new macro. checks whether the dtrace on 
  the system needs postprocessing.
  (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether the dtrace
  supports USDT.

* Makefile.in: 
  (DTRACE): new variable. name of dtrace(1).
  (TRACING_MODEL): new variable. name of the chosen tracing mechanism.
  (DTRACE_OBJ): same as the one in configure.in.
  (MINIDTRACE_OBJ): ditto.
  (GOLFDTRACE_OBJ): ditto.
  (LIBRUBY_DTRACE_OBJ): ditto.
  (CPPOUTFILE): new substitution. necessary for generating dtrace.d
  (trace_none.h): new target for TRACING_MODEL=none
  (RUBY_H_INCLUDES): appended a header for tracing.
  (distclean-local): also removes preprocessed version of dtrace.d
  ($(LIBRUBY_A)): needs $(LIBRUBY_DTRACE_OBJ) if dtrace needs 
  postprocessing.
  ($(PROGRAM)): ditto.
  (golf): ditto.
  (miniruby): ditto.
  ($(arch_hdrdir)/ruby/dtrace.d): new target. preprocessed verson 
  of defs/dtrace.d. generated if necessary.
  ($(arch_hdrdir)/ruby/trace_dtrace.h): new target.
  definition of probes.
  ($(LIBRUBY_DTRACE_OBJ)): new target. generated if dtrace needs 
  postprocessing.
  ($(DTRACE_OBJ)): ditto.
  ($(MINIDTRACE_OBJ)): ditto.
  ($(GOLFDTRACE_OBJ)): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-03 15:36:17 +00:00
nobu e6a8408c2c * iseq.c (iseq_s_disasm): return nil for native methods.
[ruby-core:27226], [Bug#2499]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-23 06:22:48 +00:00
nobu 321c94af8e * iseq.c (prepare_iseq_build, rb_iseq_build_for_ruby2cext):
untrust mark array.  [ruby-core:26137]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-19 01:59:38 +00:00
nobu aaa01efb95 * gc.h (rb_gc_debug_body): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 04:40:11 +00:00
mame 4b62641c13 * compile.c (ADD_TRACE): fire coverage event in ensure clause.
[ruby-dev:39303]

* iseq.h, iseq.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-08 16:11:30 +00:00
nobu 0f408e10ba * iseq.c (iseq_s_disasm): accept proc objects. [ruby-core:18762]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-07 16:23:20 +00:00
ko1 f833dd2e24 * iseq.c (compile_string): rename to parse_string(), because
this function only parse String to NODE.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 23:36:34 +00:00
nobu fe1ce93f52 * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c,
  vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl,
  tool/instruction.rb: fixed types.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-21 20:58:26 +00:00
nobu b46cd0e400 * include/ruby/ruby.h (rb_data_type_struct): constified dsize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 02:11:35 +00:00
nobu 034414741e * iseq.c (iseq_mark): use preprocessor.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08 12:50:13 +00:00
ko1 a31c632299 * iseq.c (iseq_mark): no need to mark inline cache entries.
* insns.def (onceinlinecache, setinlinecache): save a value
  to mark cached value.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08 02:57:39 +00:00
nobu 1612ad9d32 * iseq.c (iseq_mark): skip outdated cache entries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28 00:34:12 +00:00
nobu b587368d71 * iseq.c (iseq_mark): made invariant expressions constant references.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-28 00:31:01 +00:00
nari de5f15bbe4 * gc.c: reject unused longlife gc.
* debug.c: ditto.

* include/ruby/intern.h: ditto.

* include/ruby/ruby.h: ditto.

* iseq.c: ditto.

* node.h: ditto.

* vm_insnhelper.c: ditto.

* vm_insnhelper.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-10 02:40:34 +00:00
mame 31c561f66a * vm_core.h (struct rb_iseq_t): add a new field line_no. This field
represents line number from which the original code of the iseq
  starts.  [ruby-dev:38698]

* iseq.c, compile.c: ditto.

* parse.y: line number hack (for Proc#source_location) is no longer
  needed.

* test/ruby/test_settracefunc.rb: line number of set_trace_func is now
  compatible with 1.8's.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 13:37:26 +00:00
ko1 94664d6d0c * node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.
* compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 00:01:06 +00:00
ko1 c330876d7c * method.h, vm_core.h: add rb_method_entry_t. Remove nodes around
method management.  This change affect some VM control stack structure.
* vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto.  and make some
  refactoring.
* insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto.
* vm_core.h, compile.c (iseq_specialized_instruction): remove
  VM_CALL_SEND_BIT.  use another optimization tech for Kernel#send.
* node.h: remove unused node types.
* ext/objspace/objspace.c (count_nodes): ditto.
* gc.c: add mark/free functions for method entry.
* include/ruby/intern.h: remove decl of
  rb_define_notimplement_method_id().  nobody can use it
  because noex is not opend.
* iseq.c (iseq_mark): fix to check ic_method is available.
* iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15 14:59:41 +00:00
ko1 20d9aefccb * vm_core.h, compile.c: declare struct iseq_inline_cache_entry.
Inline cache (IC) entries are no longer GC managed object.
  IC entries are freed when ISeq is freed.
* iseq.c: fix mark, free, memsize functions for above change.
* insns.def: remove rb_gc_write_barrier().
* vm_insnhelper.c (vm_method_search): ditto.
* tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen):
  added.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13 09:30:23 +00:00
ko1 0ac93a1a40 * insns.def, vm_insnhelper.c (getinstancevariable):
fix to use inline cache.
* compile.c: fix to skip inline cache entry (IC).  IC is added
  automatically by compiler.
* insns.def, vm_insnhelper.h: fix IC positions.
* iseq.c: increment minor_version of ISeq because of above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13 04:44:20 +00:00
ko1 9e60743008 * include/ruby/ruby.h:
rename
  "...TypeStruct" and "typed_struct" to
  "TypedData..." and "typeddata", respectively.
  rename
  rb_data_type_t#name to
  rb_data_type_t#wrap_struct_name.
* error.c, gc.c, iseq.c, vm.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 20:28:27 +00:00
nobu 729d726e30 * iseq.c: provisional type fixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 01:12:17 +00:00
ko1 51d174a177 * iseq.c (iseq_memsize): added. Use RTypedData instead of RData
for ISeq.
* vm.c (env_memsize, vm_memsize, thread_memsize): added.  Use
  RTypedData instead of RData for Env, VM, Thread.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 22:23:53 +00:00
nari 832d5a8329 * iseq.c (rb_iseq_clone): use longlife object and insert write barrier.
* vm_insnhelper.c (vm_cref_push): ditto.

* vm_insnhelper.h (COPY_CREF): insert write barrier.
			


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 08:27:36 +00:00
nari 57b83a5191 * gc.c: add longlife garbage collection. [ruby-dev:38423]
(NORMAL_HEAPS_USED): new macro.
  (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto.
  (add_longlife_heaps_slot): new function.
  (rb_newobj_from_longlife_heap): ditto.
  (rb_newobj_longlife): ditto.
  (rb_node_newnode_longlife): ditto.
  (rb_gc_write_barrier): ditto.
  (remembered_set_recycle): ditto.
  (rb_gc_mark_remembered_set): ditto.
  (clear_mark_longlife_heaps): ditto.
  (gc_sweep_for_longlife): ditto.
  (assign_heap_slot): new argumnent to longlife heaps slot.
  (add_freelist): ditto.
  (gc_sweep): avoid lonlife heap slot. set longlife_collection
   flag at add heap.
  (rb_gc_force_recycle): avoid mark object and remembered_set
   object.
  (garbage_collect): add longlife collection.
  (rb_gc_start): invoke longlife collection.
  (gc_profile_record_get): for longlife collction profile.
  (gc_profile_result): ditto.

* include/ruby/intern.h (rb_gc_write_barrier): declared.

* include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED.

* debug.c (FL_REMEMBERED_SET): ditto.

* insns.def (setinlinecache): insert write barrier.

* vm_insnhelper.c (vm_method_search): ditto.

* set_relation (set_relation): use longlife object.

* vm.c (vm_define_method): ditto.

* vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto.

* vm_method.c (rb_add_method): ditto.

* class.c (rb_add_method): ditto.

* node.h (NEW_NODE_LONGLIFE): new macro.
  (rb_node_newnode_longlife): declared.
					    


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-13 14:08:26 +00:00
nobu f61b80079e * iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 20:19:24 +00:00
nobu 6fe3eaec6c * iseq.c (prepare_iseq_build): too few arguments to function
rb_ary_tmp_new().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10 02:36:33 +00:00
nobu 756c803881 * iseq.c (rb_iseq_compile_with_option): argument may be converted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10 01:54:01 +00:00
nobu 905c157917 * iseq.c (cdhash_each): resurrects internal literals.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26 04:23:21 +00:00
nobu 12d2c8ba41 stripped trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 14:23:33 +00:00
nobu 1128e61562 * array.c (rb_ary_resurrect), string.c (rb_str_resurrect): new
functions based on [ruby-dev:37983]

* insns.def (putstring, duparray): use rb_{ary,str}_resurrect().

* iseq.c (iseq_data_to_ary): needs to result TS_VALUE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18 05:33:36 +00:00
takano32 53bea54768 * iseq.c: remove nil parameter from Proc#parameters
after rest appeared.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 04:15:32 +00:00
nobu a14bd973ed * iseq.c (simple_default_value): removed. default values of optional
parameters are not available still now.  [ruby-dev:37980]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13 06:34:20 +00:00
nobu e52da91987 * compile.c (compile_array_, defined_expr, iseq_compile_each): hide
and freeze internal literal objects, to prevent from modifying.
  [ruby-dev:37959]

* iseq.c (insn_operand_intern): copy internal literal objects.

* insns.def (putstring, duparray): ditto.

* string.c (rb_str_replace): exported.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 10:42:36 +00:00
matz ee5f857a05 * iseq.c (simple_default_value): allow plain strings as default
values.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12 06:38:26 +00:00
ko1 c4c3f238d7 * iseq.c:
rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn().
  rename ruby_iseq_disasm() -> rb_iseq_disasm().
* compile.c:
  rename ruby_iseq_compile() -> rb_iseq_compile_node().
  rename ruby_iseq_translate_threaded_code() ->
  rb_iseq_translate_threaded_code().
  rename ruby_insns_name_array() -> rb_insns_name_array().
  rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary().
* iseq.c, compile.c: remove ruby_insn_make_insn_table() and make
  static function insn_make_insn_table().
* iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c,
  blockinlining.c: ditto.
  Rename strange "ruby_" prefix to "rb_" prefix.
  This changes may affect only core because renamed functions
  require a pointer of rb_iseq_t which is not exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19 01:06:56 +00:00
nobu b96f428e48 * iseq.c (rb_iseq_load): renamed from ruby_iseq_load, since it is
for C extensions or the ruby core.  [ruby-core:21407]

Index: compile.c
===================================================================
--- compile.c	(revision 21649)
+++ compile.c	(working copy)
@@ -5078,5 +5078,5 @@ iseq_build_exception(rb_iseq_t *iseq, st
 	}
 	else {
-	    eiseqval = ruby_iseq_load(ptr[1], iseq->self, Qnil);
+	    eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
 	}
 
@@ -5162,5 +5162,5 @@ iseq_build_body(rb_iseq_t *iseq, LINK_AN
 			    if (op != Qnil) {
 				if (TYPE(op) == T_ARRAY) {
-				    argv[j] = ruby_iseq_load(op, iseq->self, Qnil);
+				    argv[j] = rb_iseq_load(op, iseq->self, Qnil);
 				}
 				else if (CLASS_OF(op) == rb_cISeq) {
Index: iseq.c
===================================================================
--- iseq.c	(revision 21649)
+++ iseq.c	(working copy)
@@ -448,5 +448,5 @@ iseq_s_load(int argc, VALUE *argv, VALUE
 
 VALUE
-ruby_iseq_load(VALUE data, VALUE parent, VALUE opt)
+rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
 {
     return iseq_load(rb_cISeq, data, parent, opt);
Index: iseq.h
===================================================================
--- iseq.h	(revision 21649)
+++ iseq.h	(working copy)
@@ -21,5 +21,5 @@ VALUE ruby_iseq_build_from_ary(rb_iseq_t
 
 /* iseq.c */
-VALUE ruby_iseq_load(VALUE data, VALUE parent, VALUE opt);
+VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
 struct st_table *ruby_insn_make_insn_table(void);
 


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 19:05:15 +00:00
ko1 6c08b4522d * iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.
[ruby-dev:37619]
* compile.c (rb_dvar_defined, ruby_iseq_compile): ditto.
* iseq.c (iseq_data_to_ary, iseq_load): ditto.
* compile.c (iseq_compile_each): fix to check ip->compile_data.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 05:58:23 +00:00
ko1 597220ef0c * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
  instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
  main script (specified by -e or script name) should be run
  under TOPLEVEL_BINDING using Kernel#eval.  Above changes
  simulate Kernel#eval behaviour.  [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
  this fix is needed for [ruby-dev:37240], and also fixes
  [ruby-dev:35392].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 01:15:56 +00:00
nobu f6d18c3f2a * iseq.c (rb_iseq_parameters): proc arguments are always optional.
* proc.c (get_proc_iseq, rb_proc_parameters): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 04:05:48 +00:00
nobu 794eb7bc49 * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),
(ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with
  ruby_.

* iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 03:35:48 +00:00
nobu 6e0f413f01 * iseq.c (simple_default_value): returns simplest assignment only.
[ruby-core:20237]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 13:41:01 +00:00
nobu 46e3b0fe7b * iseq.c (simple_default_value): extracts simplest default
argument value.

* iseq.c (rb_iseq_parameters): returns parameter list.

* proc.c (get_proc_iseq, get_method_iseq): handles ifunc and
  bmethod.

* proc.c (rb_proc_parameters, rb_method_parameters): added
  Proc#parameters and Method#parameters.  [ruby-core:19759]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-28 04:19:37 +00:00
ko1 2e311f6bd5 * include/ruby/node.h, node.h: move node.h from include path.
This change stop to install node.h beacuase of saving ABI
  (node.h will be changed. Extensions should not depends on
  this file).
* blockinlining.c, class.c, compile.c, debug.h, enum.c,
  gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
  vm.c, vm_core.h, vm_dump.c: ditto.
* ext/ripper/depend: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 19:52:31 +00:00
ko1 7f7834abf7 * include/ruby/node.h, vm_core.h: move definition of
RUBY_VM_METHOD_NODE to node.h.
* class.c, common.mk: remove useless inclusion.
* compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h.
  move some definitions from vm_core.h to iseq.h.
* compile.c, iseq.c, vm.c: ditto.
* eval.c, compile.c: move some functions for parser
  from eval.c to compile.c.
* eval_intern.h, vm_core.h: move va_init_list() macro to
  vm_core.h.
* iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added.
* load.c, ruby.c: use rb_iseq_new_top() instead of
  rb_iseq_new() with ISEQ_TYPE_TOP constant directly.
* proc.c: use rb_iseq_first_lineno() instead of accessing
  iseq structure.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 07:49:45 +00:00
akr 965ff82341 * iseq.c (iseq_s_compile_file): use rb_file_open_str.
* io.c (rb_file_open_generic): call validate_enc_binmode.
  (rb_file_open_str): call FilePathValue.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12 18:32:19 +00:00
ko1 f0bf74a07b * iseq.c (iseq_data_to_ary): make it static.
* thread.c (thgroup_enclose): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 18:23:27 +00:00
akr 32c7a56555 * iseq.c (iseq_inspect): don't raise on uninitialized object.
show real class name.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 17:25:43 +00:00
matz 96765d153f * iseq.c (rb_iseq_clone): should preserve cref_stack link.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 11:39:09 +00:00
matz e956f28724 * class.c (clone_method): should copy cbase in cref as well.
[ruby-dev:35116]

* iseq.c (iseq_mark): mark original iseq object.

* iseq.c (iseq_free): do not free internal data if they have
  original iseq to belong.

* iseq.c (rb_iseq_clone): a new function to clone iseq value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-11 08:13:42 +00:00
nobu 8a6c699282 * iseq.c (ruby_iseq_disasm_insn): suppress warnings on platforms which
int size differs from pointer size.

* ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): ditto

* ext/syck/rubyext.c (rb_syck_err_handler),
  (syck_default_error_handler): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-31 01:51:44 +00:00
nobu 0acca9a826 * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),
iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm),
  process.c (pst_message), re.c (match_inspect): use rb_str_catf.

* dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use
  rb_sprintf.

* error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use
  rb_vsprintf.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 08:53:34 +00:00
mame 91c07a5ac6 * thread.c (rb_set_coverages, rb_reset_coverages): enable and disable
coverage measurement.

* thread.c (rb_get_coverages): rename and move from vm.c.

* vm.c (rb_vm_get_coverages): ditto.

* iseq.c (prepare_iseq_build): ditto.

* thread.c (clear_coverage): ditto.

* parse.y (coverage): ditto.

* ext/coverage/coverage.c: use above functions, add new method
  Coverage.start and fix rdoc .


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 15:13:22 +00:00
mame caf3933bab * thread.c (rb_enable_coverages): hide coverage array by setting 0 to
klass during measurement.

* parse.y (coverage, yycompile0): ditto.

* iseq.c (prepare_iseq_build): use rb_hash_lookup instead of
  rb_hash_aref.

* thread.c (rb_coverage_result): restore klass of coverage array and
  return it.

* theaad.c (update_coverage): chcek whether its klass is 0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08 13:57:06 +00:00
mame ae3a03eb07 * include/ruby/intern.h: remove prototypes about coverage.
* iseq.c (prepare_iseq_build): add prototype.

* parse.y (coverage): ditto.

* thread.c (clear_coverage): ditto.

* thread.c (update_coverage): use rb_sourceline.

* thread.c (rb_get_coverages): rename and move to vm.c.

* vm.c (rb_vm_get_coverages): ditto.

* ext/coverage/coverage.c: add rdoc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 14:27:43 +00:00
mame f08581c7b6 * ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminate
COVERAGE__ and introduce coverage.so instead.  How to measure
  coverage: (1) require "coverage.so", (2) require or load Ruby source
  file, and (3) Coverage.result will return the same hash as COVERAGE__.
  [ruby-dev:35324]

* thread.c (rb_enable_coverages): start coverage measurement by using
  rb_add_event_hook.

* thread.c (rb_get_coverages): returns current results of coverage
  measurement.

* include/ruby/intern.h: add prototype for above two functions.

* vm_core.h, vm.c: add field of coverages to rb_vm_t.

* insns.def (trace): remove special handling for COVERAGE__.

* iseq.c (prepare_iseq_build): switch COVERAGE__ to
  rb_get_coverages().

* parse.y (coverage): ditto.

* thread.c (clear_coverage): ditto.

* lib/coverage.rb: use coverage.so instead of COVERAGE__.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 12:55:12 +00:00
mame 5874de95e8 * Add coverage measurement constant COVERAGE__. This constant is not
for casual use.  Usage: (1) assign {} to COVERAGE__, (2) require or
  load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will
  return an array whose elements represent number of executions per
  line of source code.

* vm_core.h: add field of coverage array to iseq.

* iseq.c (prepare_iseq_build): ditto.

* insns.def (trace): update coverage array.

* parse.y (coverage): create and initialize coverage array.

* compile.h (ADD_TRACE): add trace instruction to update covearge
  array.

* thread.c (clear_coverage): delete coverage array when forking.
  Otherwise, double count of coverage may occur.

* lib/coverage.rb: sample coverage measurement tool.

* error.c: distinguish explicitly between parse_in_eval and
  mild_compile_error.

* load.c: ditto.

* vm_eval.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 16:55:30 +00:00
nobu 5669377a57 * iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond),
thread.c (eKillSignal, eTerminateSignal),
  missing/vsnprintf.c (BSD_vfprintf): constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 08:44:32 +00:00
ko1 9ebf6473eb * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class name
VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM.
  "VM" is too short name for class.
* test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto.
* include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be
  exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 17:26:16 +00:00
nobu 5a647a3f5f * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 09:25:32 +00:00
nobu 7c5e3348f7 * suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
nobu 075530a685 * suppress warnings with -Wwrite-string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
nobu 87c828e39e * iseq.c (rb_iseq_compile_with_option): get rid of segv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 21:15:23 +00:00
mame 6dbf55f1ba * iseq.c (iseq_load, iseq_data_to_ary): support
ISEQ_TYPE_DEFINED_GUARD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 11:16:40 +00:00
ko1 a6bec14471 * iseq.c (insn_operand_intern): remove Qundef related code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-14 03:48:39 +00:00
matz 3b13714738 * iseq.c (insn_operand_intern): should handle Qundef embedded in
operand.  [ruby-core:16656]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-05 15:30:07 +00:00
nobu 11f2fa4ade * iseq.c (rb_iseq_compile_with_option): check if src is a strring.
[ruby-core:16453]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 08:01:46 +00:00
nobu 6866bce757 * compile.c, compile.h (compile_debug): made runtime option.
* debug.c (ruby_debug_print_indent): returns if debug_level exceeds
  the threashold.

* debug.c (ruby_debug_printf): printf to stderr.

* iseq.c (make_compile_option, make_compile_option_value): added
  debug_level option.

* vm_core.h (rb_compile_option_t): added debug_level.

* vm_core.h (struct iseq_compile_data): added node_level.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 05:34:04 +00:00
nobu 5c1926ac82 * compile.c (iseq_set_sequence, iseq_insns_unification,
insn_data_to_s_detail): constified.

* iseq.c (insn_operand_intern, ruby_iseq_disasm_insn): ditto.

* template/{insns_info,opt_sc,optunifs}.inc.tmpl: ditto.

* tool/instruction.rb (OptUnifsIncGenerator): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03 00:00:48 +00:00
nobu 893ee30978 * compile.c (iseq_build_from_ary), iseq.c (iseq_load): fix for format change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-08 04:05:59 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
ko1 36df55c6e4 * iseq.c: all methods need $SAFE < 1.
vm.c: comment out debug functions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 09:43:23 +00:00
ko1 bfc19ade2e * iseq.c, vm_core.h: comment out unused fields.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 02:17:16 +00:00
matz 6ca558d6ab * proc.c (method_name): preserve Symbol's encoding.
* numeric.c (fix_id2name): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 16:38:44 +00:00
ko1 e2e23e688f * iseq.c (Init_ISeq): disable ISeq.load() because there is no verifier.
* iseq.c, proc.c: add ISeq.disasm(method).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 09:09:21 +00:00
ko1 be137f3601 * iseq.c (find_line_no): return 0 if not found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 07:44:03 +00:00
ko1 5485df3e10 * compile.c (iseq_compile_each): add pop after throw as return.
* bootstraptest/test_knownbug.rb, test_syntax.rb: move resolved test.
* vm_core.h, iseq.c, compile.h: add debug output code.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19 21:39:08 +00:00
ko1 4657257b75 * iseq.c (ruby_iseq_disasm): fix to show arg_simple value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 16:25:30 +00:00
ko1 b1c5d848f8 * vm_dump.c (debug_print_pre): fix to show control frame count.
* insns.def (opt_call_c_function): fix operand type.
* lib/vm/instruction.rb: ditto.
* insnhelper.ci (vm_push_frame, vm_pop_frame): fix to show
  control stack status on if VMDEBUG == 2.
* vm.h: add a comment about VMDEBUG.
* iseq.c (find_prev_line_no): fix to skip bug report if
  line is not found.
* lib/vm/instruction.rb: fix to use build_string() on
  source code generators.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-12 19:09:15 +00:00
nobu ab664381aa * iseq.c (iseq_s_compile_option_get, Init_ISeq): added a new
method VM::InstructionSequence::compile_option.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06 04:34:11 +00:00
nobu a9ba30ee86 * common.mk (node_name.inc): auto-generate node name list.
* iseq.c (ruby_node_name): ditto.

* tool/node_name.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06 04:09:56 +00:00