Skip to content

Commit

Permalink
Shortcut ivar access for normal objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Oct 22, 2009
1 parent 8e1c76b commit 48fa88d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vm/builtin/object.cpp
Expand Up @@ -215,6 +215,8 @@ namespace rubinius {
return Qnil;
}

if(type_id() == Object::type) return get_table_ivar(state, sym);

// Handle packed objects in a unique way.
if(PackedObject* po = try_as<PackedObject>(this)) {
return po->get_packed_ivar(state, sym);
Expand Down Expand Up @@ -496,6 +498,8 @@ namespace rubinius {
return val;
}

if(type_id() == Object::type) return set_table_ivar(state, sym, val);

// Handle packed objects in a unique way.
if(PackedObject* po = try_as<PackedObject>(this)) {
return po->set_packed_ivar(state, sym, val);
Expand Down

0 comments on commit 48fa88d

Please sign in to comment.