440 // Support for oops in scopes and relocs:
441 // Note: index 0 is reserved for null.
442 oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); }
443 oop* oop_addr_at(int index) const { // for GC
444 // relocation indexes are biased by 1 (because 0 is reserved)
445 assert(index > 0 && index <= oops_size(), "must be a valid non-zero index");
446 assert(!_oops_are_stale, "oops are stale");
447 return &oops_begin()[index - 1];
448 }
449
450 void copy_oops(GrowableArray<jobject>* oops);
451
452 // Relocation support
453 private:
454 void fix_oop_relocations(address begin, address end, bool initialize_immediates);
455 inline void initialize_immediate_oop(oop* dest, jobject handle);
456
457 public:
458 void fix_oop_relocations(address begin, address end) { fix_oop_relocations(begin, end, false); }
459 void fix_oop_relocations() { fix_oop_relocations(NULL, NULL, false); }
460
461 bool is_at_poll_return(address pc);
462 bool is_at_poll_or_poll_return(address pc);
463
464 // Non-perm oop support
465 bool on_scavenge_root_list() const { return (_scavenge_root_state & 1) != 0; }
466 protected:
467 enum { npl_on_list = 0x01, npl_marked = 0x10 };
468 void set_on_scavenge_root_list() { _scavenge_root_state = npl_on_list; }
469 void clear_on_scavenge_root_list() { _scavenge_root_state = 0; }
470 // assertion-checking and pruning logic uses the bits of _scavenge_root_state
471 #ifndef PRODUCT
472 void set_scavenge_root_marked() { _scavenge_root_state |= npl_marked; }
473 void clear_scavenge_root_marked() { _scavenge_root_state &= ~npl_marked; }
474 bool scavenge_root_not_marked() { return (_scavenge_root_state &~ npl_on_list) == 0; }
475 // N.B. there is no positive marked query, and we only use the not_marked query for asserts.
476 #endif //PRODUCT
477 nmethod* scavenge_root_link() const { return _scavenge_root_link; }
478 void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; }
479
|
440 // Support for oops in scopes and relocs:
441 // Note: index 0 is reserved for null.
442 oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); }
443 oop* oop_addr_at(int index) const { // for GC
444 // relocation indexes are biased by 1 (because 0 is reserved)
445 assert(index > 0 && index <= oops_size(), "must be a valid non-zero index");
446 assert(!_oops_are_stale, "oops are stale");
447 return &oops_begin()[index - 1];
448 }
449
450 void copy_oops(GrowableArray<jobject>* oops);
451
452 // Relocation support
453 private:
454 void fix_oop_relocations(address begin, address end, bool initialize_immediates);
455 inline void initialize_immediate_oop(oop* dest, jobject handle);
456
457 public:
458 void fix_oop_relocations(address begin, address end) { fix_oop_relocations(begin, end, false); }
459 void fix_oop_relocations() { fix_oop_relocations(NULL, NULL, false); }
460 void verify_oop_relocations();
461
462 bool is_at_poll_return(address pc);
463 bool is_at_poll_or_poll_return(address pc);
464
465 // Non-perm oop support
466 bool on_scavenge_root_list() const { return (_scavenge_root_state & 1) != 0; }
467 protected:
468 enum { npl_on_list = 0x01, npl_marked = 0x10 };
469 void set_on_scavenge_root_list() { _scavenge_root_state = npl_on_list; }
470 void clear_on_scavenge_root_list() { _scavenge_root_state = 0; }
471 // assertion-checking and pruning logic uses the bits of _scavenge_root_state
472 #ifndef PRODUCT
473 void set_scavenge_root_marked() { _scavenge_root_state |= npl_marked; }
474 void clear_scavenge_root_marked() { _scavenge_root_state &= ~npl_marked; }
475 bool scavenge_root_not_marked() { return (_scavenge_root_state &~ npl_on_list) == 0; }
476 // N.B. there is no positive marked query, and we only use the not_marked query for asserts.
477 #endif //PRODUCT
478 nmethod* scavenge_root_link() const { return _scavenge_root_link; }
479 void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; }
480
|