mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
7098528: crash with java -XX:+ExtendedDTraceProbes
Reviewed-by: kvn
This commit is contained in:
parent
7749aaf387
commit
bf203dac41
5 changed files with 49 additions and 15 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "gc_interface/collectedHeap.hpp"
|
||||
#include "gc_interface/collectedHeap.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/instanceMirrorKlass.hpp"
|
||||
#include "runtime/init.hpp"
|
||||
#include "services/heapDumper.hpp"
|
||||
#ifdef TARGET_OS_FAMILY_linux
|
||||
|
@ -436,3 +437,37 @@ void CollectedHeap::post_full_gc_dump() {
|
|||
inspector.doit();
|
||||
}
|
||||
}
|
||||
|
||||
oop CollectedHeap::Class_obj_allocate(KlassHandle klass, int size, KlassHandle real_klass, TRAPS) {
|
||||
debug_only(check_for_valid_allocation_state());
|
||||
assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
|
||||
assert(size >= 0, "int won't convert to size_t");
|
||||
HeapWord* obj;
|
||||
if (JavaObjectsInPerm) {
|
||||
obj = common_permanent_mem_allocate_init(size, CHECK_NULL);
|
||||
} else {
|
||||
assert(ScavengeRootsInCode > 0, "must be");
|
||||
obj = common_mem_allocate_init(size, CHECK_NULL);
|
||||
}
|
||||
post_allocation_setup_common(klass, obj, size);
|
||||
assert(Universe::is_bootstrapping() ||
|
||||
!((oop)obj)->blueprint()->oop_is_array(), "must not be an array");
|
||||
NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size));
|
||||
oop mirror = (oop)obj;
|
||||
|
||||
java_lang_Class::set_oop_size(mirror, size);
|
||||
|
||||
// Setup indirections
|
||||
if (!real_klass.is_null()) {
|
||||
java_lang_Class::set_klass(mirror, real_klass());
|
||||
real_klass->set_java_mirror(mirror);
|
||||
}
|
||||
|
||||
instanceMirrorKlass* mk = instanceMirrorKlass::cast(mirror->klass());
|
||||
assert(size == mk->instance_size(real_klass), "should have been set");
|
||||
|
||||
// notify jvmti and dtrace
|
||||
post_allocation_notify(klass, (oop)obj);
|
||||
|
||||
return mirror;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue