< prev index next >

src/hotspot/share/opto/runtime.cpp

Print this page
*** 306,18 ***
    if ((len > 0) && (result != NULL) &&
        is_deoptimized_caller_frame(current)) {
      // Zero array here if the caller is deoptimized.
      const size_t size = TypeArrayKlass::cast(array_type)->oop_size(result);
      BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
!     const size_t hs = arrayOopDesc::header_size(elem_type);
      // Align to next 8 bytes to avoid trashing arrays's length.
!     const size_t aligned_hs = align_object_offset(hs);
      HeapWord* obj = cast_from_oop<HeapWord*>(result);
!     if (aligned_hs > hs) {
!       Copy::zero_to_words(obj+hs, aligned_hs-hs);
      }
      // Optimized zeroing.
      Copy::fill_to_aligned_words(obj+aligned_hs, size-aligned_hs);
    }
  
  JRT_END
  
--- 306,19 ---
    if ((len > 0) && (result != NULL) &&
        is_deoptimized_caller_frame(current)) {
      // Zero array here if the caller is deoptimized.
      const size_t size = TypeArrayKlass::cast(array_type)->oop_size(result);
      BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
!     const size_t hs_bytes = arrayOopDesc::base_offset_in_bytes(elem_type);
      // Align to next 8 bytes to avoid trashing arrays's length.
!     const size_t aligned_hs_bytes = align_up(hs_bytes, BytesPerLong);
      HeapWord* obj = cast_from_oop<HeapWord*>(result);
!     if (aligned_hs_bytes > hs_bytes) {
!       Copy::zero_to_bytes(obj + hs_bytes, aligned_hs_bytes - hs_bytes);
      }
      // Optimized zeroing.
+     const size_t aligned_hs = aligned_hs_bytes / HeapWordSize;
      Copy::fill_to_aligned_words(obj+aligned_hs, size-aligned_hs);
    }
  
  JRT_END
  

*** 561,14 ***
  
  //-----------------------------------------------------------------------------
  // Monitor Handling
  const TypeFunc *OptoRuntime::complete_monitor_enter_Type() {
    // create input type (domain)
!   const Type **fields = TypeTuple::fields(2);
    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
!   fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;   // Address of stack location for lock
-   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2,fields);
  
    // create result type (range)
    fields = TypeTuple::fields(0);
  
    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);
--- 562,13 ---
  
  //-----------------------------------------------------------------------------
  // Monitor Handling
  const TypeFunc *OptoRuntime::complete_monitor_enter_Type() {
    // create input type (domain)
!   const Type **fields = TypeTuple::fields(1);
    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
!   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1,fields);
  
    // create result type (range)
    fields = TypeTuple::fields(0);
  
    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0,fields);

*** 578,15 ***
  
  
  //-----------------------------------------------------------------------------
  const TypeFunc *OptoRuntime::complete_monitor_exit_Type() {
    // create input type (domain)
!   const Type **fields = TypeTuple::fields(3);
    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
!   fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;    // Address of stack location for lock - BasicLock
!   fields[TypeFunc::Parms+2] = TypeRawPtr::BOTTOM;    // Thread pointer (Self)
-   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields);
  
    // create result type (range)
    fields = TypeTuple::fields(0);
  
    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
--- 578,14 ---
  
  
  //-----------------------------------------------------------------------------
  const TypeFunc *OptoRuntime::complete_monitor_exit_Type() {
    // create input type (domain)
!   const Type **fields = TypeTuple::fields(2);
    fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;  // Object to be Locked
!   fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM;    // Thread pointer (Self)
!   const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);
  
    // create result type (range)
    fields = TypeTuple::fields(0);
  
    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
< prev index next >