Commit 5ca51694 authored by Marius Wachtler's avatar Marius Wachtler

deopt: support non parent module globals

parent de7a980e
......@@ -286,7 +286,7 @@ macro(add_pyston_test testname directory)
endmacro()
# tests testname directory arguments
add_pyston_test(defaults tests --order-by-mtime)
add_pyston_test(defaults tests --order-by-mtime -t50)
add_pyston_test(force_llvm tests -a=-n -a=-x -t50)
if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
add_pyston_test(max_compilation_tier tests -a=-O -a=-x -t50)
......
......@@ -1854,8 +1854,7 @@ static Box* astInterpretDeoptInner(CLFunction* clfunc, AST_expr* after_expr, AST
}
ASTInterpreter interpreter(clfunc, vregs);
assert(clfunc->source->scoping->areGlobalsFromModule());
if (source_info->scoping->areGlobalsFromModule())
interpreter.setGlobals(source_info->parent_module);
for (const auto& p : *frame_state.locals) {
......@@ -1867,6 +1866,9 @@ static Box* astInterpretDeoptInner(CLFunction* clfunc, AST_expr* after_expr, AST
interpreter.setPassedClosure(p.second);
} else if (name == CREATED_CLOSURE_NAME) {
interpreter.setCreatedClosure(p.second);
} else if (name == PASSED_GLOBALS_NAME) {
assert(!source_info->scoping->areGlobalsFromModule());
interpreter.setGlobals(p.second);
} else {
InternedString interned = clfunc->source->getInternedStrings().get(name);
interpreter.addSymbol(interned, p.second, false);
......@@ -1880,7 +1882,7 @@ static Box* astInterpretDeoptInner(CLFunction* clfunc, AST_expr* after_expr, AST
while (true) {
if (enclosing_stmt->type == AST_TYPE::Assign) {
auto asgn = ast_cast<AST_Assign>(enclosing_stmt);
assert(asgn->value == after_expr);
RELEASE_ASSERT(asgn->value == after_expr, "%p %p", asgn->value, after_expr);
assert(asgn->targets.size() == 1);
assert(asgn->targets[0]->type == AST_TYPE::Name);
auto name = ast_cast<AST_Name>(asgn->targets[0]);
......@@ -1889,6 +1891,7 @@ static Box* astInterpretDeoptInner(CLFunction* clfunc, AST_expr* after_expr, AST
break;
} else if (enclosing_stmt->type == AST_TYPE::Expr) {
auto expr = ast_cast<AST_Expr>(enclosing_stmt);
RELEASE_ASSERT(expr->value == after_expr, "%p %p", expr->value, after_expr);
assert(expr->value == after_expr);
break;
} else if (enclosing_stmt->type == AST_TYPE::Invoke) {
......
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