/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_CI_CIMETHODDATA_HPP
#define SHARE_VM_CI_CIMETHODDATA_HPP
#include "ci/ciClassList.hpp"
#include "ci/ciKlass.hpp"
#include "ci/ciObject.hpp"
#include "ci/ciUtilities.hpp"
#include "oops/methodDataOop.hpp"
#include "oops/oop.inline.hpp"
class ciBitData;
class ciCounterData;
class ciJumpData;
class ciReceiverTypeData;
class ciRetData;
class ciBranchData;
class ciArrayData;
class ciMultiBranchData;
class ciArgInfoData;
public:
};
public:
};
public:
};
public:
}
}
// Copy & translate from oop based ReceiverTypeData
}
#ifndef PRODUCT
#endif
};
// Fake multiple inheritance... It's a ciReceiverTypeData also.
public:
}
}
// Copy & translate from oop based VirtualCallData
}
#ifndef PRODUCT
#endif
};
public:
};
public:
};
public:
};
public:
};
public:
};
// ciMethodData
//
// This class represents a methodDataOop in the HotSpot virtual
// machine.
private:
// Size in bytes
int _data_size;
int _extra_data_size;
// Data entries
// Cached hint for data_before()
int _hint_di;
// Is data attached? And is it mature?
// Set this true if empty extra_data slots are ever witnessed.
// Support for interprocedural escape analysis
// Maturity of the oop when the snapshot is taken.
int _current_mileage;
// These counters hold the age of MDO in tiered. In tiered we can have the same method
// running at different compilation levels concurrently. So, in order to precisely measure
// its maturity we need separate counters.
int _invocation_counter;
int _backedge_counter;
// Coherent snapshot of original header.
ciMethodData();
// Accessors
return mdo;
}
}
return data_index >= data_size();
}
// hint accessors
}
// avoid SEGV on this edge case
if (data_size() == 0)
return NULL;
return first_data();
}
// What is the index of the first data entry?
int first_di() { return 0; }
ciArgInfoData *arg_info() const;
public:
bool is_method_data() { return true; }
// Transfer information about the method to methodDataOop.
// would_profile means we would like to profile this method,
// meaning it's not trivial.
void set_would_profile(bool p);
// Also set the numer of loops and blocks in the method.
// Again, this is used to determine if a method is trivial.
void load_data();
// Convert a dp (data pointer) to a di (data index).
}
// Get the data at an arbitrary (sort of) data index.
// Walk through the data in order.
// Get the data at an arbitrary bci, or NULL if there is none.
return _orig.overflow_trap_count();
}
return _orig.overflow_recompile_count();
}
return _orig.decompile_count();
}
}
// Helpful query functions that decode trap_state.
}
}
void clear_escape_info();
bool has_escape_info();
void update_escape_info();
void set_arg_local(int i);
void set_arg_stack(int i);
void set_arg_returned(int i);
bool is_arg_local(int i) const;
bool is_arg_stack(int i) const;
bool is_arg_returned(int i) const;
// Code generation helper
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
#ifndef PRODUCT
// printing support for method data
void print();
#endif
};
#endif // SHARE_VM_CI_CIMETHODDATA_HPP