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
ko1
a4a8101965
* proc.c: support Binding#eval.
...
* yarvtest/test_eval.rb: add a test for above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-05 18:50:35 +00:00
ko1
0d70d88643
* proc.c: refactoring (remove K&R style, move Binding stuffs from
...
Init_Proc() to Init_Binding()).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-05 18:31:08 +00:00
nobu
d08112a656
* proc.c (yarv_proc_alloc): needs return.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 15:50:11 +00:00
nobu
c1f5d22719
* *.def, proc.c, vm_opts.h.base, template/*: set properties.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 15:21:41 +00:00
matz
0fe77cd26b
* eval_proc.c (method_receiver): add new method to get the bound
...
receiver of the method object. [ruby-talk:234949]
* eval_proc.c (method_name): new method to get the name of a
method.
* eval_proc.c (method_owner): a new method to get the class or
module that defines the method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-20 14:25:07 +00:00
ko1
dbee678630
* some refactoring around yarvcore and proc.
...
* eval_proc.c: renamed to proc.c.
* common.mk: ditto.
* yarvcore.h, yarvcore.c: rename or remove some global variables
removed: mYarvCore, mYarvInsns
renamed: cYarvISeq -> rb_cISeq,
cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding
::YarvCore module is removed and ::YarvCore::VM class becomes ::VM.
And change/remove some functions which added with YARV.
* compile.c: ditto.
* eval.c: ditto.
* iseq.c: ditto.
* vm.c: ditto.
* inits.c: rename Init_yarvcore to Init_vm.
* yarvcore.c, proc.c: move some functions and initialization
from yarvcore.c to proc.c.
* intern.h, proc.c: add global function rb_binding_new(void).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-17 08:48:52 +00:00