1 /* |
1 /* |
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
36 // ciMethodHandle::get_adapter |
36 // ciMethodHandle::get_adapter |
37 // |
37 // |
38 // Return an adapter for this MethodHandle. |
38 // Return an adapter for this MethodHandle. |
39 ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const { |
39 ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const { |
40 VM_ENTRY_MARK; |
40 VM_ENTRY_MARK; |
41 |
|
42 Handle h(get_oop()); |
41 Handle h(get_oop()); |
43 methodHandle callee(_callee->get_methodOop()); |
42 methodHandle callee(_callee->get_methodOop()); |
44 MethodHandleCompiler mhc(h, callee, is_invokedynamic, THREAD); |
43 // We catch all exceptions here that could happen in the method |
45 methodHandle m = mhc.compile(CHECK_NULL); |
44 // handle compiler and stop the VM. |
|
45 MethodHandleCompiler mhc(h, callee, is_invokedynamic, CATCH); |
|
46 methodHandle m = mhc.compile(CATCH); |
46 return CURRENT_ENV->get_object(m())->as_method(); |
47 return CURRENT_ENV->get_object(m())->as_method(); |
47 } |
48 } |
48 |
49 |
49 |
50 |
50 // ------------------------------------------------------------------ |
51 // ------------------------------------------------------------------ |