This commit is contained in:
Vladimir Kozlov 2013-06-21 15:56:24 -07:00
commit b390a2d8e3
629 changed files with 30523 additions and 8788 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -45,6 +45,7 @@
#include "runtime/java.hpp"
#include "runtime/mutexLocker.hpp"
#include "services/memoryService.hpp"
#include "trace/tracing.hpp"
#include "utilities/xmlstream.hpp"
// Helper class for printing in CodeCache
@ -114,7 +115,6 @@ class CodeBlob_sizes {
}
};
// CodeCache implementation
CodeHeap * CodeCache::_heap = new CodeHeap();
@ -126,6 +126,7 @@ bool CodeCache::_needs_cache_clean = false;
nmethod* CodeCache::_scavenge_root_nmethods = NULL;
nmethod* CodeCache::_saved_nmethods = NULL;
int CodeCache::_codemem_full_count = 0;
CodeBlob* CodeCache::first() {
assert_locked_or_safepoint(CodeCache_lock);
@ -829,6 +830,22 @@ void CodeCache::verify() {
}
}
void CodeCache::report_codemem_full() {
_codemem_full_count++;
EventCodeCacheFull event;
if (event.should_commit()) {
event.set_startAddress((u8)low_bound());
event.set_commitedTopAddress((u8)high());
event.set_reservedTopAddress((u8)high_bound());
event.set_entryCount(nof_blobs());
event.set_methodCount(nof_nmethods());
event.set_adaptorCount(nof_adapters());
event.set_unallocatedCapacity(unallocated_capacity()/K);
event.set_fullCount(_codemem_full_count);
event.commit();
}
}
//------------------------------------------------------------------------------------------------
// Non-product version

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -64,11 +64,15 @@ class CodeCache : AllStatic {
static void mark_scavenge_root_nmethods() PRODUCT_RETURN;
static void verify_perm_nmethods(CodeBlobClosure* f_or_null) PRODUCT_RETURN;
static int _codemem_full_count;
public:
// Initialization
static void initialize();
static void report_codemem_full();
// Allocation/administration
static CodeBlob* allocate(int size, bool is_critical = false); // allocates a new CodeBlob
static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled
@ -155,6 +159,7 @@ class CodeCache : AllStatic {
// The full limits of the codeCache
static address low_bound() { return (address) _heap->low_boundary(); }
static address high_bound() { return (address) _heap->high_boundary(); }
static address high() { return (address) _heap->high(); }
// Profiling
static address first_address(); // first address used for CodeBlobs
@ -186,6 +191,8 @@ class CodeCache : AllStatic {
// tells how many nmethods have dependencies
static int number_of_nmethods_with_dependencies();
static int get_codemem_full_count() { return _codemem_full_count; }
};
#endif // SHARE_VM_CODE_CODECACHE_HPP

View file

@ -1976,11 +1976,10 @@ void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map
if (!method()->is_native()) {
SimpleScopeDesc ssd(this, fr.pc());
Bytecode_invoke call(ssd.method(), ssd.bci());
// compiled invokedynamic call sites have an implicit receiver at
// resolution time, so make sure it gets GC'ed.
bool has_receiver = !call.is_invokestatic();
bool has_receiver = call.has_receiver();
bool has_appendix = call.has_appendix();
Symbol* signature = call.signature();
fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f);
fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
}
#endif // !SHARK
}