src/cpu/x86/vm/sharedRuntime_x86_32.cpp

changeset 2895
167b70ff3abc
parent 2687
3d58a4983660
child 2950
cba7b5c2d53f
     1.1 --- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Fri May 06 12:12:29 2011 -0700
     1.2 +++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Fri May 06 16:33:13 2011 -0700
     1.3 @@ -2253,6 +2253,31 @@
     1.4    return 0;
     1.5  }
     1.6  
     1.7 +//----------------------------generate_ricochet_blob---------------------------
     1.8 +void SharedRuntime::generate_ricochet_blob() {
     1.9 +  if (!EnableInvokeDynamic)  return;  // leave it as a null
    1.10 +
    1.11 +  // allocate space for the code
    1.12 +  ResourceMark rm;
    1.13 +  // setup code generation tools
    1.14 +  CodeBuffer   buffer("ricochet_blob", 256, 256);
    1.15 +  MacroAssembler* masm = new MacroAssembler(&buffer);
    1.16 +
    1.17 +  int frame_size_in_words = -1, bounce_offset = -1, exception_offset = -1;
    1.18 +  MethodHandles::RicochetFrame::generate_ricochet_blob(masm, &frame_size_in_words, &bounce_offset, &exception_offset);
    1.19 +
    1.20 +  // -------------
    1.21 +  // make sure all code is generated
    1.22 +  masm->flush();
    1.23 +
    1.24 +  // failed to generate?
    1.25 +  if (frame_size_in_words < 0 || bounce_offset < 0 || exception_offset < 0) {
    1.26 +    assert(false, "bad ricochet blob");
    1.27 +    return;
    1.28 +  }
    1.29 +
    1.30 +  _ricochet_blob = RicochetBlob::create(&buffer, bounce_offset, exception_offset, frame_size_in_words);
    1.31 +}
    1.32  
    1.33  //------------------------------generate_deopt_blob----------------------------
    1.34  void SharedRuntime::generate_deopt_blob() {
    1.35 @@ -2996,6 +3021,8 @@
    1.36      generate_handler_blob(CAST_FROM_FN_PTR(address,
    1.37                     SafepointSynchronize::handle_polling_page_exception), true);
    1.38  
    1.39 +  generate_ricochet_blob();
    1.40 +
    1.41    generate_deopt_blob();
    1.42  #ifdef COMPILER2
    1.43    generate_uncommon_trap_blob();

mercurial