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

1140 Коммитов

Автор SHA1 Сообщение Дата
ko1 f23e8d87c0 * vm.c (invoke_block_from_c): fix to point right cfp.
* vm.c (vm_make_proc, vm_make_proc_from_block), vm_core.h:
  remove unused parameter cfp.
* vm_insnhelper.c, proc.c (proc_new): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24 12:56:58 +00:00
ko1 f0da2e1657 * vm_insnhelper.c (vm_call_method): use class of method defined
instead of receiver's class on bmethod.  fixes [ruby-core:20786]
* bootstraptest/test_method.rb: add a test for above.
* vm_insnhelper.c (vm_setup_method): remove unused parameter klass.
* vm_insnhelper.h (CALL_METHOD): ditto.
* insns.def, vm_eval.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24 11:47:00 +00:00
nobu 8c8d666467 * vm_insnhelper.c (vm_callee_setup_arg_complex): uses cfp from
blockptr instead of the current cfp.  [ruby-core:20544]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 07:26:48 +00:00
nobu 47c2b02f2b * vm_insnhelper.c (check_cfunc): use function pointer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09 04:23:20 +00:00
mame e1a2fec2bb * README.EXT, README.EXT.ja, vm_exec.c, vm_insnhelper.c: update
filenames.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-14 11:31:10 +00:00
yugui a1645803bb * vm_insnhelper.c (vm_yield_setup_args): supports optional parameters.
Fixed [ruby-core:19503].

* vm_insnhelper.c (vm_yield_setup_block_args): a new function. extracted
  from vm_yield_setup_args.

* vm_insnhelper.c (vm_yield_setup_block_args_complex): ditto.

* test/ruby/test_proc.rb: added tests for arguments on a Proc from
  Kernel#proc called.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 13:35:46 +00:00
nobu 5c0515f2e2 * vm_insnhelper.c (vm_yield_setup_args): should not drop arguments
corresponding to default paramters.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 07:28:00 +00:00
ko1 8cd252ac6f * common.mk: clean up
- remove blockinlining.$(OBJEXT) to built
  - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h)
  - make VM_CORE_H_INCLUDES variable (vm_core.h)
  - simplify rules.
  - make depends rule to output depend status using gcc -MM.
* include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h.
* include/ruby.h: ditto.
* load.c: add inclusion explicitly.
* enumerator.c, object.c, parse.y, thread.c, vm_dump.c:
  remove useless inclusion.
* eval_intern.h: cleanup inclusion.
* vm_core.h: rb_thread_t should be defined in this file.
* vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c.
* vm.h, vm_exec.h: rename vm.h to vm_exec.h.
* insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h.
* vm.c, vm_insnhelper.c, vm_insnhelper.h:
  - rename vm_eval() to vm_exec_core().
  - rename vm_eval_body() to vm_exec().
  - cleanup include order.
* vm_method.c: fix comment.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 00:20:28 +00:00
usa 03e778757b * vm_insnhelper.c (vm_method_missing): C99.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 10:28:48 +00:00
mame 095ae8fd84 * vm_insnhelper.c (vm_method_missing): copy arguments to allocated
memory from machine stack.  [ruby-dev:36064]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-02 15:23:49 +00:00
ko1 100d0a568e * vm_insnhelper.c (vm_call_method): copy arguments to allocated
memory from machine stack.  [ruby-dev:36028]
* KNOWNBUGS.rb, bootstraptest/test_method.rb: move fixed test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29 08:24:51 +00:00
matz f7f0784270 * vm_insnhelper.c (vm_yield_setup_args): object with to_ary should
behave like array.  a patch from Yusuke Endoh  <mame at tsg.ne.jp>
  in [ruby-dev:35988].  [ruby-dev:35977]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28 11:29:57 +00:00
nobu 9286180079 * proc.c (proc_new): use the given class.
* vm.c (vm_make_proc): added an argument for the class.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 13:28:18 +00:00
matz e0889dbf38 * vm_insnhelper.c (caller_setup_args): should ensure if the value
from to_proc is a real Proc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13 08:32:53 +00:00
ko1 596eecd76d * vm.c, vm_insnhelper.c (vm_define_method): move
function place.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 09:59:06 +00:00
nobu 6a852b7c2b * vm_insnhelper.c (opt_eq_func): large function to make inline.
* bcc32/Makefile.sub (config.h): cannot compile a big inline function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-08 13:47:48 +00:00
ko1 c3e619c83d * vm_insnhelper.c (vm_throw): fix "return" process from "lambda".
* bootstraptest/test_proc.rb: add a test.
* bootstraptest/pending.rb: add a pending bug.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 02:46:02 +00:00
ko1 00e4fd42f3 * vm.c, vm_insnhelper.c: fix escape process with "braek" and "return"
syntax in "lambda".  [ ruby-Bugs-19304 ], [ruby-core:17164]
* KNOWNBUGS.rb, bootstraptest/test_proc.rb: add/move solved test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-17 19:27:24 +00:00
ko1 9e324fdd3e * vm.c, eval_intern.h (PASS_PASSED_BLOCK):
set a VM_FRAME_FLAG_PASSED flag to skip this frame when
  searching ruby-level-cfp.
* eval.c, eval_intern.h, proc.c: fix to check cfp.  if there is
  no valid ruby-level-cfp, cause RuntimeError exception.
  [ruby-dev:34128]
* vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c,
  insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*.
* KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 21:46:43 +00:00
ko1 ed4139e39b * include/ruby/intern.h, proc.c: revert rb_proc_call() and
create rb_proc_call_with_block() instaed.
* include/ruby/ruby.h, eval_jump.c, thread.c, vm_insnhelper.c:
  rb_blockptr should not be exposed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 16:33:51 +00:00
mame f2400eca0b * include/ruby/ruby.h, vm_core.h: add a type rb_blockptr.
* vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives
  blockptr and passes it to iterating block.

* proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives
  blockptr.  "rb_proc_call(self, args, blockptr)" in C corresponds to
  "self.call(*args, &block)" in Ruby.

* proc.c (proc_call): pass blockptr to block that is written in C.

* proc.c (curry): receive blockptr and pass it to original proc.
  [ruby-core:15551]

* vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc.

* thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for
  change of rb_proc_call.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 15:52:51 +00:00
wanabe ddf83922a2 * vm_insnhelper.c, vm.c, proc.c : revert r17021. [ruby-dev:34997]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 23:16:46 +00:00
wanabe a5fdfa5884 * vm_insnhelper.c, vm.c, proc.c (proc_call): allow call method with
block that both is written in C. [ruby-dev:34273] [ruby-core:15551]

*  proc.c (curry): use proc_call instead of rb_proc_call.
  [ruby-dev:34273] [ruby-core:15551]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 13:24:13 +00:00
wanabe 9393cc45c2 * vm_insnhelper.c (vm_throw): regard break as return in lambda.
[ruby-dev:34646]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08 11:18:54 +00:00
ko1 bf4626ed72 * vm_insnhelper.c (vm_callee_setup_arg): check simple flag before
calling setup_arg function().  this change reduce function call.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 14:48:07 +00:00
ko1 59c061235f * eval_method.c: renamed from vm_method.c. "vm_method.c" is included
by "vm.c".
* vm_eval.c: added.  Some codes are moved from "eval.c"
* common.mk: fix for above changes.
* compile.c: make a vm_eval(0)
* eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c,
  id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c,
  blockinlining.c: fix for above changes.  and do some refactoring.
  this changes improve rb_yield() performance.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 17:50:17 +00:00
mame 956dead480 * compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): remove
special handling that decrements sp in CATCH_TYPE_NEXT for NODE_WHILE.

* vm.c (vm_eval_body), vm_insnhelper.c (vm_throw): remove unused code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 06:29:48 +00:00
ko1 a45cd8a01c * eval.c, eval_intern.h, include/ruby/intern.h, include/ruby/ruby.h,
vm.c, vm_core.h, vm_insnhelper.c: remove pointless "const".



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 16:19:14 +00:00
ko1 559d021d20 * eval.c, vm.c, vm_core.h, vm_insnhelper.c: specify "const".
* vm_opts.h: add a OPT_TOKEN_THREADED_CODE macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 04:28:13 +00:00
ko1 4c094940aa * insns.def, vm_insnhelper.c: specify "const".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 15:18:15 +00:00
ko1 d457fdad2d * eval.c, vm_insnhelper.c: fix cref in instance_eval
and cvar_base search protocol.
* bootstraptest/test_knownbug.rb, test_eval.rb: move soleved test
  and add new tests.
* test/ruby/test_eval.rb: fix tests for spec.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 18:47:56 +00:00
ko1 385f0e8af6 * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.
VM value stack frame of block contains cref information.
  (dfp[-1] points CREF)
* compile.c, eval_intern.h, eval_method.c, load.c, proc.c,
  vm_dump.h, vm_core.h: ditto.
* include/ruby/ruby.h, gc.c: remove T_VALUES because of above
  changes.
* bootstraptest/test_eval.rb, test_knownbug.rb: move solved test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19 03:08:50 +00:00
matz a823fc5d8b * compile.c (compile_cpath): use Qundef to denote cbase lookup.
* insns.def (defineclass): Qudef is passed for cbase.

* insns.def (setconstant): ditto.

* vm_insnhelper.c (vm_check_if_namespace): use rb_inspect()
  instead of rb_obj_as_string() for better description.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-05 02:27:29 +00:00
nobu a0f487921e * vm_insnhelper.c (vm_get_ev_const): search from the base klass if it
is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 03:03:51 +00:00
nobu ccf20a6d3f * insns.def (defineclass): check if cbase is a class or a module.
[ruby-core:16118]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03 10:59:44 +00:00
nobu b6dff84acc * vm_insnhelper.c: math.h for isnan.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-17 17:06:51 +00:00
nobu 08c319ee2a * vm_insnhelper.c (vm_call_method): check argument number to
attr_reader.  [ruby-core:15120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-17 16:48:18 +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
akr 730374e56e * vm_insnhelper.c (vm_callee_setup_arg): it is not inlinable because
alloca is used.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05 12:49:01 +00:00
ko1 c334a09f7a * common.mk, *.ci: renamed to *.c.
* eval_laod.c: renamed to load.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 09:29:46 +00:00