summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-06 05:22:17 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-06 05:22:17 +0000
commit42ce75cdff741d69927e407ac57b68dd58408111 ()
tree23c31bb9a51e489645b42457e69ac9a50fd5014d
parentd4d5f27077dd356fb2bef031991864777cc54ef6 (diff)
* compile.c, insns.def: remove (get|set)instancevariable2 and add a
operand is_local to (get|set)instancevariable. * yarvtest/test_class.rb: add a test for class local instance variable. * parse.y (rb_decompose_ivar2): remove unused variable oid. * tool/insns2vm.rb: remove needless require. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--compile.c30
-rw-r--r--insns.def46
-rw-r--r--parse.y1
-rw-r--r--tool/insns2vm.rb2
-rw-r--r--yarvtest/test_class.rb19
6 files changed, 51 insertions, 58 deletions
@@ -1,3 +1,14 @@
Tue Feb 6 11:18:41 2007 Shugo Maeda <[email protected]>
* lib/net/ftp.rb: check the control connection on EPIPE.
@@ -3323,22 +3323,15 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
(((long)node->nd_entry) | 1));
break;
}
- case NODE_IASGN:{
- COMPILE(ret, "lvalue", node->nd_value);
- if (!poped) {
- ADD_INSN(ret, nd_line(node), dup);
- }
- ADD_INSN1(ret, nd_line(node), setinstancevariable,
- ID2SYM(node->nd_vid));
- break;
- }
case NODE_IASGN2:{
COMPILE(ret, "lvalue", node->nd_value);
if (!poped) {
ADD_INSN(ret, nd_line(node), dup);
}
- ADD_INSN1(ret, nd_line(node), setinstancevariable2,
- ID2SYM(node->nd_vid));
break;
}
case NODE_CDECL:{
@@ -3909,19 +3902,14 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
break;
}
- case NODE_IVAR:{
- debugi("nd_vid", node->nd_vid);
- if (!poped) {
- ADD_INSN1(ret, nd_line(node), getinstancevariable,
- ID2SYM(node->nd_vid));
- }
- break;
- }
case NODE_IVAR2:{
debugi("nd_vid", node->nd_vid);
if (!poped) {
- ADD_INSN1(ret, nd_line(node), getinstancevariable2,
- ID2SYM(node->nd_vid));
}
break;
}
@@ -175,60 +175,38 @@ setdynamic
/**
@c variable
@e get instance variable id of obj.
@j obj �̃C���X�^���X�ϐ� id �𓾂�B
*/
DEFINE_INSN
getinstancevariable
-(ID id)
()
(VALUE val)
{
- val = rb_ivar_get(GET_SELF(), id);
-}
-
-/**
- @c variable
- @e get class local instance variable id of obj.
- @j obj �̃N���X���[�J���C���X�^���X�ϐ� id �𓾂�B
- */
-DEFINE_INSN
-getinstancevariable2
-(ID id)
-()
-(VALUE val)
-{
- /* need to cache composed id */
- id = rb_compose_ivar2(id, eval_get_cvar_base(th, GET_ISEQ()));
val = rb_ivar_get(GET_SELF(), id);
}
/**
@c variable
@e set instance variable id of obj as val.
@j obj �̃C���X�^���X�ϐ��� val �ɂ���B
*/
DEFINE_INSN
setinstancevariable
-(ID id)
(VALUE val)
()
{
- rb_ivar_set(GET_SELF(), id, val);
-}
-
-/**
- @c variable
- @e set class local instance variable id of obj as val.
- @j obj �̃N���X���[�J���C���X�^���X�ϐ��� val �ɂ���B
- */
-DEFINE_INSN
-setinstancevariable2
-(ID id)
-(VALUE val)
-()
-{
- /* need to cache composed id */
- id = rb_compose_ivar2(id, eval_get_cvar_base(th, GET_ISEQ()));
rb_ivar_set(GET_SELF(), id, val);
}
@@ -8592,7 +8592,6 @@ ID
rb_decompose_ivar2(ID id, VALUE *klassp)
{
struct ivar2_key *kp;
- ID oid;
if (!st_lookup(global_symbols.id_ivar2, (st_data_t)id, (st_data_t *)&kp)) {
return id;
@@ -1116,8 +1116,6 @@ class InsnsDef
insns.each{|insn|
size = insn.unifs.size
if size > 0
- require 'pp'
-
insn.unifs.sort_by{|unif| -unif[1].size}.each_with_index{|unif, i|
uni_insn, uni_insns = *unif
@@ -749,5 +749,24 @@ class TestClass < YarvTestBase
:ok
}
end
end