< prev index next >

src/share/vm/code/relocInfo_ext.cpp

Print this page
rev 12854 : [mq]: gcinterface.patch


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "code/relocInfo.hpp"
  28 #include "code/relocInfo_ext.hpp"
  29 #include "gc/shared/cardTableModRefBS.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "memory/universe.hpp"
  32 #include "runtime/os.hpp"
  33 #include "utilities/debug.hpp"
  34 #ifdef COMPILER1
  35 #include "c1/c1_globals.hpp"
  36 #endif
  37 
  38 address symbolic_Relocation::symbolic_value(symbolic_Relocation::symbolic_reference t) {
  39   if (Universe::heap() == NULL) {
  40     // the symbolic values are not needed so early
  41     // (and most of them lead to errors if asked too early)
  42     return NULL;
  43   }
  44   switch(t) {
  45   case symbolic_Relocation::polling_page_reference: {
  46     return os::get_polling_page();
  47   }
  48   case symbolic_Relocation::eden_top_reference: {
  49     if (!Universe::heap()->supports_inline_contig_alloc()) {
  50       return NULL;
  51     }
  52     return (address)Universe::heap()->top_addr();
  53   }
  54   case symbolic_Relocation::heap_end_reference: {
  55     if (!Universe::heap()->supports_inline_contig_alloc()) {
  56       return NULL;
  57     }
  58     return (address)Universe::heap()->end_addr();
  59   }
  60   case symbolic_Relocation::card_table_reference: {
  61     BarrierSet* bs = Universe::heap()->barrier_set();
  62     CardTableModRefBS* ct = (CardTableModRefBS*)bs;
  63     return (address)ct->byte_map_base;
  64   }
  65   case symbolic_Relocation::mark_bits_reference: {
  66     return (address)Universe::verify_mark_bits();
  67   }
  68   case symbolic_Relocation::mark_mask_reference: {
  69     return (address)Universe::verify_mark_mask();
  70   }
  71   case symbolic_Relocation::oop_bits_reference: {
  72     return (address)Universe::verify_oop_bits();
  73   }
  74   case symbolic_Relocation::oop_mask_reference: {
  75     return (address)Universe::verify_oop_mask();
  76   }
  77   case symbolic_Relocation::debug_string_reference: {
  78     return (address)"<Lost debug string>";
  79   }
  80   default: {
  81     // missing declaration


  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "code/relocInfo.hpp"
  28 #include "code/relocInfo_ext.hpp"
  29 #include "gc/shared/cardTableModRefBS.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "memory/universe.hpp"
  32 #include "runtime/os.hpp"
  33 #include "utilities/debug.hpp"
  34 #ifdef COMPILER1
  35 #include "c1/c1_globals.hpp"
  36 #endif
  37 
  38 address symbolic_Relocation::symbolic_value(symbolic_Relocation::symbolic_reference t) {
  39   if (GC::is_initialized()) {
  40     // the symbolic values are not needed so early
  41     // (and most of them lead to errors if asked too early)
  42     return NULL;
  43   }
  44   switch(t) {
  45   case symbolic_Relocation::polling_page_reference: {
  46     return os::get_polling_page();
  47   }
  48   case symbolic_Relocation::eden_top_reference: {
  49     if (! GC::gc()->heap()->supports_inline_contig_alloc()) {
  50       return NULL;
  51     }
  52     return (address) GC::gc()->heap()->top_addr();
  53   }
  54   case symbolic_Relocation::heap_end_reference: {
  55     if (! GC::gc()->heap()->supports_inline_contig_alloc()) {
  56       return NULL;
  57     }
  58     return (address)GC::gc()->heap()->end_addr();
  59   }
  60   case symbolic_Relocation::card_table_reference: {
  61     BarrierSet* bs = GC::gc()->heap()->barrier_set();
  62     CardTableModRefBS* ct = (CardTableModRefBS*)bs;
  63     return (address)ct->byte_map_base;
  64   }
  65   case symbolic_Relocation::mark_bits_reference: {
  66     return (address)Universe::verify_mark_bits();
  67   }
  68   case symbolic_Relocation::mark_mask_reference: {
  69     return (address)Universe::verify_mark_mask();
  70   }
  71   case symbolic_Relocation::oop_bits_reference: {
  72     return (address)Universe::verify_oop_bits();
  73   }
  74   case symbolic_Relocation::oop_mask_reference: {
  75     return (address)Universe::verify_oop_mask();
  76   }
  77   case symbolic_Relocation::debug_string_reference: {
  78     return (address)"<Lost debug string>";
  79   }
  80   default: {
  81     // missing declaration
< prev index next >