Request for review (M): 6998541: JSR 292 implement missing return-type conversion for OP_RETYPE_RAW
Christian Thalinger
christian.thalinger at oracle.com
Wed May 11 09:16:00 PDT 2011
On May 11, 2011, at 5:36 PM, Tom Rodriguez wrote:
> methodHandleWalk.cpp:
>
> There are two copies of the retype code. Can that be factored out?
Well, they are slightly different (change_argument vs. make_invoke) and the conversion for return types has still an Untested in there since I couldn't produce a test case to trigger that.
I can factor it with a bool for_return argument if that's better.
>
> This doesn't seem right. 2 becomes false but 1 becomes true?
>
> + case T_BOOLEAN: {
> + jvalue one_jvalue; one_jvalue.i = 1;
> + ArgToken one = make_prim_constant(T_INT, &one_jvalue, CHECK_(zero));
> + emit_load_constant(one);
> + emit_bc(Bytecodes::_iand);
> + break;
> + }
I just asked John and that's how JSR 292 defines narrowing conversions to boolean. That's how the interpreter does it and I mimic that in the compiler.
>
> Put these on separate lines
>
> ! Symbol* name; Symbol* sig;
Done.
-- Christian
>
> Otherwise it looks good.
>
> tom
>
>
> On May 11, 2011, at 3:42 AM, Christian Thalinger wrote:
>
>> http://cr.openjdk.java.net/~twisti/6998541
>>
>> 6998541: JSR 292 implement missing return-type conversion for OP_RETYPE_RAW
>> Reviewed-by: jrose
>>
>> There is an unimplemented path in the MethodHandleWalker for
>> OP_RETYPE_RAW return-type conversions.
>>
>> This change also includes a couple of x86 fixes found by John Rose,
>> removes the check for genericInvoker on x86 and SPARC and some
>> miscellaneous fixes (e.g. MethodHandlePrinter output).
>>
>> There is also a test for the type conversions which will be pushed
>> later into the JDK 7 repository.
>>
>> src/cpu/sparc/vm/methodHandles_sparc.cpp
>> src/cpu/x86/vm/methodHandles_x86.cpp
>> src/share/vm/prims/methodHandleWalk.cpp
>> src/share/vm/prims/methodHandleWalk.hpp
>> src/share/vm/prims/methodHandles.cpp
>> src/share/vm/prims/methodHandles.hpp
More information about the hotspot-compiler-dev
mailing list