Mercurial > hg > truffle
comparison src/share/vm/ci/ciStreams.cpp @ 726:be93aad57795
6655646: dynamic languages need dynamically linked call sites
Summary: invokedynamic instruction (JSR 292 RI)
Reviewed-by: twisti, never
author | jrose |
---|---|
date | Tue, 21 Apr 2009 23:21:04 -0700 |
parents | a61af66fc99e |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
725:928912ce8438 | 726:be93aad57795 |
---|---|
299 // ciBytecodeStream::get_method_index | 299 // ciBytecodeStream::get_method_index |
300 // | 300 // |
301 // If this is a method invocation bytecode, get the constant pool | 301 // If this is a method invocation bytecode, get the constant pool |
302 // index of the invoked method. | 302 // index of the invoked method. |
303 int ciBytecodeStream::get_method_index() { | 303 int ciBytecodeStream::get_method_index() { |
304 #ifdef ASSERT | |
304 switch (cur_bc()) { | 305 switch (cur_bc()) { |
305 case Bytecodes::_invokeinterface: | 306 case Bytecodes::_invokeinterface: |
306 return Bytes::get_Java_u2(_pc-4); | |
307 case Bytecodes::_invokevirtual: | 307 case Bytecodes::_invokevirtual: |
308 case Bytecodes::_invokespecial: | 308 case Bytecodes::_invokespecial: |
309 case Bytecodes::_invokestatic: | 309 case Bytecodes::_invokestatic: |
310 return get_index_big(); | 310 case Bytecodes::_invokedynamic: |
311 break; | |
311 default: | 312 default: |
312 ShouldNotReachHere(); | 313 ShouldNotReachHere(); |
313 return 0; | 314 } |
314 } | 315 #endif |
316 return get_index_int(); | |
315 } | 317 } |
316 | 318 |
317 // ------------------------------------------------------------------ | 319 // ------------------------------------------------------------------ |
318 // ciBytecodeStream::get_method | 320 // ciBytecodeStream::get_method |
319 // | 321 // |
335 // | 337 // |
336 // There is no "will_link" result passed back. The user is responsible | 338 // There is no "will_link" result passed back. The user is responsible |
337 // for checking linkability when retrieving the associated method. | 339 // for checking linkability when retrieving the associated method. |
338 ciKlass* ciBytecodeStream::get_declared_method_holder() { | 340 ciKlass* ciBytecodeStream::get_declared_method_holder() { |
339 bool ignore; | 341 bool ignore; |
342 // report as Dynamic for invokedynamic, which is syntactically classless | |
343 if (cur_bc() == Bytecodes::_invokedynamic) | |
344 return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_Dynamic(), false); | |
340 return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore); | 345 return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore); |
341 } | 346 } |
342 | 347 |
343 // ------------------------------------------------------------------ | 348 // ------------------------------------------------------------------ |
344 // ciBytecodeStream::get_method_holder_index | 349 // ciBytecodeStream::get_method_holder_index |