Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1/c1_LIR.hpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | 6759698e3140 |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2000, 2012, 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. |
24 | 24 |
25 #ifndef SHARE_VM_C1_C1_LIR_HPP | 25 #ifndef SHARE_VM_C1_C1_LIR_HPP |
26 #define SHARE_VM_C1_C1_LIR_HPP | 26 #define SHARE_VM_C1_C1_LIR_HPP |
27 | 27 |
28 #include "c1/c1_ValueType.hpp" | 28 #include "c1/c1_ValueType.hpp" |
29 #include "oops/methodOop.hpp" | |
29 | 30 |
30 class BlockBegin; | 31 class BlockBegin; |
31 class BlockList; | 32 class BlockList; |
32 class LIR_Assembler; | 33 class LIR_Assembler; |
33 class CodeEmitInfo; | 34 class CodeEmitInfo; |
1160 bool is_invokedynamic() const { return code() == lir_dynamic_call; } | 1161 bool is_invokedynamic() const { return code() == lir_dynamic_call; } |
1161 bool is_method_handle_invoke() const { | 1162 bool is_method_handle_invoke() const { |
1162 return | 1163 return |
1163 is_invokedynamic() // An invokedynamic is always a MethodHandle call site. | 1164 is_invokedynamic() // An invokedynamic is always a MethodHandle call site. |
1164 || | 1165 || |
1165 (method()->holder()->name() == ciSymbol::java_lang_invoke_MethodHandle() && | 1166 method()->is_compiled_lambda_form() // Java-generated adapter |
1166 methodOopDesc::is_method_handle_invoke_name(method()->name()->sid())); | 1167 || |
1168 method()->is_method_handle_intrinsic(); // JVM-generated MH intrinsic | |
1167 } | 1169 } |
1168 | 1170 |
1169 intptr_t vtable_offset() const { | 1171 intptr_t vtable_offset() const { |
1170 assert(_code == lir_virtual_call, "only have vtable for real vcall"); | 1172 assert(_code == lir_virtual_call, "only have vtable for real vcall"); |
1171 return (intptr_t) addr(); | 1173 return (intptr_t) addr(); |
1821 class LIR_OpProfileCall : public LIR_Op { | 1823 class LIR_OpProfileCall : public LIR_Op { |
1822 friend class LIR_OpVisitState; | 1824 friend class LIR_OpVisitState; |
1823 | 1825 |
1824 private: | 1826 private: |
1825 ciMethod* _profiled_method; | 1827 ciMethod* _profiled_method; |
1826 int _profiled_bci; | 1828 int _profiled_bci; |
1827 LIR_Opr _mdo; | 1829 ciMethod* _profiled_callee; |
1828 LIR_Opr _recv; | 1830 LIR_Opr _mdo; |
1829 LIR_Opr _tmp1; | 1831 LIR_Opr _recv; |
1830 ciKlass* _known_holder; | 1832 LIR_Opr _tmp1; |
1833 ciKlass* _known_holder; | |
1831 | 1834 |
1832 public: | 1835 public: |
1833 // Destroys recv | 1836 // Destroys recv |
1834 LIR_OpProfileCall(LIR_Code code, ciMethod* profiled_method, int profiled_bci, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) | 1837 LIR_OpProfileCall(LIR_Code code, ciMethod* profiled_method, int profiled_bci, ciMethod* profiled_callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* known_holder) |
1835 : LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info | 1838 : LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info |
1836 , _profiled_method(profiled_method) | 1839 , _profiled_method(profiled_method) |
1837 , _profiled_bci(profiled_bci) | 1840 , _profiled_bci(profiled_bci) |
1841 , _profiled_callee(profiled_callee) | |
1838 , _mdo(mdo) | 1842 , _mdo(mdo) |
1839 , _recv(recv) | 1843 , _recv(recv) |
1840 , _tmp1(t1) | 1844 , _tmp1(t1) |
1841 , _known_holder(known_holder) { } | 1845 , _known_holder(known_holder) { } |
1842 | 1846 |
1843 ciMethod* profiled_method() const { return _profiled_method; } | 1847 ciMethod* profiled_method() const { return _profiled_method; } |
1844 int profiled_bci() const { return _profiled_bci; } | 1848 int profiled_bci() const { return _profiled_bci; } |
1849 ciMethod* profiled_callee() const { return _profiled_callee; } | |
1845 LIR_Opr mdo() const { return _mdo; } | 1850 LIR_Opr mdo() const { return _mdo; } |
1846 LIR_Opr recv() const { return _recv; } | 1851 LIR_Opr recv() const { return _recv; } |
1847 LIR_Opr tmp1() const { return _tmp1; } | 1852 LIR_Opr tmp1() const { return _tmp1; } |
1848 ciKlass* known_holder() const { return _known_holder; } | 1853 ciKlass* known_holder() const { return _known_holder; } |
1849 | 1854 |
2143 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, | 2148 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, |
2144 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, | 2149 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, |
2145 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, | 2150 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, |
2146 ciMethod* profiled_method, int profiled_bci); | 2151 ciMethod* profiled_method, int profiled_bci); |
2147 // methodDataOop profiling | 2152 // methodDataOop profiling |
2148 void profile_call(ciMethod* method, int bci, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { | 2153 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) { |
2149 append(new LIR_OpProfileCall(lir_profile_call, method, bci, mdo, recv, t1, cha_klass)); | 2154 append(new LIR_OpProfileCall(lir_profile_call, method, bci, callee, mdo, recv, t1, cha_klass)); |
2150 } | 2155 } |
2151 }; | 2156 }; |
2152 | 2157 |
2153 void print_LIR(BlockList* blocks); | 2158 void print_LIR(BlockList* blocks); |
2154 | 2159 |