More work on controlling access to members of the Object class:

- Moved the code for initializing the object class, species and base object inside the Object class
- Made propertyOffsetToId() a method of the Object class
- Made relocateObject() a method of the Object class
- The Object getVariable() method now returns a reference to the requested variable

Only SegManager::reconstructScripts() is left needing direct access to the members of the Object class

svn-id: r49228
This commit is contained in:
Filippos Karapetis 2010-05-26 08:27:24 +00:00
parent 60dd310688
commit 1c0bbb10cb
5 changed files with 120 additions and 82 deletions

View file

@ -120,7 +120,7 @@ static reg_t &validate_property(Object *obj, int index) {
return dummyReg;
}
return obj->_variables[index];
return obj->getVariable(index);
}
static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
@ -1758,8 +1758,7 @@ void quit_vm() {
reg_t* ObjVarRef::getPointer(SegManager *segMan) const {
Object *o = segMan->getObject(obj);
if (!o) return 0;
return &(o->_variables[varindex]);
return o ? &o->getVariable(varindex) : 0;
}
reg_t* ExecStack::getVarPointer(SegManager *segMan) const {