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

319 Коммитов

Автор SHA1 Сообщение Дата
charliesome fff3589899 * compile.c (make_name_for_block): use PRIsVALUE in format string
instead of %s and RSTRING_PTR to protect objects from being garbage
  collected too soon
* encoding.c (str_to_encindex): ditto
* hash.c (rb_hash_fetch_m): ditto
* io.c (rb_io_reopen): ditto
* parse.y (reg_fragment_check_gen): ditto
* parse.y (reg_compile_gen): ditto
* parse.y (ripper_assert_Qundef): ditto
* re.c (rb_reg_raise): ditto
* ruby.c (set_option_encoding_once): ditto
* vm_eval.c (rb_throw_obj): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-24 11:31:21 +00:00
ko1 4223f00713 * include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for second
parameter `slot'. You don't need to write a cast (VALUE *) any more.
* class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c,
  vm.c, vm_method.c: remove cast expressions for OBJ_WRITE().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21 19:52:40 +00:00
ko1 9b47ec04a8 * include/ruby/ruby.h (struct rb_data_type_struct), gc.c: add
rb_data_type_struct::flags. Now, this flags is passed
  at T_DATA object creation. You can specify FL_WB_PROTECTED
  on this flag.
* iseq.c: making non-shady iseq objects.
* class.c, compile.c, proc.c, vm.c: add WB for iseq objects.
* vm_core.h, iseq.h: constify fields to detect WB insertion.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-19 06:26:01 +00:00
ko1 f41b284fab * compile.c (rb_iseq_compile_node): fix location of a `trace'
instruction (b_return event).
  [ruby-core:55305] [ruby-trunk - Bug #8489]
  (need a backport to 2.0.0?)
* test/ruby/test_settracefunc.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-14 09:54:58 +00:00
akr bd15d4ca78 * internal.h (numberof): Gathered from various files.
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
  load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
  error.c, ruby.c: Remove the definitions of numberof.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 10:01:19 +00:00
nobu 4a223fb67f compile.c: not simple if keyword args
* compile.c (iseq_set_arguments): not a simple single argument if any
  keyword arguments exist.  [ruby-core:55203] [Bug #8463]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01 08:25:05 +00:00
ko1 c4c821a7d7 * hash.c (rb_hash_tbl_raw), internal.h: added.
Returns st_table without shading hash.
* array.c: use rb_hash_tbl_raw() for read-only purpose.
* compile.c (iseq_compile_each): ditto.
* gc.c (count_objects): ditto.
* insns.def: ditto.
* process.c: ditto.
* thread.c (clear_coverage): ditto.
* vm_insnhelper.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 16:19:04 +00:00
ktsj edb98f8b91 fix typos. Patch by k_takata.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 03:10:21 +00:00
nobu e38a2399d2 compile.c: forward kwrest
* compile.c (iseq_compile_each): forward anonymous and first keyword
  rest argument one.  [ruby-core:55033] [Bug #8416].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 07:38:55 +00:00
ko1 83aba04862 * include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
  This function reveal interal (hidden) object by rb_obj_hide().
  Note that do not change class before and after hiding.
  Only permitted example is:
  klass = RBASIC_CLASS(obj);
  rb_obj_hide(obj);
  ....
  rb_obj_reveal(obj, klass);
  TODO: API design. rb_obj_reveal() should be replaced with others.
  TODO: modify constified variables using cast may be harmful for
  compiler's analysis and optimizaton.
  Any idea to prohibt inserting RBasic::klass directly?
  If rename RBasic::klass and force to use RBASIC_CLASS(obj),
  then all codes such as `RBASIC(obj)->klass' will be
  compilation error. Is it acceptable? (We have similar
  experience at Ruby 1.9,
  for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
  object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
  without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
  file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
  parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
  string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
  Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
  ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 10:49:11 +00:00
ko1 aacd771046 * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
instead of using RARRAY_PTR().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 09:56:22 +00:00
tmm1 cbd8b09920 iseq: reduce array allocations for simple sequences
* compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object().

* insns.def (setinlinecache): Ditto.

* iseq.c (rb_iseq_add_mark_object): New function to allocate
  iseq->mark_ary on demand. [Bug #8142]

* iseq.h (rb_iseq_add_mark_object): Ditto.

* iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed.

* iseq.c (rb_iseq_build_for_ruby2cext): Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-17 11:20:23 +00:00
nobu f4c52b483c compile.c: append keyword hash to splat
* compile.c (iseq_compile_each): append keyword hash to argument array
  to splat if needed.  [ruby-core:54094] [Bug #8236]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-09 06:26:15 +00:00
nobu 0c5d73e80b compile.c: defined? with empty expression
* compile.c (iseq_compile_each): fix of defined? with empty
  expression.  [ruby-core:53999] [Bug #8220]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 10:40:03 +00:00
nobu 34a95669da required keyword arguments
* compile.c (iseq_set_arguments, iseq_compile_each): support required
  keyword arguments.   [ruby-core:51454] [Feature #7701]
* iseq.c (rb_iseq_parameters): ditto.
* parse.y (f_kw, f_block_kw): ditto.  this syntax is still
  experimental, the notation may change.
* vm_core.h (rb_iseq_struct): ditto.
* vm_insnhelper.c (vm_callee_setup_keyword_arg): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-12 13:20:50 +00:00
nobu 221f2a1d8a compile.c: zsuper keyword args
* compile.c (iseq_compile_each): pass keyword arguments to zsuper,
  with current values.  [ruby-core:53114] [Bug #8008]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-07 05:21:40 +00:00
nobu 8a6898394c compile.c: nd_line(node)
* compile.c (iseq_compile_each): keep nd_line(node) in a local
  variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-07 05:17:04 +00:00
nobu fedf4c2250 compile.c: calc in int
* compile.c (iseq_compile_each): calculate argc as int, not as Fixnum.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-07 05:17:00 +00:00
ko1 4cf0918e8e * compile.c (iseq_compile_each): remove redundant trace(line)
instruction. for example, at the following script
  def m()
  p:xyzzy
  1
  2
  end
  compiler ignores `1' because there is no effect. However,
  `trace(line)' instruction remains in bytecode.
  This modification removes such redundant trace(line) instruction.
* test/ruby/test_iseq.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-28 14:04:53 +00:00
nobu 45dea57588 compile.c: no keyword check if kw_rest
* compile.c (iseq_set_arguments): no keyword check if any keyword rest
  argument exists, even unnamed.  [ruby-core:52744] [Bug #7922]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23 22:51:45 +00:00
ko1 a5e2f3221a * compile.c (compile_array_): modify wrong optimization.
A script "[print(1)]; print(2)" should output "12".
  However, the compiler had eliminted "[print(1)]" expression
  because it is void expression (unused array).
  Of course, side-effect should be remained.
  This issue is reported by Masaya Tarui.
* bootstraptest/test_literal.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09 18:38:41 +00:00
nobu 4ddf057b9a compile.c: adjust indent
* compile.c (iseq_compile_each): adjust indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-08 18:47:05 +00:00
nobu 69b716111f vm_core.h: flip_cnt in rb_iseq_t
* vm_core.h (rb_iseq_t): move flip_cnt from struct iseq_compile_data,
  because it has same life span as enclosing iseq.  [Bug #7671]
  [ruby-core:51296]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-08 05:41:44 +00:00
nobu be7bf5aa0c adjust style
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29 12:22:04 +00:00
nobu eb56c1084d compile.c: no semicolon
* compile.c (ADD_TRACE): putting a semicolon at the last of a macro
  let do/while make no sense.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29 12:21:58 +00:00
nobu 7ea675732a scoped constant op-assignment
* node.h (NODE_OP_CDECL), compile.c (iseq_compile_each),
  parse.y (stmt, arg): allow scoped constant op-assignment.
  [ruby-core:40154] [Bug #5449]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24 15:59:31 +00:00
shugo ea01ffa569 * vm_core.h (rb_vm_defineclass_type_t),
compile.c (iseq_compile_each), insns.def (defineclass): change the
  meaning of the third operand of defineclass as follows:
    lower 3bits: the type of the defineclass
                   0 = class, 1 = singleton class, 2 = module
    4th bit: a flag represents whether the defineclass is scoped
               0 = not scoped (e.g., class Foo)
	       1 = scoped (e.g., class Bar::Baz)
    5th bit: a flag represents whether the superclass is specified
               0 = not specified (e.g., class Foo)
               1 = specified (e.g., class Bar < Foo)
  If the superclass is specified and is not a class, a TypeError
  should be raised.  [ruby-dev:46747] [Bug #7572]

* test/ruby/test_class.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20 08:13:53 +00:00
nobu c9b4b78085 compile.c, vm_insnhelper.c: flip-flop without hidden string key
* compile.c (iseq_compile_each): count flip-flop state in local iseq
  not in each iseqs, so that the keys can be other than hidden
  strings.  [ruby-core:47253] [Bug #6899]
* vm_insnhelper.c (lep_svar_get, lep_svar_set, vm_getspecial): store
  flip-flop states in an array instead of a hash.
* iseq.c (set_relation): main iseq also can has local scope.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10 06:11:16 +00:00
ko1 5c58280773 * compile.c (iseq_specialized_instruction):
change condition of using `opt_send_simple'.
  More method invocations can be simple.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03 11:33:09 +00:00
ko1 38766319e1 * compile.c (iseq_compile_each): joke shouldn't use id.h defined ids.
* id.c (Init_id): ditto.
* common.mk: fix dpendency.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03 05:14:50 +00:00
shirosaki 7c407e2a33 * compile.c (ADD_CATCH_ENTRY): add a cast to fix SEGV with x64 mingw
on Windows 8. Without cast, 0 might be non zero value at higher bits
  in rb_ary_new3().
  [ruby-core:50258] [Bug #7456]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 22:29:13 +00:00
ko1 4db8340398 [EXPERIMENTAL: NEED DISCUSS]
* vm_trace.c: add events
* :thread_begin - hook at thread beggining.
* :thead_end - hook at thread ending.
* :b_call - hook at block enter.
* :b_return - hook at block leave.
  This change slow down block invocation.
  Please try and give us feedback until 2.0 code freeze.
* include/ruby/ruby.h: ditto.
* compile.c (rb_iseq_compile_node): ditto.
* insns.def: ditto.
* thread.c: ditto.
* vm.c: ditto.
* include/ruby/debug.h: add a comment.
* test/ruby/test_settracefunc.rb: add a tests.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29 22:28:16 +00:00
naruse 4556a9ec65 * compile.c (compile_array_): refix r37991 remove assertion:
it is true only if type == COMPILE_ARRAY_TYPE_HASH.
  [ruby-dev:46658] [Bug #7466]

* vm.c (m_core_hash_from_ary): add assertion instead of above.

* vm.c (m_core_hash_merge_ary): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29 17:35:29 +00:00
naruse bda0aca2af Revert r37991 "compile.c: hash must be paired"
DO BUILD BEFORE COMMIT !

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29 11:09:34 +00:00
nobu 399a32dfca compile.c: hash must be paired
* compile.c (compile_array_): hash elements must be paired even for
  literal elements.  [ruby-dev:46658] [Bug #7466]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29 10:15:16 +00:00
tadf c07d295204 * include/ruby/util.h: removed extra semicolon in definition of
macro.
	* compile.c: ditto.
	* cont.c: ditto.
	* math.c: ditto.
	* node.c: ditto.
	* parse.y: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 12:42:11 +00:00
ko1 1619c02dd3 * compile.c (insn_data_to_s_detail): remove debug lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13 08:36:42 +00:00
tenderlove 4c740bae97 * probes.d: add DTrace probe declarations. [ruby-core:27448]
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe.

* compile.c (rb_insns_name): allowing DTrace probes to access
  instruction sequence name.

* Makefile.in: translate probes.d file to appropriate header file.

* common.mk: declare dependencies on the DTrace header.

* configure.in: add a test for existence of DTrace.

* eval.c (setup_exception): add a probe for when an exception is
  raised.

* gc.c: Add DTrace probes for mark begin and end, and sweep begin and
  end.

* hash.c (empty_hash_alloc): Add a probe for hash allocation.

* insns.def: Add probes for function entry and return.

* internal.h: function declaration for compile.c change.

* load.c (rb_f_load): add probes for `load` entry and exit, require
  entry and exit, and wrapping search_required for load path search.

* object.c (rb_obj_alloc): added a probe for general object creation.

* parse.y (yycompile0): added a probe around parse and compile phase.

* string.c (empty_str_alloc, str_new): DTrace probes for string
  allocation.

* test/dtrace/*: tests for DTrace probes.

* vm.c (vm_invoke_proc): add probes for function return on exception
  raise, hash create, and instruction sequence execution.

* vm_core.h: add probe declarations for function entry and exit.

* vm_dump.c: add probes header file.

* vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
  function entry and return.

* vm_exec.c: expose instruction number to instruction name function.

* vm_insnshelper.c: add function entry and exit probes for cfunc
  methods.

* vm_insnhelper.h: vm usage information is always collected, so
  uncomment the functions.

12 19:14:50 2012  Akinori MUSHA  <knu@iDaemons.org>

* configure.in (isinf, isnan): isinf() and isnan() are macros on
  DragonFly which cannot be found by AC_REPLACE_FUNCS().  This
  workaround enforces the fact that they exist on DragonFly.

12 15:59:38 2012  Shugo Maeda  <shugo@ruby-lang.org>

* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
  vm_insnhelper.c (vm_search_method): revert r37616 because it's too
  slow.  [ruby-dev:46477]

* test/ruby/test_refinement.rb (test_inline_method_cache): skip
  the test until the bug is fixed efficiently.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12 21:52:12 +00:00
shugo afdfbde4e7 * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
vm_insnhelper.c (vm_search_method): revert r37616 because it's too
  slow.  [ruby-dev:46477]

* test/ruby/test_refinement.rb (test_inline_method_cache): skip
  the test until the bug is fixed efficiently.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-12 07:00:12 +00:00
shugo ba5ea548ce * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo):
add a new field for inline method cache.

* vm_insnhelper.c (vm_search_method): check rb_call_info_t::refinements
  not to confuse inline method cache when module_eval is used with
  refinements.

* test/ruby/test_refinement.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-11 02:42:04 +00:00
ko1 1486b9cf0a * insns.def (opt_send_simple): introduce new instruction used
when no need to care about block and splat.
* compile.c: use the `opt_send_simple' instruction.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 08:35:19 +00:00
ko1 c992cec4a0 * compile.c (new_callinfo): set a temporary index of callinfo
(used in `iseq_set_sequence()') to rb_call_info_t::aux::index.
  rb_call_info_t::argc is initialiesed by same value of
  rb_call_info_t::orig_argc.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 05:33:31 +00:00
ko1 49371b5420 * compile.c (compile_dstr_fragments): use `putobject' instead of
`putstring' for all of strings used by NODE_DSTR because
  ruby users can not grab this string.
  For example, the string object of "baz" in "foo#{bar}baz"
  is located by `putobject' (users can not touch "baz" object
  directly). This change reduces GC pressure.
  This improvement is suggested by Aaron Patterson.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 23:38:58 +00:00
ko1 a91e91c537 * vm_core.h (VM_CALL_*): rename VM_CALL_*_BIT
to VM_CALL_* (remove `_BIT' suffix).
  Add comments on each macros.
  Remove unused macro VM_CALL_TAILRECURSION_BIT.
* compile.c, iseq.c, insns.def, vm_insnhelper.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-15 17:22:57 +00:00
nobu ca968ee45e remove garbage line
* compile.c (new_insn_send): remove garbage line.
* tool/instruction.rb (sp_increase_c_expr): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14 17:20:42 +00:00
ko1 cbd597e9bc * insns.def (send, invokesuper, invokeblock, opt_*), vm_core.h:
use only a `ci' (rb_call_info_t) parameter instead of using
  parameters such as `op_id', 'op_argc', `blockiseq' and flag.
  These information are stored in rb_call_info_t at the compile
  time.
  This technique simplifies parameter passings at related
  function calls (~10% speedups for simple mehtod invocation at
  my machine).
  `rb_call_info_t' also has new function pointer variable `call'.
  This `call' variable enables to customize method (block)
  invocation process for each place. However, it always call
  `vm_call_general()' at this changes.
  `rb_call_info_t' also has temporary variables for method
  (block) invocation.
* vm_core.h, compile.c, insns.def: introduce VM_CALL_ARGS_SKIP_SETUP
  VM_CALL macro.  This flag indicates that this call can skip
  caller_setup (block arg and splat arg).
* compile.c: catch up above changes.
* iseq.c: catch up above changes (especially for TS_CALLINFO).
* tool/instruction.rb: catch up above chagnes.
* vm_insnhelper.c, vm_insnhelper.h: ditto. Macros and functions
  parameters are changed.
* vm_eval.c (vm_call0): ditto (it will be rewriten soon).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-14 16:59:05 +00:00
ko1 7ea3edc409 * vm_core.h (rb_call_info_t): add new type `rb_call_inf_t'.
This data structure contains information including inline method
  cache. After that, `struct iseq_inline_cache_entry' does not
  need to contain inline cache for method invocation.
  Other information will be added to this data structure.
* vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size'
  members to `rb_iseq_t'.
* insns.def, compile.c: Use CALL_INFO instead of IC.
* tool/instruction.rb: support CALL_INFO as operand type.
* vm_insnhelper.c, vm_insnhelper.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-09 05:33:54 +00:00
ko1 08c8605de9 * insns.def (getlocal, setlocal): remove old getlocal/setlocal
instructions and rename getdaynmic/setdynamic instructions
  to getlocal/setlocal.
* compile.c: ditto.
* iseq.c: remove TS_DINDEX.
* vm_exec.h (dindex_t): remove type definition of `dindex_t'.
* tool/instruction.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-04 13:52:20 +00:00
ko1 e3990633cb * insns.def (opt_checkenv): remove unused instruction `opt_checkenv'.
* compile.c (iseq_compile_each): ditto.
* node.h: remove unused node `NODE_OPTBLOCK'.
* ext/objspace/objspace.c, gc.c (gc_mark_children): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-28 06:44:24 +00:00
ko1 1bebb22ce1 * insns.def: add new instruction `opt_empty_p' for optimize `empty?'
method.  Apply a patch proposed at [ruby-dev:46120]
  [ruby-trunk - Feature #6972] by Glass_saga (Masaki Matsushita).
* compile.c (iseq_specialized_instruction), vm.c, vm_insnhelper.h:
  ditto.
* id.c, template/id.h.tmpl: ditto.
* test/ruby/test_optimization.rb: test for this changes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-26 09:34:46 +00:00