Skip to content

Commit

Permalink
Two possible mistakes misreporting that the scope has changed in comp…
Browse files Browse the repository at this point in the history
…uteFlags
  • Loading branch information
enebo committed Jan 27, 2017
1 parent da835c4 commit 6b27592
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Expand Up @@ -38,14 +38,6 @@ public ArrayDerefInstr(Variable result, Operand obj, FrozenString arg0) {
key = arg0;
}

@Override
public boolean computeScopeFlags(IRScope scope) {
// CON: No native [] impls require backref/lastline for a literal String arg,
// so we don't have to deopt frame here.
super.computeScopeFlags(scope);
return true;
}

@Override
public Instr clone(CloneInfo ii) {
return new ArrayDerefInstr((Variable) getResult().cloneForInlining(ii), getReceiver().cloneForInlining(ii), key);
Expand Down
Expand Up @@ -33,16 +33,18 @@ public AttrAssignInstr(Operand obj, String attr, Operand[] args, boolean isPoten

@Override
public boolean computeScopeFlags(IRScope scope) {
// SSS FIXME: For now, forcibly require a frame for scopes
// having attr-assign instructions. However, we can avoid this
// by passing in the frame self explicitly to Helpers.invoke(..)
// rather than try to get it off context.getFrameSelf()
super.computeScopeFlags(scope);
// SSS FIXME: For now, forcibly require a frame for scopes having attr-assign instructions. However, we
// can avoid this by passing in the frame self explicitly to Helpers.invoke(..) rather than try to get
// it off context.getFrameSelf()
boolean modifiesScope = super.computeScopeFlags(scope);

if (targetRequiresCallersFrame()) {
// This can be narrowed further by filtering out cases with literals other than String and Regexp
scope.getFlags().add(REQUIRES_FRAME);
modifiesScope = true;
}
return true;

return modifiesScope;
}

@Override
Expand Down

0 comments on commit 6b27592

Please sign in to comment.