diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-28 06:21:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-28 06:21:46 +0000 |
commit | 5c0e68c39c3fc7717311826549a30d1615eb2007 (patch) | |
tree | ddf952542b46d0c180ed6200fcdb7b3e00036b32 /eval_method.ci | |
parent | 041fbcbf50993925b2d61fbfca4d16b766d8ea5d (diff) | |
download | ruby-5c0e68c39c3fc7717311826549a30d1615eb2007.tar.gz |
* 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
Diffstat (limited to 'eval_method.ci')
-rw-r--r-- | eval_method.ci | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/eval_method.ci b/eval_method.ci index 61ff38f532..6d86e52c50 100644 --- a/eval_method.ci +++ b/eval_method.ci @@ -143,7 +143,7 @@ rb_add_method(VALUE klass, ID mid, NODE * node, int noex) st_data_t data; NODE *old_node; - if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) { + if (st_lookup(RCLASS_M_TBL(klass), mid, &data)) { old_node = (NODE *)data; if (old_node) { if (nd_type(old_node->nd_body->nd_body) == NODE_CFUNC) { @@ -166,7 +166,7 @@ rb_add_method(VALUE klass, ID mid, NODE * node, int noex) } } - st_insert(RCLASS(klass)->m_tbl, mid, (st_data_t) body); + st_insert(RCLASS_M_TBL(klass), mid, (st_data_t) body); if (node && mid != ID_ALLOCATOR && ruby_running) { if (FL_TEST(klass, FL_SINGLETON)) { @@ -216,8 +216,8 @@ search_method(VALUE klass, ID id, VALUE *klassp) return 0; } - while (!st_lookup(RCLASS(klass)->m_tbl, id, &body)) { - klass = RCLASS(klass)->super; + while (!st_lookup(RCLASS_M_TBL(klass), id, &body)) { + klass = RCLASS_SUPER(klass); if (!klass) return 0; } @@ -305,11 +305,11 @@ remove_method(VALUE klass, ID mid) if (mid == object_id || mid == __send || mid == __send_bang || mid == init) { rb_warn("removing `%s' may cause serious problem", rb_id2name(mid)); } - if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) { + if (st_lookup(RCLASS_M_TBL(klass), mid, &data)) { body = (NODE *)data; if (!body || !body->nd_body) body = 0; else { - st_delete(RCLASS(klass)->m_tbl, &mid, &data); + st_delete(RCLASS_M_TBL(klass), &mid, &data); } } if (!body) { @@ -583,7 +583,7 @@ rb_alias(VALUE klass, ID name, ID def) orig_fbody->nd_cnt++; - if (st_lookup(RCLASS(klass)->m_tbl, name, &data)) { + if (st_lookup(RCLASS_M_TBL(klass), name, &data)) { node = (NODE *)data; if (node) { if (RTEST(ruby_verbose) && node->nd_cnt == 0 && node->nd_body) { @@ -595,7 +595,7 @@ rb_alias(VALUE klass, ID name, ID def) } } - st_insert(RCLASS(klass)->m_tbl, name, + st_insert(RCLASS_M_TBL(klass), name, (st_data_t) NEW_FBODY( NEW_METHOD(orig_fbody->nd_body->nd_body, orig_fbody->nd_body->nd_clss, |