src/share/vm/prims/jvmtiImpl.hpp

Print this page
rev 5449 : 8025834: NPE in Parallel Scavenge with -XX:+CheckUnhandledOops

@@ -64,11 +64,10 @@
 
 class GrowableElement : public CHeapObj<mtInternal> {
 public:
   virtual address getCacheValue()          =0;
   virtual bool equals(GrowableElement* e)  =0;
-  virtual bool lessThan(GrowableElement *e)=0;
   virtual GrowableElement *clone()         =0;
   virtual void oops_do(OopClosure* f)      =0;
 };
 
 class GrowableCache VALUE_OBJ_CLASS_SPEC {

@@ -105,12 +104,10 @@
   GrowableElement* at(int index);
   // find the index of the element, -1 if it doesn't exist
   int find(GrowableElement* e);
   // append a copy of the element to the end of the collection, notify listener
   void append(GrowableElement* e);
-  // insert a copy of the element using lessthan(), notify listener
-  void insert(GrowableElement* e);
   // remove the element at index, notify listener
   void remove (int index);
   // clear out all elements and release all heap space, notify listener
   void clear();
   // apply f to every element and update the cache

@@ -166,19 +163,22 @@
 
 class JvmtiBreakpoint : public GrowableElement {
 private:
   Method*               _method;
   int                   _bci;
-  Bytecodes::Code       _orig_bytecode;
   oop                   _class_loader;
+  Handle                _class_loader_handle;
+
+  JvmtiBreakpoint(Method* method, int bci, Handle class_loader_handle) :
+    _method(method),
+    _bci(bci),
+    _class_loader(class_loader_handle()),
+    _class_loader_handle(NULL) {}
 
 public:
-  JvmtiBreakpoint();
   JvmtiBreakpoint(Method* m_method, jlocation location);
   bool equals(JvmtiBreakpoint& bp);
-  bool lessThan(JvmtiBreakpoint &bp);
-  void copy(JvmtiBreakpoint& bp);
   bool is_valid();
   address getBcp();
   void each_method_version_do(method_action meth_act);
   void set();
   void clear();

@@ -186,20 +186,19 @@
 
   Method* method() { return _method; }
 
   // GrowableElement implementation
   address getCacheValue()         { return getBcp(); }
-  bool lessThan(GrowableElement* e) { Unimplemented(); return false; }
   bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); }
   void oops_do(OopClosure* f)     {
     // Mark the method loader as live
     f->do_oop(&_class_loader);
   }
   GrowableElement *clone()        {
-    JvmtiBreakpoint *bp = new JvmtiBreakpoint();
-    bp->copy(*this);
-    return bp;
+    assert(SafepointSynchronize::is_at_safepoint(),
+           "Should only be called during safepoint");
+    return new JvmtiBreakpoint(_method, _bci, _class_loader_handle);
   }
 };
 
 
 ///////////////////////////////////////////////////////////////

@@ -329,11 +328,10 @@
     assert(bp != NULL, "bp != NULL");
   }
 
   VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
   void doit();
-  void oops_do(OopClosure* f);
 };
 
 
 ///////////////////////////////////////////////////////////////
 // The get/set local operations must only be done by the VM thread