1 Star 0 Fork 86

mydecember/pythonvm

forked from hinus/pythonvm 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cellObject.cpp 846 Bytes
一键复制 编辑 原始数据 按行查看 历史
hinus 提交于 2018-10-30 01:05 +08:00 . Summary: bug fix
#include "runtime/cellObject.hpp"
#include "object/hiList.hpp"
#include "object/hiDict.hpp"
#include "object/hiString.hpp"
#include "memory/oopClosure.hpp"
CellKlass* CellKlass::_instance = NULL;
CellKlass* CellKlass::get_instance() {
if (_instance == NULL) {
_instance = new CellKlass();
}
return _instance;
}
CellKlass::CellKlass() {
set_klass_dict(new HiDict());
set_name(new HiString("cell"));
}
CellObject::CellObject(HiList* t, int i) :
_table(t),
_index(i) {
set_klass(CellKlass::get_instance());
}
HiObject* CellObject::value() {
return _table->get(_index);
}
size_t CellKlass::size() {
return sizeof(CellKlass);
}
void CellKlass::oops_do(OopClosure* closure, HiObject* obj) {
CellObject* co = (CellObject*)obj;
closure->do_oop((HiObject**)&co->_table);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/libown/pythonvm.git
git@gitee.com:libown/pythonvm.git
libown
pythonvm
pythonvm
master

搜索帮助