summaryrefslogtreecommitdiff
path: root/compile.c
AgeCommit message (Collapse)Author
2011-02-20* prevent temporary objects from GC, and should not usenobu
RSTRING_PTR() for function calls since it evaluates the argument a couple of times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-17 * compile.c (get_exception_sym2type): guard temporary object from GC.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-28* compile.c (NODE_CLASS, NODE_MODULE), insns.def (defineclass): raisemame
an exception when "class Foo::Bar" is evaluated and Foo::Bar is private. To implement this, define_type of "defineclass" is added so that the instruction can distinguish whether the class definition is scoped (class Foo::Bar) or not (class Bar). * test/ruby/test_class.rb (test_redefine_private_class), test/ruby/test_module.rb (test_define_module_under_private_constant): add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20* compile.c (setup_args), vm.c (invoke_block_from_c),nobu
vm_insnhelper.c (caller_setup_args): reverted r30241 and r30243 except for the test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18* compile.c (setup_args), vm.c (invoke_block_from_c),nobu
vm_insnhelper.c (caller_setup_args): fix of r30241. lambda block shoud check argument number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-18* compile.c (setup_args, iseq_compile_each): optimize AMPER LAMBDAnobu
combination as block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-12* compile.c (iseq_compile_each): fix for __goto__ and __label__nobu
where were totally broken. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-10remove a comma at end of enumerator list.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* compile.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-15* compile.c (iseq_set_exception_local_table, iseq_set_local_table,mame
rb_iseq_build_from_ary): fix type inconsistency (which is benign because sizeof(ID) == sizeof(ID*), though). Coverity Scan found these bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-31* compile.c (new_child_iseq): adjust argument types.nobu
* 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* vm_core.h: some refactoring.ko1
- 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-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(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* compile.c (iseq_build_body), insns.def (getglobal, setglobal),nobu
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* compile.c (iseq_compile_each): fix truncating cast.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10* compile.c: math.h for modf.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-09* compile.c (case_when_optimizable_literal): When float value can bewanabe
treated as integer, add to table hash of case that way. based on a patch from Ikuo KOBORI. [ruby-dev:42038] * insnf.def (opt_case_dispatch): ditto. * test/ruby/test_case.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): drop unused ARGSCATmame
results when poped is true. [ruby-dev:41933], [Bug #3658] This is retry of r28870 and r28873 which were reverted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* compile.c (NODE_ARGSCAT, NODE_ARGSPUSH): revert r28870 and r28873mame
which involuntarily changed semantics of type conversion. I'll re-commit a correct patch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* compile.c (iseq_compile_each): to_a method should be called.nobu
[Bug #3658] * compile.c (iseq_compile_each): ditto for ARGSPUSH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* compile.c (iseq_compile_each): drop unused ARGSCAT results.nobu
fix [ruby-dev:41933], [Bug #3658] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
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-26* compile.c (rb_iseq_translate_threaded_code): removed duplicated code.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-02* compile.c (iseq_compile_each): should consider block on stack,matz
if block argument is passed. [ruby-core:30534] * parse.c (arg_concat_gen): should append to nd_head, not to nd_iter for NODE_BLOCK_PASS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19* iseq_compile_each (NODE_DEFINED): put nil first to fix stackmame
consistency. [ruby-core:30293] Now, lfinish[0] of defined_expr seems not to be used. Refactoring may be needed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09* compile.c (iseq_compile_each), vm_insnhelper.c (vm_invoke_block,mame
vm_throw): allow "return" and "yield" even in singleton class definition. based on a patch from wanabe <s.wanabe AT gmail.com> for "return". [ruby-core:21379] [ruby-dev:40975] * insns.def (defineclass): ditto (straightforwardly push block ptr, instead of dfp ptr with special flag). * vm_core.h (RUBY_VM_CLASS_SPECIAL_P): ditto (no longer needed). * proc.c (proc_new): ditto (remove handling for special flag). * bootstraptest/test_jump.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05* compile.c (iseq_set_sequence): fix check range of ic_index.wanabe
a patch from Tomoyuki Chikanaga. #3236 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-04* compile.c (iseq_build_body): update iseq->ic_size.wanabe
a patch from Tomoyuki Chikanaga. see #3236. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20* compile.c (NODE_NEXT, NODE_REDO): add dummy putnil instruction tomame
fix stack consistency error. [ruby-core:28172] * bootstraptest/test_jump.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-17* compile.c (iseq_compile_each): fix splat condition in NODE_WHEN.wanabe
[Bug #2226] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09* compile.c (iseq_compile_each): stop hiding, and freeze unpopped string ↵muraken
nodes to allow method redefinition. [ruby-dev:40641] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-17* compile.c (iseq_build_body): add mark to jump table hash of case.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-16* compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolutemame
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-14* compile.c (insn_data_to_s_detail), iseq.c (insn_operand_intern):nobu
fixed format specifiers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-09* compile.c (defined_expr), insns.def (defined): fix to pass a Symbolko1
object such as :$foo for the "defined?($foo)" expression on defined instruction. This patch fixes ISeq#to_a/load. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24* insns.def: Change the operand type of setinlinecacheko1
(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-01-20 * common.mk (compile.$(OBJEXT)): dependencies lacking.shyouhei
* vm_method.c (rb_add_method_cfunc): invalid initializer for C89 * compile.c (iseq_insns_unification): int might be smaller than int* git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-05removes the dtrace support. reverts r26239, r26238 and r26235.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-03* trace.h: new file. wraps tracing mechanisms.yugui
* 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
2009-12-03* compile.c (compile_cpath, iseq_compile_each): revertedshugo
constant/class variable lookup in instance_eval etc. to the behavior of 1.8. * eval.c (rb_mod_nesting): ditto. * insns.def (putspecialobject, defineclass): ditto. * node.h (NODE_FL_CREF_PUSHED_BY_EVAL): ditto. * vm_core.h (VM_SPECIAL_OBJECT_CONST_BASE): ditto. * vm_eval.c (yield_under, eval_under): ditto. * vm_insnhelper.c (vm_cref_push, vm_get_const_base, vm_get_ev_const, vm_get_cvar_base): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-08* compile.c (ADD_TRACE): fire coverage event in ensure clause.mame
[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-09-21* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu
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-18* compile.c (iseq_compile_each), parse.y (stmt, arg): arg_concat()nobu
on op_asgn was inversed. [ruby-core:25629] [Bug #2050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06* compile.c (iseq_specialized_instruction), insns.def (opt_size):ko1
optimize #size methods (by specialized instruction). * id.c, id.h, vm.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (iseq_compile_each): op_asgn to aref should return rhs.nobu
[ruby-core:25387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (FIXNUM_OR): typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (FIXNUM_INC, FIXNUM_OR): trivial optimizations.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (iseq_compile_each): &&= and ||= should return rhs.nobu
[ruby-dev:39163] (#1996), [ruby-core:25143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e