// Accessors static typeArrayOop value(oop java_string) { assert(initialized && (value_offset > 0), "Must be initialized"); assert(is_instance(java_string), "must be java_string"); return (typeArrayOop) java_string->obj_field(value_offset); }
bool symbolKlass::oop_is_parsable(oop obj) const { assert(obj->is_symbol(),"must be a symbol"); symbolOop s = symbolOop(obj); return s->object_is_parsable(); }
void symbolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_symbol(), "should be symbol"); }
void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) { assert(exception != NULL && exception->is_oop(), "invalid exception oop"); _pending_exception = exception; _exception_file = file; _exception_line = line; }
bool is_method() const { return _result->is_mem(); }
oop Profiler::copy_call_graph(oop method_pt, oop block_pt, oop access_pt, oop prim_pt, oop leaf_pt, oop fold_pt, oop unknown_oop, smi cutoff_pct) { ResourceMark rm; if ( ProfilerIgnoreCallGraph || !root->edges ) { // If the call graph is ignored the root contains the // accumulated timing and allocation information if (!this->root->edges) warning("Profiler::copy_call_graph: root edges are NULL, profiled program probably was too brief"); oop node = leaf_pt->clone(CANFAIL); if (node == failedAllocationOop) return failedAllocationOop; leaf_node_info* leaf_pt_info = new leaf_node_info(leaf_pt); leaf_pt_info->fill(node, root); return node; } if ( PrintProfiling ) { // Old debugging code; checking for multiple roots -- dmu 2/04 int c; float t; graph_totaller::compute_totals(root_edge, c, t); lprintf("in copy_call_graph: count = %d, time = %g\n", c, t); lprintf(" and root and rootedge are "); { for (call_graph_edge* e = root_edge; e; e = e->next) { e->callee->print_node(), lprintf("\n"); for (call_graph_edge* ee = e->callee->edges; ee; ee = ee->next) lprintf(" "), ee->callee->print_node(), lprintf("\n"); } } lprintf("\n\n"); } // Prepare for the enumeration by collecting all referred maps in the graph. MapTable graph_maps; { ResourceMark rm2; map_collector collector(this->root->edges, &graph_maps); _collector = &collector; switchToVMStack(cont_collect); } // Enumerate the maps { ResourceMark rm2; map_enumeration enumeration(&graph_maps); enumeration.enumerate(); } graph_creator creator(this->root->edges, &graph_maps, method_pt, block_pt, access_pt, prim_pt, leaf_pt, fold_pt, unknown_oop, cutoff_pct); // Do the recursive graph traversal on the VM stack. _creator = &creator; switchToVMStack(cont_copy); graph_maps.deallocate(); return creator.ran_out_of_memory() ? failedAllocationOop : creator.root(); }
void do_object(oop obj) { obj->init_mark(); }
static void set_offset(oop string, int offset) { string->int_field_put(offset_offset, offset); }
static void set_count( oop string, int count) { string->int_field_put(count_offset, count); }
// Testing static bool is_instance(oop obj) { return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); }
static void set_value( oop string, typeArrayOop buffer) { string->obj_field_put(value_offset, (oop)buffer); }
void do_oop(narrowOop* p) { _the_obj->verify_old_oop(p, _allow_dirty); }
static void set_count( oop string, int count) { assert(initialized, "Must be initialized"); if (count_offset > 0) { string->int_field_put(count_offset, count); } }
static unsigned int hash(oop java_string) { assert(initialized && (hash_offset > 0), "Must be initialized"); assert(is_instance(java_string), "must be java_string"); return java_string->int_field(hash_offset); }
oop graph_creator::clone_access_node_pt(access_node* n) { oop oop_node= access_node_pt->clone(CANFAIL); if (oop_node == failedAllocationOop) return failedAllocationOop; access_pt_info->fill(this, oop_node, n); return oop_node; }
// Accessors static typeArrayOop value(oop java_string) { assert(is_instance(java_string), "must be java_string"); return (typeArrayOop) java_string->obj_field(value_offset); }
oop graph_creator::clone_leaf_node_pt(leaf_node* n) { oop oop_node= leaf_node_pt->clone(CANFAIL); if (oop_node == failedAllocationOop) return failedAllocationOop; leaf_pt_info->fill(oop_node, n); return oop_node; }
static int length(oop java_string) { assert(is_instance(java_string), "must be java_string"); return java_string->int_field(count_offset); }
bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) { return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded(); }
int methodKlass::oop_size(oop obj) const { assert(obj->is_method(), "must be method oop"); return methodOop(obj)->object_size(); }
oop objVectorOopClass::ov_size_prim(oop rcvr) { if (!rcvr->is_objVector()) return ErrorCodes::vmString_prim_error(BADTYPEERROR); return as_smiOop(objVectorOop(rcvr)->length()); }
bool methodKlass::oop_is_parsable(oop obj) const { assert(obj->is_method(), "must be method oop"); return methodOop(obj)->object_is_parsable(); }
void abstract_interpreter::check_selector_string(abstract_interpreter *ai, oop s) { if ( s->is_string() ) return; ai->set_error_msg( "selector must be a string"); }
inline bool HRInto_G1RemSet::self_forwarded(oop obj) { bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); return result; }
int symbolKlass::oop_size(oop obj) const { assert(obj->is_symbol(),"must be a symbol"); symbolOop s = symbolOop(obj); int size = s->object_size(); return size; }
void trace_method_handle_stub(const char* adaptername, oop mh, intptr_t* saved_regs, intptr_t* entry_sp) { // called as a leaf from native code: do not block the JVM! bool has_mh = (strstr(adaptername, "/static") == NULL && strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH const char* mh_reg_name = has_mh ? "rcx_mh" : "rcx"; tty->print_cr("MH %s %s="PTR_FORMAT" sp="PTR_FORMAT, adaptername, mh_reg_name, (void *)mh, entry_sp); if (Verbose) { tty->print_cr("Registers:"); const int saved_regs_count = RegisterImpl::number_of_registers; for (int i = 0; i < saved_regs_count; i++) { Register r = as_Register(i); // The registers are stored in reverse order on the stack (by pusha). tty->print("%3s=" PTR_FORMAT, r->name(), saved_regs[((saved_regs_count - 1) - i)]); if ((i + 1) % 4 == 0) { tty->cr(); } else { tty->print(", "); } } tty->cr(); { // dumping last frame with frame::describe JavaThread* p = JavaThread::active(); ResourceMark rm; PRESERVE_EXCEPTION_MARK; // may not be needed by safer and unexpensive here FrameValues values; // Note: We want to allow trace_method_handle from any call site. // While trace_method_handle creates a frame, it may be entered // without a PC on the stack top (e.g. not just after a call). // Walking that frame could lead to failures due to that invalid PC. // => carefully detect that frame when doing the stack walking // Current C frame frame cur_frame = os::current_frame(); // Robust search of trace_calling_frame (independant of inlining). // Assumes saved_regs comes from a pusha in the trace_calling_frame. assert(cur_frame.sp() < saved_regs, "registers not saved on stack ?"); frame trace_calling_frame = os::get_sender_for_C_frame(&cur_frame); while (trace_calling_frame.fp() < saved_regs) { trace_calling_frame = os::get_sender_for_C_frame(&trace_calling_frame); } // safely create a frame and call frame::describe intptr_t *dump_sp = trace_calling_frame.sender_sp(); intptr_t *dump_fp = trace_calling_frame.link(); bool walkable = has_mh; // whether the traced frame shoud be walkable if (walkable) { // The previous definition of walkable may have to be refined // if new call sites cause the next frame constructor to start // failing. Alternatively, frame constructors could be // modified to support the current or future non walkable // frames (but this is more intrusive and is not considered as // part of this RFE, which will instead use a simpler output). frame dump_frame = frame(dump_sp, dump_fp); dump_frame.describe(values, 1); } else { // Stack may not be walkable (invalid PC above FP): // Add descriptions without building a Java frame to avoid issues values.describe(-1, dump_fp, "fp for #1 <not parsed, cannot trust pc>"); values.describe(-1, dump_sp, "sp for #1"); } values.describe(-1, entry_sp, "raw top of stack"); tty->print_cr("Stack layout:"); values.print(p); } if (has_mh && mh->is_oop()) { mh->print(); if (java_lang_invoke_MethodHandle::is_instance(mh)) { if (java_lang_invoke_MethodHandle::form_offset_in_bytes() != 0) java_lang_invoke_MethodHandle::form(mh)->print(); } } } }
void symbolKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) { assert (obj->is_symbol(), "object must be symbol"); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::symbolKlassObj never moves. // Note: do not follow next link here (see SymbolTable::follow_contents) }
bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked(); }
int symbolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, HeapWord* beg_addr, HeapWord* end_addr) { assert(obj->is_symbol(), "should be symbol"); return symbolOop(obj)->object_size(); }
static void set_hash(oop string, unsigned int hash) { assert(initialized && (hash_offset > 0), "Must be initialized"); string->int_field_put(hash_offset, hash); }