Commit 030e879c authored by Marius Wachtler's avatar Marius Wachtler

Fix and reenable type speculations

parent 0fc53b70
......@@ -113,9 +113,6 @@ private:
assert(old_type);
assert(speculation != TypeAnalysis::NONE);
// TODO: reenable this
return old_type;
if (speculated_cls != NULL && speculated_cls->is_constant) {
ConcreteCompilerType* speculated_type = unboxedType(typeFromClass(speculated_cls));
if (VERBOSITY() >= 2) {
......
......@@ -1821,7 +1821,6 @@ Box* astInterpretFunctionEval(CLFunction* clfunc, Box* globals, Box* boxedLocals
Box* astInterpretDeopt(CLFunction* clfunc, AST_expr* after_expr, AST_stmt* enclosing_stmt, Box* expr_val,
FrameStackState frame_state) {
RELEASE_ASSERT(0, "didn't check if this still works");
assert(clfunc);
assert(enclosing_stmt);
assert(frame_state.locals);
......
......@@ -69,7 +69,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::Type* llvm_boxedstring_type_ptr, *llvm_dict_type_ptr, *llvm_aststmt_type_ptr, *llvm_astexpr_type_ptr;
llvm::Type* llvm_frame_info_type;
llvm::Type* llvm_clfunction_type_ptr, *llvm_closure_type_ptr, *llvm_generator_type_ptr;
llvm::Type* llvm_module_type_ptr, *llvm_bool_type_ptr;
......
......@@ -604,7 +604,7 @@ private:
curblock = deopt_bb;
emitter.getBuilder()->SetInsertPoint(curblock);
llvm::Value* v = emitter.createCall2(UnwindInfo(current_statement, NULL), g.funcs.deopt,
embedRelocatablePtr(node, g.llvm_aststmt_type_ptr), node_value);
embedRelocatablePtr(node, g.llvm_astexpr_type_ptr), node_value);
emitter.getBuilder()->CreateRet(v);
curblock = success_bb;
......
......@@ -148,6 +148,10 @@ void initGlobalFuncs(GlobalState& g) {
assert(g.llvm_aststmt_type_ptr);
g.llvm_aststmt_type_ptr = g.llvm_aststmt_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();
// 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
// class.std::vector.##. We can figure out exactly what it is by looking at the last
......
......@@ -510,7 +510,6 @@ public:
bool rtn = false;
if (isDeopt(ip)) {
assert(!skip_next_pythonlike_frame);
skip_next_pythonlike_frame = true;
} else if (frameIsPythonFrame(ip, bp, cursor, frame_iter)) {
if (!skip_next_pythonlike_frame)
......
# skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# skip-if: '-O' in EXTRA_JIT_ARGS or '-n' in EXTRA_JIT_ARGS
# statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2
......
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