Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
undingen committed Jan 15, 2017
1 parent ba4f0fc commit 1729dc8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/codegen/ast_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,11 @@ Box* ASTInterpreter::doOSR(BST_Jump* node) {
LivenessAnalysis* liveness = getLiveness();
std::unique_ptr<PhiAnalysis> phis = computeRequiredPhis(getCode()->param_names, source_info->cfg, liveness);

llvm::SmallVector<int, 16> dead_vregs;

for (int vreg = 0; vreg < getVRegInfo().getTotalNumOfVRegs(); ++vreg) {
if (!liveness->isLiveAtEnd(vreg, current_block)) {
dead_vregs.push_back(vreg);
Py_CLEAR(vregs[vreg]);
}
}
for (auto&& vreg_num : dead_vregs) {
Py_CLEAR(vregs[vreg_num]);
}



Expand Down Expand Up @@ -745,7 +740,7 @@ Box* ASTInterpreter::doOSR(BST_Jump* node) {

OSRExit exit(found_entry);

std::vector<Box*> arg_array;
llvm::SmallVector<Box*, 8> arg_array;
arg_array.reserve(sorted_symbol_table.numSet() + potentially_undefined.numSet());
for (auto&& p : sorted_symbol_table) {
arg_array.push_back(p.second);
Expand All @@ -758,8 +753,8 @@ Box* ASTInterpreter::doOSR(BST_Jump* node) {
UNAVOIDABLE_STAT_TIMER(t0, "us_timer_in_jitted_code");
CompiledFunction* partial_func = compilePartialFuncInternal(&exit);

// generated is only borrowed in order to not introduce cycles
Box* r = partial_func->call_osr(generator, created_closure, &frame_info, &arg_array[0]);
// generator is only borrowed in order to not introduce cycles
Box* r = partial_func->call_osr(generator, created_closure, &frame_info, arg_array.data());

if (partial_func->exception_style == CXX) {
assert(r);
Expand Down

0 comments on commit 1729dc8

Please sign in to comment.