comparison src/share/vm/graal/graalEnv.cpp @ 8945:7ef66078d837

add basic invokedynamic support
author Andreas Woess <andreas.woess@jku.at>
date Tue, 09 Apr 2013 17:11:17 +0200
parents b89a97928e72
children 23762f2438b6
comparison
equal deleted inserted replaced
8939:8fab4f4fde34 8945:7ef66078d837
317 317
318 // ------------------------------------------------------------------ 318 // ------------------------------------------------------------------
319 methodHandle GraalEnv::get_method_by_index_impl(constantPoolHandle& cpool, 319 methodHandle GraalEnv::get_method_by_index_impl(constantPoolHandle& cpool,
320 int index, Bytecodes::Code bc, 320 int index, Bytecodes::Code bc,
321 instanceKlassHandle& accessor) { 321 instanceKlassHandle& accessor) {
322 if (bc == Bytecodes::_invokedynamic) {
323 ConstantPoolCacheEntry* cpce = cpool->invokedynamic_cp_cache_entry_at(index);
324 bool is_resolved = !cpce->is_f1_null();
325 if (is_resolved) {
326 // Get the invoker Method* from the constant pool.
327 // (The appendix argument, if any, will be noted in the method's signature.)
328 Method* adapter = cpce->f1_as_method();
329 return methodHandle(adapter);
330 }
331
332 return NULL;
333 }
334
322 int holder_index = cpool->klass_ref_index_at(index); 335 int holder_index = cpool->klass_ref_index_at(index);
323 bool holder_is_accessible; 336 bool holder_is_accessible;
324 KlassHandle holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor); 337 KlassHandle holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor);
325 338
326 // Get the method's name and signature. 339 // Get the method's name and signature.
367 // ------------------------------------------------------------------ 380 // ------------------------------------------------------------------
368 methodHandle GraalEnv::get_method_by_index(constantPoolHandle& cpool, 381 methodHandle GraalEnv::get_method_by_index(constantPoolHandle& cpool,
369 int index, Bytecodes::Code bc, 382 int index, Bytecodes::Code bc,
370 instanceKlassHandle& accessor) { 383 instanceKlassHandle& accessor) {
371 ResourceMark rm; 384 ResourceMark rm;
372 assert(bc != Bytecodes::_invokedynamic, "invokedynamic not yet supported");
373 return get_method_by_index_impl(cpool, index, bc, accessor); 385 return get_method_by_index_impl(cpool, index, bc, accessor);
374 } 386 }
375 387
376 // ------------------------------------------------------------------ 388 // ------------------------------------------------------------------
377 // Check for changes to the system dictionary during compilation 389 // Check for changes to the system dictionary during compilation