hotspot/src/share/vm/opto/runtime.cpp
changeset 10987 696ed3367418
parent 10972 ef164805934c
child 12377 ae6def2813e0
child 12981 b557c10f5444
equal deleted inserted replaced
10986:1952e39a6364 10987:696ed3367418
   336 
   336 
   337   if (GraphKit::use_ReduceInitialCardMarks()) {
   337   if (GraphKit::use_ReduceInitialCardMarks()) {
   338     // inform GC that we won't do card marks for initializing writes.
   338     // inform GC that we won't do card marks for initializing writes.
   339     new_store_pre_barrier(thread);
   339     new_store_pre_barrier(thread);
   340   }
   340   }
       
   341 
       
   342   oop result = thread->vm_result();
       
   343   if ((len > 0) && (result != NULL) &&
       
   344       is_deoptimized_caller_frame(thread)) {
       
   345     // Zero array here if the caller is deoptimized.
       
   346     int size = ((typeArrayOop)result)->object_size();
       
   347     BasicType elem_type = typeArrayKlass::cast(array_type)->element_type();
       
   348     const size_t hs = arrayOopDesc::header_size(elem_type);
       
   349     // Align to next 8 bytes to avoid trashing arrays's length.
       
   350     const size_t aligned_hs = align_object_offset(hs);
       
   351     HeapWord* obj = (HeapWord*)result;
       
   352     if (aligned_hs > hs) {
       
   353       Copy::zero_to_words(obj+hs, aligned_hs-hs);
       
   354     }
       
   355     // Optimized zeroing.
       
   356     Copy::fill_to_aligned_words(obj+aligned_hs, size-aligned_hs);
       
   357   }
       
   358 
   341 JRT_END
   359 JRT_END
   342 
   360 
   343 // Note: multianewarray for one dimension is handled inline by GraphKit::new_array.
   361 // Note: multianewarray for one dimension is handled inline by GraphKit::new_array.
   344 
   362 
   345 // multianewarray for 2 dimensions
   363 // multianewarray for 2 dimensions
  1134     Deoptimization::deoptimize_frame(thread, caller_frame.id());
  1152     Deoptimization::deoptimize_frame(thread, caller_frame.id());
  1135   }
  1153   }
  1136 }
  1154 }
  1137 
  1155 
  1138 
  1156 
       
  1157 bool OptoRuntime::is_deoptimized_caller_frame(JavaThread *thread) {
       
  1158   // Called from within the owner thread, so no need for safepoint
       
  1159   RegisterMap reg_map(thread);
       
  1160   frame stub_frame = thread->last_frame();
       
  1161   assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
       
  1162   frame caller_frame = stub_frame.sender(&reg_map);
       
  1163   return caller_frame.is_deoptimized_frame();
       
  1164 }
       
  1165 
       
  1166 
  1139 const TypeFunc *OptoRuntime::register_finalizer_Type() {
  1167 const TypeFunc *OptoRuntime::register_finalizer_Type() {
  1140   // create input type (domain)
  1168   // create input type (domain)
  1141   const Type **fields = TypeTuple::fields(1);
  1169   const Type **fields = TypeTuple::fields(1);
  1142   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // oop;          Receiver
  1170   fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // oop;          Receiver
  1143   // // The JavaThread* is passed to each routine as the last argument
  1171   // // The JavaThread* is passed to each routine as the last argument