Skip to content
New issue

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

[hail] fix constant pool issue #8622

Merged
merged 3 commits into from Apr 25, 2020
Merged

[hail] fix constant pool issue #8622

merged 3 commits into from Apr 25, 2020

Conversation

danking
Copy link
Collaborator

@danking danking commented Apr 23, 2020

The constant pool may only hold references to JVM things (e.g. a class),
Strings, Floats, Doubles, Ints, and Longs. https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-5.html

cseed
cseed previously requested changes Apr 23, 2020
Copy link
Collaborator

@cseed cseed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should call toInt in the const functions on short, char and byte, and put the integer in the ldc, but with the right typeinfo like we do for boolean.

cseed
cseed previously requested changes Apr 23, 2020
class LdcX(val a: Any, val ti: TypeInfo[_]) extends ValueX {
assert(
a.isInstanceOf[String] || a.isInstanceOf[Double] || a.isInstanceOf[Float] || a.isInstanceOf[Int] || a.isInstanceOf[Long],
s"not a string, double, float, int, or long: {a}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, not an f-string. In Scala, you need $a.

@konradjk
Copy link
Collaborator

konradjk commented Apr 24, 2020

FWIW this replaced my issue with another one (that I was able to fix in my code), so I'm unblocked but also can't speak to pros or cons on this one

@danking danking merged commit 73aeb0f into hail-is:master Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants