bool OopMapCacheEntry::verify_mask(CellTypeState* vars, CellTypeState* stack, int max_locals, int stack_top) { // Check mask includes map VerifyClosure blk(this); iterate_oop(&blk); if (blk.failed()) return false; // Check if map is generated correctly // (Use ?: operator to make sure all 'true' & 'false' are represented exactly the same so we can use == afterwards) if (TraceOopMapGeneration && Verbose) tty->print("Locals (%d): ", max_locals); for(int i = 0; i < max_locals; i++) { bool v1 = is_oop(i) ? true : false; bool v2 = vars[i].is_reference() ? true : false; assert(v1 == v2, "locals oop mask generation error"); if (TraceOopMapGeneration && Verbose) tty->print("%d", v1 ? 1 : 0); #ifdef ENABLE_ZAP_DEAD_LOCALS bool v3 = is_dead(i) ? true : false; bool v4 = !vars[i].is_live() ? true : false; assert(v3 == v4, "locals live mask generation error"); assert(!(v1 && v3), "dead value marked as oop"); #endif } if (TraceOopMapGeneration && Verbose) { tty->cr(); tty->print("Stack (%d): ", stack_top); } for(int j = 0; j < stack_top; j++) { bool v1 = is_oop(max_locals + j) ? true : false; bool v2 = stack[j].is_reference() ? true : false; assert(v1 == v2, "stack oop mask generation error"); if (TraceOopMapGeneration && Verbose) tty->print("%d", v1 ? 1 : 0); #ifdef ENABLE_ZAP_DEAD_LOCALS bool v3 = is_dead(max_locals + j) ? true : false; bool v4 = !stack[j].is_live() ? true : false; assert(v3 == v4, "stack live mask generation error"); assert(!(v1 && v3), "dead value marked as oop"); #endif } if (TraceOopMapGeneration && Verbose) tty->cr(); return true; }
void InterpreterOopMap::print() { int n = number_of_entries(); tty->print("oop map for "); method()->print_value(); tty->print(" @ %d = [%d] { ", bci(), n); for (int i = 0; i < n; i++) { #ifdef ENABLE_ZAP_DEAD_LOCALS if (is_dead(i)) tty->print("%d+ ", i); else #endif if (is_oop(i)) tty->print("%d ", i); } tty->print_cr("}"); }
oop get_oop() { assert(is_oop(), "bad call"); return oop(_ptr); }
// used only for asserts inline bool oopDesc::is_oop_or_null() const { return this == NULL ? true : is_oop(); }
// used only for asserts inline bool oopDesc::is_oop_or_null(bool ignore_mark_word) const { return this == NULL ? true : is_oop(ignore_mark_word); }