本文整理汇总了C++中methodOop::localvariable_name方法的典型用法代码示例。如果您正苦于以下问题:C++ methodOop::localvariable_name方法的具体用法?C++ methodOop::localvariable_name怎么用?C++ methodOop::localvariable_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodOop
的用法示例。
在下文中一共展示了methodOop::localvariable_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_xml_on
void vframe::print_xml_on(JavaThread *thread, xmlBuffer *xb) const {
ResourceMark rm;
frame fr = get_frame();
const char *frame_style = "UNKNOWN";
CodeBlob*cb=CodeCache::find_blob(fr.pc());
if( fr.is_interpreted_frame() )
frame_style = "INTERPRETER";
else if( cb && cb->is_native_method() )
frame_style = "NATIVE";
else if( cb && cb->is_c1_method() )
frame_style = "COMPILER1";
else if( cb && cb->is_c2_method() )
frame_style = "COMPILER2";
// Frame header
xb->name_value_item("frame_style",frame_style);
// Java Locals
if (!fr.is_java_frame())
return; // no more printing to be done
const methodOop moop = method();
if (moop->is_native())
return; // no more printing to be done
const int max_locals = moop->max_locals();
if(fr.is_compiled_frame()){
for( int i=0; i<max_locals; i++ ) {
xmlElement je(xb, "java_element");
{ xmlElement n(xb, "name", xmlElement::delayed_LF);
bool out_of_scope = true;
const char* name = moop->localvariable_name(i, bci(), out_of_scope);
if( name ) xb->print("%s%s%s", out_of_scope ? "{": "", name, out_of_scope ? "}": "");
else xb->print("JL%-2d", i);
}
DebugScopeValue::Name vreg = _ds->get_local(i);
if( !DebugScopeValue::is_valid(vreg) ) {
xb->name_value_item("type","invalid");
xb->name_ptr_item("value",0);
} else {
intptr_t *data_ptr = fr.reg_to_addr(DebugScopeValue::to_vreg(vreg));
const int rel_pc = cb->rel_pc(fr.pc());
const bool isoop = cb->oop_maps()->is_oop( rel_pc, VReg::as_VOopReg(DebugScopeValue::to_vreg(vreg)) );
if( isoop ) {
xb->name_value_item("type", "oop");
oop o = ((objectRef*)data_ptr)->as_oop();
o->print_xml_on(xb, true);
} else {
xb->name_value_item("type", "normal");
xb->name_ptr_item("value", (void*)*data_ptr);
}
}
}
}else if(fr.is_interpreted_frame()){
for( int i = 0; i < max_locals; i++ ) {
frame::InterpreterStackSlotType tag = fr.tag_at_address(fr.interpreter_frame_local_addr(i));
if (tag == frame::double_slot_primitive_type)
i++;//skip the tag slot
xmlElement je(xb, "java_element");
{ xmlElement n(xb, "name", xmlElement::delayed_LF);
bool out_of_scope = true;
const char* name = moop->localvariable_name(i, bci(), out_of_scope);
if (name != NULL) {
xb->print("%s%s%s", out_of_scope ? "{": "", name, out_of_scope ? "}": "");
} else {
xb->print("JL%-2d", i);
}
}
intptr_t local_value = fr.interpreter_frame_local_at(i);
switch (tag) {
case frame::single_slot_primitive_type: {
xb->name_value_item("type", "single_slot_primitive_type");
xb->name_ptr_item("value", (void*)local_value);
break;
}
case frame::double_slot_primitive_type: {
xb->name_value_item("type", "double_slot_primitive_type");
xb->name_ptr_item("value", (void*)local_value);
break;
}
case frame::single_slot_ref_type: {
xb->name_value_item("type", "oop");
oop o = objectRef((uint64_t)local_value).as_oop();
o->print_xml_on(xb, true);
break;
}
default: ShouldNotReachHere(); break;
}
}
}
}