本文整理汇总了C++中methodOop类的典型用法代码示例。如果您正苦于以下问题:C++ methodOop类的具体用法?C++ methodOop怎么用?C++ methodOop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了methodOop类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: methods_EMCP
bool MethodComparator::methods_EMCP(methodOop old_method, methodOop new_method) {
if (old_method->code_size() != new_method->code_size())
return false;
if (check_stack_and_locals_size(old_method, new_method) != 0) {
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00800000, ("Methods %s non-comparable with diagnosis %d",
old_method->name()->as_C_string(),
check_stack_and_locals_size(old_method, new_method)));
return false;
}
_old_cp = old_method->constants();
_new_cp = new_method->constants();
BytecodeStream s_old(old_method);
BytecodeStream s_new(new_method);
_s_old = &s_old;
_s_new = &s_new;
_switchable_test = false;
Bytecodes::Code c_old, c_new;
while ((c_old = s_old.next()) >= 0) {
if ((c_new = s_new.next()) < 0 || c_old != c_new)
return false;
if (! args_same(c_old, c_new))
return false;
}
return true;
}
开发者ID:641252154,项目名称:HotSpot-JVM-Linux-x86-Research,代码行数:29,代码来源:methodComparator.cpp
示例2: layout_interpreterState
void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
frame* caller,
frame* current,
methodOop method,
intptr_t* locals,
intptr_t* stack,
intptr_t* stack_base,
intptr_t* monitor_base,
intptr_t* frame_bottom,
bool is_top_frame) {
istate->set_locals(locals);
istate->set_method(method);
istate->set_self_link(istate);
istate->set_prev_link(NULL);
// thread will be set by a hacky repurposing of frame::patch_pc()
// bcp will be set by vframeArrayElement::unpack_on_stack()
istate->set_constants(method->constants()->cache());
istate->set_msg(BytecodeInterpreter::method_resume);
istate->set_bcp_advance(0);
istate->set_oop_temp(NULL);
istate->set_mdx(NULL);
if (caller->is_interpreted_frame()) {
interpreterState prev = caller->get_interpreterState();
prev->set_callee(method);
if (*prev->bcp() == Bytecodes::_invokeinterface)
prev->set_bcp_advance(5);
else
prev->set_bcp_advance(3);
}
istate->set_callee(NULL);
istate->set_monitor_base((BasicObjectLock *) monitor_base);
istate->set_stack_base(stack_base);
istate->set_stack(stack);
istate->set_stack_limit(stack_base - method->max_stack() - 1);
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例3: update_rate
// update_rate() is called from select_task() while holding a compile queue lock.
void AdvancedThresholdPolicy::update_rate(jlong t, methodOop m) {
if (is_old(m)) {
// We don't remove old methods from the queue,
// so we can just zero the rate.
m->set_rate(0);
return;
}
// We don't update the rate if we've just came out of a safepoint.
// delta_s is the time since last safepoint in milliseconds.
jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
jlong delta_t = t - (m->prev_time() != 0 ? m->prev_time() : start_time()); // milliseconds since the last measurement
// How many events were there since the last time?
int event_count = m->invocation_count() + m->backedge_count();
int delta_e = event_count - m->prev_event_count();
// We should be running for at least 1ms.
if (delta_s >= TieredRateUpdateMinTime) {
// And we must've taken the previous point at least 1ms before.
if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) {
m->set_prev_time(t);
m->set_prev_event_count(event_count);
m->set_rate((float)delta_e / (float)delta_t); // Rate is events per millisecond
} else
if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) {
// If nothing happened for 25ms, zero the rate. Don't modify prev values.
m->set_rate(0);
}
}
}
开发者ID:,项目名称:,代码行数:31,代码来源:
示例4: hash
// for hashing into the table
static int hash(methodOop method) {
// The point here is to try to make something fairly unique
// out of the fields we can read without grabbing any locks
// since the method may be locked when we need the hash.
return (
method->code_size() ^
method->max_stack() ^
method->max_locals() ^
method->size_of_parameters());
}
开发者ID:,项目名称:,代码行数:11,代码来源:
示例5: methods_switchable
bool MethodComparator::methods_switchable(methodOop old_method, methodOop new_method,
BciMap &bci_map) {
if (old_method->code_size() > new_method->code_size())
// Something has definitely been deleted in the new method, compared to the old one.
return false;
if (! check_stack_and_locals_size(old_method, new_method))
return false;
_old_cp = old_method->constants();
_new_cp = new_method->constants();
BytecodeStream s_old(old_method);
BytecodeStream s_new(new_method);
_s_old = &s_old;
_s_new = &s_new;
_bci_map = &bci_map;
_switchable_test = true;
GrowableArray<int> fwd_jmps(16);
_fwd_jmps = &fwd_jmps;
Bytecodes::Code c_old, c_new;
while ((c_old = s_old.next()) >= 0) {
if ((c_new = s_new.next()) < 0)
return false;
if (! (c_old == c_new && args_same(c_old, c_new))) {
int old_bci = s_old.bci();
int new_st_bci = s_new.bci();
bool found_match = false;
do {
c_new = s_new.next();
if (c_new == c_old && args_same(c_old, c_new)) {
found_match = true;
break;
}
} while (c_new >= 0);
if (! found_match)
return false;
int new_end_bci = s_new.bci();
bci_map.store_fragment_location(old_bci, new_st_bci, new_end_bci);
}
}
// Now we can test all forward jumps
for (int i = 0; i < fwd_jmps.length() / 2; i++) {
if (! bci_map.old_and_new_locations_same(fwd_jmps.at(i*2), fwd_jmps.at(i*2+1))) {
RC_TRACE(0x00800000,
("Fwd jump miss: old dest = %d, calc new dest = %d, act new dest = %d",
fwd_jmps.at(i*2), bci_map.new_bci_for_old(fwd_jmps.at(i*2)),
fwd_jmps.at(i*2+1)));
return false;
}
}
return true;
}
开发者ID:641252154,项目名称:HotSpot-JVM-Linux-x86-Research,代码行数:55,代码来源:methodComparator.cpp
示例6: is_trivial
// Simple methods are as good being compiled with C1 as C2.
// Determine if a given method is such a case.
bool SimpleThresholdPolicy::is_trivial(methodOop method) {
if (method->is_accessor()) return true;
if (method->code() != NULL) {
methodDataOop mdo = method->method_data();
if (mdo != NULL && mdo->num_loops() == 0 &&
(method->code_size() < 5 || (mdo->num_blocks() < 4) && (method->code_size() < 15))) {
return !mdo->would_profile();
}
}
return false;
}
开发者ID:641252154,项目名称:HotSpot-JVM-Linux-x86-Research,代码行数:13,代码来源:simpleThresholdPolicy.inline.hpp
示例7: should_create_mdo
// If a method is old enough and is still in the interpreter we would want to
// start profiling without waiting for the compiled method to arrive.
// We also take the load on compilers into the account.
bool AdvancedThresholdPolicy::should_create_mdo(methodOop method, CompLevel cur_level) {
if (cur_level == CompLevel_none &&
CompileBroker::queue_size(CompLevel_full_optimization) <=
Tier3DelayOn * compiler_count(CompLevel_full_optimization)) {
int i = method->invocation_count();
int b = method->backedge_count();
double k = Tier0ProfilingStartPercentage / 100.0;
return call_predicate_helper<CompLevel_none>(i, b, k) || loop_predicate_helper<CompLevel_none>(i, b, k);
}
return false;
}
开发者ID:,项目名称:,代码行数:14,代码来源:
示例8: is_stale
// Check if this method has been stale from a given number of milliseconds.
// See select_task().
bool AdvancedThresholdPolicy::is_stale(jlong t, jlong timeout, methodOop m) {
jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
jlong delta_t = t - m->prev_time();
if (delta_t > timeout && delta_s > timeout) {
int event_count = m->invocation_count() + m->backedge_count();
int delta_e = event_count - m->prev_event_count();
// Return true if there were no events.
return delta_e == 0;
}
return false;
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例9: compare_methods
// Apply heuristics and return true if x should be compiled before y
bool AdvancedThresholdPolicy::compare_methods(methodOop x, methodOop y) {
if (x->highest_comp_level() > y->highest_comp_level()) {
// recompilation after deopt
return true;
} else
if (x->highest_comp_level() == y->highest_comp_level()) {
if (weight(x) > weight(y)) {
return true;
}
}
return false;
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例10: mileage_of
// Get a measure of how much mileage the method has on it.
int methodDataOopDesc::mileage_of(methodOop method) {
int mileage = 0;
#ifdef COMPILER2
int iic = method->interpreter_invocation_count();
if (mileage < iic) mileage = iic;
#endif
int icval = method->invocation_counter()->count();
if (mileage < icval) mileage = icval;
int bcval = method->backedge_counter()->count();
if (mileage < bcval) mileage = bcval;
return mileage;
}
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:13,代码来源:methodDataOop.cpp
示例11: layout_activation
int AbstractInterpreter::layout_activation(methodOop method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
assert(popframe_extra_args == 0, "what to do?");
assert(!is_top_frame || (!callee_locals && !callee_param_count),
"top frame should have no caller");
// This code must exactly match what InterpreterFrame::build
// does (the full InterpreterFrame::build, that is, not the
// one that creates empty frames for the deoptimizer).
//
// If interpreter_frame is not NULL then it will be filled in.
// It's size is determined by a previous call to this method,
// so it should be correct.
//
// Note that tempcount is the current size of the expression
// stack. For top most frames we will allocate a full sized
// expression stack and not the trimmed version that non-top
// frames have.
int header_words = InterpreterFrame::header_words;
int monitor_words = moncount * frame::interpreter_frame_monitor_size();
int stack_words = is_top_frame ? method->max_stack() : tempcount;
int callee_extra_locals = callee_locals - callee_param_count;
if (interpreter_frame) {
intptr_t *locals = interpreter_frame->fp() + method->max_locals();
interpreterState istate = interpreter_frame->get_interpreterState();
intptr_t *monitor_base = (intptr_t*) istate;
intptr_t *stack_base = monitor_base - monitor_words;
intptr_t *stack = stack_base - tempcount - 1;
BytecodeInterpreter::layout_interpreterState(istate,
caller,
NULL,
method,
locals,
stack,
stack_base,
monitor_base,
NULL,
is_top_frame);
}
return header_words + monitor_words + stack_words + callee_extra_locals;
}
开发者ID:AK47POMA,项目名称:openjdk-icedtea7,代码行数:53,代码来源:cppInterpreter_zero.cpp
示例12: result_type
BasicType Bytecode_static::result_type(methodOop method) const {
int index = java_hwrd_at(1);
constantPoolOop constants = method->constants();
symbolOop field_type = constants->signature_ref_at(index);
BasicType basic_type = FieldType::basic_type(field_type);
return basic_type;
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:7,代码来源:bytecode.cpp
示例13: mileage_of
// Get a measure of how much mileage the method has on it.
int methodDataOopDesc::mileage_of(methodOop method) {
int mileage = 0;
int iic = method->interpreter_invocation_count();
if (mileage < iic) mileage = iic;
InvocationCounter* ic = method->invocation_counter();
InvocationCounter* bc = method->backedge_counter();
int icval = ic->count();
if (ic->carry()) icval += CompileThreshold;
if (mileage < icval) mileage = icval;
int bcval = bc->count();
if (bc->carry()) bcval += CompileThreshold;
if (mileage < bcval) mileage = bcval;
return mileage;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:17,代码来源:methodDataOop.cpp
示例14: SAPReg
void BlockScope::initialize(methodOop method, klassOop methodHolder, Scope* p, InlinedScope* s, RScope* rs, SendInfo* info) {
InlinedScope::initialize(method, methodHolder, s, rs, info);
_parent = p;
_self_is_initialized = false;
if (s == NULL) {
// top scope: create a context (currently always initialized for blocks)
// (context is set up by the prologue node)
_context = new SAPReg(this, PrologueBCI, EpilogueBCI);
} else {
// set up for context passed in by caller
// (_context may be changed later if this scope allocates its own context)
switch (method->block_info()) {
case methodOopDesc::expects_nil: // no context needed
_context = NULL; break;
case methodOopDesc::expects_self:
_context = self()->preg(); fatal("self not known yet -- fix this"); break;
case methodOopDesc::expects_parameter: // fix this -- should find which
Unimplemented();
break;
case methodOopDesc::expects_context:
if (p->isInlinedScope()) {
_context = ((InlinedScope*)p)->context();
} else {
fatal("shouldn't inline"); // shouldn't inline block unless parent was inlined, too
}
break;
default:
fatal("unexpected incoming info");
}
}
}
开发者ID:sebkirche,项目名称:strongtalk,代码行数:31,代码来源:scope.cpp
示例15: collect_profiled_methods
void collect_profiled_methods(methodOop m) {
methodHandle mh(Thread::current(), m);
if ((m->method_data() != NULL) &&
(PrintMethodData || CompilerOracle::should_print(mh))) {
collected_profiled_methods->push(m);
}
}
开发者ID:tetratec,项目名称:Runescape-Launcher,代码行数:7,代码来源:java.cpp
示例16: is_method_profiled
// Is method profiled enough?
bool AdvancedThresholdPolicy::is_method_profiled(methodOop method) {
methodDataOop mdo = method->method_data();
if (mdo != NULL) {
int i = mdo->invocation_count_delta();
int b = mdo->backedge_count_delta();
return call_predicate_helper<CompLevel_full_profile>(i, b, 1);
}
return false;
}
开发者ID:,项目名称:,代码行数:10,代码来源:
示例17: trace
void trace(methodOop method, address bcp, uintptr_t tos, uintptr_t tos2) {
#ifndef PRODUCT
MutexLocker ml(BytecodeTrace_lock);
if (_current_method != method) {
// Note 1: This code will not work as expected with true MT/MP.
// Need an explicit lock or a different solution.
ResourceMark rm;
tty->cr();
tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
method->print_name(tty);
tty->cr();
_current_method = method;
}
if (Verbose) {
const char* format;
switch (Bytecodes::length_at(bcp)) {
case 1: format = "%x %02x " ; break;
case 2: format = "%x %02x %02x " ; break;
case 3: format = "%x %02x %02x %02x "; break;
default: format = "%x %02x %02x %02x .."; break;
}
tty->print(format, bcp, *bcp, *(bcp+1), *(bcp+2));
}
Bytecodes::Code code;
if (_previous_bytecode == Bytecodes::_wide) {
code = Bytecodes::cast(*(bcp+1));
} else {
code = Bytecodes::cast(*bcp);
}
int bci = bcp - method->code_base();
const char* format = _previous_bytecode == Bytecodes::_wide ? Bytecodes::wide_format(code) : Bytecodes::format(code);
tty->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
if (Verbose) {
tty->print("%8d %4d 0x%016lx 0x%016lx %s",
BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
} else {
tty->print("%8d %4d %s",
BytecodeCounter::counter_value(), bci, Bytecodes::name(code));
}
print_attributes(bcp, bci, format);
tty->cr();
_previous_bytecode = code;
#endif
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:44,代码来源:bytecodeTracer.cpp
示例18: call_event
// Determine if a method should be compiled with a normal entry point at a different level.
CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
CompLevel osr_level = (CompLevel) method->highest_osr_comp_level();
CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level);
// If OSR method level is greater than the regular method level, the levels should be
// equalized by raising the regular method level in order to avoid OSRs during each
// invocation of the method.
if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
methodDataOop mdo = method->method_data();
guarantee(mdo != NULL, "MDO should not be NULL");
if (mdo->invocation_count() >= 1) {
next_level = CompLevel_full_optimization;
}
} else {
next_level = MAX2(osr_level, next_level);
}
return next_level;
}
开发者ID:,项目名称:,代码行数:20,代码来源:
示例19: deopt_reexecute_entry
// If deoptimization happens, this function returns the point where the interpreter reexecutes
// the bytecode.
// Note: Bytecodes::_athrow is a special case in that it does not return
// Interpreter::deopt_entry(vtos, 0) like others
address AbstractInterpreter::deopt_reexecute_entry(methodOop method, address bcp) {
assert(method->contains(bcp), "just checkin'");
Bytecodes::Code code = Bytecodes::java_code_at(bcp);
#ifdef COMPILER1
if(code == Bytecodes::_athrow ) {
return Interpreter::rethrow_exception_entry();
}
#endif /* COMPILER1 */
return Interpreter::deopt_entry(vtos, 0);
}
开发者ID:BaHbKaTX,项目名称:openjdk,代码行数:14,代码来源:interpreter.cpp
示例20: result_type_of
BasicType CppInterpreter::result_type_of(methodOop method) {
BasicType t;
switch (method->result_index()) {
case 0 : t = T_BOOLEAN; break;
case 1 : t = T_CHAR; break;
case 2 : t = T_BYTE; break;
case 3 : t = T_SHORT; break;
case 4 : t = T_INT; break;
case 5 : t = T_LONG; break;
case 6 : t = T_VOID; break;
case 7 : t = T_FLOAT; break;
case 8 : t = T_DOUBLE; break;
case 9 : t = T_OBJECT; break;
default: ShouldNotReachHere();
}
assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(),
"out of step with AbstractInterpreter::BasicType_as_index");
return t;
}
开发者ID:,项目名称:,代码行数:19,代码来源:
注:本文中的methodOop类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论