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 class BytecodeStream; 26 27 // The MethodData object collects counts and other profile information 28 // during zeroth-tier (interpretive) and first-tier execution. 29 // The profile is used later by compilation heuristics. Some heuristics 30 // enable use of aggressive (or "heroic") optimizations. An aggressive 31 // optimization often has a down-side, a corner case that it handles 32 // poorly, but which is thought to be rare. The profile provides 33 // evidence of this rarity for a given method or even BCI. It allows 34 // the compiler to back out of the optimization at places where it 35 // has historically been a poor choice. Other heuristics try to use 36 // specific information gathered about types observed at a given site. 37 // 38 // All data in the profile is approximate. It is expected to be accurate 39 // on the whole, but the system expects occasional inaccuraces, due to 40 // counter overflow, multiprocessor races during data collection, space 41 // limitations, missing MDO blocks, etc. Bad or missing data will degrade 42 // optimization quality but will not affect correctness. Also, each MDO 43 // is marked with its birth-date ("creation_mileage") which can be used 44 // to assess the quality ("maturity") of its data. 1473 static ByteSize invocation_counter_offset() { 1474 return byte_offset_of(methodDataOopDesc, _invocation_counter); 1475 } 1476 static ByteSize backedge_counter_offset() { 1477 return byte_offset_of(methodDataOopDesc, _backedge_counter); 1478 } 1479 1480 // GC support 1481 oop* adr_method() const { return (oop*)&_method; } 1482 bool object_is_parsable() const { return _size != 0; } 1483 void set_object_is_parsable(int object_size_in_bytes) { _size = object_size_in_bytes; } 1484 1485 #ifndef PRODUCT 1486 // printing support for method data 1487 void print_data_on(outputStream* st); 1488 #endif 1489 1490 // verification 1491 void verify_data_on(outputStream* st); 1492 }; | 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_METHODDATAOOP_HPP 26 #define SHARE_VM_OOPS_METHODDATAOOP_HPP 27 28 #include "interpreter/bytecodes.hpp" 29 #include "memory/universe.hpp" 30 #include "oops/methodOop.hpp" 31 #include "oops/oop.hpp" 32 #include "runtime/orderAccess.hpp" 33 34 class BytecodeStream; 35 36 // The MethodData object collects counts and other profile information 37 // during zeroth-tier (interpretive) and first-tier execution. 38 // The profile is used later by compilation heuristics. Some heuristics 39 // enable use of aggressive (or "heroic") optimizations. An aggressive 40 // optimization often has a down-side, a corner case that it handles 41 // poorly, but which is thought to be rare. The profile provides 42 // evidence of this rarity for a given method or even BCI. It allows 43 // the compiler to back out of the optimization at places where it 44 // has historically been a poor choice. Other heuristics try to use 45 // specific information gathered about types observed at a given site. 46 // 47 // All data in the profile is approximate. It is expected to be accurate 48 // on the whole, but the system expects occasional inaccuraces, due to 49 // counter overflow, multiprocessor races during data collection, space 50 // limitations, missing MDO blocks, etc. Bad or missing data will degrade 51 // optimization quality but will not affect correctness. Also, each MDO 52 // is marked with its birth-date ("creation_mileage") which can be used 53 // to assess the quality ("maturity") of its data. 1482 static ByteSize invocation_counter_offset() { 1483 return byte_offset_of(methodDataOopDesc, _invocation_counter); 1484 } 1485 static ByteSize backedge_counter_offset() { 1486 return byte_offset_of(methodDataOopDesc, _backedge_counter); 1487 } 1488 1489 // GC support 1490 oop* adr_method() const { return (oop*)&_method; } 1491 bool object_is_parsable() const { return _size != 0; } 1492 void set_object_is_parsable(int object_size_in_bytes) { _size = object_size_in_bytes; } 1493 1494 #ifndef PRODUCT 1495 // printing support for method data 1496 void print_data_on(outputStream* st); 1497 #endif 1498 1499 // verification 1500 void verify_data_on(outputStream* st); 1501 }; 1502 1503 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP |