Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/templateTable_x86_64.cpp @ 1602:136b78722a08
6939203: JSR 292 needs method handle constants
Summary: Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode.
Reviewed-by: twisti, never
author | jrose |
---|---|
date | Wed, 09 Jun 2010 18:50:45 -0700 |
parents | e9ff18c4ace7 |
children | 126ea7725993 |
comparison
equal
deleted
inserted
replaced
1585:49fac4acd688 | 1602:136b78722a08 |
---|---|
385 if (VerifyOops) { | 385 if (VerifyOops) { |
386 __ verify_oop(rax); | 386 __ verify_oop(rax); |
387 } | 387 } |
388 | 388 |
389 __ bind(Done); | 389 __ bind(Done); |
390 } | |
391 | |
392 // Fast path for caching oop constants. | |
393 // %%% We should use this to handle Class and String constants also. | |
394 // %%% It will simplify the ldc/primitive path considerably. | |
395 void TemplateTable::fast_aldc(bool wide) { | |
396 transition(vtos, atos); | |
397 | |
398 if (!EnableMethodHandles) { | |
399 // We should not encounter this bytecode if !EnableMethodHandles. | |
400 // The verifier will stop it. However, if we get past the verifier, | |
401 // this will stop the thread in a reasonable way, without crashing the JVM. | |
402 __ call_VM(noreg, CAST_FROM_FN_PTR(address, | |
403 InterpreterRuntime::throw_IncompatibleClassChangeError)); | |
404 // the call_VM checks for exception, so we should never return here. | |
405 __ should_not_reach_here(); | |
406 return; | |
407 } | |
408 | |
409 const Register cache = rcx; | |
410 const Register index = rdx; | |
411 | |
412 resolve_cache_and_index(f1_oop, rax, cache, index, wide ? sizeof(u2) : sizeof(u1)); | |
413 if (VerifyOops) { | |
414 __ verify_oop(rax); | |
415 } | |
390 } | 416 } |
391 | 417 |
392 void TemplateTable::ldc2_w() { | 418 void TemplateTable::ldc2_w() { |
393 transition(vtos, vtos); | 419 transition(vtos, vtos); |
394 Label Long, Done; | 420 Label Long, Done; |
2061 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); | 2087 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); |
2062 break; | 2088 break; |
2063 case Bytecodes::_invokedynamic: | 2089 case Bytecodes::_invokedynamic: |
2064 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); | 2090 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); |
2065 break; | 2091 break; |
2092 case Bytecodes::_fast_aldc: | |
2093 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); | |
2094 break; | |
2095 case Bytecodes::_fast_aldc_w: | |
2096 entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); | |
2097 break; | |
2066 default: | 2098 default: |
2067 ShouldNotReachHere(); | 2099 ShouldNotReachHere(); |
2068 break; | 2100 break; |
2069 } | 2101 } |
2070 __ movl(temp, (int) bytecode()); | 2102 __ movl(temp, (int) bytecode()); |