hotspot/src/share/vm/code/codeBlob.hpp
changeset 5050 47ecd86932ce
parent 4584 e2a449e8cc6f
child 5686 5435e77aa3df
child 5547 f4b087cbb361
equal deleted inserted replaced
5049:cdeb352c6bbe 5050:47ecd86932ce
     1 /*
     1 /*
     2  * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1998-2010 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    88 
    88 
    89   // Deletion
    89   // Deletion
    90   void flush();
    90   void flush();
    91 
    91 
    92   // Typing
    92   // Typing
    93   virtual bool is_buffer_blob() const            { return false; }
    93   virtual bool is_buffer_blob() const                 { return false; }
    94   virtual bool is_nmethod() const                { return false; }
    94   virtual bool is_nmethod() const                     { return false; }
    95   virtual bool is_runtime_stub() const           { return false; }
    95   virtual bool is_runtime_stub() const                { return false; }
    96   virtual bool is_deoptimization_stub() const    { return false; }
    96   virtual bool is_deoptimization_stub() const         { return false; }
    97   virtual bool is_uncommon_trap_stub() const     { return false; }
    97   virtual bool is_uncommon_trap_stub() const          { return false; }
    98   virtual bool is_exception_stub() const         { return false; }
    98   virtual bool is_exception_stub() const              { return false; }
    99   virtual bool is_safepoint_stub() const         { return false; }
    99   virtual bool is_safepoint_stub() const              { return false; }
   100   virtual bool is_adapter_blob() const           { return false; }
   100   virtual bool is_adapter_blob() const                { return false; }
       
   101   virtual bool is_method_handles_adapter_blob() const { return false; }
   101 
   102 
   102   virtual bool is_compiled_by_c2() const         { return false; }
   103   virtual bool is_compiled_by_c2() const         { return false; }
   103   virtual bool is_compiled_by_c1() const         { return false; }
   104   virtual bool is_compiled_by_c1() const         { return false; }
   104 
   105 
   105   // Casting
   106   // Casting
   219 //----------------------------------------------------------------------------------------------------
   220 //----------------------------------------------------------------------------------------------------
   220 // BufferBlob: used to hold non-relocatable machine code such as the interpreter, stubroutines, etc.
   221 // BufferBlob: used to hold non-relocatable machine code such as the interpreter, stubroutines, etc.
   221 
   222 
   222 class BufferBlob: public CodeBlob {
   223 class BufferBlob: public CodeBlob {
   223   friend class VMStructs;
   224   friend class VMStructs;
       
   225   friend class AdapterBlob;
       
   226   friend class MethodHandlesAdapterBlob;
       
   227 
   224  private:
   228  private:
   225   // Creation support
   229   // Creation support
   226   BufferBlob(const char* name, int size);
   230   BufferBlob(const char* name, int size);
   227   BufferBlob(const char* name, int size, CodeBuffer* cb);
   231   BufferBlob(const char* name, int size, CodeBuffer* cb);
   228 
   232 
   234   static BufferBlob* create(const char* name, CodeBuffer* cb);
   238   static BufferBlob* create(const char* name, CodeBuffer* cb);
   235 
   239 
   236   static void free(BufferBlob* buf);
   240   static void free(BufferBlob* buf);
   237 
   241 
   238   // Typing
   242   // Typing
   239   bool is_buffer_blob() const                    { return true; }
   243   virtual bool is_buffer_blob() const            { return true; }
   240   bool is_adapter_blob() const;
       
   241 
   244 
   242   // GC/Verification support
   245   // GC/Verification support
   243   void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f)  { /* nothing to do */ }
   246   void preserve_callee_argument_oops(frame fr, const RegisterMap* reg_map, OopClosure* f)  { /* nothing to do */ }
   244   bool is_alive() const                          { return true; }
   247   bool is_alive() const                          { return true; }
   245   void do_unloading(BoolObjectClosure* is_alive,
   248   void do_unloading(BoolObjectClosure* is_alive,
   249   void oops_do(OopClosure* f)                    { /* do nothing*/ }
   252   void oops_do(OopClosure* f)                    { /* do nothing*/ }
   250 
   253 
   251   void verify();
   254   void verify();
   252   void print() const                             PRODUCT_RETURN;
   255   void print() const                             PRODUCT_RETURN;
   253   void print_value_on(outputStream* st) const    PRODUCT_RETURN;
   256   void print_value_on(outputStream* st) const    PRODUCT_RETURN;
       
   257 };
       
   258 
       
   259 
       
   260 //----------------------------------------------------------------------------------------------------
       
   261 // AdapterBlob: used to hold C2I/I2C adapters
       
   262 
       
   263 class AdapterBlob: public BufferBlob {
       
   264 private:
       
   265   AdapterBlob(int size)                 : BufferBlob("I2C/C2I adapters", size) {}
       
   266   AdapterBlob(int size, CodeBuffer* cb) : BufferBlob("I2C/C2I adapters", size, cb) {}
       
   267 
       
   268 public:
       
   269   // Creation
       
   270   static AdapterBlob* create(CodeBuffer* cb);
       
   271 
       
   272   // Typing
       
   273   virtual bool is_adapter_blob() const { return true; }
       
   274 };
       
   275 
       
   276 
       
   277 //----------------------------------------------------------------------------------------------------
       
   278 // MethodHandlesAdapterBlob: used to hold MethodHandles adapters
       
   279 
       
   280 class MethodHandlesAdapterBlob: public BufferBlob {
       
   281 private:
       
   282   MethodHandlesAdapterBlob(int size)                 : BufferBlob("MethodHandles adapters", size) {}
       
   283   MethodHandlesAdapterBlob(int size, CodeBuffer* cb) : BufferBlob("MethodHandles adapters", size, cb) {}
       
   284 
       
   285 public:
       
   286   // Creation
       
   287   static MethodHandlesAdapterBlob* create(int buffer_size);
       
   288 
       
   289   // Typing
       
   290   virtual bool is_method_handles_adapter_blob() const { return true; }
   254 };
   291 };
   255 
   292 
   256 
   293 
   257 //----------------------------------------------------------------------------------------------------
   294 //----------------------------------------------------------------------------------------------------
   258 // RuntimeStub: describes stubs used by compiled code to call a (static) C++ runtime routine
   295 // RuntimeStub: describes stubs used by compiled code to call a (static) C++ runtime routine