hotspot/src/share/vm/runtime/frame.cpp
changeset 38144 0976c0c5c5d3
parent 38133 78b95467b9f1
parent 38074 8475fdc6dcc3
child 40332 a52d1e719c4d
equal deleted inserted replaced
38143:3b732f17ea7d 38144:0976c0c5c5d3
   392 }
   392 }
   393 
   393 
   394 void frame::interpreter_frame_set_method(Method* method) {
   394 void frame::interpreter_frame_set_method(Method* method) {
   395   assert(is_interpreted_frame(), "interpreted frame expected");
   395   assert(is_interpreted_frame(), "interpreted frame expected");
   396   *interpreter_frame_method_addr() = method;
   396   *interpreter_frame_method_addr() = method;
       
   397 }
       
   398 
       
   399 void frame::interpreter_frame_set_mirror(oop mirror) {
       
   400   assert(is_interpreted_frame(), "interpreted frame expected");
       
   401   *interpreter_frame_mirror_addr() = mirror;
   397 }
   402 }
   398 
   403 
   399 jint frame::interpreter_frame_bci() const {
   404 jint frame::interpreter_frame_bci() const {
   400   assert(is_interpreted_frame(), "interpreted frame expected");
   405   assert(is_interpreted_frame(), "interpreted frame expected");
   401   address bcp = interpreter_frame_bcp();
   406   address bcp = interpreter_frame_bcp();
   856   int size = asc.size();
   861   int size = asc.size();
   857   return (oop *)interpreter_frame_tos_at(size);
   862   return (oop *)interpreter_frame_tos_at(size);
   858 }
   863 }
   859 
   864 
   860 
   865 
   861 void frame::oops_interpreted_do(OopClosure* f, CLDClosure* cld_f,
   866 void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) {
   862     const RegisterMap* map, bool query_oop_map_cache) {
       
   863   assert(is_interpreted_frame(), "Not an interpreted frame");
   867   assert(is_interpreted_frame(), "Not an interpreted frame");
   864   assert(map != NULL, "map must be set");
   868   assert(map != NULL, "map must be set");
   865   Thread *thread = Thread::current();
   869   Thread *thread = Thread::current();
   866   methodHandle m (thread, interpreter_frame_method());
   870   methodHandle m (thread, interpreter_frame_method());
   867   jint      bci = interpreter_frame_bci();
   871   jint      bci = interpreter_frame_bci();
   883     interpreter_frame_verify_monitor(current);
   887     interpreter_frame_verify_monitor(current);
   884 #endif
   888 #endif
   885     current->oops_do(f);
   889     current->oops_do(f);
   886   }
   890   }
   887 
   891 
   888   // process fixed part
   892   if (m->is_native()) {
   889   if (cld_f != NULL) {
       
   890     // The method pointer in the frame might be the only path to the method's
       
   891     // klass, and the klass needs to be kept alive while executing. The GCs
       
   892     // don't trace through method pointers, so typically in similar situations
       
   893     // the mirror or the class loader of the klass are installed as a GC root.
       
   894     // To minimize the overhead of doing that here, we ask the GC to pass down a
       
   895     // closure that knows how to keep klasses alive given a ClassLoaderData.
       
   896     cld_f->do_cld(m->method_holder()->class_loader_data());
       
   897   }
       
   898 
       
   899   if (m->is_native() PPC32_ONLY(&& m->is_static())) {
       
   900     f->do_oop(interpreter_frame_temp_oop_addr());
   893     f->do_oop(interpreter_frame_temp_oop_addr());
   901   }
   894   }
       
   895 
       
   896   // The method pointer in the frame might be the only path to the method's
       
   897   // klass, and the klass needs to be kept alive while executing. The GCs
       
   898   // don't trace through method pointers, so the mirror of the method's klass
       
   899   // is installed as a GC root.
       
   900   f->do_oop(interpreter_frame_mirror_addr());
   902 
   901 
   903   int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
   902   int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
   904 
   903 
   905   Symbol* signature = NULL;
   904   Symbol* signature = NULL;
   906   bool has_receiver = false;
   905   bool has_receiver = false;
  1097   // Traverse the Handle Block saved in the entry frame
  1096   // Traverse the Handle Block saved in the entry frame
  1098   entry_frame_call_wrapper()->oops_do(f);
  1097   entry_frame_call_wrapper()->oops_do(f);
  1099 }
  1098 }
  1100 
  1099 
  1101 
  1100 
  1102 void frame::oops_do_internal(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) {
  1101 void frame::oops_do_internal(OopClosure* f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) {
  1103 #ifndef PRODUCT
  1102 #ifndef PRODUCT
  1104   // simulate GC crash here to dump java thread in error report
  1103   // simulate GC crash here to dump java thread in error report
  1105   if (CrashGCForDumpingJavaThread) {
  1104   if (CrashGCForDumpingJavaThread) {
  1106     char *t = NULL;
  1105     char *t = NULL;
  1107     *t = 'c';
  1106     *t = 'c';
  1108   }
  1107   }
  1109 #endif
  1108 #endif
  1110   if (is_interpreted_frame()) {
  1109   if (is_interpreted_frame()) {
  1111     oops_interpreted_do(f, cld_f, map, use_interpreter_oop_map_cache);
  1110     oops_interpreted_do(f, map, use_interpreter_oop_map_cache);
  1112   } else if (is_entry_frame()) {
  1111   } else if (is_entry_frame()) {
  1113     oops_entry_do(f, map);
  1112     oops_entry_do(f, map);
  1114   } else if (CodeCache::contains(pc())) {
  1113   } else if (CodeCache::contains(pc())) {
  1115     oops_code_blob_do(f, cf, map);
  1114     oops_code_blob_do(f, cf, map);
  1116 #ifdef SHARK
  1115 #ifdef SHARK
  1151     }
  1150     }
  1152   }
  1151   }
  1153 #if defined(COMPILER2) || INCLUDE_JVMCI
  1152 #if defined(COMPILER2) || INCLUDE_JVMCI
  1154   assert(DerivedPointerTable::is_empty(), "must be empty before verify");
  1153   assert(DerivedPointerTable::is_empty(), "must be empty before verify");
  1155 #endif
  1154 #endif
  1156   oops_do_internal(&VerifyOopClosure::verify_oop, NULL, NULL, (RegisterMap*)map, false);
  1155   oops_do_internal(&VerifyOopClosure::verify_oop, NULL, (RegisterMap*)map, false);
  1157 }
  1156 }
  1158 
  1157 
  1159 
  1158 
  1160 #ifdef ASSERT
  1159 #ifdef ASSERT
  1161 bool frame::verify_return_pc(address x) {
  1160 bool frame::verify_return_pc(address x) {