< prev index next >

src/share/vm/code/vtableStubs.cpp

Print this page




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/vtableStubs.hpp"
  27 #include "compiler/compileBroker.hpp"
  28 #include "compiler/disassembler.hpp"
  29 #include "memory/allocation.inline.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "oops/instanceKlass.hpp"
  32 #include "oops/klassVtable.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/forte.hpp"
  35 #include "prims/jvmtiExport.hpp"
  36 #include "runtime/handles.inline.hpp"
  37 #include "runtime/mutexLocker.hpp"
  38 #include "runtime/sharedRuntime.hpp"

  39 #ifdef COMPILER2
  40 #include "opto/matcher.hpp"
  41 #endif
  42 
  43 // -----------------------------------------------------------------------------------------
  44 // Implementation of VtableStub
  45 
  46 address VtableStub::_chunk             = NULL;
  47 address VtableStub::_chunk_end         = NULL;
  48 VMReg   VtableStub::_receiver_location = VMRegImpl::Bad();
  49 
  50 
  51 void* VtableStub::operator new(size_t size, int code_size) throw() {
  52   assert(size == sizeof(VtableStub), "mismatched size");
  53   // compute real VtableStub size (rounded to nearest word)
  54   const int real_size = align_up(code_size + (int)sizeof(VtableStub), wordSize);
  55   // malloc them in chunks to minimize header overhead
  56   const int chunk_factor = 32;
  57   if (_chunk == NULL || _chunk + real_size > _chunk_end) {
  58     const int bytes = chunk_factor * real_size + pd_code_alignment();




  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/vtableStubs.hpp"
  27 #include "compiler/compileBroker.hpp"
  28 #include "compiler/disassembler.hpp"
  29 #include "memory/allocation.inline.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "oops/instanceKlass.hpp"
  32 #include "oops/klassVtable.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/forte.hpp"
  35 #include "prims/jvmtiExport.hpp"
  36 #include "runtime/handles.inline.hpp"
  37 #include "runtime/mutexLocker.hpp"
  38 #include "runtime/sharedRuntime.hpp"
  39 #include "utilities/align.hpp"
  40 #ifdef COMPILER2
  41 #include "opto/matcher.hpp"
  42 #endif
  43 
  44 // -----------------------------------------------------------------------------------------
  45 // Implementation of VtableStub
  46 
  47 address VtableStub::_chunk             = NULL;
  48 address VtableStub::_chunk_end         = NULL;
  49 VMReg   VtableStub::_receiver_location = VMRegImpl::Bad();
  50 
  51 
  52 void* VtableStub::operator new(size_t size, int code_size) throw() {
  53   assert(size == sizeof(VtableStub), "mismatched size");
  54   // compute real VtableStub size (rounded to nearest word)
  55   const int real_size = align_up(code_size + (int)sizeof(VtableStub), wordSize);
  56   // malloc them in chunks to minimize header overhead
  57   const int chunk_factor = 32;
  58   if (_chunk == NULL || _chunk + real_size > _chunk_end) {
  59     const int bytes = chunk_factor * real_size + pd_code_alignment();


< prev index next >