mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8205683: Refactor heap allocation to separate concerns
Reviewed-by: pliden, kbarrett
This commit is contained in:
parent
7f3a801cae
commit
e4dbe9909f
22 changed files with 638 additions and 528 deletions
|
@ -38,6 +38,7 @@
|
|||
#include "gc/shared/collectedHeap.inline.hpp"
|
||||
#include "interpreter/bytecode.hpp"
|
||||
#include "jfr/jfrEvents.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "memory/referenceType.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
|
@ -661,9 +662,10 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle))
|
|||
oop new_obj_oop = NULL;
|
||||
if (obj->is_array()) {
|
||||
const int length = ((arrayOop)obj())->length();
|
||||
new_obj_oop = CollectedHeap::array_allocate(klass, size, length, CHECK_NULL);
|
||||
new_obj_oop = Universe::heap()->array_allocate(klass, size, length,
|
||||
/* do_zero */ true, CHECK_NULL);
|
||||
} else {
|
||||
new_obj_oop = CollectedHeap::obj_allocate(klass, size, CHECK_NULL);
|
||||
new_obj_oop = Universe::heap()->obj_allocate(klass, size, CHECK_NULL);
|
||||
}
|
||||
|
||||
HeapAccess<>::clone(obj(), new_obj_oop, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue