< prev index next >

src/hotspot/share/runtime/stubRoutines.cpp

Print this page
*** 27,10 ***
--- 27,11 ---
  #include "asm/macroAssembler.inline.hpp"
  #include "memory/resourceArea.hpp"
  #include "oops/access.inline.hpp"
  #include "oops/oop.inline.hpp"
  #include "prims/vectorSupport.hpp"
+ #include "runtime/continuation.hpp"
  #include "runtime/interfaceSupport.inline.hpp"
  #include "runtime/timerTrace.hpp"
  #include "runtime/safefetch.inline.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "utilities/align.hpp"

*** 49,10 ***
--- 50,11 ---
  
  // Class Variables
  
  BufferBlob* StubRoutines::_code1                                = NULL;
  BufferBlob* StubRoutines::_code2                                = NULL;
+ BufferBlob* StubRoutines::_code3                                = NULL;
  
  address StubRoutines::_call_stub_return_address                 = NULL;
  address StubRoutines::_call_stub_entry                          = NULL;
  
  address StubRoutines::_catch_exception_entry                    = NULL;

*** 87,10 ***
--- 89,16 ---
  address StubRoutines::_jint_disjoint_arraycopy           = CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
  address StubRoutines::_jlong_disjoint_arraycopy          = CAST_FROM_FN_PTR(address, StubRoutines::jlong_copy);
  address StubRoutines::_oop_disjoint_arraycopy            = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy);
  address StubRoutines::_oop_disjoint_arraycopy_uninit     = CAST_FROM_FN_PTR(address, StubRoutines::oop_copy_uninit);
  
+ bool    StubRoutines::_has_word_memcpy             = false;
+ address StubRoutines::_word_memcpy_up              = NULL; // CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
+ address StubRoutines::_word_memcpy_down            = NULL; // CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
+ address StubRoutines::_word_memcpy_up_nt           = NULL; // CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
+ address StubRoutines::_word_memcpy_down_nt         = NULL; // CAST_FROM_FN_PTR(address, StubRoutines::jint_copy);
+ 
  address StubRoutines::_arrayof_jbyte_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jbyte_copy);
  address StubRoutines::_arrayof_jshort_arraycopy = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jshort_copy);
  address StubRoutines::_arrayof_jint_arraycopy   = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jint_copy);
  address StubRoutines::_arrayof_jlong_arraycopy  = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_jlong_copy);
  address StubRoutines::_arrayof_oop_arraycopy    = CAST_FROM_FN_PTR(address, StubRoutines::arrayof_oop_copy);

*** 176,17 ***
  address StubRoutines::_safefetchN_continuation_pc        = NULL;
  
  address StubRoutines::_vector_f_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{NULL}, {NULL}};
  address StubRoutines::_vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{NULL}, {NULL}};
  
  // Initialization
  //
  // Note: to break cycle with universe initialization, stubs are generated in two phases.
  // The first one generates stubs needed during universe init (e.g., _handle_must_compile_first_entry).
  // The second phase includes all other stubs (which may depend on universe being initialized.)
  
! extern void StubGenerator_generate(CodeBuffer* code, bool all); // only interface to generators
  
  void UnsafeCopyMemory::create_table(int max_size) {
    UnsafeCopyMemory::_table = new UnsafeCopyMemory[max_size];
    UnsafeCopyMemory::_table_max_length = max_size;
  }
--- 184,28 ---
  address StubRoutines::_safefetchN_continuation_pc        = NULL;
  
  address StubRoutines::_vector_f_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{NULL}, {NULL}};
  address StubRoutines::_vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{NULL}, {NULL}};
  
+ RuntimeStub* StubRoutines::_cont_doYield_stub = NULL;
+ address StubRoutines::_cont_doYield       = NULL;
+ address StubRoutines::_cont_jump_from_sp  = NULL;
+ address StubRoutines::_cont_thaw          = NULL;
+ address StubRoutines::_cont_returnBarrier = NULL;
+ address StubRoutines::_cont_returnBarrierExc = NULL;
+ address StubRoutines::_cont_interpreter_forced_preempt_return = NULL;
+ 
+ JFR_ONLY(address StubRoutines::_jfr_write_checkpoint = NULL;)
+ JFR_ONLY(address StubRoutines::_jfr_get_event_writer = NULL;)
+ 
  // Initialization
  //
  // Note: to break cycle with universe initialization, stubs are generated in two phases.
  // The first one generates stubs needed during universe init (e.g., _handle_must_compile_first_entry).
  // The second phase includes all other stubs (which may depend on universe being initialized.)
  
! extern void StubGenerator_generate(CodeBuffer* code, int phase); // only interface to generators
  
  void UnsafeCopyMemory::create_table(int max_size) {
    UnsafeCopyMemory::_table = new UnsafeCopyMemory[max_size];
    UnsafeCopyMemory::_table_max_length = max_size;
  }

*** 218,18 ***
      _code1 = BufferBlob::create("StubRoutines (1)", code_size1);
      if (_code1 == NULL) {
        vm_exit_out_of_memory(code_size1, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (1)");
      }
      CodeBuffer buffer(_code1);
!     StubGenerator_generate(&buffer, false);
      // When new stubs added we need to make sure there is some space left
      // to catch situation when we should increase size again.
      assert(code_size1 == 0 || buffer.insts_remaining() > 200, "increase code_size1");
    }
  }
  
- 
  #ifdef ASSERT
  typedef void (*arraycopy_fn)(address src, address dst, int count);
  
  // simple tests of generated arraycopy functions
  static void test_arraycopy_func(address func, int alignment) {
--- 237,17 ---
      _code1 = BufferBlob::create("StubRoutines (1)", code_size1);
      if (_code1 == NULL) {
        vm_exit_out_of_memory(code_size1, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (1)");
      }
      CodeBuffer buffer(_code1);
!     StubGenerator_generate(&buffer, 0);
      // When new stubs added we need to make sure there is some space left
      // to catch situation when we should increase size again.
      assert(code_size1 == 0 || buffer.insts_remaining() > 200, "increase code_size1");
    }
  }
  
  #ifdef ASSERT
  typedef void (*arraycopy_fn)(address src, address dst, int count);
  
  // simple tests of generated arraycopy functions
  static void test_arraycopy_func(address func, int alignment) {

*** 263,20 ***
      assert(fbuffer[i] == v && fbuffer2[i] == v2, "shouldn't have copied anything");
    }
  }
  #endif // ASSERT
  
  void StubRoutines::initialize2() {
    if (_code2 == NULL) {
      ResourceMark rm;
      TraceTime timer("StubRoutines generation 2", TRACETIME_LOG(Info, startuptime));
      _code2 = BufferBlob::create("StubRoutines (2)", code_size2);
      if (_code2 == NULL) {
        vm_exit_out_of_memory(code_size2, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (2)");
      }
      CodeBuffer buffer(_code2);
!     StubGenerator_generate(&buffer, true);
      // When new stubs added we need to make sure there is some space left
      // to catch situation when we should increase size again.
      assert(code_size2 == 0 || buffer.insts_remaining() > 200, "increase code_size2");
    }
  
--- 281,36 ---
      assert(fbuffer[i] == v && fbuffer2[i] == v2, "shouldn't have copied anything");
    }
  }
  #endif // ASSERT
  
+ void StubRoutines::initializeContinuationStubs() {
+   if (_code3 == NULL) {
+     ResourceMark rm;
+     TraceTime timer("StubRoutines generation 3", TRACETIME_LOG(Info, startuptime));
+     _code3 = BufferBlob::create("StubRoutines (3)", code_size2);
+     if (_code3 == NULL) {
+       vm_exit_out_of_memory(code_size2, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (3)");
+     }
+     CodeBuffer buffer(_code3);
+     StubGenerator_generate(&buffer, 1);
+     // When new stubs added we need to make sure there is some space left
+     // to catch situation when we should increase size again.
+     assert(code_size2 == 0 || buffer.insts_remaining() > 200, "increase code_size3");
+   }
+ }
+ 
  void StubRoutines::initialize2() {
    if (_code2 == NULL) {
      ResourceMark rm;
      TraceTime timer("StubRoutines generation 2", TRACETIME_LOG(Info, startuptime));
      _code2 = BufferBlob::create("StubRoutines (2)", code_size2);
      if (_code2 == NULL) {
        vm_exit_out_of_memory(code_size2, OOM_MALLOC_ERROR, "CodeCache: no room for StubRoutines (2)");
      }
      CodeBuffer buffer(_code2);
!     StubGenerator_generate(&buffer, 2);
      // When new stubs added we need to make sure there is some space left
      // to catch situation when we should increase size again.
      assert(code_size2 == 0 || buffer.insts_remaining() > 200, "increase code_size2");
    }
  

*** 363,10 ***
--- 397,11 ---
  }
  
  
  void stubRoutines_init1() { StubRoutines::initialize1(); }
  void stubRoutines_init2() { StubRoutines::initialize2(); }
+ void stubRoutines_initContinuationStubs() { StubRoutines::initializeContinuationStubs(); }
  
  //
  // Default versions of arraycopy functions
  //
  
< prev index next >