Commit ba82f050 authored by Marius Wachtler's avatar Marius Wachtler

Skip initializing exc fields inside JITed code

parent bc36f5df
......@@ -179,16 +179,11 @@ llvm::Value* IRGenState::getFrameInfoVar() {
// The "normal" case
// frame_info.exc.type = NULL
// frame_info.exc.value = NULL
// frame_info.exc.traceback = NULL
llvm::Constant* null_value = getNullPtr(g.llvm_value_type_ptr);
llvm::Value* exc_info = getExcinfoGep(builder, al);
builder.CreateStore(
null_value, builder.CreateConstInBoundsGEP2_32(exc_info, 0, offsetof(ExcInfo, type) / sizeof(Box*)));
builder.CreateStore(
null_value, builder.CreateConstInBoundsGEP2_32(exc_info, 0, offsetof(ExcInfo, value) / sizeof(Box*)));
builder.CreateStore(null_value, builder.CreateConstInBoundsGEP2_32(exc_info, 0, offsetof(ExcInfo, traceback)
/ sizeof(Box*)));
// frame_info.boxedLocals = NULL
llvm::Value* boxed_locals_gep = getBoxedLocalsGep(builder, al);
builder.CreateStore(getNullPtr(g.llvm_value_type_ptr), boxed_locals_gep);
......
......@@ -173,6 +173,13 @@ extern "C" Box* deopt(AST_expr* expr, Box* value) {
// Should we only do this selectively?
execution_point.cf->speculationFailed();
// Except of exc.type we skip initializing the exc fields inside the JITed code path (small perf improvement) that's
// why we have todo it now if we didn't set an exception (which sets all fields)
if (frame_state.frame_info->exc.type == NULL) {
frame_state.frame_info->exc.traceback = NULL;
frame_state.frame_info->exc.value = NULL;
}
return astInterpretFrom(execution_point.cf, expr, execution_point.current_stmt, value, frame_state);
}
......
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