We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class X { def f(x: String) = x f(null) }
Produces the icode
def g(): String { locals: startBlock: 1 blocks: [1] 1: 7 THIS(X) 7 CONSTANT(null) ? DROP REF(class Null) ? CONSTANT(null) 7 CALL_METHOD X.f (dynamic) 7 RETURN(REF(class String)) }{code} Note the CONSTANT(null) DROP REF(class Null) CONSTANT(NULL) And that generates the bytecode
public java.lang.String g(); Code: 0: aload_0 1: aconst_null 2: pop 3: aconst_null 4: invokevirtual #18; //Method f:(Ljava/lang/String;)Ljava/lang/String; 7: areturn {code} Again, the redundant push null, pop, push null sequence.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-7015?orig=1 Reporter: @JamesIry Assignee: @JamesIry See #7159
Sorry, something went wrong.
@JamesIry said: scala/scala#2147
@magarciaEPFL said: For the example
class X { def f(x: String) = x def g { f(null) } }
GenBCode emits:
GenBCode
public void g(); flags: ACC_PUBLIC Code: stack=2, locals=1, args_size=1 0: aload_0 1: aconst_null 2: invokevirtual #13 // Method f:(Ljava/lang/String;)Ljava/lang/String; 5: pop 6: return
Details at http://magarciaepfl.github.com/scala/
@JamesIry said: With this fix, so does GenICode
No branches or pull requests
Produces the icode
public java.lang.String g();
Code:
0: aload_0
1: aconst_null
2: pop
3: aconst_null
4: invokevirtual #18; //Method f:(Ljava/lang/String;)Ljava/lang/String;
7: areturn
{code}
Again, the redundant push null, pop, push null sequence.
The text was updated successfully, but these errors were encountered: