< prev index next >

src/hotspot/share/ci/ciObjectFactory.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  *


  57 public:
  58   struct NonPermObject : public ResourceObj {
  59     ciObject*      _object;
  60     NonPermObject* _next;
  61 
  62     inline NonPermObject(NonPermObject* &bucket, oop key, ciObject* object);
  63     ciObject*     object()  { return _object; }
  64     NonPermObject* &next()  { return _next; }
  65   };
  66 private:
  67   enum { NON_PERM_BUCKETS = 61 };
  68   NonPermObject* _non_perm_bucket[NON_PERM_BUCKETS];
  69   int _non_perm_count;
  70 
  71   static int metadata_compare(Metadata* const& key, ciMetadata* const& elt);
  72 
  73   ciObject* create_new_object(oop o);
  74   ciMetadata* create_new_metadata(Metadata* o);
  75 
  76   static bool is_equal(NonPermObject* p, oop key) {
  77     return p->object()->get_oop() == key;
  78   }
  79 
  80   NonPermObject* &find_non_perm(oop key);
  81   void insert_non_perm(NonPermObject* &where, oop key, ciObject* obj);
  82 
  83   void init_ident_of(ciBaseObject* obj);
  84 
  85   Arena* arena() { return _arena; }
  86 
  87   void print_contents_impl();
  88 
  89   ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
  90 
  91 public:
  92   static bool is_initialized() { return _initialized; }
  93 
  94   static void initialize();
  95   void init_shared_objects();
  96   void remove_symbols();
  97 


   1 /*
   2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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  *


  57 public:
  58   struct NonPermObject : public ResourceObj {
  59     ciObject*      _object;
  60     NonPermObject* _next;
  61 
  62     inline NonPermObject(NonPermObject* &bucket, oop key, ciObject* object);
  63     ciObject*     object()  { return _object; }
  64     NonPermObject* &next()  { return _next; }
  65   };
  66 private:
  67   enum { NON_PERM_BUCKETS = 61 };
  68   NonPermObject* _non_perm_bucket[NON_PERM_BUCKETS];
  69   int _non_perm_count;
  70 
  71   static int metadata_compare(Metadata* const& key, ciMetadata* const& elt);
  72 
  73   ciObject* create_new_object(oop o);
  74   ciMetadata* create_new_metadata(Metadata* o);
  75 
  76   static bool is_equal(NonPermObject* p, oop key) {
  77     return oopDesc::equals(p->object()->get_oop(), key);
  78   }
  79 
  80   NonPermObject* &find_non_perm(oop key);
  81   void insert_non_perm(NonPermObject* &where, oop key, ciObject* obj);
  82 
  83   void init_ident_of(ciBaseObject* obj);
  84 
  85   Arena* arena() { return _arena; }
  86 
  87   void print_contents_impl();
  88 
  89   ciInstance* get_unloaded_instance(ciInstanceKlass* klass);
  90 
  91 public:
  92   static bool is_initialized() { return _initialized; }
  93 
  94   static void initialize();
  95   void init_shared_objects();
  96   void remove_symbols();
  97 


< prev index next >