Question on C1's as_ValueType(ciConstant value) (original) (raw)
Krystal Mok rednaxelafx at gmail.com
Mon Jun 8 06:48:25 UTC 2015
- Previous message: Question on C1's as_ValueType(ciConstant value)
- Next message: Question on C1's as_ValueType(ciConstant value)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Oops, s/GraphKit/GraphBuilder/ in my last email.
Thanks, Kris
On Sun, Jun 7, 2015 at 10:47 PM, Krystal Mok <rednaxelafx at gmail.com> wrote:
Hi compiler team,
I'd like to ask a question about a piece of code in C1. The code snippet below is from the tip version of jdk9/hs-comp. 145 ValueType* asValueType(ciConstant value) { 146 switch (value.basictype()) { 147 case TBYTE : // fall through 148 case TCHAR : // fall through 149 case TSHORT : // fall through 150 case TBOOLEAN: // fall through 151 case TINT : return new IntConstant (value.asint ()); 152 case TLONG : return new LongConstant (value.aslong ()); 153 case TFLOAT : return new FloatConstant (value.asfloat ()); 154 case TDOUBLE : return new DoubleConstant(value.asdouble()); 155 case TARRAY : // fall through (ciConstant doesn't have an array accessor) 156 case TOBJECT : return new ObjectConstant(value.asobject()); 157 } 158 ShouldNotReachHere(); 159 return illegalType; 160 } On lines 155 and 156, both basic types TARRAY and TOBJECT turns into a ObjectConstant. That's not consistent with the handling in GraphKit::loadconstant(), where ArrayConstant, InstanceConstant and ObjectConstant are treated separately. I ran into this inconsistency when I wanted to try out something with array constants. But I was only able to reach the constant from an ObjectConstant, instead of an ArrayConstant like I was expecting. If people agree that this inconsistency should be fixed, I'd be happy to provide a patch and test it. Thanks, Kris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150607/ab0f6fff/attachment-0001.html>
- Previous message: Question on C1's as_ValueType(ciConstant value)
- Next message: Question on C1's as_ValueType(ciConstant value)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the hotspot-compiler-dev mailing list