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

56 Коммитов

Автор SHA1 Сообщение Дата
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
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
matz 989c8ed00a * proc.c (proc_dup): should copy safe_level from src proc
properly.  a patch from Keita Yamaguchi
  <keita.yamaguchi at gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 20:47:26 +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 3d751cde0f * proc.c (method_name): should return symbols instead of strings.
[ruby-dev:34531]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28 02:12:21 +00:00
matz 3730710d79 * proc.c (proc_dup): should copy is_lambda attribute as well.
[ruby-talk:296244]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30 14:50:55 +00:00
akr 861219ce4a fix doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09 01:04:46 +00:00
mame cd6dcfb05b * proc.c (proc_curry): new method. [ruby-dev:33676]
* test/ruby/test_proc.rb: add tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 12:51:31 +00:00
akr 87ea50380d fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-09 09:49:31 +00:00
nobu 857b3018dd * proc.c (proc_mark): needs to mark the receiver too. a patch from
Chris Heath <chris AT heathens.co.nz> in [ruby-core:14983].
  [ruby-core:14885]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11 11:20: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 8702c4d0d7 update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05 03:35:13 +00:00
akr a3f722abef update lambda? doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-26 03:49:10 +00:00
matz 520d763d77 * proc.c (method_inspect): preserve encoding of the method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 03:24:50 +00:00
akr cf41125e3a update Proc#lambda? doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 18:36:30 +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
akr e5988f7404 update Proc#lambda? doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 06:56:06 +00:00
nobu 4542f21a42 * proc.c (rb_proc_new), vm.c (invoke_block): removed u3.state magic.
[ruby-core:14310]

* test/ruby/test_symbol.rb (test_to_proc): a test from Frederick
  Cheung <frederick.cheung AT gmail.com>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 04:55:37 +00:00
akr e615f0ec42 Proc#lambda? documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23 15:36:00 +00:00
ko1 40d8543fbd * proc.c: support Proc#binding.
* sample/test.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 08:20:02 +00:00
ko1 314bef7ef1 * insnhelper.ci, vm.c, vm_core.h: change interface of
vm_invoke_block() to specify block ptr.  [ruby-talk:266422]
* cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c:
  apply above change.
* bootstraptest/test_knownbug.rb: move fixed bug.
* bootstraptest/test_block.rb: ditto. and add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 07:07:35 +00:00
matz 1281cb00e5 * proc.c (rb_obj_public_method): Object#public_method to retrieve
public method object.

* proc.c (rb_mod_public_instance_method): Module#public_instance_method 
  to retrieve public instance method from class / module.

* proc.c (mnew): visibility check added.

* eval_error.ci (rb_print_undef): add rb_ prefix.

* eval_error.ci (rb_print_undef): add visibility in the error
  message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-17 23:01:50 +00:00
nobu 430f5a1d61 * proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
* proc.c (rb_proc_location): return file name and line number where
  the proc is defined.

* thread.c (thread_s_new): call initialize.  [ruby-core:13835]

* thread.c (thread_initialize): split initialize method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 07:18:52 +00:00
matz c227d3feb3 * insnhelper.ci (vm_search_normal_superclass): rename function.
* insnhelper.ci (vm_search_superclass): ditto.

* proc.c (struct METHOD): rename rklass -> rclass.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-22 01:17:52 +00:00
ko1 88f570d9ae * proc.c (proc_dup): proc->block.proc should be self.
* bootstraptest/test_knownbug.rb, test_method.rb:
  move a fixed test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-01 22:02:23 +00:00
akr 5c0e68c39c * include/ruby/intern.h: export rb_ivar_foreach.
* include/ruby/ruby.h: modify struct RObject and RClass for optimizing
  T_OBJECT space.  [ruby-dev:31853]
  (ROBJECT_LEN, ROBJECT_PTR)
  (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL)
  (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor
  defined.

* variable.c: support the modified RObject and RClass.

* object.c: ditto.

* class.c: ditto.

* gc.c: ditto.

* marshal.c: ditto.

* eval_method.ci: use the abstract accessor.

* insns.def: ditto.

* proc.c: ditto.

* struct.c: ditto.

* eval.c: ditto.

* error.c: ditto.

* vm.c: ditto.

* insnhelper.ci: ditto.

* ext/digest/digest.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28 06:21:46 +00:00
nobu 7d4ee1d235 * proc.c (rb_obj_define_method): reverted. [ruby-talk:266637]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30 05:06:52 +00:00
ko1 cd30220aff * insnhelper.ci (vm_call_bmethod): fix to propagate information
that this proc is "from Method".  [ruby-dev:31490]
* proc.c (method_proc, rb_mod_define_method): ditto.
* vm.c (vm_invoke_proc_core): removed.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 04:02:21 +00:00
ko1 14c3aa52ae * proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
init place of exception_error.
* inits.c: ditto.
* eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL.
  [ruby-dev:31407]
* bootstraptest/test_exception.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-14 10:53:53 +00:00
ko1 6b6bf4dd48 * blockinlining.c: remove "yarv" prefix.
* array.c, numeric.c: ditto.
* insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
* yarvcore.c: removed.
* yarvcore.h: renamed to core.h.
* cont.c, debug.c, error.c, process.c, signal.c : ditto.
* ext/probeprofiler/probeprofiler.c: ditto.
* id.c, id.h: added.
* inits.c: ditto.
* compile.c: rename internal functions.
* compile.h: fix debug flag.
* eval.c, object.c, vm.c: remove ruby_top_self.
  use rb_vm_top_self() instead.
* eval_intern.h, eval_load: ditto.
* gc.c: rename yarv_machine_stack_mark() to
  rb_gc_mark_machine_stack().
* insnhelper.h: remove unused macros.
* iseq.c: add iseq_compile() to create iseq object
  from source string.
* proc.c: rename a internal function.
* template/insns.inc.tmpl: remove YARV prefix.
* thread.c:
* vm.c (rb_iseq_eval): added.
* vm.c: move some functions from yarvcore.c.
* vm_dump.c: fix to remove compiler warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12 04:25:46 +00:00
ko1 6a69ad4df1 * yarvcore.h: some refactoring on rb_iseq_t.
rename some variable names, add comments, etc.
* compile.c, iseq.c, proc.c, vm.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-30 18:04:35 +00:00
ko1 6aacb0ede4 * proc.c (proc_new): fix to return a proc object
which block is contained.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-29 07:42:16 +00:00
ko1 8bfcdf323f * insnhelper.ci (vm_yield_with_cfunc), proc.c: fix Method#to_proc
to return lamba Proc ([ruby-dev:31021], [ruby-dev:31037]).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25 19:06:00 +00:00
ko1 4bdb5ced9a * gc.h: add RUBY_ prefix to debug macros.
* cont.c, proc.c, yarvcore.c,
* gc.c: define ruby_gc_debug_indent variable to debug mark/free.
* vm.c, insnhelper.ci: rename some functions to vm_* or rb_vm_*.
  move some functions, definitions, declarations to suitable files.
* eval.c, yarvcore.h, eval_error.ci, insnhelper.ci: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25 02:44:20 +00:00
ko1 6bd0345627 * eval_*.h: rename to eval_*.ci.
* common.mk: ditto.
* eval_error.ci: remove ruby_set_current_source().
* error.c, eval.c, ruby.c: ditto.
* eval_safe.c, proc.c: remove unused macros.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 19:23:24 +00:00
ko1 97ba019c94 * vm.c: some refactoring.
* rename th_* to vm_*.
  * remove unused variables functions.
  * add prototypes.
* blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h,
  eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y,
  proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c,
  vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 15:42:41 +00:00
nobu d1bd418715 * proc.c (proc_to_s): used a variable before initialized.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 07:35:49 +00:00
nobu a5c9bf7d63 * proc.c (proc_to_s): suppress warning, and reduced duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 07:10:46 +00:00
akr f11a6f2d65 * proc.c (proc_to_s): revert the change from %p to %lx at YARV
merge time.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-22 10:56:43 +00:00
akr e2bc064096 * proc.c (proc_to_s): show is_lambda.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-22 10:34:19 +00:00
ko1 78029f00d5 * parse.y (new_yield), compile.c (iseq_compile_each): fix
passing parameter.
* eval.c, eval_jump.h: simplify rb_yield*.
* proc.c (proc_mark): fix to mark proc->block.proc.
* proc.c (Init_Proc): add Proc#lambda?
* test/ruby/test_lambda.rb: add some tests.
* vm.c (invoke_block): fix to check lambda block or not.
* vm.c (th_yield_setup_args): fix to check arguments size
  when lambda block.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 17:26:00 +00:00
ko1 66d4a354a8 * proc.c (Init_Proc): remove a line break.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-02 07:47:20 +00:00
ko1 f80841275d * proc.c (proc_arity): fix an arity bug ([ruby-core:11060]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-01 05:01:15 +00:00
ko1 75d28f8870 * yarvcore.h, compile.c (set_arguments): support post arguments.
* test/ruby/test_method.rb: add tests for above.
* test/ruby/test_proc.rb: ditto.
* proc.c: fix an arity bug ([ruby-core:11029]).
* vm.c, vm.h, insns.def, vm_dump.h: fix bmethod process.
* vm.c: support block argument on block parameter.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-01 04:35:58 +00:00
nobu 354844be45 * eval_intern.h (PUSH_TAG): no argument now.
* eval.c, eval_error.h, eval_jump.h, eval_load.c, proc.c, thread.c:
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 01:35:13 +00:00
ko1 bb7a2d40ff * compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
  debug.c, debug.h: merge half-baked-1.9 changes.  The biggest change
  is to change node structure around NODE_SCOPE, NODE_ARGS.  Every
  scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
  represents more details of arguments information.  I'll write a
  document about detail of node structure.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 11:15:15 +00:00
ko1 71986ef6bc * yarvcore.h:
rename:
  rb_iseq_t#file_name -> filename
  rb_iseq_t#local_tbl -> local_table
  add:
  rb_iseq_t#local_table_size
* compile.c: separate local_table_size and local_size
  (local variable size)
* blockinlining.c: apply above rename.
* compile.h: ditto.
* eval.c: ditto.
* iseq.c: ditto.
* proc.c: ditto.
* vm.c: ditto.
* vm_dump.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-25 01:34:33 +00:00
ko1 9c574383a4 * blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
  thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
  vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fix typo (rb_thead_t -> rb_thread_t).

* eval_intern.h: remove unused definitions.

* common.mk: fix around vm_opts.h path
  and remove harmful argument passed to insns2vm.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-08 06:37:46 +00:00
ko1 8ee7d0767f * blockinlining.c, compile.c, compile.h, error.c, eval.c,
eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
  eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
  process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
  yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
  * yarv_*_t -> rb_*_t
  * yarv_*_struct -> rb_*_struct
  * yarv_tag -> rb_vm_tag
  * YARV_* -> RUBY_VM_*
* proc.c, vm.c: move functions about env object creation
  from proc.c to vm.c.
* proc.c, yarvcore.c: fix rb_cVM initialization place.
* inits.c: change Init_ISeq() order (after Init_VM).
* ruby.h, proc.c: change declaration place of rb_cEnv
  from proc.c to ruby.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06 19:00:03 +00:00