1 Star 0 Fork 86

LearningTogether/pythonvm

forked from hinus/pythonvm 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
frameObject.hpp 2.27 KB
一键复制 编辑 原始数据 按行查看 历史
hinus 提交于 2018-10-07 10:30 +08:00 . Summary: traceback
#ifndef FRAME_OBJECT_HPP
#define FRAME_OBJECT_HPP
#include "code/codeObject.hpp"
#include "util/map.hpp"
#include "util/arrayList.hpp"
class FunctionObject;
class HiList;
class Block {
public:
unsigned char _type;
unsigned int _target;
int _level;
Block() {
_type = 0;
_target = 0;
_level = 0;
}
Block(unsigned char b_type,
unsigned int b_target,
int b_level):
_type(b_type),
_target(b_target),
_level(b_level) {
}
Block(const Block& b) {
_type = b._type;
_target = b._target;
_level = b._level;
}
};
class FrameObject {
public:
FrameObject(CodeObject* codes);
FrameObject(FunctionObject* func, ObjList args, int op_arg);
~FrameObject() {};
HiList* _stack;
ArrayList<Block*>* _loop_stack;
ArrayList<HiObject*>* _consts;
ArrayList<HiObject*>* _names;
HiDict* _locals;
HiDict* _globals;
HiList* _fast_locals;
HiList* _closure;
CodeObject* _codes;
FrameObject* _sender;
int _pc;
bool _entry_frame;
public:
void set_sender(FrameObject* x) { _sender = x; }
FrameObject* sender() { return _sender;}
void set_pc(int x) { _pc = x; }
int get_pc() { return _pc; }
void set_entry_frame(bool x) { _entry_frame = x; }
bool is_entry_frame() { return _entry_frame; }
bool is_first_frame() { return _sender == NULL; }
HiList* stack() { return _stack; }
ArrayList<Block*>* loop_stack() { return _loop_stack; }
ArrayList<HiObject*>* consts() { return _consts; }
ArrayList<HiObject*>* names() { return _names; }
HiDict* locals() { return _locals; }
HiDict* globals() { return _globals; }
HiList* fast_locals() { return _fast_locals; }
HiList* closure() { return _closure; }
HiObject* get_cell_from_parameter(int i );
HiString* file_name();
HiString* func_name();
int lineno();
bool has_more_codes();
unsigned char get_op_code();
int get_op_arg();
void oops_do(OopClosure* f);
};
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/LearningTogether/pythonvm.git
git@gitee.com:LearningTogether/pythonvm.git
LearningTogether
pythonvm
pythonvm
master

搜索帮助