no inline fix

This commit is contained in:
Mikhael Bogdanov
2014-01-28 16:11:55 +04:00
parent 510c0eff7f
commit e2db1aacdb
2 changed files with 6 additions and 1 deletions
@@ -272,7 +272,8 @@ public class InlineCodegen implements ParentCodegenAware, Inliner {
boolean shouldPut = false == (stackValue != null && stackValue instanceof StackValue.Local);
if (shouldPut) {
//we could recapture field of anonymous objects cause they couldn't change
if (codegen.getContext().getContextDescriptor() instanceof AnonymousFunctionDescriptor) {
boolean isInlineClosure = codegen.getContext().isInlineClosure();
if (isInlineClosure && codegen.getContext().getContextDescriptor() instanceof AnonymousFunctionDescriptor) {
Type internalName = asmTypeForAnonymousClass(bindingContext, (FunctionDescriptor) codegen.getContext().getContextDescriptor());
String owner = null;
@@ -100,6 +100,10 @@ public class MethodContext extends CodegenContext<CallableMemberDescriptor> {
this.isInlineClosure = isInlineClosure;
}
public boolean isInlineClosure() {
return isInlineClosure;
}
public StackValue isSpecialStackValue(StackValue stackValue) {
if (isInlineClosure && stackValue instanceof StackValue.Composed) {
StackValue prefix = ((StackValue.Composed) stackValue).prefix;