6998541: JSR 292 implement missing return-type conversion for OP_RETYPE_RAW

Reviewed-by: jrose, kvn, never
This commit is contained in:
Christian Thalinger 2011-05-12 14:04:48 -07:00
parent 3327033b50
commit db9005f0d3
10 changed files with 355 additions and 197 deletions

View file

@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "ci/ciClassList.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciMethodData.hpp"
#include "ci/ciMethodHandle.hpp"
#include "ci/ciUtilities.hpp"
#include "prims/methodHandleWalk.hpp"
@ -36,13 +37,13 @@
// ciMethodHandle::get_adapter
//
// Return an adapter for this MethodHandle.
ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const {
ciMethod* ciMethodHandle::get_adapter_impl(bool is_invokedynamic) const {
VM_ENTRY_MARK;
Handle h(get_oop());
methodHandle callee(_callee->get_methodOop());
// We catch all exceptions here that could happen in the method
// handle compiler and stop the VM.
MethodHandleCompiler mhc(h, callee, call_profile()->count(), is_invokedynamic, THREAD);
MethodHandleCompiler mhc(h, callee, _profile->count(), is_invokedynamic, THREAD);
if (!HAS_PENDING_EXCEPTION) {
methodHandle m = mhc.compile(THREAD);
if (!HAS_PENDING_EXCEPTION) {
@ -58,6 +59,22 @@ ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const {
return NULL;
}
// ------------------------------------------------------------------
// ciMethodHandle::get_adapter
//
// Return an adapter for this MethodHandle.
ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const {
ciMethod* result = get_adapter_impl(is_invokedynamic);
if (result) {
// Fake up the MDO maturity.
ciMethodData* mdo = result->method_data();
if (mdo != NULL && _caller->method_data() != NULL && _caller->method_data()->is_mature()) {
mdo->set_mature();
}
}
return result;
}
// ------------------------------------------------------------------
// ciMethodHandle::print_impl