Commit eb3a0fe4 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Re-enable the "block-local" bjit optimization

Also fix the is_live handling and make the get and set
cases look more similar to each other.
parent c079bc47
...@@ -476,16 +476,13 @@ void ASTInterpreter::doStore(AST_Name* node, STOLEN(Value) value) { ...@@ -476,16 +476,13 @@ void ASTInterpreter::doStore(AST_Name* node, STOLEN(Value) value) {
} else { } else {
bool closure = vst == ScopeInfo::VarScopeType::CLOSURE; bool closure = vst == ScopeInfo::VarScopeType::CLOSURE;
if (jit) { if (jit) {
if (!closure) { bool is_live = true;
bool is_live = source_info->getLiveness()->isLiveAtEnd(name, current_block); if (!closure)
// HACK: this disable the 'this variable is dead at the end of this block' optimization is_live = source_info->getLiveness()->isLiveAtEnd(name, current_block);
is_live = true;
if (is_live) if (is_live)
jit->emitSetLocal(name, node->vreg, closure, value); jit->emitSetLocal(name, node->vreg, closure, value);
else else
jit->emitSetBlockLocal(name, value); jit->emitSetBlockLocal(name, value);
} else
jit->emitSetLocal(name, node->vreg, closure, value);
} }
if (closure) { if (closure) {
...@@ -1658,7 +1655,7 @@ Value ASTInterpreter::visit_name(AST_Name* node) { ...@@ -1658,7 +1655,7 @@ Value ASTInterpreter::visit_name(AST_Name* node) {
case ScopeInfo::VarScopeType::CLOSURE: { case ScopeInfo::VarScopeType::CLOSURE: {
Value v; Value v;
if (jit) { if (jit) {
bool is_live = false; bool is_live = true;
if (node->lookup_type == ScopeInfo::VarScopeType::FAST) if (node->lookup_type == ScopeInfo::VarScopeType::FAST)
is_live = source_info->getLiveness()->isLiveAtEnd(node->id, current_block); is_live = source_info->getLiveness()->isLiveAtEnd(node->id, current_block);
......
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