< prev index next >

src/share/vm/oops/valueKlass.hpp

Print this page

        

@@ -67,10 +67,17 @@
   // in Java heap like Java objects.
   virtual int size_helper() const {
     return layout_helper_to_size_helper(layout_helper());
   }
 
+  // allocate_instance() allocates a stand alone value in the Java heap
+  instanceOop allocate_instance(TRAPS);
+  // allocate_buffered_or_heap_instance() tries to allocate a value in the
+  // thread local value buffer, if allocation fails, it allocates it in the
+  // Java heap
+  instanceOop allocate_buffered_or_heap_instance(bool* in_heap, TRAPS);
+
   // minimum number of bytes occupied by nonstatic fields, HeapWord aligned or pow2
   int raw_value_byte_size() const;
 
   int first_field_offset() const;
 

@@ -82,10 +89,31 @@
     oop o = (oop) (data - first_field_offset());
     assert(o->is_oop(false), "Not an oop");
     return o;
   }
 
+   void set_if_bufferable() {
+     bool bufferable;
+     if (contains_oops()) {
+       bufferable = false;
+     } else {
+       int size_in_heap_words = size_helper();
+       int base_offset = instanceOopDesc::base_offset_in_bytes();
+       size_t size_in_bytes = size_in_heap_words * HeapWordSize - base_offset;
+       bufferable = size_in_bytes <= BigValueTypeThreshold;
+     }
+     if (bufferable) {
+       _extra_flags |= _extra_is_bufferable;
+     } else {
+       _extra_flags &= ~_extra_is_bufferable;
+     }
+   }
+
+  bool is_bufferable() const          {
+    return (_extra_flags & _extra_is_bufferable) != 0;
+  }
+
   // Query if h/w provides atomic load/store
   bool is_atomic();
 
   bool flatten_array();
 

@@ -102,12 +130,12 @@
   }
 
   // store the value of this klass contained with src into dst, raw data ptr
   void value_store(void* src, void* dst, size_t raw_byte_size, bool dst_is_heap, bool dst_uninitialized);
 
-
-  oop derive_value_type_copy(Handle src, InstanceKlass* target_klass, TRAPS);
+  oop unbox(Handle src, InstanceKlass* target_klass, TRAPS);
+  oop box(Handle src, InstanceKlass* target_klass, TRAPS);
 
   // GC support...
 
   // oop iterate raw value type data pointer (where oop_addr may not be an oop, but backing/array-element)
   template <bool nv, typename T, class OopClosureType>
< prev index next >