< prev index next >

src/hotspot/share/code/stubs.cpp

Print this page
rev 47398 : 8166317: InterpreterCodeSize should be computed
Reviewed-by: kvn, coleenp

@@ -22,10 +22,11 @@
  *
  */
 
 #include "precompiled.hpp"
 #include "code/codeBlob.hpp"
+#include "code/codeCache.hpp"
 #include "code/stubs.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/align.hpp"

@@ -87,10 +88,17 @@
   //       allocated in the constructor (i.e., we need to keep it around or look it
   //       up via CodeCache::find_blob(...).
   Unimplemented();
 }
 
+void StubQueue::deallocate_unused_tail() {
+  CodeBlob* blob = CodeCache::find_blob((void*)_stub_buffer);
+  CodeCache::free_unused_tail(blob, used_space());
+  // Update the limits to the new, trimmed CodeBlob size
+  _buffer_size = blob->content_size();
+  _buffer_limit = blob->content_size();
+}
 
 Stub* StubQueue::stub_containing(address pc) const {
   if (contains(pc)) {
     for (Stub* s = first(); s != NULL; s = next(s)) {
       if (stub_contains(s, pc)) return s;
< prev index next >