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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 // A methodOop represents a Java method. 26 // 27 // Memory layout (each line represents a word). Note that most applications load thousands of methods, 28 // so keeping the size of this structure small has a big impact on footprint. 29 // 30 // We put all oops and method_size first for better gc cache locality. 31 // 32 // The actual bytecodes are inlined after the end of the methodOopDesc struct. 33 // 34 // There are bits in the access_flags telling whether inlined tables are present. 35 // Note that accessing the line number and local variable tables is not performance critical at all. 36 // Accessing the checked exceptions table is used by reflection, so we put that last to make access 37 // to it fast. 38 // 39 // The line number table is compressed and inlined following the byte codes. It is found as the first 40 // byte following the byte codes. The checked exceptions table and the local variable table are inlined 41 // after the line number table, and indexed from the end of the method. We do not compress the checked 42 // exceptions table since the average length is less than 2, and do not bother to compress the local 43 // variable table either since it is mostly absent. 44 // 767 Bytecodes::Code orig_bytecode() { return _orig_bytecode; } 768 void set_orig_bytecode(Bytecodes::Code code) { _orig_bytecode = code; } 769 int bci() { return _bci; } 770 771 BreakpointInfo* next() const { return _next; } 772 void set_next(BreakpointInfo* n) { _next = n; } 773 774 // helps for searchers 775 bool match(methodOop m, int bci) { 776 return bci == _bci && match(m); 777 } 778 779 bool match(methodOop m) { 780 return _name_index == m->name_index() && 781 _signature_index == m->signature_index(); 782 } 783 784 void set(methodOop method); 785 void clear(methodOop method); 786 }; | 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_OOPS_METHODOOP_HPP 26 #define SHARE_VM_OOPS_METHODOOP_HPP 27 28 #include "classfile/vmSymbols.hpp" 29 #include "code/compressedStream.hpp" 30 #include "compiler/oopMap.hpp" 31 #include "interpreter/invocationCounter.hpp" 32 #include "oops/constMethodOop.hpp" 33 #include "oops/constantPoolOop.hpp" 34 #include "oops/instanceKlass.hpp" 35 #include "oops/oop.hpp" 36 #include "oops/typeArrayOop.hpp" 37 #include "utilities/accessFlags.hpp" 38 #include "utilities/growableArray.hpp" 39 40 // A methodOop represents a Java method. 41 // 42 // Memory layout (each line represents a word). Note that most applications load thousands of methods, 43 // so keeping the size of this structure small has a big impact on footprint. 44 // 45 // We put all oops and method_size first for better gc cache locality. 46 // 47 // The actual bytecodes are inlined after the end of the methodOopDesc struct. 48 // 49 // There are bits in the access_flags telling whether inlined tables are present. 50 // Note that accessing the line number and local variable tables is not performance critical at all. 51 // Accessing the checked exceptions table is used by reflection, so we put that last to make access 52 // to it fast. 53 // 54 // The line number table is compressed and inlined following the byte codes. It is found as the first 55 // byte following the byte codes. The checked exceptions table and the local variable table are inlined 56 // after the line number table, and indexed from the end of the method. We do not compress the checked 57 // exceptions table since the average length is less than 2, and do not bother to compress the local 58 // variable table either since it is mostly absent. 59 // 782 Bytecodes::Code orig_bytecode() { return _orig_bytecode; } 783 void set_orig_bytecode(Bytecodes::Code code) { _orig_bytecode = code; } 784 int bci() { return _bci; } 785 786 BreakpointInfo* next() const { return _next; } 787 void set_next(BreakpointInfo* n) { _next = n; } 788 789 // helps for searchers 790 bool match(methodOop m, int bci) { 791 return bci == _bci && match(m); 792 } 793 794 bool match(methodOop m) { 795 return _name_index == m->name_index() && 796 _signature_index == m->signature_index(); 797 } 798 799 void set(methodOop method); 800 void clear(methodOop method); 801 }; 802 803 #endif // SHARE_VM_OOPS_METHODOOP_HPP |