Mercurial > hg > truffle
comparison src/cpu/sparc/vm/templateTable_sparc.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 |
---|---|
314 __ bind(notString); | 314 __ bind(notString); |
315 // __ ldf(FloatRegisterImpl::S, O0, O1, Ftos_f); | 315 // __ ldf(FloatRegisterImpl::S, O0, O1, Ftos_f); |
316 __ push(ftos); | 316 __ push(ftos); |
317 | 317 |
318 __ bind(exit); | 318 __ bind(exit); |
319 } | |
320 | |
321 // Fast path for caching oop constants. | |
322 // %%% We should use this to handle Class and String constants also. | |
323 // %%% It will simplify the ldc/primitive path considerably. | |
324 void TemplateTable::fast_aldc(bool wide) { | |
325 transition(vtos, atos); | |
326 | |
327 if (!EnableMethodHandles) { | |
328 // We should not encounter this bytecode if !EnableMethodHandles. | |
329 // The verifier will stop it. However, if we get past the verifier, | |
330 // this will stop the thread in a reasonable way, without crashing the JVM. | |
331 __ call_VM(noreg, CAST_FROM_FN_PTR(address, | |
332 InterpreterRuntime::throw_IncompatibleClassChangeError)); | |
333 // the call_VM checks for exception, so we should never return here. | |
334 __ should_not_reach_here(); | |
335 return; | |
336 } | |
337 | |
338 Register Rcache = G3_scratch; | |
339 Register Rscratch = G4_scratch; | |
340 | |
341 resolve_cache_and_index(f1_oop, Otos_i, Rcache, Rscratch, wide ? sizeof(u2) : sizeof(u1)); | |
342 | |
343 __ verify_oop(Otos_i); | |
319 } | 344 } |
320 | 345 |
321 void TemplateTable::ldc2_w() { | 346 void TemplateTable::ldc2_w() { |
322 transition(vtos, vtos); | 347 transition(vtos, vtos); |
323 Label retry, resolved, Long, exit; | 348 Label retry, resolved, Long, exit; |
1992 case Bytecodes::_invokevirtual : // fall through | 2017 case Bytecodes::_invokevirtual : // fall through |
1993 case Bytecodes::_invokespecial : // fall through | 2018 case Bytecodes::_invokespecial : // fall through |
1994 case Bytecodes::_invokestatic : // fall through | 2019 case Bytecodes::_invokestatic : // fall through |
1995 case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; | 2020 case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; |
1996 case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; | 2021 case Bytecodes::_invokedynamic : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); break; |
2022 case Bytecodes::_fast_aldc : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); break; | |
2023 case Bytecodes::_fast_aldc_w : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc); break; | |
1997 default : ShouldNotReachHere(); break; | 2024 default : ShouldNotReachHere(); break; |
1998 } | 2025 } |
1999 // first time invocation - must resolve first | 2026 // first time invocation - must resolve first |
2000 __ call_VM(noreg, entry, O1); | 2027 __ call_VM(noreg, entry, O1); |
2001 // Update registers with resolved info | 2028 // Update registers with resolved info |