Commit 5e76425d authored by Kevin Modzelewski's avatar Kevin Modzelewski

Migrated everything to bst except for cfg

parent 42a07f21
......@@ -33,7 +33,7 @@
namespace pyston {
class LivenessBBVisitor : public NoopASTVisitor {
class LivenessBBVisitor : public NoopBSTVisitor {
private:
struct Status {
enum Usage : char {
......@@ -55,7 +55,7 @@ private:
VRegMap<Status> statuses;
LivenessAnalysis* analysis;
void _doLoad(int vreg, AST_Name* node) {
void _doLoad(int vreg, BST_Name* node) {
Status& status = statuses[vreg];
status.addUsage(Status::USED);
}
......@@ -76,11 +76,11 @@ public:
bool firstIsDef(int vreg) const { return getStatusFirst(vreg) == Status::DEFINED; }
bool isKilledAt(AST_Name* node, bool is_live_at_end) { return node->is_kill; }
bool isKilledAt(BST_Name* node, bool is_live_at_end) { return node->is_kill; }
bool visit_import(AST_Import* node) { RELEASE_ASSERT(0, "these should all get removed by the cfg"); }
bool visit_import(BST_Import* node) { RELEASE_ASSERT(0, "these should all get removed by the cfg"); }
bool visit_classdef(AST_ClassDef* node) {
bool visit_classdef(BST_ClassDef* node) {
for (auto e : node->bases)
e->accept(this);
for (auto e : node->decorator_list)
......@@ -89,7 +89,7 @@ public:
return true;
}
bool visit_functiondef(AST_FunctionDef* node) {
bool visit_functiondef(BST_FunctionDef* node) {
for (auto* d : node->decorator_list)
d->accept(this);
for (auto* d : node->args->defaults)
......@@ -98,7 +98,7 @@ public:
return true;
}
bool visit_name(AST_Name* node) {
bool visit_name(BST_Name* node) {
if (node->vreg == -1)
return true;
......@@ -119,7 +119,7 @@ public:
return true;
}
bool visit_alias(AST_alias* node) { RELEASE_ASSERT(0, "these should be removed by the cfg"); }
bool visit_alias(BST_alias* node) { RELEASE_ASSERT(0, "these should be removed by the cfg"); }
};
LivenessAnalysis::LivenessAnalysis(CFG* cfg) : cfg(cfg), result_cache(cfg->getVRegInfo().getTotalNumOfVRegs()) {
......@@ -127,7 +127,7 @@ LivenessAnalysis::LivenessAnalysis(CFG* cfg) : cfg(cfg), result_cache(cfg->getVR
for (CFGBlock* b : cfg->blocks) {
auto visitor = new LivenessBBVisitor(this); // livenessCache unique_ptr will delete it.
for (AST_stmt* stmt : b->body) {
for (BST_stmt* stmt : b->body) {
stmt->accept(visitor);
}
liveness_cache.insert(std::make_pair(b, std::unique_ptr<LivenessBBVisitor>(visitor)));
......@@ -140,7 +140,7 @@ LivenessAnalysis::LivenessAnalysis(CFG* cfg) : cfg(cfg), result_cache(cfg->getVR
LivenessAnalysis::~LivenessAnalysis() {
}
bool LivenessAnalysis::isKill(AST_Name* node, CFGBlock* parent_block) {
bool LivenessAnalysis::isKill(BST_Name* node, CFGBlock* parent_block) {
if (node->id.s()[0] != '#')
return false;
......@@ -232,7 +232,7 @@ public:
virtual void processBB(Map& starting, CFGBlock* block) const;
};
class DefinednessVisitor : public ASTVisitor {
class DefinednessVisitor : public BSTVisitor {
private:
typedef DefinednessBBAnalyzer::Map Map;
Map& state;
......@@ -242,13 +242,13 @@ private:
state[vreg] = DefinednessAnalysis::Defined;
}
void _doSet(AST* t) {
void _doSet(BST* t) {
switch (t->type) {
case AST_TYPE::Attribute:
case BST_TYPE::Attribute:
// doesn't affect definedness (yet?)
break;
case AST_TYPE::Name: {
auto name = ast_cast<AST_Name>(t);
case BST_TYPE::Name: {
auto name = bst_cast<BST_Name>(t);
if (name->lookup_type == ScopeInfo::VarScopeType::FAST
|| name->lookup_type == ScopeInfo::VarScopeType::CLOSURE) {
assert(name->vreg != -1);
......@@ -262,10 +262,10 @@ private:
}
break;
}
case AST_TYPE::Subscript:
case BST_TYPE::Subscript:
break;
case AST_TYPE::Tuple: {
AST_Tuple* tt = ast_cast<AST_Tuple>(t);
case BST_TYPE::Tuple: {
BST_Tuple* tt = bst_cast<BST_Tuple>(t);
for (int i = 0; i < tt->elts.size(); i++) {
_doSet(tt->elts[i]);
}
......@@ -279,21 +279,21 @@ private:
public:
DefinednessVisitor(Map& state) : state(state) {}
virtual bool visit_assert(AST_Assert* node) { return true; }
virtual bool visit_branch(AST_Branch* node) { return true; }
virtual bool visit_expr(AST_Expr* node) { return true; }
virtual bool visit_global(AST_Global* node) { return true; }
virtual bool visit_invoke(AST_Invoke* node) { return false; }
virtual bool visit_jump(AST_Jump* node) { return true; }
virtual bool visit_pass(AST_Pass* node) { return true; }
virtual bool visit_print(AST_Print* node) { return true; }
virtual bool visit_raise(AST_Raise* node) { return true; }
virtual bool visit_return(AST_Return* node) { return true; }
virtual bool visit_delete(AST_Delete* node) {
virtual bool visit_assert(BST_Assert* node) { return true; }
virtual bool visit_branch(BST_Branch* node) { return true; }
virtual bool visit_expr(BST_Expr* node) { return true; }
virtual bool visit_global(BST_Global* node) { return true; }
virtual bool visit_invoke(BST_Invoke* node) { return false; }
virtual bool visit_jump(BST_Jump* node) { return true; }
virtual bool visit_pass(BST_Pass* node) { return true; }
virtual bool visit_print(BST_Print* node) { return true; }
virtual bool visit_raise(BST_Raise* node) { return true; }
virtual bool visit_return(BST_Return* node) { return true; }
virtual bool visit_delete(BST_Delete* node) {
for (auto t : node->targets) {
if (t->type == AST_TYPE::Name) {
AST_Name* name = ast_cast<AST_Name>(t);
if (t->type == BST_TYPE::Name) {
BST_Name* name = bst_cast<BST_Name>(t);
if (name->lookup_type != ScopeInfo::VarScopeType::GLOBAL
&& name->lookup_type != ScopeInfo::VarScopeType::NAME) {
assert(name->vreg != -1);
......@@ -302,27 +302,27 @@ public:
assert(name->vreg == -1);
} else {
// The CFG pass should reduce all deletes to the "basic" deletes on names/attributes/subscripts.
// If not, probably the best way to do this would be to just do a full AST traversal
// and look for AST_Name's with a ctx of Del
assert(t->type == AST_TYPE::Attribute || t->type == AST_TYPE::Subscript);
// If not, probably the best way to do this would be to just do a full BST traversal
// and look for BST_Name's with a ctx of Del
assert(t->type == BST_TYPE::Attribute || t->type == BST_TYPE::Subscript);
}
}
return true;
}
virtual bool visit_classdef(AST_ClassDef* node) {
virtual bool visit_classdef(BST_ClassDef* node) {
assert(0 && "I think this isn't needed");
//_doSet(node->name);
return true;
}
virtual bool visit_functiondef(AST_FunctionDef* node) {
virtual bool visit_functiondef(BST_FunctionDef* node) {
assert(0 && "I think this isn't needed");
//_doSet(node->name);
return true;
}
virtual bool visit_alias(AST_alias* node) {
virtual bool visit_alias(BST_alias* node) {
int vreg = node->name_vreg;
if (node->asname.s().size())
vreg = node->asname_vreg;
......@@ -330,17 +330,17 @@ public:
_doSet(vreg);
return true;
}
virtual bool visit_import(AST_Import* node) { return false; }
virtual bool visit_importfrom(AST_ImportFrom* node) { return false; }
virtual bool visit_import(BST_Import* node) { return false; }
virtual bool visit_importfrom(BST_ImportFrom* node) { return false; }
virtual bool visit_assign(AST_Assign* node) {
virtual bool visit_assign(BST_Assign* node) {
for (int i = 0; i < node->targets.size(); i++) {
_doSet(node->targets[i]);
}
return true;
}
virtual bool visit_arguments(AST_arguments* node) {
virtual bool visit_arguments(BST_arguments* node) {
if (node->kwarg)
_doSet(node->kwarg);
if (node->vararg)
......@@ -351,7 +351,7 @@ public:
return true;
}
virtual bool visit_exec(AST_Exec* node) { return true; }
virtual bool visit_exec(BST_Exec* node) { return true; }
friend class DefinednessBBAnalyzer;
};
......@@ -537,7 +537,7 @@ std::unique_ptr<PhiAnalysis> computeRequiredPhis(const ParamNames& args, CFG* cf
initial_map[vreg] = DefinednessAnalysis::Undefined;
}
for (AST_Name* n : args.allArgsAsName()) {
for (BST_Name* n : args.allArgsAsName()) {
ScopeInfo::VarScopeType vst = n->lookup_type;
assert(vst != ScopeInfo::VarScopeType::UNKNOWN);
assert(vst != ScopeInfo::VarScopeType::GLOBAL); // global-and-local error
......
......@@ -26,9 +26,9 @@
namespace pyston {
class AST_arguments;
class AST_Jump;
class AST_Name;
class BST_arguments;
class BST_Jump;
class BST_Name;
class CFG;
class CFGBlock;
class LivenessBBVisitor;
......@@ -48,7 +48,7 @@ public:
~LivenessAnalysis();
// we don't keep track of node->parent_block relationships, so you have to pass both:
bool isKill(AST_Name* node, CFGBlock* parent_block);
bool isKill(BST_Name* node, CFGBlock* parent_block);
bool isLiveAtEnd(int vreg, CFGBlock* block);
};
......
......@@ -17,6 +17,7 @@
#include "llvm/ADT/DenseSet.h"
#include "core/ast.h"
#include "core/bst.h"
#include "core/common.h"
#include "core/types.h"
#include "core/util.h"
......@@ -35,12 +36,12 @@ ScopingResults::ScopingResults(ScopeInfo* scope_info, bool globals_from_module)
deref_info = scope_info->getAllDerefVarsAndInfo();
}
DerefInfo ScopingResults::getDerefInfo(AST_Name* node) const {
DerefInfo ScopingResults::getDerefInfo(BST_Name* node) const {
assert(node->lookup_type == ScopeInfo::VarScopeType::DEREF);
assert(node->deref_info.offset != INT_MAX);
return node->deref_info;
}
size_t ScopingResults::getClosureOffset(AST_Name* node) const {
size_t ScopingResults::getClosureOffset(BST_Name* node) const {
assert(node->lookup_type == ScopeInfo::VarScopeType::CLOSURE);
assert(node->closure_offset != -1);
return node->closure_offset;
......
This diff is collapsed.
......@@ -25,8 +25,8 @@ namespace pyston {
class CFGBlock;
class BoxedClass;
class AST_expr;
class AST_slice;
class BST_expr;
class BST_slice;
class OSREntryDescriptor;
class TypeAnalysis {
......@@ -40,8 +40,8 @@ public:
virtual ConcreteCompilerType* getTypeAtBlockStart(int vreg, CFGBlock* block) = 0;
virtual ConcreteCompilerType* getTypeAtBlockEnd(int vreg, CFGBlock* block) = 0;
virtual BoxedClass* speculatedExprClass(AST_expr*) = 0;
virtual BoxedClass* speculatedExprClass(AST_slice*) = 0;
virtual BoxedClass* speculatedExprClass(BST_expr*) = 0;
virtual BoxedClass* speculatedExprClass(BST_slice*) = 0;
};
TypeAnalysis* doTypeAnalysis(CFG* cfg, const ParamNames& param_names,
......
......@@ -336,7 +336,7 @@ ICSlotInfo* ICInfo::pickEntryForRewrite(const char* debug_name) {
}
static llvm::DenseMap<void*, ICInfo*> ics_by_return_addr;
static llvm::DenseMap<AST*, ICInfo*> ics_by_ast_node;
static llvm::DenseMap<BST*, ICInfo*> ics_by_ast_node;
ICInfo::ICInfo(void* start_addr, void* slowpath_rtn_addr, void* continue_addr, StackInfo stack_info, int size,
llvm::CallingConv::ID calling_conv, LiveOutSet _live_outs, assembler::GenericRegister return_register,
......@@ -480,13 +480,13 @@ bool ICInfo::isMegamorphic() {
return times_rewritten >= IC_MEGAMORPHIC_THRESHOLD;
}
ICInfo* ICInfo::getICInfoForNode(AST* node) {
ICInfo* ICInfo::getICInfoForNode(BST* node) {
auto&& it = ics_by_ast_node.find(node);
if (it != ics_by_ast_node.end())
return it->second;
return NULL;
}
void ICInfo::associateNodeWithICInfo(AST* node, std::unique_ptr<TypeRecorder> type_recorder) {
void ICInfo::associateNodeWithICInfo(BST* node, std::unique_ptr<TypeRecorder> type_recorder) {
assert(!this->node);
this->node = node;
this->type_recorder = std::move(type_recorder);
......
......@@ -104,8 +104,8 @@ private:
// global ones.
std::vector<Location> ic_global_decref_locations;
// associated AST node for this IC
AST* node;
// associated BST node for this IC
BST* node;
// for ICSlotRewrite:
ICSlotInfo* pickEntryForRewrite(const char* debug_name);
......@@ -145,8 +145,8 @@ public:
friend class ICSlotRewrite;
static ICInfo* getICInfoForNode(AST* node);
void associateNodeWithICInfo(AST* node, std::unique_ptr<TypeRecorder> type_recorder);
static ICInfo* getICInfoForNode(BST* node);
void associateNodeWithICInfo(BST* node, std::unique_ptr<TypeRecorder> type_recorder);
void appendDecrefInfosTo(std::vector<DecrefInfo>& dest_decref_infos);
};
......
This diff is collapsed.
......@@ -23,9 +23,9 @@ namespace gc {
class GCVisitor;
}
class AST_expr;
class AST_stmt;
class AST_Jump;
class BST_expr;
class BST_stmt;
class BST_Jump;
class Box;
class BoxedClosure;
class BoxedDict;
......@@ -46,11 +46,11 @@ struct ASTInterpreterJitInterface {
static int getGlobalsOffset();
static void delNameHelper(void* _interpreter, InternedString name);
static Box* derefHelper(void* interp, AST_Name* node);
static Box* derefHelper(void* interp, BST_Name* node);
static Box* landingpadHelper(void* interp);
static void pendingCallsCheckHelper();
static void setExcInfoHelper(void* interp, STOLEN(Box*) type, STOLEN(Box*) value, STOLEN(Box*) traceback);
static void setLocalClosureHelper(void* interp, AST_Name* name, Box* v);
static void setLocalClosureHelper(void* interp, BST_Name* name, Box* v);
static void uncacheExcInfoHelper(void* interp);
static void raise0Helper(void* interp) __attribute__((noreturn));
static Box* yieldHelper(void* interp, STOLEN(Box*) value);
......@@ -79,7 +79,7 @@ Box* astInterpretFunction(BoxedCode* f, Box* closure, Box* generator, Box* globa
Box** args);
Box* astInterpretFunctionEval(BoxedCode* cf, Box* globals, Box* boxedLocals);
// this function is implemented in the src/codegen/ast_interpreter_exec.S assembler file
extern "C" Box* astInterpretDeopt(BoxedCode* cf, AST_expr* after_expr, AST_stmt* enclosing_stmt, Box* expr_val,
extern "C" Box* astInterpretDeopt(BoxedCode* cf, BST_expr* after_expr, BST_stmt* enclosing_stmt, Box* expr_val,
STOLEN(FrameStackState) frame_state);
struct FrameInfo;
......
......@@ -226,7 +226,7 @@ RewriterVar* JitFragmentWriter::imm(void* val) {
return loadConst((uint64_t)val);
}
RewriterVar* JitFragmentWriter::emitAugbinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
RewriterVar* JitFragmentWriter::emitAugbinop(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
return emitPPCall((void*)augbinop, { lhs, rhs, imm(op_type) }, 2 * 320, true /* record type */, node)
.first->setType(RefType::OWNED);
}
......@@ -239,12 +239,12 @@ RewriterVar* JitFragmentWriter::emitApplySlice(RewriterVar* target, RewriterVar*
return emitPPCall((void*)applySlice, { target, lower, upper }, 256).first->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitBinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
RewriterVar* JitFragmentWriter::emitBinop(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
return emitPPCall((void*)binop, { lhs, rhs, imm(op_type) }, 2 * 240, true /* record type */, node)
.first->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitCallattr(AST_expr* node, RewriterVar* obj, BoxedString* attr, CallattrFlags flags,
RewriterVar* JitFragmentWriter::emitCallattr(BST_expr* node, RewriterVar* obj, BoxedString* attr, CallattrFlags flags,
const llvm::ArrayRef<RewriterVar*> args,
std::vector<BoxedString*>* keyword_names) {
#if ENABLE_BASELINEJIT_ICS
......@@ -298,7 +298,7 @@ RewriterVar* JitFragmentWriter::emitCallattr(AST_expr* node, RewriterVar* obj, B
#endif
}
RewriterVar* JitFragmentWriter::emitCompare(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
RewriterVar* JitFragmentWriter::emitCompare(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type) {
if (op_type == AST_TYPE::Is || op_type == AST_TYPE::IsNot) {
RewriterVar* cmp_result = lhs->cmp(op_type == AST_TYPE::IsNot ? AST_TYPE::NotEq : AST_TYPE::Eq, rhs);
return call(false, (void*)boxBool, cmp_result)->setType(RefType::OWNED);
......@@ -372,7 +372,7 @@ RewriterVar* JitFragmentWriter::emitCreateTuple(const llvm::ArrayRef<RewriterVar
return r;
}
RewriterVar* JitFragmentWriter::emitDeref(AST_Name* name) {
RewriterVar* JitFragmentWriter::emitDeref(BST_Name* name) {
return call(false, (void*)ASTInterpreterJitInterface::derefHelper, getInterp(), imm(name))->setType(RefType::OWNED);
}
......@@ -380,12 +380,12 @@ RewriterVar* JitFragmentWriter::emitExceptionMatches(RewriterVar* v, RewriterVar
return call(false, (void*)exceptionMatchesHelper, v, cls)->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitGetAttr(RewriterVar* obj, BoxedString* s, AST_expr* node) {
RewriterVar* JitFragmentWriter::emitGetAttr(RewriterVar* obj, BoxedString* s, BST_expr* node) {
return emitPPCall((void*)getattr, { obj, imm(s) }, 2 * 256, true /* record type */, node)
.first->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitGetBlockLocal(AST_Name* name) {
RewriterVar* JitFragmentWriter::emitGetBlockLocal(BST_Name* name) {
auto s = name->id;
auto vreg = name->vreg;
auto it = local_syms.find(s);
......@@ -398,7 +398,7 @@ RewriterVar* JitFragmentWriter::emitGetBlockLocal(AST_Name* name) {
return it->second;
}
void JitFragmentWriter::emitKillTemporary(AST_Name* name) {
void JitFragmentWriter::emitKillTemporary(BST_Name* name) {
if (!local_syms.count(name->id))
emitSetLocal(name, false, imm(nullptr));
}
......@@ -427,12 +427,12 @@ RewriterVar* JitFragmentWriter::emitGetGlobal(BoxedString* s) {
return emitPPCall((void*)getGlobal, { globals, imm(s) }, 128).first->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitGetItem(AST_expr* node, RewriterVar* value, RewriterVar* slice) {
RewriterVar* JitFragmentWriter::emitGetItem(BST_expr* node, RewriterVar* value, RewriterVar* slice) {
return emitPPCall((void*)getitem, { value, slice }, 256, true /* record type */, node)
.first->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitGetLocal(AST_Name* name) {
RewriterVar* JitFragmentWriter::emitGetLocal(BST_Name* name) {
if (LOG_BJIT_ASSEMBLY)
comment("BJIT: emitGetLocal start");
auto vreg = name->vreg;
......@@ -500,7 +500,7 @@ RewriterVar* JitFragmentWriter::emitRepr(RewriterVar* v) {
return call(false, (void*)repr, v)->setType(RefType::OWNED);
}
RewriterVar* JitFragmentWriter::emitRuntimeCall(AST_expr* node, RewriterVar* obj, ArgPassSpec argspec,
RewriterVar* JitFragmentWriter::emitRuntimeCall(BST_expr* node, RewriterVar* obj, ArgPassSpec argspec,
const llvm::ArrayRef<RewriterVar*> args,
std::vector<BoxedString*>* keyword_names) {
#if ENABLE_BASELINEJIT_ICS
......@@ -637,7 +637,7 @@ void JitFragmentWriter::emitJump(CFGBlock* b) {
comment("BJIT: emitJump() end");
}
void JitFragmentWriter::emitOSRPoint(AST_Jump* node) {
void JitFragmentWriter::emitOSRPoint(BST_Jump* node) {
if (LOG_BJIT_ASSEMBLY)
comment("BJIT: emitOSRPoint() start");
addAction([=]() { _emitOSRPoint(); }, { getInterp() }, ActionType::NORMAL);
......@@ -679,12 +679,12 @@ void JitFragmentWriter::emitReturn(RewriterVar* v) {
v->refConsumed();
}
void JitFragmentWriter::emitSetAttr(AST_expr* node, RewriterVar* obj, BoxedString* s, STOLEN(RewriterVar*) attr) {
void JitFragmentWriter::emitSetAttr(BST_expr* node, RewriterVar* obj, BoxedString* s, STOLEN(RewriterVar*) attr) {
auto rtn = emitPPCall((void*)setattr, { obj, imm(s), attr }, 2 * 256, false /* don't record type */, node);
attr->refConsumed(rtn.second);
}
void JitFragmentWriter::emitSetBlockLocal(AST_Name* name, STOLEN(RewriterVar*) v) {
void JitFragmentWriter::emitSetBlockLocal(BST_Name* name, STOLEN(RewriterVar*) v) {
if (LOG_BJIT_ASSEMBLY)
comment("BJIT: emitSetBlockLocal() start");
auto vreg = name->vreg;
......@@ -699,7 +699,7 @@ void JitFragmentWriter::emitSetBlockLocal(AST_Name* name, STOLEN(RewriterVar*) v
comment("BJIT: emitSetBlockLocal() end");
}
void JitFragmentWriter::emitSetCurrentInst(AST_stmt* node) {
void JitFragmentWriter::emitSetCurrentInst(BST_stmt* node) {
getInterp()->setAttr(ASTInterpreterJitInterface::getCurrentInstOffset(), imm(node));
}
......@@ -728,7 +728,7 @@ void JitFragmentWriter::emitSetItemName(BoxedString* s, RewriterVar* v) {
emitSetItem(emitGetBoxedLocals(), imm(s), v);
}
void JitFragmentWriter::emitSetLocal(AST_Name* name, bool set_closure, STOLEN(RewriterVar*) v) {
void JitFragmentWriter::emitSetLocal(BST_Name* name, bool set_closure, STOLEN(RewriterVar*) v) {
if (LOG_BJIT_ASSEMBLY)
comment("BJIT: emitSetLocal() start");
auto vreg = name->vreg;
......@@ -922,7 +922,7 @@ uint64_t JitFragmentWriter::asUInt(InternedString s) {
std::pair<RewriterVar*, RewriterAction*>
JitFragmentWriter::emitPPCall(void* func_addr, llvm::ArrayRef<RewriterVar*> args, unsigned short pp_size,
bool should_record_type, AST* ast_node, llvm::ArrayRef<RewriterVar*> additional_uses) {
bool should_record_type, BST* ast_node, llvm::ArrayRef<RewriterVar*> additional_uses) {
if (LOG_BJIT_ASSEMBLY)
comment("BJIT: emitPPCall() start");
#if ENABLE_BASELINEJIT_ICS
......@@ -1125,7 +1125,7 @@ void JitFragmentWriter::_emitOSRPoint() {
}
void JitFragmentWriter::_emitPPCall(RewriterVar* result, void* func_addr, llvm::ArrayRef<RewriterVar*> args,
unsigned short pp_size, AST* ast_node, llvm::ArrayRef<RewriterVar*> vars_to_bump) {
unsigned short pp_size, BST* ast_node, llvm::ArrayRef<RewriterVar*> vars_to_bump) {
assembler::Register r = allocReg(assembler::R11);
if (args.size() > 6) { // only 6 args can get passed in registers.
......
......@@ -28,7 +28,7 @@ namespace pyston {
#define ENABLE_BASELINEJIT_MAP_32BIT 1
#define ENABLE_BASELINEJIT_ICS 1
class AST_stmt;
class BST_stmt;
class Box;
class BoxedDict;
class BoxedList;
......@@ -43,7 +43,7 @@ class JitFragmentWriter;
// It operates on a basic block at a time (=CFGBLock*) and supports very fast switching between the
// interpreter and the JITed code on every block start/end.
//
// To archive this it's tightly integrated with the AST Interpreter and always operates on an ASTInterpreter instance.
// To archive this it's tightly integrated with the BST Interpreter and always operates on an ASTInterpreter instance.
// The process works like this:
// - in the ASTInterpreter main loop we will check on every basic block start if we have already machine code for the
// basic block
......@@ -53,7 +53,7 @@ class JitFragmentWriter;
// - create/reuse a JitCodeBlock for the function
// - create a new JitFragmentWriter for the basic block to JIT
// - interpret the basic block and in addition call into corresponding emit* functions of the JitFragmentWriter on
// every AST node encountered.
// every BST node encountered.
// - if a node is encountered which is not supported, abort JITing of the block and blacklist this block
// - if we reached the control flow changing node of the basic block (e.g. a branch, return or jump node) we finish
// JITing the block.
......@@ -127,7 +127,7 @@ class JitFragmentWriter;
// second_JitFragment:
// ...
// ; this shows how a AST_Return looks like
// ; this shows how a BST_Return looks like
// xor %eax,%eax ; rax contains the next block to interpret.
// in this case 0 which means we are finished
// movabs $0x1270014108,%rdx ; rdx must contain the Box* value to return
......@@ -249,7 +249,7 @@ private:
uint8_t* end_addr;
std::unique_ptr<ICSetupInfo> ic;
StackInfo stack_info;
AST* node;
BST* node;
std::vector<Location> decref_infos;
std::unique_ptr<TypeRecorder> type_recorder;
};
......@@ -266,29 +266,29 @@ public:
RewriterVar* imm(uint64_t val);
RewriterVar* imm(void* val);
RewriterVar* emitAugbinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitAugbinop(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitApplySlice(RewriterVar* target, RewriterVar* lower, RewriterVar* upper);
RewriterVar* emitBinop(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitCallattr(AST_expr* node, RewriterVar* obj, BoxedString* attr, CallattrFlags flags,
RewriterVar* emitBinop(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitCallattr(BST_expr* node, RewriterVar* obj, BoxedString* attr, CallattrFlags flags,
const llvm::ArrayRef<RewriterVar*> args, std::vector<BoxedString*>* keyword_names);
RewriterVar* emitCompare(AST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitCompare(BST_expr* node, RewriterVar* lhs, RewriterVar* rhs, int op_type);
RewriterVar* emitCreateDict();
void emitDictSet(RewriterVar* dict, RewriterVar* k, RewriterVar* v);
RewriterVar* emitCreateList(const llvm::ArrayRef<STOLEN(RewriterVar*)> values);
RewriterVar* emitCreateSet(const llvm::ArrayRef<RewriterVar*> values);
RewriterVar* emitCreateSlice(RewriterVar* start, RewriterVar* stop, RewriterVar* step);
RewriterVar* emitCreateTuple(const llvm::ArrayRef<RewriterVar*> values);
RewriterVar* emitDeref(AST_Name* name);
RewriterVar* emitDeref(BST_Name* name);
RewriterVar* emitExceptionMatches(RewriterVar* v, RewriterVar* cls);
RewriterVar* emitGetAttr(RewriterVar* obj, BoxedString* s, AST_expr* node);
RewriterVar* emitGetBlockLocal(AST_Name* name);
void emitKillTemporary(AST_Name* name);
RewriterVar* emitGetAttr(RewriterVar* obj, BoxedString* s, BST_expr* node);
RewriterVar* emitGetBlockLocal(BST_Name* name);
void emitKillTemporary(BST_Name* name);
RewriterVar* emitGetBoxedLocal(BoxedString* s);
RewriterVar* emitGetBoxedLocals();
RewriterVar* emitGetClsAttr(RewriterVar* obj, BoxedString* s);
RewriterVar* emitGetGlobal(BoxedString* s);
RewriterVar* emitGetItem(AST_expr* node, RewriterVar* value, RewriterVar* slice);
RewriterVar* emitGetLocal(AST_Name* name);
RewriterVar* emitGetItem(BST_expr* node, RewriterVar* value, RewriterVar* slice);
RewriterVar* emitGetLocal(BST_Name* name);
RewriterVar* emitGetPystonIter(RewriterVar* v);
RewriterVar* emitHasnext(RewriterVar* v);
RewriterVar* emitImportFrom(RewriterVar* module, BoxedString* name);
......@@ -298,7 +298,7 @@ public:
RewriterVar* emitNonzero(RewriterVar* v);
RewriterVar* emitNotNonzero(RewriterVar* v);
RewriterVar* emitRepr(RewriterVar* v);
RewriterVar* emitRuntimeCall(AST_expr* node, RewriterVar* obj, ArgPassSpec argspec,
RewriterVar* emitRuntimeCall(BST_expr* node, RewriterVar* obj, ArgPassSpec argspec,
const llvm::ArrayRef<RewriterVar*> args, std::vector<BoxedString*>* keyword_names);
RewriterVar* emitUnaryop(RewriterVar* v, int op_type);
std::vector<RewriterVar*> emitUnpackIntoArray(RewriterVar* v, uint64_t num);
......@@ -311,20 +311,20 @@ public:
void emitDelName(InternedString name);
void emitExec(RewriterVar* code, RewriterVar* globals, RewriterVar* locals, FutureFlags flags);
void emitJump(CFGBlock* b);
void emitOSRPoint(AST_Jump* node);
void emitOSRPoint(BST_Jump* node);
void emitPendingCallsCheck();
void emitPrint(RewriterVar* dest, RewriterVar* var, bool nl);
void emitRaise0();
void emitRaise3(RewriterVar* arg0, RewriterVar* arg1, RewriterVar* arg2);
void emitReturn(RewriterVar* v);
void emitSetAttr(AST_expr* node, RewriterVar* obj, BoxedString* s, STOLEN(RewriterVar*) attr);
void emitSetBlockLocal(AST_Name* name, STOLEN(RewriterVar*) v);
void emitSetCurrentInst(AST_stmt* node);
void emitSetAttr(BST_expr* node, RewriterVar* obj, BoxedString* s, STOLEN(RewriterVar*) attr);
void emitSetBlockLocal(BST_Name* name, STOLEN(RewriterVar*) v);
void emitSetCurrentInst(BST_stmt* node);
void emitSetExcInfo(RewriterVar* type, RewriterVar* value, RewriterVar* traceback);
void emitSetGlobal(BoxedString* s, STOLEN(RewriterVar*) v, bool are_globals_from_module);
void emitSetItemName(BoxedString* s, RewriterVar* v);
void emitSetItem(RewriterVar* target, RewriterVar* slice, RewriterVar* value);
void emitSetLocal(AST_Name* name, bool set_closure, STOLEN(RewriterVar*) v);
void emitSetLocal(BST_Name* name, bool set_closure, STOLEN(RewriterVar*) v);
// emitSideExit steals a full ref from v, not just a vref
void emitSideExit(STOLEN(RewriterVar*) v, Box* cmp_value, CFGBlock* next_block);
void emitUncacheExcInfo();
......@@ -351,7 +351,7 @@ private:
const llvm::ArrayRef<RewriterVar*> additional_uses);
std::pair<RewriterVar*, RewriterAction*> emitPPCall(void* func_addr, llvm::ArrayRef<RewriterVar*> args,
unsigned short pp_size, bool should_record_type = false,
AST* ast_node = NULL,
BST* bst_node = NULL,
llvm::ArrayRef<RewriterVar*> additional_uses = {});
static void assertNameDefinedHelper(const char* id);
......@@ -371,7 +371,7 @@ private:
void _emitJump(CFGBlock* b, RewriterVar* block_next, ExitInfo& exit_info);
void _emitOSRPoint();
void _emitPPCall(RewriterVar* result, void* func_addr, llvm::ArrayRef<RewriterVar*> args, unsigned short pp_size,
AST* ast_node, llvm::ArrayRef<RewriterVar*> vars_to_bump);
BST* bst_node, llvm::ArrayRef<RewriterVar*> vars_to_bump);
void _emitRecordType(RewriterVar* obj_cls_var);
void _emitReturn(RewriterVar* v);
void _emitSideExit(STOLEN(RewriterVar*) var, RewriterVar* val_constant, CFGBlock* next_block,
......
......@@ -29,7 +29,7 @@
#include "analysis/scoping_analysis.h"
#include "codegen/baseline_jit.h"
#include "codegen/compvars.h"
#include "core/ast.h"
#include "core/bst.h"
#include "core/cfg.h"
#include "core/util.h"
#include "runtime/types.h"
......
......@@ -73,7 +73,7 @@ struct GlobalState {
llvm::Type* llvm_value_type, *llvm_value_type_ptr, *llvm_value_type_ptr_ptr;
llvm::Type* llvm_class_type, *llvm_class_type_ptr;
llvm::Type* llvm_opaque_type;
llvm::Type* llvm_boxedstring_type_ptr, *llvm_dict_type_ptr, *llvm_aststmt_type_ptr, *llvm_astexpr_type_ptr;
llvm::Type* llvm_boxedstring_type_ptr, *llvm_dict_type_ptr, *llvm_bststmt_type_ptr, *llvm_bstexpr_type_ptr;
llvm::Type* llvm_frame_info_type;
llvm::Type* llvm_code_type_ptr, *llvm_closure_type_ptr, *llvm_generator_type_ptr;
llvm::Type* llvm_module_type_ptr, *llvm_bool_type_ptr;
......
......@@ -21,6 +21,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Support/raw_ostream.h"
#include "core/bst.h"
#include "codegen/codegen.h"
#include "codegen/gcbuilder.h"
#include "codegen/irgen.h"
......
......@@ -51,7 +51,7 @@
#include "codegen/osrentry.h"
#include "codegen/patchpoints.h"
#include "codegen/stackmaps.h"
#include "core/ast.h"
#include "core/bst.h"
#include "core/cfg.h"
#include "core/options.h"
#include "core/stats.h"
......@@ -551,7 +551,7 @@ static void emitBBs(IRGenState* irstate, TypeAnalysis* types, const OSREntryDesc
if (block == cfg->getStartingBlock()) {
assert(entry_descriptor == NULL);
if (ENABLE_REOPT && effort < EffortLevel::MAXIMAL && source->ast_type != AST_TYPE::Module) {
if (ENABLE_REOPT && effort < EffortLevel::MAXIMAL && source->ast_type != BST_TYPE::Module) {
llvm::BasicBlock* preentry_bb = llvm::BasicBlock::Create(
g.context, "pre_entry", irstate->getLLVMFunction(), llvm_entry_blocks[cfg->getStartingBlock()]);
llvm::BasicBlock* reopt_bb = llvm::BasicBlock::Create(g.context, "reopt", irstate->getLLVMFunction());
......@@ -695,7 +695,7 @@ static void emitBBs(IRGenState* irstate, TypeAnalysis* types, const OSREntryDesc
// analysis frameworks can't (yet) support the idea of a block flowing differently to its different
// successors.
//
// There are four kinds of AST statements which can set a name:
// There are four kinds of BST statements which can set a name:
// - Assign
// - ClassDef
// - FunctionDef
......@@ -715,25 +715,25 @@ static void emitBBs(IRGenState* irstate, TypeAnalysis* types, const OSREntryDesc
SymbolTable* sym_table = ending_symbol_tables[pred];
bool created_new_sym_table = false;
if (last_inst->type == AST_TYPE::Invoke && ast_cast<AST_Invoke>(last_inst)->exc_dest == block) {
AST_stmt* stmt = ast_cast<AST_Invoke>(last_inst)->stmt;
if (last_inst->type == BST_TYPE::Invoke && bst_cast<BST_Invoke>(last_inst)->exc_dest == block) {
BST_stmt* stmt = bst_cast<BST_Invoke>(last_inst)->stmt;
// The CFG pass translates away these statements, so we should never encounter them.
// If we did, we'd need to remove a name here.
assert(stmt->type != AST_TYPE::ClassDef);
assert(stmt->type != AST_TYPE::FunctionDef);
assert(stmt->type != AST_TYPE::Import);
assert(stmt->type != AST_TYPE::ImportFrom);
assert(stmt->type != BST_TYPE::ClassDef);
assert(stmt->type != BST_TYPE::FunctionDef);
assert(stmt->type != BST_TYPE::Import);
assert(stmt->type != BST_TYPE::ImportFrom);
if (stmt->type == AST_TYPE::Assign) {
auto asgn = ast_cast<AST_Assign>(stmt);
if (stmt->type == BST_TYPE::Assign) {
auto asgn = bst_cast<BST_Assign>(stmt);
assert(asgn->targets.size() == 1);
if (asgn->targets[0]->type == AST_TYPE::Name) {
auto asname = ast_cast<AST_Name>(asgn->targets[0]);
if (asgn->targets[0]->type == BST_TYPE::Name) {
auto asname = bst_cast<BST_Name>(asgn->targets[0]);
assert(asname->lookup_type != ScopeInfo::VarScopeType::UNKNOWN);
InternedString name = asname->id;
int vreg = ast_cast<AST_Name>(asgn->targets[0])->vreg;
int vreg = bst_cast<BST_Name>(asgn->targets[0])->vreg;
assert(name.c_str()[0] == '#'); // it must be a temporary
// You might think I need to check whether `name' is being assigned globally or locally,
// since a global assign doesn't affect the symbol table. However, the CFG pass only
......@@ -823,9 +823,9 @@ static void emitBBs(IRGenState* irstate, TypeAnalysis* types, const OSREntryDesc
llvm_exit_blocks[block] = ending_st.ending_block;
if (ending_st.exception_state.size()) {
AST_stmt* last_stmt = block->body.back();
assert(last_stmt->type == AST_TYPE::Invoke);
CFGBlock* exc_block = ast_cast<AST_Invoke>(last_stmt)->exc_dest;
BST_stmt* last_stmt = block->body.back();
assert(last_stmt->type == BST_TYPE::Invoke);
CFGBlock* exc_block = bst_cast<BST_Invoke>(last_stmt)->exc_dest;
assert(!incoming_exception_state.count(exc_block));
incoming_exception_state.insert(std::make_pair(exc_block, ending_st.exception_state));
......
......@@ -29,15 +29,15 @@
namespace pyston {
class AST_expr;
class AST_stmt;
class BST_expr;
class BST_stmt;
class CFGBlock;
class GCBuilder;
class IREmitter;
struct UnwindInfo {
public:
AST_stmt* current_stmt;
BST_stmt* current_stmt;
llvm::BasicBlock* exc_dest;
......@@ -46,7 +46,7 @@ public:
bool hasHandler() const { return exc_dest != NULL; }
UnwindInfo(AST_stmt* current_stmt, llvm::BasicBlock* exc_dest, bool is_after_deopt = false)
UnwindInfo(BST_stmt* current_stmt, llvm::BasicBlock* exc_dest, bool is_after_deopt = false)
: current_stmt(current_stmt), exc_dest(exc_dest), is_after_deopt(is_after_deopt) {}
ExceptionStyle preferredExceptionStyle() const;
......@@ -119,7 +119,7 @@ public:
// virtual void checkAndPropagateCapiException(const UnwindInfo& unw_info, llvm::Value* returned_val,
// llvm::Value* exc_val, bool double_check = false) = 0;
virtual llvm::Value* createDeopt(AST_stmt* current_stmt, AST_expr* node, llvm::Value* node_value) = 0;
virtual llvm::Value* createDeopt(BST_stmt* current_stmt, BST_expr* node, llvm::Value* node_value) = 0;
virtual BORROWED(Box*) getIntConstant(int64_t n) = 0;
virtual BORROWED(Box*) getFloatConstant(double d) = 0;
......
......@@ -21,6 +21,8 @@
namespace pyston {
class AST_stmt;
// Loop through import statements to find __future__ imports throwing errors for
// bad __future__ imports. Returns the futures that are turned on. This is used
// for irgeneration; the parser still has to handle some futures on its own,
......
......@@ -42,7 +42,7 @@
#include "codegen/patchpoints.h"
#include "codegen/stackmaps.h"
#include "codegen/unwinding.h"
#include "core/ast.h"
#include "core/bst.h"
#include "core/cfg.h"
#include "core/common.h"
#include "core/options.h"
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ class MDNode;
namespace pyston {
class AST_Invoke;
class BST_Invoke;
class CFGBlock;
class GCBuilder;
struct PatchpointInfo;
......@@ -186,25 +186,25 @@ public:
virtual void copySymbolsFrom(SymbolTable* st) = 0;
virtual void run(const CFGBlock* block) = 0; // primary entry point
virtual EndingState getEndingSymbolTable() = 0;
virtual void doSafePoint(AST_stmt* next_statement) = 0;
virtual void doSafePoint(BST_stmt* next_statement) = 0;
virtual void addFrameStackmapArgs(PatchpointInfo* pp, std::vector<llvm::Value*>& stackmap_args) = 0;
virtual void addOutgoingExceptionState(ExceptionState exception_state) = 0;
virtual void setIncomingExceptionState(llvm::SmallVector<ExceptionState, 2> exc_state) = 0;
virtual llvm::BasicBlock* getCXXExcDest(const UnwindInfo&) = 0;
virtual llvm::BasicBlock* getCAPIExcDest(llvm::BasicBlock* from_block, llvm::BasicBlock* final_dest,
AST_stmt* current_stmt, bool is_after_deopt = false) = 0;
BST_stmt* current_stmt, bool is_after_deopt = false) = 0;
virtual CFGBlock* getCFGBlock() = 0;
};
std::tuple<llvm::Value*, llvm::Value*, llvm::Value*> createLandingpad(llvm::BasicBlock*);
class IREmitter;
class AST_Call;
class BST_Call;
IREmitter* createIREmitter(IRGenState* irstate, llvm::BasicBlock*& curblock, IRGenerator* irgenerator = NULL);
IRGenerator* createIRGenerator(IRGenState* irstate, std::unordered_map<CFGBlock*, llvm::BasicBlock*>& entry_blocks,
CFGBlock* myblock, TypeAnalysis* types);
std::vector<BoxedString*>* getKeywordNameStorage(AST_Call* node);
std::vector<BoxedString*>* getKeywordNameStorage(BST_Call* node);
}
#endif
......@@ -33,7 +33,7 @@ struct StackMap;
class OSREntryDescriptor {
private:
OSREntryDescriptor(BoxedCode* code, AST_Jump* backedge, ExceptionStyle exception_style)
OSREntryDescriptor(BoxedCode* code, BST_Jump* backedge, ExceptionStyle exception_style)
: code(code),
backedge(backedge),
exception_style(exception_style),
......@@ -44,13 +44,13 @@ private:
public:
BoxedCode* code;
AST_Jump* const backedge;
BST_Jump* const backedge;
ExceptionStyle exception_style;
typedef VRegMap<ConcreteCompilerType*> ArgMap;
ArgMap args;
VRegSet potentially_undefined;
static OSREntryDescriptor* create(BoxedCode* code, AST_Jump* backedge, ExceptionStyle exception_style) {
static OSREntryDescriptor* create(BoxedCode* code, BST_Jump* backedge, ExceptionStyle exception_style) {
return new OSREntryDescriptor(code, backedge, exception_style);
}
};
......
......@@ -147,13 +147,13 @@ void initGlobalFuncs(GlobalState& g) {
assert(g.llvm_dict_type_ptr);
g.llvm_dict_type_ptr = g.llvm_dict_type_ptr->getPointerTo();
g.llvm_aststmt_type_ptr = g.stdlib_module->getTypeByName("class.pyston::AST_stmt");
assert(g.llvm_aststmt_type_ptr);
g.llvm_aststmt_type_ptr = g.llvm_aststmt_type_ptr->getPointerTo();
g.llvm_bststmt_type_ptr = g.stdlib_module->getTypeByName("class.pyston::BST_stmt");
assert(g.llvm_bststmt_type_ptr);
g.llvm_bststmt_type_ptr = g.llvm_bststmt_type_ptr->getPointerTo();
g.llvm_astexpr_type_ptr = g.stdlib_module->getTypeByName("class.pyston::AST_expr");
assert(g.llvm_astexpr_type_ptr);
g.llvm_astexpr_type_ptr = g.llvm_astexpr_type_ptr->getPointerTo();
g.llvm_bstexpr_type_ptr = g.stdlib_module->getTypeByName("class.pyston::BST_expr");
assert(g.llvm_bstexpr_type_ptr);
g.llvm_bstexpr_type_ptr = g.llvm_bstexpr_type_ptr->getPointerTo();
// The LLVM vector type for the arguments that we pass to runtimeCall and related functions.
// It will be a pointer to a type named something like class.std::vector or
......
......@@ -42,7 +42,7 @@ Box* recordType(TypeRecorder* self, Box* obj) {
return obj;
}
BoxedClass* predictClassFor(AST* node) {
BoxedClass* predictClassFor(BST* node) {
ICInfo* ic = ICInfo::getICInfoForNode(node);
if (!ic || !ic->getTypeRecorder())
return NULL;
......
......@@ -19,7 +19,7 @@
namespace pyston {
class AST;
class BST;
class Box;
class BoxedClass;
......@@ -44,7 +44,7 @@ public:
friend Box* recordType(TypeRecorder*, Box*);
};
BoxedClass* predictClassFor(AST* node);
BoxedClass* predictClassFor(BST* node);
}
#endif
......@@ -365,7 +365,7 @@ public:
}
}
AST_stmt* getCurrentStatement() {
BST_stmt* getCurrentStatement() {
assert(getFrameInfo()->stmt);
return getFrameInfo()->stmt;
}
......@@ -417,7 +417,7 @@ static unw_word_t getFunctionEnd(unw_word_t ip) {
return pip.end_ip;
}
static bool inASTInterpreterExecuteInner(unw_word_t ip) {
static bool inBSTInterpreterExecuteInner(unw_word_t ip) {
static unw_word_t interpreter_instr_end = getFunctionEnd((unw_word_t)interpreter_instr_addr);
return ((unw_word_t)interpreter_instr_addr < ip && ip <= interpreter_instr_end);
}
......@@ -451,12 +451,12 @@ static inline unw_word_t get_cursor_sp(unw_cursor_t* cursor) {
}
// if the given ip/bp correspond to a jitted frame or
// ASTInterpreter::execute_inner frame, return true and return the
// BSTInterpreter::execute_inner frame, return true and return the
// frame information through the PythonFrameIteratorImpl* info arg.
bool frameIsPythonFrame(unw_word_t ip, unw_word_t bp, unw_cursor_t* cursor, PythonFrameIteratorImpl* info) {
CompiledFunction* cf = getCFForAddress(ip);
bool jitted = cf != NULL;
bool interpreted = !jitted && inASTInterpreterExecuteInner(ip);
bool interpreted = !jitted && inBSTInterpreterExecuteInner(ip);
if (!jitted && !interpreted)
return false;
......@@ -486,7 +486,7 @@ bool frameIsPythonFrame(unw_word_t ip, unw_word_t bp, unw_cursor_t* cursor, Pyth
}
static const LineInfo lineInfoForFrameInfo(FrameInfo* frame_info) {
AST_stmt* current_stmt = frame_info->stmt;
BST_stmt* current_stmt = frame_info->stmt;
auto* code = frame_info->code;
assert(code);
......@@ -736,7 +736,7 @@ template <typename Func> void unwindPythonStack(Func func) {
// 2. Grab the next frame in the stack and check what function it is from. There are four options:
//
// (a) A JIT-compiled Python function.
// (b) ASTInterpreter::execute() in codegen/ast_interpreter.cpp.
// (b) BSTInterpreter::execute() in codegen/ast_interpreter.cpp.
// (c) generatorEntry() in runtime/generator.cpp.
// (d) Something else.
//
......@@ -753,7 +753,7 @@ template <typename Func> void unwindPythonStack(Func func) {
//
// 3. We've found a frame for our traceback, along with a CompiledFunction* and some other information about it.
//
// We grab the current statement it is in (as an AST_stmt*) and use it and the CompiledFunction*'s source info to
// We grab the current statement it is in (as an BST_stmt*) and use it and the CompiledFunction*'s source info to
// produce the line information for the traceback. For JIT-compiled functions, getting the statement involves the
// CF's location_map.
//
......@@ -1040,7 +1040,7 @@ BORROWED(Box*) FrameInfo::updateBoxedLocals() {
return frame_info->boxedLocals;
}
AST_stmt* PythonFrameIterator::getCurrentStatement() {
BST_stmt* PythonFrameIterator::getCurrentStatement() {
return impl->getCurrentStatement();
}
......
......@@ -107,7 +107,7 @@ public:
BoxedCode* getCode();
FrameInfo* getFrameInfo();
bool exists() { return impl.get() != NULL; }
AST_stmt* getCurrentStatement();
BST_stmt* getCurrentStatement();
BORROWED(Box*) getGlobalsDict();
PythonFrameIterator(PythonFrameIterator&& rhs);
......@@ -150,7 +150,7 @@ FrameStackState getFrameStackState();
struct DeoptState {
FrameStackState frame_state;
CompiledFunction* cf;
AST_stmt* current_stmt;
BST_stmt* current_stmt;
};
DeoptState getDeoptState();
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -28,7 +28,6 @@
#include "codegen/irgen/hooks.h"
#include "codegen/parser.h"
#include "codegen/unwinding.h"
#include "core/ast.h"
#include "core/types.h"
#include "runtime/classobj.h"
#include "runtime/ics.h"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment