mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
Merge
This commit is contained in:
commit
135f315eaa
315 changed files with 7243 additions and 1475 deletions
|
@ -41,10 +41,10 @@ public class BasicHashtable extends VMObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
Type type = db.lookupType("BasicHashtable");
|
Type type = db.lookupType("BasicHashtable<mtInternal>");
|
||||||
tableSizeField = type.getCIntegerField("_table_size");
|
tableSizeField = type.getCIntegerField("_table_size");
|
||||||
bucketsField = type.getAddressField("_buckets");
|
bucketsField = type.getAddressField("_buckets");
|
||||||
bucketSize = db.lookupType("HashtableBucket").getSize();
|
bucketSize = db.lookupType("HashtableBucket<mtInternal>").getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class BasicHashtableEntry extends VMObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
Type type = db.lookupType("BasicHashtableEntry");
|
Type type = db.lookupType("BasicHashtableEntry<mtInternal>");
|
||||||
hashField = type.getCIntegerField("_hash");
|
hashField = type.getCIntegerField("_hash");
|
||||||
nextField = type.getAddressField("_next");
|
nextField = type.getAddressField("_next");
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class Hashtable extends BasicHashtable {
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
// just to confirm that type exists
|
// just to confirm that type exists
|
||||||
Type type = db.lookupType("Hashtable<intptr_t>");
|
Type type = db.lookupType("IntptrHashtable");
|
||||||
}
|
}
|
||||||
|
|
||||||
// derived class may return Class<? extends HashtableEntry>
|
// derived class may return Class<? extends HashtableEntry>
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class HashtableBucket extends VMObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
Type type = db.lookupType("HashtableBucket");
|
Type type = db.lookupType("HashtableBucket<mtInternal>");
|
||||||
entryField = type.getAddressField("_entry");
|
entryField = type.getAddressField("_entry");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class HashtableEntry extends BasicHashtableEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static synchronized void initialize(TypeDataBase db) {
|
private static synchronized void initialize(TypeDataBase db) {
|
||||||
Type type = db.lookupType("HashtableEntry<intptr_t>");
|
Type type = db.lookupType("IntptrHashtableEntry");
|
||||||
literalField = type.getAddressField("_literal");
|
literalField = type.getAddressField("_literal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
|
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
|
||||||
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
|
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
|
||||||
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
|
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
|
||||||
CFLAGS += $(DEBUG_CFLAGS/BYFILE)
|
|
||||||
|
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
|
||||||
|
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
|
||||||
|
|
||||||
# Set the environment variable HOTSPARC_GENERIC to "true"
|
# Set the environment variable HOTSPARC_GENERIC to "true"
|
||||||
# to inhibit the effect of the previous line on CFLAGS.
|
# to inhibit the effect of the previous line on CFLAGS.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -27,7 +27,9 @@
|
||||||
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
|
# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
|
||||||
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
|
DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
|
||||||
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
|
DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
|
||||||
CFLAGS += $(DEBUG_CFLAGS/BYFILE)
|
|
||||||
|
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
|
||||||
|
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
|
||||||
|
|
||||||
# Set the environment variable HOTSPARC_GENERIC to "true"
|
# Set the environment variable HOTSPARC_GENERIC to "true"
|
||||||
# to inhibit the effect of the previous line on CFLAGS.
|
# to inhibit the effect of the previous line on CFLAGS.
|
||||||
|
|
|
@ -37,7 +37,8 @@ ifeq ($(COMPILER_REV_NUMERIC),508)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += $(DEBUG_CFLAGS/BYFILE)
|
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
|
||||||
|
CFLAGS += $(DEBUG_CFLAGS/BYFILE) -D_NMT_NOINLINE_
|
||||||
|
|
||||||
# Set the environment variable HOTSPARC_GENERIC to "true"
|
# Set the environment variable HOTSPARC_GENERIC to "true"
|
||||||
# to inhibit the effect of the previous line on CFLAGS.
|
# to inhibit the effect of the previous line on CFLAGS.
|
||||||
|
|
|
@ -38,7 +38,8 @@ default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA wb
|
||||||
!include ../local.make
|
!include ../local.make
|
||||||
!include compile.make
|
!include compile.make
|
||||||
|
|
||||||
CXX_FLAGS=$(CXX_FLAGS) $(DEBUG_OPT_OPTION)
|
# _NMT_NOINLINE_ informs NMT that no inlining by Compiler
|
||||||
|
CXX_FLAGS=$(CXX_FLAGS) $(DEBUG_OPT_OPTION) /D "_NMT_NOINLINE_"
|
||||||
|
|
||||||
!include $(WorkSpace)/make/windows/makefiles/vm.make
|
!include $(WorkSpace)/make/windows/makefiles/vm.make
|
||||||
!include local.make
|
!include local.make
|
||||||
|
|
|
@ -440,7 +440,7 @@ void os::init_system_properties_values() {
|
||||||
// code needs to be changed accordingly.
|
// code needs to be changed accordingly.
|
||||||
|
|
||||||
// The next few definitions allow the code to be verbatim:
|
// The next few definitions allow the code to be verbatim:
|
||||||
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
|
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
|
||||||
#define getenv(n) ::getenv(n)
|
#define getenv(n) ::getenv(n)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1913,11 +1913,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
|
||||||
// release the storage
|
// release the storage
|
||||||
for (int i = 0 ; i < n ; i++) {
|
for (int i = 0 ; i < n ; i++) {
|
||||||
if (pelements[i] != NULL) {
|
if (pelements[i] != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, pelements[i]);
|
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pelements != NULL) {
|
if (pelements != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char*, pelements);
|
FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(buffer, buflen, "%s/" JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, pname, fname);
|
snprintf(buffer, buflen, "%s/" JNI_LIB_PREFIX "%s" JNI_LIB_SUFFIX, pname, fname);
|
||||||
|
@ -2766,7 +2766,7 @@ void bsd_wrap_code(char* base, size_t size) {
|
||||||
// All it does is to check if there are enough free pages
|
// All it does is to check if there are enough free pages
|
||||||
// left at the time of mmap(). This could be a potential
|
// left at the time of mmap(). This could be a potential
|
||||||
// problem.
|
// problem.
|
||||||
bool os::commit_memory(char* addr, size_t size, bool exec) {
|
bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
|
||||||
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
|
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
|
||||||
|
@ -2790,7 +2790,7 @@ bool os::commit_memory(char* addr, size_t size, bool exec) {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
|
bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
|
||||||
bool exec) {
|
bool exec) {
|
||||||
#ifndef _ALLBSD_SOURCE
|
#ifndef _ALLBSD_SOURCE
|
||||||
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
||||||
|
@ -2806,7 +2806,7 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
|
||||||
return commit_memory(addr, size, exec);
|
return commit_memory(addr, size, exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
#ifndef _ALLBSD_SOURCE
|
#ifndef _ALLBSD_SOURCE
|
||||||
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
||||||
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
|
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
|
||||||
|
@ -2816,7 +2816,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
::madvise(addr, bytes, MADV_DONTNEED);
|
::madvise(addr, bytes, MADV_DONTNEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2958,7 +2958,7 @@ os::Bsd::numa_interleave_memory_func_t os::Bsd::_numa_interleave_memory;
|
||||||
unsigned long* os::Bsd::_numa_all_nodes;
|
unsigned long* os::Bsd::_numa_all_nodes;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool os::uncommit_memory(char* addr, size_t size) {
|
bool os::pd_uncommit_memory(char* addr, size_t size) {
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
|
// XXX: Work-around mmap/MAP_FIXED bug temporarily on OpenBSD
|
||||||
return ::mprotect(addr, size, PROT_NONE) == 0;
|
return ::mprotect(addr, size, PROT_NONE) == 0;
|
||||||
|
@ -2969,7 +2969,7 @@ bool os::uncommit_memory(char* addr, size_t size) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::create_stack_guard_pages(char* addr, size_t size) {
|
bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||||
return os::commit_memory(addr, size);
|
return os::commit_memory(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3023,12 +3023,12 @@ static int anon_munmap(char * addr, size_t size) {
|
||||||
return ::munmap(addr, size) == 0;
|
return ::munmap(addr, size) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* os::reserve_memory(size_t bytes, char* requested_addr,
|
char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
|
||||||
size_t alignment_hint) {
|
size_t alignment_hint) {
|
||||||
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
|
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory(char* addr, size_t size) {
|
bool os::pd_release_memory(char* addr, size_t size) {
|
||||||
return anon_munmap(addr, size);
|
return anon_munmap(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3331,7 +3331,7 @@ bool os::can_execute_large_page_memory() {
|
||||||
// Reserve memory at an arbitrary address, only if that area is
|
// Reserve memory at an arbitrary address, only if that area is
|
||||||
// available (and not reserved for something else).
|
// available (and not reserved for something else).
|
||||||
|
|
||||||
char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
||||||
const int max_tries = 10;
|
const int max_tries = 10;
|
||||||
char* base[max_tries];
|
char* base[max_tries];
|
||||||
size_t size[max_tries];
|
size_t size[max_tries];
|
||||||
|
@ -4987,7 +4987,7 @@ int os::socket_available(int fd, jint *pbytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map a block of memory.
|
// Map a block of memory.
|
||||||
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
int prot;
|
int prot;
|
||||||
|
@ -5019,7 +5019,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Remap a block of memory.
|
// Remap a block of memory.
|
||||||
char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
// same as map_memory() on this OS
|
// same as map_memory() on this OS
|
||||||
|
@ -5029,7 +5029,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Unmap a block of memory.
|
// Unmap a block of memory.
|
||||||
bool os::unmap_memory(char* addr, size_t bytes) {
|
bool os::pd_unmap_memory(char* addr, size_t bytes) {
|
||||||
return munmap(addr, bytes) == 0;
|
return munmap(addr, bytes) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class PlatformEvent : public CHeapObj {
|
class PlatformEvent : public CHeapObj<mtInternal> {
|
||||||
private:
|
private:
|
||||||
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
||||||
volatile int _Event ;
|
volatile int _Event ;
|
||||||
|
@ -347,7 +347,7 @@ class PlatformEvent : public CHeapObj {
|
||||||
void SetAssociation (Thread * a) { _Assoc = a ; }
|
void SetAssociation (Thread * a) { _Assoc = a ; }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class PlatformParker : public CHeapObj {
|
class PlatformParker : public CHeapObj<mtInternal> {
|
||||||
protected:
|
protected:
|
||||||
pthread_mutex_t _mutex [1] ;
|
pthread_mutex_t _mutex [1] ;
|
||||||
pthread_cond_t _cond [1] ;
|
pthread_cond_t _cond [1] ;
|
||||||
|
|
|
@ -95,7 +95,7 @@ inline bool os::allocate_stack_guard_pages() {
|
||||||
|
|
||||||
|
|
||||||
// On Bsd, reservations are made on a page by page basis, nothing to do.
|
// On Bsd, reservations are made on a page by page basis, nothing to do.
|
||||||
inline void os::split_reserved_memory(char *base, size_t size,
|
inline void os::pd_split_reserved_memory(char *base, size_t size,
|
||||||
size_t split, bool realloc) {
|
size_t split, bool realloc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, destfile);
|
FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ static char* get_user_tmp_dir(const char* user) {
|
||||||
const char* tmpdir = os::get_temp_directory();
|
const char* tmpdir = os::get_temp_directory();
|
||||||
const char* perfdir = PERFDATA_NAME;
|
const char* perfdir = PERFDATA_NAME;
|
||||||
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
||||||
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
// construct the path name to user specific tmp directory
|
// construct the path name to user specific tmp directory
|
||||||
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
||||||
|
@ -246,7 +246,7 @@ static char* get_user_name(uid_t uid) {
|
||||||
if (bufsize == -1)
|
if (bufsize == -1)
|
||||||
bufsize = 1024;
|
bufsize = 1024;
|
||||||
|
|
||||||
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
|
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||||
|
|
||||||
// POSIX interface to getpwuid_r is used on LINUX
|
// POSIX interface to getpwuid_r is used on LINUX
|
||||||
struct passwd* p;
|
struct passwd* p;
|
||||||
|
@ -278,14 +278,14 @@ static char* get_user_name(uid_t uid) {
|
||||||
"pw_name zero length");
|
"pw_name zero length");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
|
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
|
||||||
strcpy(user_name, p->pw_name);
|
strcpy(user_name, p->pw_name);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return user_name;
|
return user_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// to determine the user name for the process id.
|
// to determine the user name for the process id.
|
||||||
//
|
//
|
||||||
struct dirent* dentry;
|
struct dirent* dentry;
|
||||||
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
|
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(tmpdirname) + strlen(dentry->d_name) + 2);
|
strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
|
||||||
strcpy(usrdir_name, tmpdirname);
|
strcpy(usrdir_name, tmpdirname);
|
||||||
strcat(usrdir_name, "/");
|
strcat(usrdir_name, "/");
|
||||||
strcat(usrdir_name, dentry->d_name);
|
strcat(usrdir_name, dentry->d_name);
|
||||||
|
@ -346,7 +346,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
DIR* subdirp = os::opendir(usrdir_name);
|
DIR* subdirp = os::opendir(usrdir_name);
|
||||||
|
|
||||||
if (subdirp == NULL) {
|
if (subdirp == NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,13 +357,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// symlink can be exploited.
|
// symlink can be exploited.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(usrdir_name)) {
|
if (!is_directory_secure(usrdir_name)) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent* udentry;
|
struct dirent* udentry;
|
||||||
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
|
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
char* filename = NEW_C_HEAP_ARRAY(char,
|
char* filename = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(usrdir_name) + strlen(udentry->d_name) + 2);
|
strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
|
||||||
|
|
||||||
strcpy(filename, usrdir_name);
|
strcpy(filename, usrdir_name);
|
||||||
strcat(filename, "/");
|
strcat(filename, "/");
|
||||||
|
@ -381,13 +381,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// don't follow symbolic links for the file
|
// don't follow symbolic links for the file
|
||||||
RESTARTABLE(::lstat(filename, &statbuf), result);
|
RESTARTABLE(::lstat(filename, &statbuf), result);
|
||||||
if (result == OS_ERR) {
|
if (result == OS_ERR) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip over files that are not regular files.
|
// skip over files that are not regular files.
|
||||||
if (!S_ISREG(statbuf.st_mode)) {
|
if (!S_ISREG(statbuf.st_mode)) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,23 +397,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
if (statbuf.st_ctime > oldest_ctime) {
|
if (statbuf.st_ctime > oldest_ctime) {
|
||||||
char* user = strchr(dentry->d_name, '_') + 1;
|
char* user = strchr(dentry->d_name, '_') + 1;
|
||||||
|
|
||||||
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
|
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
|
||||||
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
|
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||||
|
|
||||||
strcpy(oldest_user, user);
|
strcpy(oldest_user, user);
|
||||||
oldest_ctime = statbuf.st_ctime;
|
oldest_ctime = statbuf.st_ctime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, udbuf);
|
FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
}
|
}
|
||||||
os::closedir(tmpdirp);
|
os::closedir(tmpdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, tdbuf);
|
FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
|
||||||
|
|
||||||
return(oldest_user);
|
return(oldest_user);
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
|
||||||
// add 2 for the file separator and a null terminator.
|
// add 2 for the file separator and a null terminator.
|
||||||
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
||||||
|
|
||||||
char* name = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -472,7 +472,7 @@ static void remove_file(const char* path) {
|
||||||
static void remove_file(const char* dirname, const char* filename) {
|
static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
||||||
char* path = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
strcpy(path, dirname);
|
strcpy(path, dirname);
|
||||||
strcat(path, "/");
|
strcat(path, "/");
|
||||||
|
@ -480,7 +480,7 @@ static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
remove_file(path);
|
remove_file(path);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, path);
|
FREE_C_HEAP_ARRAY(char, path, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
// opendir/readdir.
|
// opendir/readdir.
|
||||||
//
|
//
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
|
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
os::closedir(dirp);
|
os::closedir(dirp);
|
||||||
FREE_C_HEAP_ARRAY(char, dbuf);
|
FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the user specific temporary directory. Returns true if
|
// make the user specific temporary directory. Returns true if
|
||||||
|
@ -723,11 +723,11 @@ static char* mmap_create_shared(size_t size) {
|
||||||
|
|
||||||
fd = create_sharedmem_resources(dirname, filename, size);
|
fd = create_sharedmem_resources(dirname, filename, size);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, user_name);
|
FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ static char* mmap_create_shared(size_t size) {
|
||||||
warning("mmap failed - %s\n", strerror(errno));
|
warning("mmap failed - %s\n", strerror(errno));
|
||||||
}
|
}
|
||||||
remove_file(filename);
|
remove_file(filename);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +869,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
// store file, we don't follow them when attaching either.
|
// store file, we don't follow them when attaching either.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(dirname)) {
|
if (!is_directory_secure(dirname)) {
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||||
"Process not found");
|
"Process not found");
|
||||||
}
|
}
|
||||||
|
@ -884,9 +884,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
strcpy(rfilename, filename);
|
strcpy(rfilename, filename);
|
||||||
|
|
||||||
// free the c heap resources that are no longer needed
|
// free the c heap resources that are no longer needed
|
||||||
if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
|
if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
|
|
||||||
// open the shared memory file for the give vmid
|
// open the shared memory file for the give vmid
|
||||||
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
||||||
|
|
|
@ -371,7 +371,7 @@ void os::init_system_properties_values() {
|
||||||
// code needs to be changed accordingly.
|
// code needs to be changed accordingly.
|
||||||
|
|
||||||
// The next few definitions allow the code to be verbatim:
|
// The next few definitions allow the code to be verbatim:
|
||||||
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
|
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
|
||||||
#define getenv(n) ::getenv(n)
|
#define getenv(n) ::getenv(n)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -639,7 +639,7 @@ void os::Linux::libpthread_init() {
|
||||||
|
|
||||||
size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
|
size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
char *str = (char *)malloc(n);
|
char *str = (char *)malloc(n, mtInternal);
|
||||||
confstr(_CS_GNU_LIBC_VERSION, str, n);
|
confstr(_CS_GNU_LIBC_VERSION, str, n);
|
||||||
os::Linux::set_glibc_version(str);
|
os::Linux::set_glibc_version(str);
|
||||||
} else {
|
} else {
|
||||||
|
@ -652,7 +652,7 @@ void os::Linux::libpthread_init() {
|
||||||
|
|
||||||
n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
|
n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
char *str = (char *)malloc(n);
|
char *str = (char *)malloc(n, mtInternal);
|
||||||
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
|
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
|
||||||
// Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells
|
// Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells
|
||||||
// us "NPTL-0.29" even we are running with LinuxThreads. Check if this
|
// us "NPTL-0.29" even we are running with LinuxThreads. Check if this
|
||||||
|
@ -1685,11 +1685,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
|
||||||
// release the storage
|
// release the storage
|
||||||
for (int i = 0 ; i < n ; i++) {
|
for (int i = 0 ; i < n ; i++) {
|
||||||
if (pelements[i] != NULL) {
|
if (pelements[i] != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, pelements[i]);
|
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pelements != NULL) {
|
if (pelements != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char*, pelements);
|
FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
|
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
|
||||||
|
@ -2469,7 +2469,7 @@ void linux_wrap_code(char* base, size_t size) {
|
||||||
// All it does is to check if there are enough free pages
|
// All it does is to check if there are enough free pages
|
||||||
// left at the time of mmap(). This could be a potential
|
// left at the time of mmap(). This could be a potential
|
||||||
// problem.
|
// problem.
|
||||||
bool os::commit_memory(char* addr, size_t size, bool exec) {
|
bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
|
||||||
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
||||||
uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
|
uintptr_t res = (uintptr_t) ::mmap(addr, size, prot,
|
||||||
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
|
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
|
||||||
|
@ -2492,7 +2492,7 @@ bool os::commit_memory(char* addr, size_t size, bool exec) {
|
||||||
#define MADV_HUGEPAGE 14
|
#define MADV_HUGEPAGE 14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
|
bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
|
||||||
bool exec) {
|
bool exec) {
|
||||||
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
||||||
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
||||||
|
@ -2516,7 +2516,7 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
|
||||||
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
|
// We don't check the return value: madvise(MADV_HUGEPAGE) may not
|
||||||
// be supported or the memory may already be backed by huge pages.
|
// be supported or the memory may already be backed by huge pages.
|
||||||
|
@ -2524,7 +2524,7 @@ void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
// This method works by doing an mmap over an existing mmaping and effectively discarding
|
// This method works by doing an mmap over an existing mmaping and effectively discarding
|
||||||
// the existing pages. However it won't work for SHM-based large pages that cannot be
|
// the existing pages. However it won't work for SHM-based large pages that cannot be
|
||||||
// uncommitted at all. We don't do anything in this case to avoid creating a segment with
|
// uncommitted at all. We don't do anything in this case to avoid creating a segment with
|
||||||
|
@ -2646,7 +2646,7 @@ bool os::Linux::libnuma_init() {
|
||||||
if (numa_available() != -1) {
|
if (numa_available() != -1) {
|
||||||
set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
|
set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
|
||||||
// Create a cpu -> node mapping
|
// Create a cpu -> node mapping
|
||||||
_cpu_to_node = new (ResourceObj::C_HEAP) GrowableArray<int>(0, true);
|
_cpu_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(0, true);
|
||||||
rebuild_cpu_to_node_map();
|
rebuild_cpu_to_node_map();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2676,7 +2676,7 @@ void os::Linux::rebuild_cpu_to_node_map() {
|
||||||
cpu_to_node()->at_grow(cpu_num - 1);
|
cpu_to_node()->at_grow(cpu_num - 1);
|
||||||
size_t node_num = numa_get_groups_num();
|
size_t node_num = numa_get_groups_num();
|
||||||
|
|
||||||
unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size);
|
unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal);
|
||||||
for (size_t i = 0; i < node_num; i++) {
|
for (size_t i = 0; i < node_num; i++) {
|
||||||
if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
|
if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
|
||||||
for (size_t j = 0; j < cpu_map_valid_size; j++) {
|
for (size_t j = 0; j < cpu_map_valid_size; j++) {
|
||||||
|
@ -2690,7 +2690,7 @@ void os::Linux::rebuild_cpu_to_node_map() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(unsigned long, cpu_map);
|
FREE_C_HEAP_ARRAY(unsigned long, cpu_map, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
int os::Linux::get_node_by_cpu(int cpu_id) {
|
int os::Linux::get_node_by_cpu(int cpu_id) {
|
||||||
|
@ -2709,7 +2709,7 @@ os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory;
|
||||||
os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
|
os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory;
|
||||||
unsigned long* os::Linux::_numa_all_nodes;
|
unsigned long* os::Linux::_numa_all_nodes;
|
||||||
|
|
||||||
bool os::uncommit_memory(char* addr, size_t size) {
|
bool os::pd_uncommit_memory(char* addr, size_t size) {
|
||||||
uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
|
uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
|
||||||
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
|
MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
|
||||||
return res != (uintptr_t) MAP_FAILED;
|
return res != (uintptr_t) MAP_FAILED;
|
||||||
|
@ -2774,7 +2774,7 @@ bool get_stack_bounds(uintptr_t *bottom, uintptr_t *top) {
|
||||||
// munmap() the guard pages we don't leave a hole in the stack
|
// munmap() the guard pages we don't leave a hole in the stack
|
||||||
// mapping. This only affects the main/initial thread, but guard
|
// mapping. This only affects the main/initial thread, but guard
|
||||||
// against future OS changes
|
// against future OS changes
|
||||||
bool os::create_stack_guard_pages(char* addr, size_t size) {
|
bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||||
uintptr_t stack_extent, stack_base;
|
uintptr_t stack_extent, stack_base;
|
||||||
bool chk_bounds = NOT_DEBUG(os::Linux::is_initial_thread()) DEBUG_ONLY(true);
|
bool chk_bounds = NOT_DEBUG(os::Linux::is_initial_thread()) DEBUG_ONLY(true);
|
||||||
if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) {
|
if (chk_bounds && get_stack_bounds(&stack_extent, &stack_base)) {
|
||||||
|
@ -2847,12 +2847,12 @@ static int anon_munmap(char * addr, size_t size) {
|
||||||
return ::munmap(addr, size) == 0;
|
return ::munmap(addr, size) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* os::reserve_memory(size_t bytes, char* requested_addr,
|
char* os::pd_reserve_memory(size_t bytes, char* requested_addr,
|
||||||
size_t alignment_hint) {
|
size_t alignment_hint) {
|
||||||
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
|
return anon_mmap(requested_addr, bytes, (requested_addr != NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory(char* addr, size_t size) {
|
bool os::pd_release_memory(char* addr, size_t size) {
|
||||||
return anon_munmap(addr, size);
|
return anon_munmap(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3149,7 +3149,7 @@ bool os::can_execute_large_page_memory() {
|
||||||
// Reserve memory at an arbitrary address, only if that area is
|
// Reserve memory at an arbitrary address, only if that area is
|
||||||
// available (and not reserved for something else).
|
// available (and not reserved for something else).
|
||||||
|
|
||||||
char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
||||||
const int max_tries = 10;
|
const int max_tries = 10;
|
||||||
char* base[max_tries];
|
char* base[max_tries];
|
||||||
size_t size[max_tries];
|
size_t size[max_tries];
|
||||||
|
@ -4671,7 +4671,7 @@ int os::socket_available(int fd, jint *pbytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map a block of memory.
|
// Map a block of memory.
|
||||||
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
int prot;
|
int prot;
|
||||||
|
@ -4701,7 +4701,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Remap a block of memory.
|
// Remap a block of memory.
|
||||||
char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
// same as map_memory() on this OS
|
// same as map_memory() on this OS
|
||||||
|
@ -4711,7 +4711,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Unmap a block of memory.
|
// Unmap a block of memory.
|
||||||
bool os::unmap_memory(char* addr, size_t bytes) {
|
bool os::pd_unmap_memory(char* addr, size_t bytes) {
|
||||||
return munmap(addr, bytes) == 0;
|
return munmap(addr, bytes) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class PlatformEvent : public CHeapObj {
|
class PlatformEvent : public CHeapObj<mtInternal> {
|
||||||
private:
|
private:
|
||||||
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
||||||
volatile int _Event ;
|
volatile int _Event ;
|
||||||
|
@ -322,7 +322,7 @@ class PlatformEvent : public CHeapObj {
|
||||||
void SetAssociation (Thread * a) { _Assoc = a ; }
|
void SetAssociation (Thread * a) { _Assoc = a ; }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class PlatformParker : public CHeapObj {
|
class PlatformParker : public CHeapObj<mtInternal> {
|
||||||
protected:
|
protected:
|
||||||
pthread_mutex_t _mutex [1] ;
|
pthread_mutex_t _mutex [1] ;
|
||||||
pthread_cond_t _cond [1] ;
|
pthread_cond_t _cond [1] ;
|
||||||
|
|
|
@ -99,7 +99,7 @@ inline bool os::allocate_stack_guard_pages() {
|
||||||
|
|
||||||
|
|
||||||
// On Linux, reservations are made on a page by page basis, nothing to do.
|
// On Linux, reservations are made on a page by page basis, nothing to do.
|
||||||
inline void os::split_reserved_memory(char *base, size_t size,
|
inline void os::pd_split_reserved_memory(char *base, size_t size,
|
||||||
size_t split, bool realloc) {
|
size_t split, bool realloc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, destfile);
|
FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ static char* get_user_tmp_dir(const char* user) {
|
||||||
const char* tmpdir = os::get_temp_directory();
|
const char* tmpdir = os::get_temp_directory();
|
||||||
const char* perfdir = PERFDATA_NAME;
|
const char* perfdir = PERFDATA_NAME;
|
||||||
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
||||||
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
// construct the path name to user specific tmp directory
|
// construct the path name to user specific tmp directory
|
||||||
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
||||||
|
@ -246,7 +246,7 @@ static char* get_user_name(uid_t uid) {
|
||||||
if (bufsize == -1)
|
if (bufsize == -1)
|
||||||
bufsize = 1024;
|
bufsize = 1024;
|
||||||
|
|
||||||
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
|
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||||
|
|
||||||
// POSIX interface to getpwuid_r is used on LINUX
|
// POSIX interface to getpwuid_r is used on LINUX
|
||||||
struct passwd* p;
|
struct passwd* p;
|
||||||
|
@ -278,14 +278,14 @@ static char* get_user_name(uid_t uid) {
|
||||||
"pw_name zero length");
|
"pw_name zero length");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
|
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
|
||||||
strcpy(user_name, p->pw_name);
|
strcpy(user_name, p->pw_name);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return user_name;
|
return user_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// to determine the user name for the process id.
|
// to determine the user name for the process id.
|
||||||
//
|
//
|
||||||
struct dirent* dentry;
|
struct dirent* dentry;
|
||||||
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
|
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(tmpdirname) + strlen(dentry->d_name) + 2);
|
strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
|
||||||
strcpy(usrdir_name, tmpdirname);
|
strcpy(usrdir_name, tmpdirname);
|
||||||
strcat(usrdir_name, "/");
|
strcat(usrdir_name, "/");
|
||||||
strcat(usrdir_name, dentry->d_name);
|
strcat(usrdir_name, dentry->d_name);
|
||||||
|
@ -346,7 +346,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
DIR* subdirp = os::opendir(usrdir_name);
|
DIR* subdirp = os::opendir(usrdir_name);
|
||||||
|
|
||||||
if (subdirp == NULL) {
|
if (subdirp == NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,13 +357,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// symlink can be exploited.
|
// symlink can be exploited.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(usrdir_name)) {
|
if (!is_directory_secure(usrdir_name)) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent* udentry;
|
struct dirent* udentry;
|
||||||
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
|
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
char* filename = NEW_C_HEAP_ARRAY(char,
|
char* filename = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(usrdir_name) + strlen(udentry->d_name) + 2);
|
strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
|
||||||
|
|
||||||
strcpy(filename, usrdir_name);
|
strcpy(filename, usrdir_name);
|
||||||
strcat(filename, "/");
|
strcat(filename, "/");
|
||||||
|
@ -381,13 +381,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// don't follow symbolic links for the file
|
// don't follow symbolic links for the file
|
||||||
RESTARTABLE(::lstat(filename, &statbuf), result);
|
RESTARTABLE(::lstat(filename, &statbuf), result);
|
||||||
if (result == OS_ERR) {
|
if (result == OS_ERR) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip over files that are not regular files.
|
// skip over files that are not regular files.
|
||||||
if (!S_ISREG(statbuf.st_mode)) {
|
if (!S_ISREG(statbuf.st_mode)) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,23 +397,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
if (statbuf.st_ctime > oldest_ctime) {
|
if (statbuf.st_ctime > oldest_ctime) {
|
||||||
char* user = strchr(dentry->d_name, '_') + 1;
|
char* user = strchr(dentry->d_name, '_') + 1;
|
||||||
|
|
||||||
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
|
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
|
||||||
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
|
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||||
|
|
||||||
strcpy(oldest_user, user);
|
strcpy(oldest_user, user);
|
||||||
oldest_ctime = statbuf.st_ctime;
|
oldest_ctime = statbuf.st_ctime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, udbuf);
|
FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
}
|
}
|
||||||
os::closedir(tmpdirp);
|
os::closedir(tmpdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, tdbuf);
|
FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
|
||||||
|
|
||||||
return(oldest_user);
|
return(oldest_user);
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
|
||||||
// add 2 for the file separator and a null terminator.
|
// add 2 for the file separator and a null terminator.
|
||||||
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
||||||
|
|
||||||
char* name = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -472,7 +472,7 @@ static void remove_file(const char* path) {
|
||||||
static void remove_file(const char* dirname, const char* filename) {
|
static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
||||||
char* path = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
strcpy(path, dirname);
|
strcpy(path, dirname);
|
||||||
strcat(path, "/");
|
strcat(path, "/");
|
||||||
|
@ -480,7 +480,7 @@ static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
remove_file(path);
|
remove_file(path);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, path);
|
FREE_C_HEAP_ARRAY(char, path, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
// opendir/readdir.
|
// opendir/readdir.
|
||||||
//
|
//
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
|
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
os::closedir(dirp);
|
os::closedir(dirp);
|
||||||
FREE_C_HEAP_ARRAY(char, dbuf);
|
FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the user specific temporary directory. Returns true if
|
// make the user specific temporary directory. Returns true if
|
||||||
|
@ -723,11 +723,11 @@ static char* mmap_create_shared(size_t size) {
|
||||||
|
|
||||||
fd = create_sharedmem_resources(dirname, filename, size);
|
fd = create_sharedmem_resources(dirname, filename, size);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, user_name);
|
FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ static char* mmap_create_shared(size_t size) {
|
||||||
warning("mmap failed - %s\n", strerror(errno));
|
warning("mmap failed - %s\n", strerror(errno));
|
||||||
}
|
}
|
||||||
remove_file(filename);
|
remove_file(filename);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +869,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
// store file, we don't follow them when attaching either.
|
// store file, we don't follow them when attaching either.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(dirname)) {
|
if (!is_directory_secure(dirname)) {
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||||
"Process not found");
|
"Process not found");
|
||||||
}
|
}
|
||||||
|
@ -884,9 +884,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
strcpy(rfilename, filename);
|
strcpy(rfilename, filename);
|
||||||
|
|
||||||
// free the c heap resources that are no longer needed
|
// free the c heap resources that are no longer needed
|
||||||
if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
|
if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
|
|
||||||
// open the shared memory file for the give vmid
|
// open the shared memory file for the give vmid
|
||||||
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prims/jvm.h"
|
#include "prims/jvm.h"
|
||||||
|
#include "runtime/frame.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "utilities/vmError.hpp"
|
#include "utilities/vmError.hpp"
|
||||||
|
|
||||||
|
@ -61,6 +62,23 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char*
|
||||||
VMError::report_coredump_status(buffer, success);
|
VMError::report_coredump_status(buffer, success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
address os::get_caller_pc(int n) {
|
||||||
|
#ifdef _NMT_NOINLINE_
|
||||||
|
n ++;
|
||||||
|
#endif
|
||||||
|
frame fr = os::current_frame();
|
||||||
|
while (n > 0 && fr.pc() &&
|
||||||
|
!os::is_first_C_frame(&fr) && fr.sender_pc()) {
|
||||||
|
fr = os::get_sender_for_C_frame(&fr);
|
||||||
|
n --;
|
||||||
|
}
|
||||||
|
if (n == 0) {
|
||||||
|
return fr.pc();
|
||||||
|
} else {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int os::get_last_error() {
|
int os::get_last_error() {
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
provider hs_private {
|
provider hs_private {
|
||||||
probe hashtable__new_entry(void*, uintptr_t, void*);
|
|
||||||
probe safepoint__begin();
|
probe safepoint__begin();
|
||||||
probe safepoint__end();
|
probe safepoint__end();
|
||||||
probe cms__initmark__begin();
|
probe cms__initmark__begin();
|
||||||
|
|
|
@ -546,7 +546,7 @@ static bool find_processors_in_pset(psetid_t pset,
|
||||||
// Find the number of processors in the processor set.
|
// Find the number of processors in the processor set.
|
||||||
if (pset_info(pset, NULL, id_length, NULL) == 0) {
|
if (pset_info(pset, NULL, id_length, NULL) == 0) {
|
||||||
// Make up an array to hold their ids.
|
// Make up an array to hold their ids.
|
||||||
*id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length);
|
*id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length, mtInternal);
|
||||||
// Fill in the array with their processor ids.
|
// Fill in the array with their processor ids.
|
||||||
if (pset_info(pset, NULL, id_length, *id_array) == 0) {
|
if (pset_info(pset, NULL, id_length, *id_array) == 0) {
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -577,7 +577,7 @@ static bool find_processors_online(processorid_t** id_array,
|
||||||
// Find the number of processors online.
|
// Find the number of processors online.
|
||||||
*id_length = sysconf(_SC_NPROCESSORS_ONLN);
|
*id_length = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
// Make up an array to hold their ids.
|
// Make up an array to hold their ids.
|
||||||
*id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length);
|
*id_array = NEW_C_HEAP_ARRAY(processorid_t, *id_length, mtInternal);
|
||||||
// Processors need not be numbered consecutively.
|
// Processors need not be numbered consecutively.
|
||||||
long found = 0;
|
long found = 0;
|
||||||
processorid_t next = 0;
|
processorid_t next = 0;
|
||||||
|
@ -629,7 +629,7 @@ static bool assign_distribution(processorid_t* id_array,
|
||||||
// The next id, to limit loops.
|
// The next id, to limit loops.
|
||||||
const processorid_t limit_id = max_id + 1;
|
const processorid_t limit_id = max_id + 1;
|
||||||
// Make up markers for available processors.
|
// Make up markers for available processors.
|
||||||
bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id);
|
bool* available_id = NEW_C_HEAP_ARRAY(bool, limit_id, mtInternal);
|
||||||
for (uint c = 0; c < limit_id; c += 1) {
|
for (uint c = 0; c < limit_id; c += 1) {
|
||||||
available_id[c] = false;
|
available_id[c] = false;
|
||||||
}
|
}
|
||||||
|
@ -666,7 +666,7 @@ static bool assign_distribution(processorid_t* id_array,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (available_id != NULL) {
|
if (available_id != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(bool, available_id);
|
FREE_C_HEAP_ARRAY(bool, available_id, mtInternal);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,7 @@ bool os::distribute_processes(uint length, uint* distribution) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (id_array != NULL) {
|
if (id_array != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(processorid_t, id_array);
|
FREE_C_HEAP_ARRAY(processorid_t, id_array, mtInternal);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -771,8 +771,8 @@ void os::init_system_properties_values() {
|
||||||
// code needs to be changed accordingly.
|
// code needs to be changed accordingly.
|
||||||
|
|
||||||
// The next few definitions allow the code to be verbatim:
|
// The next few definitions allow the code to be verbatim:
|
||||||
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n))
|
#define malloc(n) (char*)NEW_C_HEAP_ARRAY(char, (n), mtInternal)
|
||||||
#define free(p) FREE_C_HEAP_ARRAY(char, p)
|
#define free(p) FREE_C_HEAP_ARRAY(char, p, mtInternal)
|
||||||
#define getenv(n) ::getenv(n)
|
#define getenv(n) ::getenv(n)
|
||||||
|
|
||||||
#define EXTENSIONS_DIR "/lib/ext"
|
#define EXTENSIONS_DIR "/lib/ext"
|
||||||
|
@ -1927,11 +1927,11 @@ void os::dll_build_name(char* buffer, size_t buflen,
|
||||||
// release the storage
|
// release the storage
|
||||||
for (int i = 0 ; i < n ; i++) {
|
for (int i = 0 ; i < n ; i++) {
|
||||||
if (pelements[i] != NULL) {
|
if (pelements[i] != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, pelements[i]);
|
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pelements != NULL) {
|
if (pelements != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char*, pelements);
|
FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
|
snprintf(buffer, buflen, "%s/lib%s.so", pname, fname);
|
||||||
|
@ -2662,17 +2662,17 @@ void os::Solaris::init_signal_mem() {
|
||||||
|
|
||||||
// pending_signals has one int per signal
|
// pending_signals has one int per signal
|
||||||
// The additional signal is for SIGEXIT - exit signal to signal_thread
|
// The additional signal is for SIGEXIT - exit signal to signal_thread
|
||||||
pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1));
|
pending_signals = (jint *)os::malloc(sizeof(jint) * (Sigexit+1), mtInternal);
|
||||||
memset(pending_signals, 0, (sizeof(jint) * (Sigexit+1)));
|
memset(pending_signals, 0, (sizeof(jint) * (Sigexit+1)));
|
||||||
|
|
||||||
if (UseSignalChaining) {
|
if (UseSignalChaining) {
|
||||||
chainedsigactions = (struct sigaction *)malloc(sizeof(struct sigaction)
|
chainedsigactions = (struct sigaction *)malloc(sizeof(struct sigaction)
|
||||||
* (Maxsignum + 1));
|
* (Maxsignum + 1), mtInternal);
|
||||||
memset(chainedsigactions, 0, (sizeof(struct sigaction) * (Maxsignum + 1)));
|
memset(chainedsigactions, 0, (sizeof(struct sigaction) * (Maxsignum + 1)));
|
||||||
preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1));
|
preinstalled_sigs = (int *)os::malloc(sizeof(int) * (Maxsignum + 1), mtInternal);
|
||||||
memset(preinstalled_sigs, 0, (sizeof(int) * (Maxsignum + 1)));
|
memset(preinstalled_sigs, 0, (sizeof(int) * (Maxsignum + 1)));
|
||||||
}
|
}
|
||||||
ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1 ));
|
ourSigFlags = (int*)malloc(sizeof(int) * (Maxsignum + 1 ), mtInternal);
|
||||||
memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1));
|
memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2760,7 +2760,7 @@ int os::vm_allocation_granularity() {
|
||||||
return page_size;
|
return page_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t bytes, bool exec) {
|
bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) {
|
||||||
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
|
||||||
size_t size = bytes;
|
size_t size = bytes;
|
||||||
char *res = Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot);
|
char *res = Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot);
|
||||||
|
@ -2773,7 +2773,7 @@ bool os::commit_memory(char* addr, size_t bytes, bool exec) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
|
bool os::pd_commit_memory(char* addr, size_t bytes, size_t alignment_hint,
|
||||||
bool exec) {
|
bool exec) {
|
||||||
if (commit_memory(addr, bytes, exec)) {
|
if (commit_memory(addr, bytes, exec)) {
|
||||||
if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
|
if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
|
||||||
|
@ -2803,14 +2803,14 @@ bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncommit the pages in a specified region.
|
// Uncommit the pages in a specified region.
|
||||||
void os::free_memory(char* addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) {
|
||||||
if (madvise(addr, bytes, MADV_FREE) < 0) {
|
if (madvise(addr, bytes, MADV_FREE) < 0) {
|
||||||
debug_only(warning("MADV_FREE failed."));
|
debug_only(warning("MADV_FREE failed."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::create_stack_guard_pages(char* addr, size_t size) {
|
bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||||
return os::commit_memory(addr, size);
|
return os::commit_memory(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2819,7 +2819,7 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change the page size in a given range.
|
// Change the page size in a given range.
|
||||||
void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
|
||||||
assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
|
assert((intptr_t)addr % alignment_hint == 0, "Address should be aligned.");
|
||||||
assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
|
assert((intptr_t)(addr + bytes) % alignment_hint == 0, "End should be aligned.");
|
||||||
if (UseLargePages && UseMPSS) {
|
if (UseLargePages && UseMPSS) {
|
||||||
|
@ -3006,7 +3006,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::uncommit_memory(char* addr, size_t bytes) {
|
bool os::pd_uncommit_memory(char* addr, size_t bytes) {
|
||||||
size_t size = bytes;
|
size_t size = bytes;
|
||||||
// Map uncommitted pages PROT_NONE so we fail early if we touch an
|
// Map uncommitted pages PROT_NONE so we fail early if we touch an
|
||||||
// uncommitted page. Otherwise, the read/write might succeed if we
|
// uncommitted page. Otherwise, the read/write might succeed if we
|
||||||
|
@ -3045,7 +3045,7 @@ char* os::Solaris::anon_mmap(char* requested_addr, size_t bytes, size_t alignmen
|
||||||
return mmap_chunk(addr, bytes, flags, PROT_NONE);
|
return mmap_chunk(addr, bytes, flags, PROT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* os::reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) {
|
char* os::pd_reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hint) {
|
||||||
char* addr = Solaris::anon_mmap(requested_addr, bytes, alignment_hint, (requested_addr != NULL));
|
char* addr = Solaris::anon_mmap(requested_addr, bytes, alignment_hint, (requested_addr != NULL));
|
||||||
|
|
||||||
guarantee(requested_addr == NULL || requested_addr == addr,
|
guarantee(requested_addr == NULL || requested_addr == addr,
|
||||||
|
@ -3056,7 +3056,7 @@ char* os::reserve_memory(size_t bytes, char* requested_addr, size_t alignment_hi
|
||||||
// Reserve memory at an arbitrary address, only if that area is
|
// Reserve memory at an arbitrary address, only if that area is
|
||||||
// available (and not reserved for something else).
|
// available (and not reserved for something else).
|
||||||
|
|
||||||
char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
||||||
const int max_tries = 10;
|
const int max_tries = 10;
|
||||||
char* base[max_tries];
|
char* base[max_tries];
|
||||||
size_t size[max_tries];
|
size_t size[max_tries];
|
||||||
|
@ -3178,7 +3178,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
||||||
return (i < max_tries) ? requested_addr : NULL;
|
return (i < max_tries) ? requested_addr : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory(char* addr, size_t bytes) {
|
bool os::pd_release_memory(char* addr, size_t bytes) {
|
||||||
size_t size = bytes;
|
size_t size = bytes;
|
||||||
return munmap(addr, size) == 0;
|
return munmap(addr, size) == 0;
|
||||||
}
|
}
|
||||||
|
@ -4792,7 +4792,7 @@ bool isT2_libthread() {
|
||||||
lwpSize = 16*1024;
|
lwpSize = 16*1024;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
::lseek64 (lwpFile, 0, SEEK_SET);
|
::lseek64 (lwpFile, 0, SEEK_SET);
|
||||||
lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize);
|
lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize, mtInternal);
|
||||||
if (::read(lwpFile, lwpArray, lwpSize) < 0) {
|
if (::read(lwpFile, lwpArray, lwpSize) < 0) {
|
||||||
if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
|
if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
|
||||||
break;
|
break;
|
||||||
|
@ -4810,10 +4810,10 @@ bool isT2_libthread() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lwpSize = lwpArray->pr_nent * lwpArray->pr_entsize;
|
lwpSize = lwpArray->pr_nent * lwpArray->pr_entsize;
|
||||||
FREE_C_HEAP_ARRAY(char, lwpArray); // retry.
|
FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal); // retry.
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, lwpArray);
|
FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal);
|
||||||
::close (lwpFile);
|
::close (lwpFile);
|
||||||
if (ThreadPriorityVerbose) {
|
if (ThreadPriorityVerbose) {
|
||||||
if (isT2) tty->print_cr("We are running with a T2 libthread\n");
|
if (isT2) tty->print_cr("We are running with a T2 libthread\n");
|
||||||
|
@ -5137,9 +5137,9 @@ jint os::init_2(void) {
|
||||||
UseNUMA = false;
|
UseNUMA = false;
|
||||||
} else {
|
} else {
|
||||||
size_t lgrp_limit = os::numa_get_groups_num();
|
size_t lgrp_limit = os::numa_get_groups_num();
|
||||||
int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit);
|
int *lgrp_ids = NEW_C_HEAP_ARRAY(int, lgrp_limit, mtInternal);
|
||||||
size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
|
size_t lgrp_num = os::numa_get_leaf_groups(lgrp_ids, lgrp_limit);
|
||||||
FREE_C_HEAP_ARRAY(int, lgrp_ids);
|
FREE_C_HEAP_ARRAY(int, lgrp_ids, mtInternal);
|
||||||
if (lgrp_num < 2) {
|
if (lgrp_num < 2) {
|
||||||
// There's only one locality group, disable NUMA.
|
// There's only one locality group, disable NUMA.
|
||||||
UseNUMA = false;
|
UseNUMA = false;
|
||||||
|
@ -5485,7 +5485,7 @@ int os::available(int fd, jlong *bytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map a block of memory.
|
// Map a block of memory.
|
||||||
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
int prot;
|
int prot;
|
||||||
|
@ -5517,7 +5517,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Remap a block of memory.
|
// Remap a block of memory.
|
||||||
char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
// same as map_memory() on this OS
|
// same as map_memory() on this OS
|
||||||
|
@ -5527,7 +5527,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Unmap a block of memory.
|
// Unmap a block of memory.
|
||||||
bool os::unmap_memory(char* addr, size_t bytes) {
|
bool os::pd_unmap_memory(char* addr, size_t bytes) {
|
||||||
return munmap(addr, bytes) == 0;
|
return munmap(addr, bytes) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ class Solaris {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlatformEvent : public CHeapObj {
|
class PlatformEvent : public CHeapObj<mtInternal> {
|
||||||
private:
|
private:
|
||||||
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
|
||||||
volatile int _Event ;
|
volatile int _Event ;
|
||||||
|
@ -383,7 +383,7 @@ class PlatformEvent : public CHeapObj {
|
||||||
void unpark () ;
|
void unpark () ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class PlatformParker : public CHeapObj {
|
class PlatformParker : public CHeapObj<mtInternal> {
|
||||||
protected:
|
protected:
|
||||||
mutex_t _mutex [1] ;
|
mutex_t _mutex [1] ;
|
||||||
cond_t _cond [1] ;
|
cond_t _cond [1] ;
|
||||||
|
|
|
@ -71,7 +71,7 @@ inline bool os::allocate_stack_guard_pages() {
|
||||||
|
|
||||||
|
|
||||||
// On Solaris, reservations are made on a page by page basis, nothing to do.
|
// On Solaris, reservations are made on a page by page basis, nothing to do.
|
||||||
inline void os::split_reserved_memory(char *base, size_t size,
|
inline void os::pd_split_reserved_memory(char *base, size_t size,
|
||||||
size_t split, bool realloc) {
|
size_t split, bool realloc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, destfile);
|
FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ static char* get_user_tmp_dir(const char* user) {
|
||||||
const char* tmpdir = os::get_temp_directory();
|
const char* tmpdir = os::get_temp_directory();
|
||||||
const char* perfdir = PERFDATA_NAME;
|
const char* perfdir = PERFDATA_NAME;
|
||||||
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
||||||
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
// construct the path name to user specific tmp directory
|
// construct the path name to user specific tmp directory
|
||||||
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
|
||||||
|
@ -248,7 +248,7 @@ static char* get_user_name(uid_t uid) {
|
||||||
if (bufsize == -1)
|
if (bufsize == -1)
|
||||||
bufsize = 1024;
|
bufsize = 1024;
|
||||||
|
|
||||||
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize);
|
char* pwbuf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
struct passwd* p = NULL;
|
struct passwd* p = NULL;
|
||||||
|
@ -269,14 +269,14 @@ static char* get_user_name(uid_t uid) {
|
||||||
"pw_name zero length");
|
"pw_name zero length");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1);
|
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(p->pw_name) + 1, mtInternal);
|
||||||
strcpy(user_name, p->pw_name);
|
strcpy(user_name, p->pw_name);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, pwbuf);
|
FREE_C_HEAP_ARRAY(char, pwbuf, mtInternal);
|
||||||
return user_name;
|
return user_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// to determine the user name for the process id.
|
// to determine the user name for the process id.
|
||||||
//
|
//
|
||||||
struct dirent* dentry;
|
struct dirent* dentry;
|
||||||
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
|
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(tmpdirname) + strlen(dentry->d_name) + 2);
|
strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
|
||||||
strcpy(usrdir_name, tmpdirname);
|
strcpy(usrdir_name, tmpdirname);
|
||||||
strcat(usrdir_name, "/");
|
strcat(usrdir_name, "/");
|
||||||
strcat(usrdir_name, dentry->d_name);
|
strcat(usrdir_name, dentry->d_name);
|
||||||
|
@ -337,7 +337,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
DIR* subdirp = os::opendir(usrdir_name);
|
DIR* subdirp = os::opendir(usrdir_name);
|
||||||
|
|
||||||
if (subdirp == NULL) {
|
if (subdirp == NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,13 +348,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// symlink can be exploited.
|
// symlink can be exploited.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(usrdir_name)) {
|
if (!is_directory_secure(usrdir_name)) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent* udentry;
|
struct dirent* udentry;
|
||||||
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
|
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
char* filename = NEW_C_HEAP_ARRAY(char,
|
char* filename = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(usrdir_name) + strlen(udentry->d_name) + 2);
|
strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
|
||||||
|
|
||||||
strcpy(filename, usrdir_name);
|
strcpy(filename, usrdir_name);
|
||||||
strcat(filename, "/");
|
strcat(filename, "/");
|
||||||
|
@ -372,13 +372,13 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
// don't follow symbolic links for the file
|
// don't follow symbolic links for the file
|
||||||
RESTARTABLE(::lstat(filename, &statbuf), result);
|
RESTARTABLE(::lstat(filename, &statbuf), result);
|
||||||
if (result == OS_ERR) {
|
if (result == OS_ERR) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip over files that are not regular files.
|
// skip over files that are not regular files.
|
||||||
if (!S_ISREG(statbuf.st_mode)) {
|
if (!S_ISREG(statbuf.st_mode)) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,23 +388,23 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
||||||
if (statbuf.st_ctime > oldest_ctime) {
|
if (statbuf.st_ctime > oldest_ctime) {
|
||||||
char* user = strchr(dentry->d_name, '_') + 1;
|
char* user = strchr(dentry->d_name, '_') + 1;
|
||||||
|
|
||||||
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user);
|
if (oldest_user != NULL) FREE_C_HEAP_ARRAY(char, oldest_user, mtInternal);
|
||||||
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
|
oldest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||||
|
|
||||||
strcpy(oldest_user, user);
|
strcpy(oldest_user, user);
|
||||||
oldest_ctime = statbuf.st_ctime;
|
oldest_ctime = statbuf.st_ctime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, udbuf);
|
FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
}
|
}
|
||||||
os::closedir(tmpdirp);
|
os::closedir(tmpdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, tdbuf);
|
FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
|
||||||
|
|
||||||
return(oldest_user);
|
return(oldest_user);
|
||||||
}
|
}
|
||||||
|
@ -471,7 +471,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
|
||||||
// add 2 for the file separator and a NULL terminator.
|
// add 2 for the file separator and a NULL terminator.
|
||||||
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
||||||
|
|
||||||
char* name = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
snprintf(name, nbytes, "%s/%d", dirname, vmid);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -509,7 +509,7 @@ static void remove_file(const char* path) {
|
||||||
static void remove_file(const char* dirname, const char* filename) {
|
static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
||||||
char* path = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
strcpy(path, dirname);
|
strcpy(path, dirname);
|
||||||
strcat(path, "/");
|
strcat(path, "/");
|
||||||
|
@ -517,7 +517,7 @@ static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
remove_file(path);
|
remove_file(path);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, path);
|
FREE_C_HEAP_ARRAY(char, path, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -554,7 +554,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
// opendir/readdir.
|
// opendir/readdir.
|
||||||
//
|
//
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
|
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -593,7 +593,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
os::closedir(dirp);
|
os::closedir(dirp);
|
||||||
FREE_C_HEAP_ARRAY(char, dbuf);
|
FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the user specific temporary directory. Returns true if
|
// make the user specific temporary directory. Returns true if
|
||||||
|
@ -738,11 +738,11 @@ static char* mmap_create_shared(size_t size) {
|
||||||
|
|
||||||
fd = create_sharedmem_resources(dirname, filename, size);
|
fd = create_sharedmem_resources(dirname, filename, size);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, user_name);
|
FREE_C_HEAP_ARRAY(char, user_name, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ static char* mmap_create_shared(size_t size) {
|
||||||
warning("mmap failed - %s\n", strerror(errno));
|
warning("mmap failed - %s\n", strerror(errno));
|
||||||
}
|
}
|
||||||
remove_file(filename);
|
remove_file(filename);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -884,7 +884,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
// store file, we don't follow them when attaching either.
|
// store file, we don't follow them when attaching either.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(dirname)) {
|
if (!is_directory_secure(dirname)) {
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||||
"Process not found");
|
"Process not found");
|
||||||
}
|
}
|
||||||
|
@ -899,9 +899,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
|
||||||
strcpy(rfilename, filename);
|
strcpy(rfilename, filename);
|
||||||
|
|
||||||
// free the c heap resources that are no longer needed
|
// free the c heap resources that are no longer needed
|
||||||
if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
|
if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
|
|
||||||
// open the shared memory file for the give vmid
|
// open the shared memory file for the give vmid
|
||||||
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
fd = open_sharedmem_file(rfilename, file_flags, CHECK);
|
||||||
|
|
|
@ -96,7 +96,6 @@
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <process.h> // For _beginthreadex(), _endthreadex()
|
#include <process.h> // For _beginthreadex(), _endthreadex()
|
||||||
#include <imagehlp.h> // For os::dll_address_to_function_name
|
#include <imagehlp.h> // For os::dll_address_to_function_name
|
||||||
|
|
||||||
/* for enumerating dll libraries */
|
/* for enumerating dll libraries */
|
||||||
#include <vdmdbg.h>
|
#include <vdmdbg.h>
|
||||||
|
|
||||||
|
@ -214,13 +213,13 @@ void os::init_system_properties_values() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1);
|
home_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + 1, mtInternal);
|
||||||
if (home_path == NULL)
|
if (home_path == NULL)
|
||||||
return;
|
return;
|
||||||
strcpy(home_path, home_dir);
|
strcpy(home_path, home_dir);
|
||||||
Arguments::set_java_home(home_path);
|
Arguments::set_java_home(home_path);
|
||||||
|
|
||||||
dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1);
|
dll_path = NEW_C_HEAP_ARRAY(char, strlen(home_dir) + strlen(bin) + 1, mtInternal);
|
||||||
if (dll_path == NULL)
|
if (dll_path == NULL)
|
||||||
return;
|
return;
|
||||||
strcpy(dll_path, home_dir);
|
strcpy(dll_path, home_dir);
|
||||||
|
@ -251,7 +250,7 @@ void os::init_system_properties_values() {
|
||||||
char *path_str = ::getenv("PATH");
|
char *path_str = ::getenv("PATH");
|
||||||
|
|
||||||
library_path = NEW_C_HEAP_ARRAY(char, MAX_PATH * 5 + sizeof(PACKAGE_DIR) +
|
library_path = NEW_C_HEAP_ARRAY(char, MAX_PATH * 5 + sizeof(PACKAGE_DIR) +
|
||||||
sizeof(BIN_DIR) + (path_str ? strlen(path_str) : 0) + 10);
|
sizeof(BIN_DIR) + (path_str ? strlen(path_str) : 0) + 10, mtInternal);
|
||||||
|
|
||||||
library_path[0] = '\0';
|
library_path[0] = '\0';
|
||||||
|
|
||||||
|
@ -280,7 +279,7 @@ void os::init_system_properties_values() {
|
||||||
strcat(library_path, ";.");
|
strcat(library_path, ";.");
|
||||||
|
|
||||||
Arguments::set_library_path(library_path);
|
Arguments::set_library_path(library_path);
|
||||||
FREE_C_HEAP_ARRAY(char, library_path);
|
FREE_C_HEAP_ARRAY(char, library_path, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default extensions directory */
|
/* Default extensions directory */
|
||||||
|
@ -300,7 +299,7 @@ void os::init_system_properties_values() {
|
||||||
{
|
{
|
||||||
#define ENDORSED_DIR "\\lib\\endorsed"
|
#define ENDORSED_DIR "\\lib\\endorsed"
|
||||||
size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
|
size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
|
||||||
char * buf = NEW_C_HEAP_ARRAY(char, len);
|
char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal);
|
||||||
sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
|
sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
|
||||||
Arguments::set_endorsed_dirs(buf);
|
Arguments::set_endorsed_dirs(buf);
|
||||||
#undef ENDORSED_DIR
|
#undef ENDORSED_DIR
|
||||||
|
@ -324,6 +323,23 @@ extern "C" void breakpoint() {
|
||||||
os::breakpoint();
|
os::breakpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* RtlCaptureStackBackTrace Windows API may not exist prior to Windows XP.
|
||||||
|
* So far, this method is only used by Native Memory Tracking, which is
|
||||||
|
* only supported on Windows XP or later.
|
||||||
|
*/
|
||||||
|
address os::get_caller_pc(int n) {
|
||||||
|
#ifdef _NMT_NOINLINE_
|
||||||
|
n ++;
|
||||||
|
#endif
|
||||||
|
address pc;
|
||||||
|
if (os::Kernel32Dll::RtlCaptureStackBackTrace(n + 1, 1, (PVOID*)&pc, NULL) == 1) {
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// os::current_stack_base()
|
// os::current_stack_base()
|
||||||
//
|
//
|
||||||
// Returns the base of the stack, which is the stack's
|
// Returns the base of the stack, which is the stack's
|
||||||
|
@ -1014,7 +1030,7 @@ DIR *
|
||||||
os::opendir(const char *dirname)
|
os::opendir(const char *dirname)
|
||||||
{
|
{
|
||||||
assert(dirname != NULL, "just checking"); // hotspot change
|
assert(dirname != NULL, "just checking"); // hotspot change
|
||||||
DIR *dirp = (DIR *)malloc(sizeof(DIR));
|
DIR *dirp = (DIR *)malloc(sizeof(DIR), mtInternal);
|
||||||
DWORD fattr; // hotspot change
|
DWORD fattr; // hotspot change
|
||||||
char alt_dirname[4] = { 0, 0, 0, 0 };
|
char alt_dirname[4] = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
@ -1036,9 +1052,9 @@ os::opendir(const char *dirname)
|
||||||
dirname = alt_dirname;
|
dirname = alt_dirname;
|
||||||
}
|
}
|
||||||
|
|
||||||
dirp->path = (char *)malloc(strlen(dirname) + 5);
|
dirp->path = (char *)malloc(strlen(dirname) + 5, mtInternal);
|
||||||
if (dirp->path == 0) {
|
if (dirp->path == 0) {
|
||||||
free(dirp);
|
free(dirp, mtInternal);
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1046,13 +1062,13 @@ os::opendir(const char *dirname)
|
||||||
|
|
||||||
fattr = GetFileAttributes(dirp->path);
|
fattr = GetFileAttributes(dirp->path);
|
||||||
if (fattr == 0xffffffff) {
|
if (fattr == 0xffffffff) {
|
||||||
free(dirp->path);
|
free(dirp->path, mtInternal);
|
||||||
free(dirp);
|
free(dirp, mtInternal);
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return 0;
|
return 0;
|
||||||
} else if ((fattr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
} else if ((fattr & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
||||||
free(dirp->path);
|
free(dirp->path, mtInternal);
|
||||||
free(dirp);
|
free(dirp, mtInternal);
|
||||||
errno = ENOTDIR;
|
errno = ENOTDIR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1070,8 +1086,8 @@ os::opendir(const char *dirname)
|
||||||
dirp->handle = FindFirstFile(dirp->path, &dirp->find_data);
|
dirp->handle = FindFirstFile(dirp->path, &dirp->find_data);
|
||||||
if (dirp->handle == INVALID_HANDLE_VALUE) {
|
if (dirp->handle == INVALID_HANDLE_VALUE) {
|
||||||
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
|
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
|
||||||
free(dirp->path);
|
free(dirp->path, mtInternal);
|
||||||
free(dirp);
|
free(dirp, mtInternal);
|
||||||
errno = EACCES;
|
errno = EACCES;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1114,8 +1130,8 @@ os::closedir(DIR *dirp)
|
||||||
}
|
}
|
||||||
dirp->handle = INVALID_HANDLE_VALUE;
|
dirp->handle = INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
free(dirp->path);
|
free(dirp->path, mtInternal);
|
||||||
free(dirp);
|
free(dirp, mtInternal);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1176,11 +1192,11 @@ void os::dll_build_name(char *buffer, size_t buflen,
|
||||||
// release the storage
|
// release the storage
|
||||||
for (int i = 0 ; i < n ; i++) {
|
for (int i = 0 ; i < n ; i++) {
|
||||||
if (pelements[i] != NULL) {
|
if (pelements[i] != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, pelements[i]);
|
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pelements != NULL) {
|
if (pelements != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char*, pelements);
|
FREE_C_HEAP_ARRAY(char*, pelements, mtInternal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jio_snprintf(buffer, buflen, "%s\\%s.dll", pname, fname);
|
jio_snprintf(buffer, buflen, "%s\\%s.dll", pname, fname);
|
||||||
|
@ -2637,7 +2653,7 @@ private:
|
||||||
|
|
||||||
void free_node_list() {
|
void free_node_list() {
|
||||||
if (_numa_used_node_list != NULL) {
|
if (_numa_used_node_list != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(int, _numa_used_node_list);
|
FREE_C_HEAP_ARRAY(int, _numa_used_node_list, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2659,7 +2675,7 @@ public:
|
||||||
ULONG highest_node_number;
|
ULONG highest_node_number;
|
||||||
if (!os::Kernel32Dll::GetNumaHighestNodeNumber(&highest_node_number)) return false;
|
if (!os::Kernel32Dll::GetNumaHighestNodeNumber(&highest_node_number)) return false;
|
||||||
free_node_list();
|
free_node_list();
|
||||||
_numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1);
|
_numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1, mtInternal);
|
||||||
for (unsigned int i = 0; i <= highest_node_number; i++) {
|
for (unsigned int i = 0; i <= highest_node_number; i++) {
|
||||||
ULONGLONG proc_mask_numa_node;
|
ULONGLONG proc_mask_numa_node;
|
||||||
if (!os::Kernel32Dll::GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false;
|
if (!os::Kernel32Dll::GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false;
|
||||||
|
@ -2918,7 +2934,7 @@ void os::large_page_init() {
|
||||||
// On win32, one cannot release just a part of reserved memory, it's an
|
// On win32, one cannot release just a part of reserved memory, it's an
|
||||||
// all or nothing deal. When we split a reservation, we must break the
|
// all or nothing deal. When we split a reservation, we must break the
|
||||||
// reservation into two reservations.
|
// reservation into two reservations.
|
||||||
void os::split_reserved_memory(char *base, size_t size, size_t split,
|
void os::pd_split_reserved_memory(char *base, size_t size, size_t split,
|
||||||
bool realloc) {
|
bool realloc) {
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
release_memory(base, size);
|
release_memory(base, size);
|
||||||
|
@ -2931,7 +2947,7 @@ void os::split_reserved_memory(char *base, size_t size, size_t split,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
|
char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
|
||||||
assert((size_t)addr % os::vm_allocation_granularity() == 0,
|
assert((size_t)addr % os::vm_allocation_granularity() == 0,
|
||||||
"reserve alignment");
|
"reserve alignment");
|
||||||
assert(bytes % os::vm_allocation_granularity() == 0, "reserve block size");
|
assert(bytes % os::vm_allocation_granularity() == 0, "reserve block size");
|
||||||
|
@ -2964,7 +2980,7 @@ char* os::reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
|
||||||
|
|
||||||
// Reserve memory at an arbitrary address, only if that area is
|
// Reserve memory at an arbitrary address, only if that area is
|
||||||
// available (and not reserved for something else).
|
// available (and not reserved for something else).
|
||||||
char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
|
||||||
// Windows os::reserve_memory() fails of the requested address range is
|
// Windows os::reserve_memory() fails of the requested address range is
|
||||||
// not avilable.
|
// not avilable.
|
||||||
return reserve_memory(bytes, requested_addr);
|
return reserve_memory(bytes, requested_addr);
|
||||||
|
@ -3027,7 +3043,7 @@ bool os::release_memory_special(char* base, size_t bytes) {
|
||||||
void os::print_statistics() {
|
void os::print_statistics() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t bytes, bool exec) {
|
bool os::pd_commit_memory(char* addr, size_t bytes, bool exec) {
|
||||||
if (bytes == 0) {
|
if (bytes == 0) {
|
||||||
// Don't bother the OS with noops.
|
// Don't bother the OS with noops.
|
||||||
return true;
|
return true;
|
||||||
|
@ -3075,26 +3091,26 @@ bool os::commit_memory(char* addr, size_t bytes, bool exec) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
|
bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
|
||||||
bool exec) {
|
bool exec) {
|
||||||
return commit_memory(addr, size, exec);
|
return commit_memory(addr, size, exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::uncommit_memory(char* addr, size_t bytes) {
|
bool os::pd_uncommit_memory(char* addr, size_t bytes) {
|
||||||
if (bytes == 0) {
|
if (bytes == 0) {
|
||||||
// Don't bother the OS with noops.
|
// Don't bother the OS with noops.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert((size_t) addr % os::vm_page_size() == 0, "uncommit on page boundaries");
|
assert((size_t) addr % os::vm_page_size() == 0, "uncommit on page boundaries");
|
||||||
assert(bytes % os::vm_page_size() == 0, "uncommit in page-sized chunks");
|
assert(bytes % os::vm_page_size() == 0, "uncommit in page-sized chunks");
|
||||||
return VirtualFree(addr, bytes, MEM_DECOMMIT) != 0;
|
return (VirtualFree(addr, bytes, MEM_DECOMMIT) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::release_memory(char* addr, size_t bytes) {
|
bool os::pd_release_memory(char* addr, size_t bytes) {
|
||||||
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::create_stack_guard_pages(char* addr, size_t size) {
|
bool os::pd_create_stack_guard_pages(char* addr, size_t size) {
|
||||||
return os::commit_memory(addr, size);
|
return os::commit_memory(addr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3141,8 +3157,8 @@ bool os::unguard_memory(char* addr, size_t bytes) {
|
||||||
return VirtualProtect(addr, bytes, PAGE_READWRITE, &old_status) != 0;
|
return VirtualProtect(addr, bytes, PAGE_READWRITE, &old_status) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
|
void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) { }
|
||||||
void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
|
void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) { }
|
||||||
void os::numa_make_global(char *addr, size_t bytes) { }
|
void os::numa_make_global(char *addr, size_t bytes) { }
|
||||||
void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { }
|
void os::numa_make_local(char *addr, size_t bytes, int lgrp_hint) { }
|
||||||
bool os::numa_topology_changed() { return false; }
|
bool os::numa_topology_changed() { return false; }
|
||||||
|
@ -4276,14 +4292,14 @@ static int stdinAvailable(int fd, long *pbytes) {
|
||||||
numEvents = MAX_INPUT_EVENTS;
|
numEvents = MAX_INPUT_EVENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD));
|
lpBuffer = (INPUT_RECORD *)os::malloc(numEvents * sizeof(INPUT_RECORD), mtInternal);
|
||||||
if (lpBuffer == NULL) {
|
if (lpBuffer == NULL) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead);
|
error = ::PeekConsoleInput(han, lpBuffer, numEvents, &numEventsRead);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
os::free(lpBuffer);
|
os::free(lpBuffer, mtInternal);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4304,7 +4320,7 @@ static int stdinAvailable(int fd, long *pbytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lpBuffer != NULL) {
|
if(lpBuffer != NULL) {
|
||||||
os::free(lpBuffer);
|
os::free(lpBuffer, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
*pbytes = (long) actualLength;
|
*pbytes = (long) actualLength;
|
||||||
|
@ -4312,7 +4328,7 @@ static int stdinAvailable(int fd, long *pbytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map a block of memory.
|
// Map a block of memory.
|
||||||
char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
|
@ -4432,7 +4448,7 @@ char* os::map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
|
||||||
|
|
||||||
// Remap a block of memory.
|
// Remap a block of memory.
|
||||||
char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
char *addr, size_t bytes, bool read_only,
|
char *addr, size_t bytes, bool read_only,
|
||||||
bool allow_exec) {
|
bool allow_exec) {
|
||||||
// This OS does not allow existing memory maps to be remapped so we
|
// This OS does not allow existing memory maps to be remapped so we
|
||||||
|
@ -4445,15 +4461,15 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
// call above and the map_memory() call below where a thread in native
|
// call above and the map_memory() call below where a thread in native
|
||||||
// code may be able to access an address that is no longer mapped.
|
// code may be able to access an address that is no longer mapped.
|
||||||
|
|
||||||
return os::map_memory(fd, file_name, file_offset, addr, bytes, read_only,
|
return os::map_memory(fd, file_name, file_offset, addr, bytes,
|
||||||
allow_exec);
|
read_only, allow_exec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Unmap a block of memory.
|
// Unmap a block of memory.
|
||||||
// Returns true=success, otherwise false.
|
// Returns true=success, otherwise false.
|
||||||
|
|
||||||
bool os::unmap_memory(char* addr, size_t bytes) {
|
bool os::pd_unmap_memory(char* addr, size_t bytes) {
|
||||||
BOOL result = UnmapViewOfFile(addr);
|
BOOL result = UnmapViewOfFile(addr);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
|
@ -4931,11 +4947,15 @@ typedef SIZE_T (WINAPI* GetLargePageMinimum_Fn)(void);
|
||||||
typedef LPVOID (WINAPI *VirtualAllocExNuma_Fn) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
|
typedef LPVOID (WINAPI *VirtualAllocExNuma_Fn) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
|
||||||
typedef BOOL (WINAPI *GetNumaHighestNodeNumber_Fn) (PULONG);
|
typedef BOOL (WINAPI *GetNumaHighestNodeNumber_Fn) (PULONG);
|
||||||
typedef BOOL (WINAPI *GetNumaNodeProcessorMask_Fn) (UCHAR, PULONGLONG);
|
typedef BOOL (WINAPI *GetNumaNodeProcessorMask_Fn) (UCHAR, PULONGLONG);
|
||||||
|
typedef USHORT (WINAPI* RtlCaptureStackBackTrace_Fn)(ULONG, ULONG, PVOID*, PULONG);
|
||||||
|
|
||||||
GetLargePageMinimum_Fn os::Kernel32Dll::_GetLargePageMinimum = NULL;
|
GetLargePageMinimum_Fn os::Kernel32Dll::_GetLargePageMinimum = NULL;
|
||||||
VirtualAllocExNuma_Fn os::Kernel32Dll::_VirtualAllocExNuma = NULL;
|
VirtualAllocExNuma_Fn os::Kernel32Dll::_VirtualAllocExNuma = NULL;
|
||||||
GetNumaHighestNodeNumber_Fn os::Kernel32Dll::_GetNumaHighestNodeNumber = NULL;
|
GetNumaHighestNodeNumber_Fn os::Kernel32Dll::_GetNumaHighestNodeNumber = NULL;
|
||||||
GetNumaNodeProcessorMask_Fn os::Kernel32Dll::_GetNumaNodeProcessorMask = NULL;
|
GetNumaNodeProcessorMask_Fn os::Kernel32Dll::_GetNumaNodeProcessorMask = NULL;
|
||||||
|
RtlCaptureStackBackTrace_Fn os::Kernel32Dll::_RtlCaptureStackBackTrace = NULL;
|
||||||
|
|
||||||
|
|
||||||
BOOL os::Kernel32Dll::initialized = FALSE;
|
BOOL os::Kernel32Dll::initialized = FALSE;
|
||||||
SIZE_T os::Kernel32Dll::GetLargePageMinimum() {
|
SIZE_T os::Kernel32Dll::GetLargePageMinimum() {
|
||||||
assert(initialized && _GetLargePageMinimum != NULL,
|
assert(initialized && _GetLargePageMinimum != NULL,
|
||||||
|
@ -4978,6 +4998,19 @@ BOOL os::Kernel32Dll::GetNumaNodeProcessorMask(UCHAR node, PULONGLONG proc_mask)
|
||||||
return _GetNumaNodeProcessorMask(node, proc_mask);
|
return _GetNumaNodeProcessorMask(node, proc_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
USHORT os::Kernel32Dll::RtlCaptureStackBackTrace(ULONG FrameToSkip,
|
||||||
|
ULONG FrameToCapture, PVOID* BackTrace, PULONG BackTraceHash) {
|
||||||
|
if (!initialized) {
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_RtlCaptureStackBackTrace != NULL) {
|
||||||
|
return _RtlCaptureStackBackTrace(FrameToSkip, FrameToCapture,
|
||||||
|
BackTrace, BackTraceHash);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void os::Kernel32Dll::initializeCommon() {
|
void os::Kernel32Dll::initializeCommon() {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
|
@ -4987,6 +5020,7 @@ void os::Kernel32Dll::initializeCommon() {
|
||||||
_VirtualAllocExNuma = (VirtualAllocExNuma_Fn)::GetProcAddress(handle, "VirtualAllocExNuma");
|
_VirtualAllocExNuma = (VirtualAllocExNuma_Fn)::GetProcAddress(handle, "VirtualAllocExNuma");
|
||||||
_GetNumaHighestNodeNumber = (GetNumaHighestNodeNumber_Fn)::GetProcAddress(handle, "GetNumaHighestNodeNumber");
|
_GetNumaHighestNodeNumber = (GetNumaHighestNodeNumber_Fn)::GetProcAddress(handle, "GetNumaHighestNodeNumber");
|
||||||
_GetNumaNodeProcessorMask = (GetNumaNodeProcessorMask_Fn)::GetProcAddress(handle, "GetNumaNodeProcessorMask");
|
_GetNumaNodeProcessorMask = (GetNumaNodeProcessorMask_Fn)::GetProcAddress(handle, "GetNumaNodeProcessorMask");
|
||||||
|
_RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace");
|
||||||
initialized = TRUE;
|
initialized = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5101,7 +5135,6 @@ Module32First_Fn os::Kernel32Dll::_Module32First = NULL;
|
||||||
Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL;
|
Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL;
|
||||||
GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL;
|
GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL;
|
||||||
|
|
||||||
|
|
||||||
void os::Kernel32Dll::initialize() {
|
void os::Kernel32Dll::initialize() {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
HMODULE handle = ::GetModuleHandle("Kernel32.dll");
|
HMODULE handle = ::GetModuleHandle("Kernel32.dll");
|
||||||
|
@ -5179,8 +5212,6 @@ void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) {
|
||||||
_GetNativeSystemInfo(lpSystemInfo);
|
_GetNativeSystemInfo(lpSystemInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// PSAPI API
|
// PSAPI API
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ class win32 {
|
||||||
static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
|
static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlatformEvent : public CHeapObj {
|
class PlatformEvent : public CHeapObj<mtInternal> {
|
||||||
private:
|
private:
|
||||||
double CachePad [4] ; // increase odds that _Event is sole occupant of cache line
|
double CachePad [4] ; // increase odds that _Event is sole occupant of cache line
|
||||||
volatile int _Event ;
|
volatile int _Event ;
|
||||||
|
@ -124,7 +124,7 @@ class PlatformEvent : public CHeapObj {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PlatformParker : public CHeapObj {
|
class PlatformParker : public CHeapObj<mtInternal> {
|
||||||
protected:
|
protected:
|
||||||
HANDLE _ParkEvent ;
|
HANDLE _ParkEvent ;
|
||||||
|
|
||||||
|
@ -182,6 +182,9 @@ public:
|
||||||
static BOOL GetNumaHighestNodeNumber(PULONG);
|
static BOOL GetNumaHighestNodeNumber(PULONG);
|
||||||
static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG);
|
static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG);
|
||||||
|
|
||||||
|
// Stack walking
|
||||||
|
static USHORT RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// GetLargePageMinimum available on Windows Vista/Windows Server 2003
|
// GetLargePageMinimum available on Windows Vista/Windows Server 2003
|
||||||
// and later
|
// and later
|
||||||
|
@ -191,6 +194,7 @@ private:
|
||||||
static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
|
static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD);
|
||||||
static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG);
|
static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG);
|
||||||
static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG);
|
static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG);
|
||||||
|
static USHORT (WINAPI *_RtlCaptureStackBackTrace)(ULONG, ULONG, PVOID*, PULONG);
|
||||||
static BOOL initialized;
|
static BOOL initialized;
|
||||||
|
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
|
@ -120,7 +120,7 @@ static void save_memory_to_file(char* addr, size_t size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, destfile);
|
FREE_C_HEAP_ARRAY(char, destfile, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shared Memory Implementation Details
|
// Shared Memory Implementation Details
|
||||||
|
@ -157,7 +157,7 @@ static char* get_user_tmp_dir(const char* user) {
|
||||||
const char* tmpdir = os::get_temp_directory();
|
const char* tmpdir = os::get_temp_directory();
|
||||||
const char* perfdir = PERFDATA_NAME;
|
const char* perfdir = PERFDATA_NAME;
|
||||||
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3;
|
||||||
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
// construct the path name to user specific tmp directory
|
// construct the path name to user specific tmp directory
|
||||||
_snprintf(dirname, nbytes, "%s\\%s_%s", tmpdir, perfdir, user);
|
_snprintf(dirname, nbytes, "%s\\%s_%s", tmpdir, perfdir, user);
|
||||||
|
@ -281,7 +281,7 @@ static char* get_user_name() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
|
char* user_name = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||||
strcpy(user_name, user);
|
strcpy(user_name, user);
|
||||||
|
|
||||||
return user_name;
|
return user_name;
|
||||||
|
@ -315,7 +315,7 @@ static char* get_user_name_slow(int vmid) {
|
||||||
// to determine the user name for the process id.
|
// to determine the user name for the process id.
|
||||||
//
|
//
|
||||||
struct dirent* dentry;
|
struct dirent* dentry;
|
||||||
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname));
|
char* tdbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(tmpdirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
while ((dentry = os::readdir(tmpdirp, (struct dirent *)tdbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ static char* get_user_name_slow(int vmid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
char* usrdir_name = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(tmpdirname) + strlen(dentry->d_name) + 2);
|
strlen(tmpdirname) + strlen(dentry->d_name) + 2, mtInternal);
|
||||||
strcpy(usrdir_name, tmpdirname);
|
strcpy(usrdir_name, tmpdirname);
|
||||||
strcat(usrdir_name, "\\");
|
strcat(usrdir_name, "\\");
|
||||||
strcat(usrdir_name, dentry->d_name);
|
strcat(usrdir_name, dentry->d_name);
|
||||||
|
@ -333,7 +333,7 @@ static char* get_user_name_slow(int vmid) {
|
||||||
DIR* subdirp = os::opendir(usrdir_name);
|
DIR* subdirp = os::opendir(usrdir_name);
|
||||||
|
|
||||||
if (subdirp == NULL) {
|
if (subdirp == NULL) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,13 +344,13 @@ static char* get_user_name_slow(int vmid) {
|
||||||
// symlink can be exploited.
|
// symlink can be exploited.
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(usrdir_name)) {
|
if (!is_directory_secure(usrdir_name)) {
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent* udentry;
|
struct dirent* udentry;
|
||||||
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name));
|
char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
while ((udentry = os::readdir(subdirp, (struct dirent *)udbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -358,20 +358,20 @@ static char* get_user_name_slow(int vmid) {
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
char* filename = NEW_C_HEAP_ARRAY(char,
|
char* filename = NEW_C_HEAP_ARRAY(char,
|
||||||
strlen(usrdir_name) + strlen(udentry->d_name) + 2);
|
strlen(usrdir_name) + strlen(udentry->d_name) + 2, mtInternal);
|
||||||
|
|
||||||
strcpy(filename, usrdir_name);
|
strcpy(filename, usrdir_name);
|
||||||
strcat(filename, "\\");
|
strcat(filename, "\\");
|
||||||
strcat(filename, udentry->d_name);
|
strcat(filename, udentry->d_name);
|
||||||
|
|
||||||
if (::stat(filename, &statbuf) == OS_ERR) {
|
if (::stat(filename, &statbuf) == OS_ERR) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip over files that are not regular files.
|
// skip over files that are not regular files.
|
||||||
if ((statbuf.st_mode & S_IFMT) != S_IFREG) {
|
if ((statbuf.st_mode & S_IFMT) != S_IFREG) {
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,22 +393,22 @@ static char* get_user_name_slow(int vmid) {
|
||||||
if (statbuf.st_ctime > latest_ctime) {
|
if (statbuf.st_ctime > latest_ctime) {
|
||||||
char* user = strchr(dentry->d_name, '_') + 1;
|
char* user = strchr(dentry->d_name, '_') + 1;
|
||||||
|
|
||||||
if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user);
|
if (latest_user != NULL) FREE_C_HEAP_ARRAY(char, latest_user, mtInternal);
|
||||||
latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1);
|
latest_user = NEW_C_HEAP_ARRAY(char, strlen(user)+1, mtInternal);
|
||||||
|
|
||||||
strcpy(latest_user, user);
|
strcpy(latest_user, user);
|
||||||
latest_ctime = statbuf.st_ctime;
|
latest_ctime = statbuf.st_ctime;
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
os::closedir(subdirp);
|
os::closedir(subdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, udbuf);
|
FREE_C_HEAP_ARRAY(char, udbuf, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, usrdir_name);
|
FREE_C_HEAP_ARRAY(char, usrdir_name, mtInternal);
|
||||||
}
|
}
|
||||||
os::closedir(tmpdirp);
|
os::closedir(tmpdirp);
|
||||||
FREE_C_HEAP_ARRAY(char, tdbuf);
|
FREE_C_HEAP_ARRAY(char, tdbuf, mtInternal);
|
||||||
|
|
||||||
return(latest_user);
|
return(latest_user);
|
||||||
}
|
}
|
||||||
|
@ -453,7 +453,7 @@ static char *get_sharedmem_objectname(const char* user, int vmid) {
|
||||||
// about a name containing a '-' characters.
|
// about a name containing a '-' characters.
|
||||||
//
|
//
|
||||||
nbytes += UINT_CHARS;
|
nbytes += UINT_CHARS;
|
||||||
char* name = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
_snprintf(name, nbytes, "%s_%s_%u", PERFDATA_NAME, user, vmid);
|
_snprintf(name, nbytes, "%s_%s_%u", PERFDATA_NAME, user, vmid);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -469,7 +469,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
|
||||||
// add 2 for the file separator and a null terminator.
|
// add 2 for the file separator and a null terminator.
|
||||||
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
|
||||||
|
|
||||||
char* name = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* name = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
_snprintf(name, nbytes, "%s\\%d", dirname, vmid);
|
_snprintf(name, nbytes, "%s\\%d", dirname, vmid);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
@ -485,7 +485,7 @@ static char* get_sharedmem_filename(const char* dirname, int vmid) {
|
||||||
static void remove_file(const char* dirname, const char* filename) {
|
static void remove_file(const char* dirname, const char* filename) {
|
||||||
|
|
||||||
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
size_t nbytes = strlen(dirname) + strlen(filename) + 2;
|
||||||
char* path = NEW_C_HEAP_ARRAY(char, nbytes);
|
char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
strcpy(path, dirname);
|
strcpy(path, dirname);
|
||||||
strcat(path, "\\");
|
strcat(path, "\\");
|
||||||
|
@ -500,7 +500,7 @@ static void remove_file(const char* dirname, const char* filename) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, path);
|
FREE_C_HEAP_ARRAY(char, path, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the process represented by pid is alive, otherwise
|
// returns true if the process represented by pid is alive, otherwise
|
||||||
|
@ -638,7 +638,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
// opendir/readdir.
|
// opendir/readdir.
|
||||||
//
|
//
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname));
|
char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) {
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ static void cleanup_sharedmem_resources(const char* dirname) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
os::closedir(dirp);
|
os::closedir(dirp);
|
||||||
FREE_C_HEAP_ARRAY(char, dbuf);
|
FREE_C_HEAP_ARRAY(char, dbuf, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a file mapping object with the requested name, and size
|
// create a file mapping object with the requested name, and size
|
||||||
|
@ -747,11 +747,11 @@ static void free_security_desc(PSECURITY_DESCRIPTOR pSD) {
|
||||||
// be an ACL we enlisted. free the resources.
|
// be an ACL we enlisted. free the resources.
|
||||||
//
|
//
|
||||||
if (success && exists && pACL != NULL && !isdefault) {
|
if (success && exists && pACL != NULL && !isdefault) {
|
||||||
FREE_C_HEAP_ARRAY(char, pACL);
|
FREE_C_HEAP_ARRAY(char, pACL, mtInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// free the security descriptor
|
// free the security descriptor
|
||||||
FREE_C_HEAP_ARRAY(char, pSD);
|
FREE_C_HEAP_ARRAY(char, pSD, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -766,7 +766,7 @@ static void free_security_attr(LPSECURITY_ATTRIBUTES lpSA) {
|
||||||
lpSA->lpSecurityDescriptor = NULL;
|
lpSA->lpSecurityDescriptor = NULL;
|
||||||
|
|
||||||
// free the security attributes structure
|
// free the security attributes structure
|
||||||
FREE_C_HEAP_ARRAY(char, lpSA);
|
FREE_C_HEAP_ARRAY(char, lpSA, mtInternal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ static PSID get_user_sid(HANDLE hProcess) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
token_buf = (PTOKEN_USER) NEW_C_HEAP_ARRAY(char, rsize);
|
token_buf = (PTOKEN_USER) NEW_C_HEAP_ARRAY(char, rsize, mtInternal);
|
||||||
|
|
||||||
// get the user token information
|
// get the user token information
|
||||||
if (!GetTokenInformation(hAccessToken, TokenUser, token_buf, rsize, &rsize)) {
|
if (!GetTokenInformation(hAccessToken, TokenUser, token_buf, rsize, &rsize)) {
|
||||||
|
@ -813,28 +813,28 @@ static PSID get_user_sid(HANDLE hProcess) {
|
||||||
warning("GetTokenInformation failure: lasterror = %d,"
|
warning("GetTokenInformation failure: lasterror = %d,"
|
||||||
" rsize = %d\n", GetLastError(), rsize);
|
" rsize = %d\n", GetLastError(), rsize);
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
|
||||||
CloseHandle(hAccessToken);
|
CloseHandle(hAccessToken);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD nbytes = GetLengthSid(token_buf->User.Sid);
|
DWORD nbytes = GetLengthSid(token_buf->User.Sid);
|
||||||
PSID pSID = NEW_C_HEAP_ARRAY(char, nbytes);
|
PSID pSID = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
|
||||||
|
|
||||||
if (!CopySid(nbytes, pSID, token_buf->User.Sid)) {
|
if (!CopySid(nbytes, pSID, token_buf->User.Sid)) {
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("GetTokenInformation failure: lasterror = %d,"
|
warning("GetTokenInformation failure: lasterror = %d,"
|
||||||
" rsize = %d\n", GetLastError(), rsize);
|
" rsize = %d\n", GetLastError(), rsize);
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, pSID);
|
FREE_C_HEAP_ARRAY(char, pSID, mtInternal);
|
||||||
CloseHandle(hAccessToken);
|
CloseHandle(hAccessToken);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// close the access token.
|
// close the access token.
|
||||||
CloseHandle(hAccessToken);
|
CloseHandle(hAccessToken);
|
||||||
FREE_C_HEAP_ARRAY(char, token_buf);
|
FREE_C_HEAP_ARRAY(char, token_buf, mtInternal);
|
||||||
|
|
||||||
return pSID;
|
return pSID;
|
||||||
}
|
}
|
||||||
|
@ -912,13 +912,13 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the new ACL
|
// create the new ACL
|
||||||
newACL = (PACL) NEW_C_HEAP_ARRAY(char, newACLsize);
|
newACL = (PACL) NEW_C_HEAP_ARRAY(char, newACLsize, mtInternal);
|
||||||
|
|
||||||
if (!InitializeAcl(newACL, newACLsize, ACL_REVISION)) {
|
if (!InitializeAcl(newACL, newACLsize, ACL_REVISION)) {
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -931,7 +931,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceFlags && INHERITED_ACE) {
|
if (((ACCESS_ALLOWED_ACE *)ace)->Header.AceFlags && INHERITED_ACE) {
|
||||||
|
@ -958,7 +958,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("AddAce failure: lasterror = %d \n", GetLastError());
|
warning("AddAce failure: lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -974,7 +974,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
warning("AddAccessAllowedAce failure: lasterror = %d \n",
|
warning("AddAccessAllowedAce failure: lasterror = %d \n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -989,7 +989,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
warning("InitializeAcl failure: lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!AddAce(newACL, ACL_REVISION, MAXDWORD, ace,
|
if (!AddAce(newACL, ACL_REVISION, MAXDWORD, ace,
|
||||||
|
@ -997,7 +997,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
if (PrintMiscellaneous && Verbose) {
|
if (PrintMiscellaneous && Verbose) {
|
||||||
warning("AddAce failure: lasterror = %d \n", GetLastError());
|
warning("AddAce failure: lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ace_index++;
|
ace_index++;
|
||||||
|
@ -1010,7 +1010,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
warning("SetSecurityDescriptorDacl failure:"
|
warning("SetSecurityDescriptorDacl failure:"
|
||||||
" lasterror = %d \n", GetLastError());
|
" lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,7 +1030,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
|
||||||
warning("SetSecurityDescriptorControl failure:"
|
warning("SetSecurityDescriptorControl failure:"
|
||||||
" lasterror = %d \n", GetLastError());
|
" lasterror = %d \n", GetLastError());
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, newACL);
|
FREE_C_HEAP_ARRAY(char, newACL, mtInternal);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1054,7 +1054,7 @@ static LPSECURITY_ATTRIBUTES make_security_attr(ace_data_t aces[], int count) {
|
||||||
|
|
||||||
// allocate space for a security descriptor
|
// allocate space for a security descriptor
|
||||||
PSECURITY_DESCRIPTOR pSD = (PSECURITY_DESCRIPTOR)
|
PSECURITY_DESCRIPTOR pSD = (PSECURITY_DESCRIPTOR)
|
||||||
NEW_C_HEAP_ARRAY(char, SECURITY_DESCRIPTOR_MIN_LENGTH);
|
NEW_C_HEAP_ARRAY(char, SECURITY_DESCRIPTOR_MIN_LENGTH, mtInternal);
|
||||||
|
|
||||||
// initialize the security descriptor
|
// initialize the security descriptor
|
||||||
if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
|
if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
|
||||||
|
@ -1076,7 +1076,7 @@ static LPSECURITY_ATTRIBUTES make_security_attr(ace_data_t aces[], int count) {
|
||||||
// return it to the caller.
|
// return it to the caller.
|
||||||
//
|
//
|
||||||
LPSECURITY_ATTRIBUTES lpSA = (LPSECURITY_ATTRIBUTES)
|
LPSECURITY_ATTRIBUTES lpSA = (LPSECURITY_ATTRIBUTES)
|
||||||
NEW_C_HEAP_ARRAY(char, sizeof(SECURITY_ATTRIBUTES));
|
NEW_C_HEAP_ARRAY(char, sizeof(SECURITY_ATTRIBUTES), mtInternal);
|
||||||
lpSA->nLength = sizeof(SECURITY_ATTRIBUTES);
|
lpSA->nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
lpSA->lpSecurityDescriptor = pSD;
|
lpSA->lpSecurityDescriptor = pSD;
|
||||||
lpSA->bInheritHandle = FALSE;
|
lpSA->bInheritHandle = FALSE;
|
||||||
|
@ -1147,7 +1147,7 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr(
|
||||||
// create a security attributes structure with access control
|
// create a security attributes structure with access control
|
||||||
// entries as initialized above.
|
// entries as initialized above.
|
||||||
LPSECURITY_ATTRIBUTES lpSA = make_security_attr(aces, 3);
|
LPSECURITY_ATTRIBUTES lpSA = make_security_attr(aces, 3);
|
||||||
FREE_C_HEAP_ARRAY(char, aces[0].pSid);
|
FREE_C_HEAP_ARRAY(char, aces[0].pSid, mtInternal);
|
||||||
FreeSid(everybodySid);
|
FreeSid(everybodySid);
|
||||||
FreeSid(administratorsSid);
|
FreeSid(administratorsSid);
|
||||||
return(lpSA);
|
return(lpSA);
|
||||||
|
@ -1462,15 +1462,15 @@ static char* mapping_create_shared(size_t size) {
|
||||||
assert(((size != 0) && (size % os::vm_page_size() == 0)),
|
assert(((size != 0) && (size % os::vm_page_size() == 0)),
|
||||||
"unexpected PerfMemry region size");
|
"unexpected PerfMemry region size");
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, user);
|
FREE_C_HEAP_ARRAY(char, user, mtInternal);
|
||||||
|
|
||||||
// create the shared memory resources
|
// create the shared memory resources
|
||||||
sharedmem_fileMapHandle =
|
sharedmem_fileMapHandle =
|
||||||
create_sharedmem_resources(dirname, filename, objectname, size);
|
create_sharedmem_resources(dirname, filename, objectname, size);
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, objectname);
|
FREE_C_HEAP_ARRAY(char, objectname, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
|
|
||||||
if (sharedmem_fileMapHandle == NULL) {
|
if (sharedmem_fileMapHandle == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1621,7 +1621,7 @@ static void open_file_mapping(const char* user, int vmid,
|
||||||
// store file, we also don't following them when attaching
|
// store file, we also don't following them when attaching
|
||||||
//
|
//
|
||||||
if (!is_directory_secure(dirname)) {
|
if (!is_directory_secure(dirname)) {
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
|
||||||
"Process not found");
|
"Process not found");
|
||||||
}
|
}
|
||||||
|
@ -1640,10 +1640,10 @@ static void open_file_mapping(const char* user, int vmid,
|
||||||
strcpy(robjectname, objectname);
|
strcpy(robjectname, objectname);
|
||||||
|
|
||||||
// free the c heap resources that are no longer needed
|
// free the c heap resources that are no longer needed
|
||||||
if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
|
if (luser != user) FREE_C_HEAP_ARRAY(char, luser, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, dirname);
|
FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, filename);
|
FREE_C_HEAP_ARRAY(char, filename, mtInternal);
|
||||||
FREE_C_HEAP_ARRAY(char, objectname);
|
FREE_C_HEAP_ARRAY(char, objectname, mtInternal);
|
||||||
|
|
||||||
if (*sizep == 0) {
|
if (*sizep == 0) {
|
||||||
size = sharedmem_filesize(rfilename, CHECK);
|
size = sharedmem_filesize(rfilename, CHECK);
|
||||||
|
|
|
@ -261,7 +261,7 @@ address CodeBuffer::decode_begin() {
|
||||||
|
|
||||||
GrowableArray<int>* CodeBuffer::create_patch_overflow() {
|
GrowableArray<int>* CodeBuffer::create_patch_overflow() {
|
||||||
if (_overflow_arena == NULL) {
|
if (_overflow_arena == NULL) {
|
||||||
_overflow_arena = new Arena();
|
_overflow_arena = new (mtCode) Arena();
|
||||||
}
|
}
|
||||||
return new (_overflow_arena) GrowableArray<int>(_overflow_arena, 8, 0, 0);
|
return new (_overflow_arena) GrowableArray<int>(_overflow_arena, 8, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -910,7 +910,7 @@ void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
|
||||||
_comments.add_comment(offset, comment);
|
_comments.add_comment(offset, comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CodeComment: public CHeapObj {
|
class CodeComment: public CHeapObj<mtCode> {
|
||||||
private:
|
private:
|
||||||
friend class CodeComments;
|
friend class CodeComments;
|
||||||
intptr_t _offset;
|
intptr_t _offset;
|
||||||
|
@ -919,13 +919,13 @@ class CodeComment: public CHeapObj {
|
||||||
|
|
||||||
~CodeComment() {
|
~CodeComment() {
|
||||||
assert(_next == NULL, "wrong interface for freeing list");
|
assert(_next == NULL, "wrong interface for freeing list");
|
||||||
os::free((void*)_comment);
|
os::free((void*)_comment, mtCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CodeComment(intptr_t offset, const char * comment) {
|
CodeComment(intptr_t offset, const char * comment) {
|
||||||
_offset = offset;
|
_offset = offset;
|
||||||
_comment = os::strdup(comment);
|
_comment = os::strdup(comment, mtCode);
|
||||||
_next = NULL;
|
_next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
|
||||||
|
|
||||||
class CFGPrinterOutput : public CHeapObj {
|
class CFGPrinterOutput : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
outputStream* _output;
|
outputStream* _output;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ void CFGPrinter::print_intervals(IntervalList* intervals, const char* name) {
|
||||||
|
|
||||||
|
|
||||||
CFGPrinterOutput::CFGPrinterOutput()
|
CFGPrinterOutput::CFGPrinterOutput()
|
||||||
: _output(new(ResourceObj::C_HEAP) fileStream("output.cfg"))
|
: _output(new(ResourceObj::C_HEAP, mtCompiler) fileStream("output.cfg"))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ Compiler::~Compiler() {
|
||||||
|
|
||||||
void Compiler::initialize_all() {
|
void Compiler::initialize_all() {
|
||||||
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
|
BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
|
||||||
Arena* arena = new Arena();
|
Arena* arena = new (mtCompiler) Arena();
|
||||||
Runtime1::initialize(buffer_blob);
|
Runtime1::initialize(buffer_blob);
|
||||||
FrameMap::initialize();
|
FrameMap::initialize();
|
||||||
// initialize data structures
|
// initialize data structures
|
||||||
|
|
|
@ -2467,12 +2467,12 @@ void LinearScan::compute_oop_map(IntervalWalker* iw, const LIR_OpVisitState &vis
|
||||||
// Allocate them with new so they are never destroyed (otherwise, a
|
// Allocate them with new so they are never destroyed (otherwise, a
|
||||||
// forced exit could destroy these objects while they are still in
|
// forced exit could destroy these objects while they are still in
|
||||||
// use).
|
// use).
|
||||||
ConstantOopWriteValue* LinearScan::_oop_null_scope_value = new (ResourceObj::C_HEAP) ConstantOopWriteValue(NULL);
|
ConstantOopWriteValue* LinearScan::_oop_null_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantOopWriteValue(NULL);
|
||||||
ConstantIntValue* LinearScan::_int_m1_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(-1);
|
ConstantIntValue* LinearScan::_int_m1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(-1);
|
||||||
ConstantIntValue* LinearScan::_int_0_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(0);
|
ConstantIntValue* LinearScan::_int_0_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(0);
|
||||||
ConstantIntValue* LinearScan::_int_1_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(1);
|
ConstantIntValue* LinearScan::_int_1_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(1);
|
||||||
ConstantIntValue* LinearScan::_int_2_scope_value = new (ResourceObj::C_HEAP) ConstantIntValue(2);
|
ConstantIntValue* LinearScan::_int_2_scope_value = new (ResourceObj::C_HEAP, mtCompiler) ConstantIntValue(2);
|
||||||
LocationValue* _illegal_value = new (ResourceObj::C_HEAP) LocationValue(Location());
|
LocationValue* _illegal_value = new (ResourceObj::C_HEAP, mtCompiler) LocationValue(Location());
|
||||||
|
|
||||||
void LinearScan::init_compute_debug_info() {
|
void LinearScan::init_compute_debug_info() {
|
||||||
// cache for frequently used scope values
|
// cache for frequently used scope values
|
||||||
|
|
|
@ -111,7 +111,7 @@ void ciObjectFactory::initialize() {
|
||||||
// This Arena is long lived and exists in the resource mark of the
|
// This Arena is long lived and exists in the resource mark of the
|
||||||
// compiler thread that initializes the initial ciObjectFactory which
|
// compiler thread that initializes the initial ciObjectFactory which
|
||||||
// creates the shared ciObjects that all later ciObjectFactories use.
|
// creates the shared ciObjects that all later ciObjectFactories use.
|
||||||
Arena* arena = new Arena();
|
Arena* arena = new (mtCompiler) Arena();
|
||||||
ciEnv initial(arena);
|
ciEnv initial(arena);
|
||||||
ciEnv* env = ciEnv::current();
|
ciEnv* env = ciEnv::current();
|
||||||
env->_factory->init_shared_objects();
|
env->_factory->init_shared_objects();
|
||||||
|
|
|
@ -1368,7 +1368,7 @@ class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LVT_Hash: public CHeapObj {
|
class LVT_Hash: public CHeapObj<mtClass> {
|
||||||
public:
|
public:
|
||||||
LocalVariableTableElement *_elem; // element
|
LocalVariableTableElement *_elem; // element
|
||||||
LVT_Hash* _next; // Next entry in hash table
|
LVT_Hash* _next; // Next entry in hash table
|
||||||
|
|
|
@ -153,7 +153,7 @@ MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
|
||||||
_meta_package_names = NULL;
|
_meta_package_names = NULL;
|
||||||
_num_meta_package_names = 0;
|
_num_meta_package_names = 0;
|
||||||
} else {
|
} else {
|
||||||
_meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names);
|
_meta_package_names = NEW_C_HEAP_ARRAY(char*, num_meta_package_names, mtClass);
|
||||||
_num_meta_package_names = num_meta_package_names;
|
_num_meta_package_names = num_meta_package_names;
|
||||||
memcpy(_meta_package_names, meta_package_names, num_meta_package_names * sizeof(char*));
|
memcpy(_meta_package_names, meta_package_names, num_meta_package_names * sizeof(char*));
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ MetaIndex::MetaIndex(char** meta_package_names, int num_meta_package_names) {
|
||||||
|
|
||||||
|
|
||||||
MetaIndex::~MetaIndex() {
|
MetaIndex::~MetaIndex() {
|
||||||
FREE_C_HEAP_ARRAY(char*, _meta_package_names);
|
FREE_C_HEAP_ARRAY(char*, _meta_package_names, mtClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ bool ClassPathEntry::is_lazy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassPathDirEntry::ClassPathDirEntry(char* dir) : ClassPathEntry() {
|
ClassPathDirEntry::ClassPathDirEntry(char* dir) : ClassPathEntry() {
|
||||||
_dir = NEW_C_HEAP_ARRAY(char, strlen(dir)+1);
|
_dir = NEW_C_HEAP_ARRAY(char, strlen(dir)+1, mtClass);
|
||||||
strcpy(_dir, dir);
|
strcpy(_dir, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ ClassFileStream* ClassPathDirEntry::open_stream(const char* name) {
|
||||||
|
|
||||||
ClassPathZipEntry::ClassPathZipEntry(jzfile* zip, const char* zip_name) : ClassPathEntry() {
|
ClassPathZipEntry::ClassPathZipEntry(jzfile* zip, const char* zip_name) : ClassPathEntry() {
|
||||||
_zip = zip;
|
_zip = zip;
|
||||||
_zip_name = NEW_C_HEAP_ARRAY(char, strlen(zip_name)+1);
|
_zip_name = NEW_C_HEAP_ARRAY(char, strlen(zip_name)+1, mtClass);
|
||||||
strcpy(_zip_name, zip_name);
|
strcpy(_zip_name, zip_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ ClassPathZipEntry::~ClassPathZipEntry() {
|
||||||
if (ZipClose != NULL) {
|
if (ZipClose != NULL) {
|
||||||
(*ZipClose)(_zip);
|
(*ZipClose)(_zip);
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(char, _zip_name);
|
FREE_C_HEAP_ARRAY(char, _zip_name, mtClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassFileStream* ClassPathZipEntry::open_stream(const char* name) {
|
ClassFileStream* ClassPathZipEntry::open_stream(const char* name) {
|
||||||
|
@ -454,11 +454,11 @@ void ClassLoader::setup_bootstrap_search_path() {
|
||||||
while (sys_class_path[end] && sys_class_path[end] != os::path_separator()[0]) {
|
while (sys_class_path[end] && sys_class_path[end] != os::path_separator()[0]) {
|
||||||
end++;
|
end++;
|
||||||
}
|
}
|
||||||
char* path = NEW_C_HEAP_ARRAY(char, end-start+1);
|
char* path = NEW_C_HEAP_ARRAY(char, end-start+1, mtClass);
|
||||||
strncpy(path, &sys_class_path[start], end-start);
|
strncpy(path, &sys_class_path[start], end-start);
|
||||||
path[end-start] = '\0';
|
path[end-start] = '\0';
|
||||||
update_class_path_entry_list(path, false);
|
update_class_path_entry_list(path, false);
|
||||||
FREE_C_HEAP_ARRAY(char, path);
|
FREE_C_HEAP_ARRAY(char, path, mtClass);
|
||||||
while (sys_class_path[end] == os::path_separator()[0]) {
|
while (sys_class_path[end] == os::path_separator()[0]) {
|
||||||
end++;
|
end++;
|
||||||
}
|
}
|
||||||
|
@ -652,13 +652,13 @@ void ClassLoader::load_zip_library() {
|
||||||
// in the classpath must be the same files, in the same order, even
|
// in the classpath must be the same files, in the same order, even
|
||||||
// though the exact name is not the same.
|
// though the exact name is not the same.
|
||||||
|
|
||||||
class PackageInfo: public BasicHashtableEntry {
|
class PackageInfo: public BasicHashtableEntry<mtClass> {
|
||||||
public:
|
public:
|
||||||
const char* _pkgname; // Package name
|
const char* _pkgname; // Package name
|
||||||
int _classpath_index; // Index of directory or JAR file loaded from
|
int _classpath_index; // Index of directory or JAR file loaded from
|
||||||
|
|
||||||
PackageInfo* next() {
|
PackageInfo* next() {
|
||||||
return (PackageInfo*)BasicHashtableEntry::next();
|
return (PackageInfo*)BasicHashtableEntry<mtClass>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* pkgname() { return _pkgname; }
|
const char* pkgname() { return _pkgname; }
|
||||||
|
@ -674,7 +674,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class PackageHashtable : public BasicHashtable {
|
class PackageHashtable : public BasicHashtable<mtClass> {
|
||||||
private:
|
private:
|
||||||
inline unsigned int compute_hash(const char *s, int n) {
|
inline unsigned int compute_hash(const char *s, int n) {
|
||||||
unsigned int val = 0;
|
unsigned int val = 0;
|
||||||
|
@ -685,7 +685,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageInfo* bucket(int index) {
|
PackageInfo* bucket(int index) {
|
||||||
return (PackageInfo*)BasicHashtable::bucket(index);
|
return (PackageInfo*)BasicHashtable<mtClass>::bucket(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageInfo* get_entry(int index, unsigned int hash,
|
PackageInfo* get_entry(int index, unsigned int hash,
|
||||||
|
@ -702,10 +702,10 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PackageHashtable(int table_size)
|
PackageHashtable(int table_size)
|
||||||
: BasicHashtable(table_size, sizeof(PackageInfo)) {}
|
: BasicHashtable<mtClass>(table_size, sizeof(PackageInfo)) {}
|
||||||
|
|
||||||
PackageHashtable(int table_size, HashtableBucket* t, int number_of_entries)
|
PackageHashtable(int table_size, HashtableBucket<mtClass>* t, int number_of_entries)
|
||||||
: BasicHashtable(table_size, sizeof(PackageInfo), t, number_of_entries) {}
|
: BasicHashtable<mtClass>(table_size, sizeof(PackageInfo), t, number_of_entries) {}
|
||||||
|
|
||||||
PackageInfo* get_entry(const char* pkgname, int n) {
|
PackageInfo* get_entry(const char* pkgname, int n) {
|
||||||
unsigned int hash = compute_hash(pkgname, n);
|
unsigned int hash = compute_hash(pkgname, n);
|
||||||
|
@ -715,14 +715,14 @@ public:
|
||||||
PackageInfo* new_entry(char* pkgname, int n) {
|
PackageInfo* new_entry(char* pkgname, int n) {
|
||||||
unsigned int hash = compute_hash(pkgname, n);
|
unsigned int hash = compute_hash(pkgname, n);
|
||||||
PackageInfo* pp;
|
PackageInfo* pp;
|
||||||
pp = (PackageInfo*)BasicHashtable::new_entry(hash);
|
pp = (PackageInfo*)BasicHashtable<mtClass>::new_entry(hash);
|
||||||
pp->set_pkgname(pkgname);
|
pp->set_pkgname(pkgname);
|
||||||
return pp;
|
return pp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(PackageInfo* pp) {
|
void add_entry(PackageInfo* pp) {
|
||||||
int index = hash_to_index(pp->hash());
|
int index = hash_to_index(pp->hash());
|
||||||
BasicHashtable::add_entry(index, pp);
|
BasicHashtable<mtClass>::add_entry(index, pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_pkgnames(const char** packages) {
|
void copy_pkgnames(const char** packages) {
|
||||||
|
@ -742,7 +742,7 @@ public:
|
||||||
void PackageHashtable::copy_table(char** top, char* end,
|
void PackageHashtable::copy_table(char** top, char* end,
|
||||||
PackageHashtable* table) {
|
PackageHashtable* table) {
|
||||||
// Copy (relocate) the table to the shared space.
|
// Copy (relocate) the table to the shared space.
|
||||||
BasicHashtable::copy_table(top, end);
|
BasicHashtable<mtClass>::copy_table(top, end);
|
||||||
|
|
||||||
// Calculate the space needed for the package name strings.
|
// Calculate the space needed for the package name strings.
|
||||||
int i;
|
int i;
|
||||||
|
@ -815,7 +815,7 @@ bool ClassLoader::add_package(const char *pkgname, int classpath_index, TRAPS) {
|
||||||
// Package prefix found
|
// Package prefix found
|
||||||
int n = cp - pkgname + 1;
|
int n = cp - pkgname + 1;
|
||||||
|
|
||||||
char* new_pkgname = NEW_C_HEAP_ARRAY(char, n + 1);
|
char* new_pkgname = NEW_C_HEAP_ARRAY(char, n + 1, mtClass);
|
||||||
if (new_pkgname == NULL) {
|
if (new_pkgname == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -929,10 +929,10 @@ instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ClassLoader::create_package_info_table(HashtableBucket *t, int length,
|
void ClassLoader::create_package_info_table(HashtableBucket<mtClass> *t, int length,
|
||||||
int number_of_entries) {
|
int number_of_entries) {
|
||||||
assert(_package_hash_table == NULL, "One package info table allowed.");
|
assert(_package_hash_table == NULL, "One package info table allowed.");
|
||||||
assert(length == package_hash_table_size * sizeof(HashtableBucket),
|
assert(length == package_hash_table_size * sizeof(HashtableBucket<mtClass>),
|
||||||
"bad shared package info size.");
|
"bad shared package info size.");
|
||||||
_package_hash_table = new PackageHashtable(package_hash_table_size, t,
|
_package_hash_table = new PackageHashtable(package_hash_table_size, t,
|
||||||
number_of_entries);
|
number_of_entries);
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
|
|
||||||
// Meta-index (optional, to be able to skip opening boot classpath jar files)
|
// Meta-index (optional, to be able to skip opening boot classpath jar files)
|
||||||
class MetaIndex: public CHeapObj {
|
class MetaIndex: public CHeapObj<mtClass> {
|
||||||
private:
|
private:
|
||||||
char** _meta_package_names;
|
char** _meta_package_names;
|
||||||
int _num_meta_package_names;
|
int _num_meta_package_names;
|
||||||
|
@ -46,7 +46,7 @@ class MetaIndex: public CHeapObj {
|
||||||
|
|
||||||
// Class path entry (directory or zip file)
|
// Class path entry (directory or zip file)
|
||||||
|
|
||||||
class ClassPathEntry: public CHeapObj {
|
class ClassPathEntry: public CHeapObj<mtClass> {
|
||||||
private:
|
private:
|
||||||
ClassPathEntry* _next;
|
ClassPathEntry* _next;
|
||||||
public:
|
public:
|
||||||
|
@ -141,7 +141,7 @@ class LazyClassPathEntry: public ClassPathEntry {
|
||||||
|
|
||||||
class PackageHashtable;
|
class PackageHashtable;
|
||||||
class PackageInfo;
|
class PackageInfo;
|
||||||
class HashtableBucket;
|
template <MEMFLAGS F> class HashtableBucket;
|
||||||
|
|
||||||
class ClassLoader: AllStatic {
|
class ClassLoader: AllStatic {
|
||||||
public:
|
public:
|
||||||
|
@ -299,7 +299,7 @@ class ClassLoader: AllStatic {
|
||||||
// Initialization
|
// Initialization
|
||||||
static void initialize();
|
static void initialize();
|
||||||
static void create_package_info_table();
|
static void create_package_info_table();
|
||||||
static void create_package_info_table(HashtableBucket *t, int length,
|
static void create_package_info_table(HashtableBucket<mtClass> *t, int length,
|
||||||
int number_of_entries);
|
int number_of_entries);
|
||||||
static int compute_Object_vtable();
|
static int compute_Object_vtable();
|
||||||
|
|
||||||
|
|
|
@ -36,16 +36,16 @@ int Dictionary::_current_class_index = 0;
|
||||||
|
|
||||||
|
|
||||||
Dictionary::Dictionary(int table_size)
|
Dictionary::Dictionary(int table_size)
|
||||||
: TwoOopHashtable<klassOop>(table_size, sizeof(DictionaryEntry)) {
|
: TwoOopHashtable<klassOop, mtClass>(table_size, sizeof(DictionaryEntry)) {
|
||||||
_current_class_index = 0;
|
_current_class_index = 0;
|
||||||
_current_class_entry = NULL;
|
_current_class_entry = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dictionary::Dictionary(int table_size, HashtableBucket* t,
|
Dictionary::Dictionary(int table_size, HashtableBucket<mtClass>* t,
|
||||||
int number_of_entries)
|
int number_of_entries)
|
||||||
: TwoOopHashtable<klassOop>(table_size, sizeof(DictionaryEntry), t, number_of_entries) {
|
: TwoOopHashtable<klassOop, mtClass>(table_size, sizeof(DictionaryEntry), t, number_of_entries) {
|
||||||
_current_class_index = 0;
|
_current_class_index = 0;
|
||||||
_current_class_entry = NULL;
|
_current_class_entry = NULL;
|
||||||
};
|
};
|
||||||
|
@ -54,7 +54,7 @@ Dictionary::Dictionary(int table_size, HashtableBucket* t,
|
||||||
DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
|
DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
|
||||||
oop loader) {
|
oop loader) {
|
||||||
DictionaryEntry* entry;
|
DictionaryEntry* entry;
|
||||||
entry = (DictionaryEntry*)Hashtable<klassOop>::new_entry(hash, klass);
|
entry = (DictionaryEntry*)Hashtable<klassOop, mtClass>::new_entry(hash, klass);
|
||||||
entry->set_loader(loader);
|
entry->set_loader(loader);
|
||||||
entry->set_pd_set(NULL);
|
entry->set_pd_set(NULL);
|
||||||
return entry;
|
return entry;
|
||||||
|
@ -62,7 +62,7 @@ DictionaryEntry* Dictionary::new_entry(unsigned int hash, klassOop klass,
|
||||||
|
|
||||||
|
|
||||||
DictionaryEntry* Dictionary::new_entry() {
|
DictionaryEntry* Dictionary::new_entry() {
|
||||||
DictionaryEntry* entry = (DictionaryEntry*)Hashtable<klassOop>::new_entry(0L, NULL);
|
DictionaryEntry* entry = (DictionaryEntry*)Hashtable<klassOop, mtClass>::new_entry(0L, NULL);
|
||||||
entry->set_loader(NULL);
|
entry->set_loader(NULL);
|
||||||
entry->set_pd_set(NULL);
|
entry->set_pd_set(NULL);
|
||||||
return entry;
|
return entry;
|
||||||
|
@ -76,7 +76,7 @@ void Dictionary::free_entry(DictionaryEntry* entry) {
|
||||||
entry->set_pd_set(to_delete->next());
|
entry->set_pd_set(to_delete->next());
|
||||||
delete to_delete;
|
delete to_delete;
|
||||||
}
|
}
|
||||||
Hashtable<klassOop>::free_entry(entry);
|
Hashtable<klassOop, mtClass>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -554,12 +554,12 @@ void Dictionary::reorder_dictionary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolPropertyTable::SymbolPropertyTable(int table_size)
|
SymbolPropertyTable::SymbolPropertyTable(int table_size)
|
||||||
: Hashtable<Symbol*>(table_size, sizeof(SymbolPropertyEntry))
|
: Hashtable<Symbol*, mtSymbol>(table_size, sizeof(SymbolPropertyEntry))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
SymbolPropertyTable::SymbolPropertyTable(int table_size, HashtableBucket* t,
|
SymbolPropertyTable::SymbolPropertyTable(int table_size, HashtableBucket<mtSymbol>* t,
|
||||||
int number_of_entries)
|
int number_of_entries)
|
||||||
: Hashtable<Symbol*>(table_size, sizeof(SymbolPropertyEntry), t, number_of_entries)
|
: Hashtable<Symbol*, mtSymbol>(table_size, sizeof(SymbolPropertyEntry), t, number_of_entries)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ SymbolPropertyEntry* SymbolPropertyTable::add_entry(int index, unsigned int hash
|
||||||
assert(find_entry(index, hash, sym, sym_mode) == NULL, "no double entry");
|
assert(find_entry(index, hash, sym, sym_mode) == NULL, "no double entry");
|
||||||
|
|
||||||
SymbolPropertyEntry* p = new_entry(hash, sym, sym_mode);
|
SymbolPropertyEntry* p = new_entry(hash, sym, sym_mode);
|
||||||
Hashtable<Symbol*>::add_entry(index, p);
|
Hashtable<Symbol*, mtSymbol>::add_entry(index, p);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class DictionaryEntry;
|
||||||
// The data structure for the system dictionary (and the shared system
|
// The data structure for the system dictionary (and the shared system
|
||||||
// dictionary).
|
// dictionary).
|
||||||
|
|
||||||
class Dictionary : public TwoOopHashtable<klassOop> {
|
class Dictionary : public TwoOopHashtable<klassOop, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
// current iteration index.
|
// current iteration index.
|
||||||
|
@ -48,22 +48,22 @@ private:
|
||||||
Symbol* name, Handle loader);
|
Symbol* name, Handle loader);
|
||||||
|
|
||||||
DictionaryEntry* bucket(int i) {
|
DictionaryEntry* bucket(int i) {
|
||||||
return (DictionaryEntry*)Hashtable<klassOop>::bucket(i);
|
return (DictionaryEntry*)Hashtable<klassOop, mtClass>::bucket(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following method is not MT-safe and must be done under lock.
|
// The following method is not MT-safe and must be done under lock.
|
||||||
DictionaryEntry** bucket_addr(int i) {
|
DictionaryEntry** bucket_addr(int i) {
|
||||||
return (DictionaryEntry**)Hashtable<klassOop>::bucket_addr(i);
|
return (DictionaryEntry**)Hashtable<klassOop, mtClass>::bucket_addr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, DictionaryEntry* new_entry) {
|
void add_entry(int index, DictionaryEntry* new_entry) {
|
||||||
Hashtable<klassOop>::add_entry(index, (HashtableEntry<oop>*)new_entry);
|
Hashtable<klassOop, mtClass>::add_entry(index, (HashtableEntry<oop, mtClass>*)new_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Dictionary(int table_size);
|
Dictionary(int table_size);
|
||||||
Dictionary(int table_size, HashtableBucket* t, int number_of_entries);
|
Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);
|
||||||
|
|
||||||
DictionaryEntry* new_entry(unsigned int hash, klassOop klass, oop loader);
|
DictionaryEntry* new_entry(unsigned int hash, klassOop klass, oop loader);
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ public:
|
||||||
// The following classes can be in dictionary.cpp, but we need these
|
// The following classes can be in dictionary.cpp, but we need these
|
||||||
// to be in header file so that SA's vmStructs can access.
|
// to be in header file so that SA's vmStructs can access.
|
||||||
|
|
||||||
class ProtectionDomainEntry :public CHeapObj {
|
class ProtectionDomainEntry :public CHeapObj<mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
public:
|
public:
|
||||||
ProtectionDomainEntry* _next;
|
ProtectionDomainEntry* _next;
|
||||||
|
@ -147,7 +147,7 @@ class ProtectionDomainEntry :public CHeapObj {
|
||||||
// An entry in the system dictionary, this describes a class as
|
// An entry in the system dictionary, this describes a class as
|
||||||
// { klassOop, loader, protection_domain }.
|
// { klassOop, loader, protection_domain }.
|
||||||
|
|
||||||
class DictionaryEntry : public HashtableEntry<klassOop> {
|
class DictionaryEntry : public HashtableEntry<klassOop, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
// Contains the set of approved protection domains that can access
|
// Contains the set of approved protection domains that can access
|
||||||
|
@ -166,11 +166,11 @@ class DictionaryEntry : public HashtableEntry<klassOop> {
|
||||||
klassOop* klass_addr() { return (klassOop*)literal_addr(); }
|
klassOop* klass_addr() { return (klassOop*)literal_addr(); }
|
||||||
|
|
||||||
DictionaryEntry* next() const {
|
DictionaryEntry* next() const {
|
||||||
return (DictionaryEntry*)HashtableEntry<klassOop>::next();
|
return (DictionaryEntry*)HashtableEntry<klassOop, mtClass>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
DictionaryEntry** next_addr() {
|
DictionaryEntry** next_addr() {
|
||||||
return (DictionaryEntry**)HashtableEntry<klassOop>::next_addr();
|
return (DictionaryEntry**)HashtableEntry<klassOop, mtClass>::next_addr();
|
||||||
}
|
}
|
||||||
|
|
||||||
oop loader() const { return _loader; }
|
oop loader() const { return _loader; }
|
||||||
|
@ -228,7 +228,7 @@ class DictionaryEntry : public HashtableEntry<klassOop> {
|
||||||
|
|
||||||
// Entry in a SymbolPropertyTable, mapping a single Symbol*
|
// Entry in a SymbolPropertyTable, mapping a single Symbol*
|
||||||
// to a managed and an unmanaged pointer.
|
// to a managed and an unmanaged pointer.
|
||||||
class SymbolPropertyEntry : public HashtableEntry<Symbol*> {
|
class SymbolPropertyEntry : public HashtableEntry<Symbol*, mtSymbol> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
intptr_t _symbol_mode; // secondary key
|
intptr_t _symbol_mode; // secondary key
|
||||||
|
@ -248,11 +248,11 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*> {
|
||||||
void set_property_data(address p) { _property_data = p; }
|
void set_property_data(address p) { _property_data = p; }
|
||||||
|
|
||||||
SymbolPropertyEntry* next() const {
|
SymbolPropertyEntry* next() const {
|
||||||
return (SymbolPropertyEntry*)HashtableEntry<Symbol*>::next();
|
return (SymbolPropertyEntry*)HashtableEntry<Symbol*, mtSymbol>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolPropertyEntry** next_addr() {
|
SymbolPropertyEntry** next_addr() {
|
||||||
return (SymbolPropertyEntry**)HashtableEntry<Symbol*>::next_addr();
|
return (SymbolPropertyEntry**)HashtableEntry<Symbol*, mtSymbol>::next_addr();
|
||||||
}
|
}
|
||||||
|
|
||||||
oop* property_oop_addr() { return &_property_oop; }
|
oop* property_oop_addr() { return &_property_oop; }
|
||||||
|
@ -278,16 +278,16 @@ class SymbolPropertyEntry : public HashtableEntry<Symbol*> {
|
||||||
// A system-internal mapping of symbols to pointers, both managed
|
// A system-internal mapping of symbols to pointers, both managed
|
||||||
// and unmanaged. Used to record the auto-generation of each method
|
// and unmanaged. Used to record the auto-generation of each method
|
||||||
// MethodHandle.invoke(S)T, for all signatures (S)T.
|
// MethodHandle.invoke(S)T, for all signatures (S)T.
|
||||||
class SymbolPropertyTable : public Hashtable<Symbol*> {
|
class SymbolPropertyTable : public Hashtable<Symbol*, mtSymbol> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
SymbolPropertyEntry* bucket(int i) {
|
SymbolPropertyEntry* bucket(int i) {
|
||||||
return (SymbolPropertyEntry*) Hashtable<Symbol*>::bucket(i);
|
return (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::bucket(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following method is not MT-safe and must be done under lock.
|
// The following method is not MT-safe and must be done under lock.
|
||||||
SymbolPropertyEntry** bucket_addr(int i) {
|
SymbolPropertyEntry** bucket_addr(int i) {
|
||||||
return (SymbolPropertyEntry**) Hashtable<Symbol*>::bucket_addr(i);
|
return (SymbolPropertyEntry**) Hashtable<Symbol*, mtSymbol>::bucket_addr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, SymbolPropertyEntry* new_entry) {
|
void add_entry(int index, SymbolPropertyEntry* new_entry) {
|
||||||
|
@ -298,7 +298,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
|
SymbolPropertyEntry* new_entry(unsigned int hash, Symbol* symbol, intptr_t symbol_mode) {
|
||||||
SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable<Symbol*>::new_entry(hash, symbol);
|
SymbolPropertyEntry* entry = (SymbolPropertyEntry*) Hashtable<Symbol*, mtSymbol>::new_entry(hash, symbol);
|
||||||
// Hashtable with Symbol* literal must increment and decrement refcount.
|
// Hashtable with Symbol* literal must increment and decrement refcount.
|
||||||
symbol->increment_refcount();
|
symbol->increment_refcount();
|
||||||
entry->set_symbol_mode(symbol_mode);
|
entry->set_symbol_mode(symbol_mode);
|
||||||
|
@ -309,17 +309,17 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SymbolPropertyTable(int table_size);
|
SymbolPropertyTable(int table_size);
|
||||||
SymbolPropertyTable(int table_size, HashtableBucket* t, int number_of_entries);
|
SymbolPropertyTable(int table_size, HashtableBucket<mtSymbol>* t, int number_of_entries);
|
||||||
|
|
||||||
void free_entry(SymbolPropertyEntry* entry) {
|
void free_entry(SymbolPropertyEntry* entry) {
|
||||||
// decrement Symbol refcount here because hashtable doesn't.
|
// decrement Symbol refcount here because hashtable doesn't.
|
||||||
entry->literal()->decrement_refcount();
|
entry->literal()->decrement_refcount();
|
||||||
Hashtable<Symbol*>::free_entry(entry);
|
Hashtable<Symbol*, mtSymbol>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int compute_hash(Symbol* sym, intptr_t symbol_mode) {
|
unsigned int compute_hash(Symbol* sym, intptr_t symbol_mode) {
|
||||||
// Use the regular identity_hash.
|
// Use the regular identity_hash.
|
||||||
return Hashtable<Symbol*>::compute_hash(sym) ^ symbol_mode;
|
return Hashtable<Symbol*, mtSymbol>::compute_hash(sym) ^ symbol_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index_for(Symbol* name, intptr_t symbol_mode) {
|
int index_for(Symbol* name, intptr_t symbol_mode) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ void JavaAssertions::addOption(const char* name, bool enable) {
|
||||||
// it is never freed, so will be leaked (along with other option strings -
|
// it is never freed, so will be leaked (along with other option strings -
|
||||||
// e.g., bootclasspath) if a process creates/destroys multiple VMs.
|
// e.g., bootclasspath) if a process creates/destroys multiple VMs.
|
||||||
int len = (int)strlen(name);
|
int len = (int)strlen(name);
|
||||||
char *name_copy = NEW_C_HEAP_ARRAY(char, len + 1);
|
char *name_copy = NEW_C_HEAP_ARRAY(char, len + 1, mtClass);
|
||||||
strcpy(name_copy, name);
|
strcpy(name_copy, name);
|
||||||
|
|
||||||
// Figure out which list the new item should go on. Names that end in "..."
|
// Figure out which list the new item should go on. Names that end in "..."
|
||||||
|
|
|
@ -68,7 +68,7 @@ private:
|
||||||
static OptionList* _packages; // Options for package trees.
|
static OptionList* _packages; // Options for package trees.
|
||||||
};
|
};
|
||||||
|
|
||||||
class JavaAssertions::OptionList: public CHeapObj {
|
class JavaAssertions::OptionList: public CHeapObj<mtClass> {
|
||||||
public:
|
public:
|
||||||
inline OptionList(const char* name, bool enable, OptionList* next);
|
inline OptionList(const char* name, bool enable, OptionList* next);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "utilities/hashtable.inline.hpp"
|
#include "utilities/hashtable.inline.hpp"
|
||||||
|
|
||||||
LoaderConstraintTable::LoaderConstraintTable(int nof_buckets)
|
LoaderConstraintTable::LoaderConstraintTable(int nof_buckets)
|
||||||
: Hashtable<klassOop>(nof_buckets, sizeof(LoaderConstraintEntry)) {};
|
: Hashtable<klassOop, mtClass>(nof_buckets, sizeof(LoaderConstraintEntry)) {};
|
||||||
|
|
||||||
|
|
||||||
LoaderConstraintEntry* LoaderConstraintTable::new_entry(
|
LoaderConstraintEntry* LoaderConstraintTable::new_entry(
|
||||||
|
@ -39,7 +39,7 @@ LoaderConstraintEntry* LoaderConstraintTable::new_entry(
|
||||||
klassOop klass, int num_loaders,
|
klassOop klass, int num_loaders,
|
||||||
int max_loaders) {
|
int max_loaders) {
|
||||||
LoaderConstraintEntry* entry;
|
LoaderConstraintEntry* entry;
|
||||||
entry = (LoaderConstraintEntry*)Hashtable<klassOop>::new_entry(hash, klass);
|
entry = (LoaderConstraintEntry*)Hashtable<klassOop, mtClass>::new_entry(hash, klass);
|
||||||
entry->set_name(name);
|
entry->set_name(name);
|
||||||
entry->set_num_loaders(num_loaders);
|
entry->set_num_loaders(num_loaders);
|
||||||
entry->set_max_loaders(max_loaders);
|
entry->set_max_loaders(max_loaders);
|
||||||
|
@ -49,7 +49,7 @@ LoaderConstraintEntry* LoaderConstraintTable::new_entry(
|
||||||
void LoaderConstraintTable::free_entry(LoaderConstraintEntry *entry) {
|
void LoaderConstraintTable::free_entry(LoaderConstraintEntry *entry) {
|
||||||
// decrement name refcount before freeing
|
// decrement name refcount before freeing
|
||||||
entry->name()->decrement_refcount();
|
entry->name()->decrement_refcount();
|
||||||
Hashtable<klassOop>::free_entry(entry);
|
Hashtable<klassOop, mtClass>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void LoaderConstraintTable::purge_loader_constraints(BoolObjectClosure* is_alive
|
||||||
|
|
||||||
// Purge entry
|
// Purge entry
|
||||||
*p = probe->next();
|
*p = probe->next();
|
||||||
FREE_C_HEAP_ARRAY(oop, probe->loaders());
|
FREE_C_HEAP_ARRAY(oop, probe->loaders(), mtClass);
|
||||||
free_entry(probe);
|
free_entry(probe);
|
||||||
} else {
|
} else {
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
|
@ -224,7 +224,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
|
||||||
int index = hash_to_index(hash);
|
int index = hash_to_index(hash);
|
||||||
LoaderConstraintEntry* p;
|
LoaderConstraintEntry* p;
|
||||||
p = new_entry(hash, class_name, klass, 2, 2);
|
p = new_entry(hash, class_name, klass, 2, 2);
|
||||||
p->set_loaders(NEW_C_HEAP_ARRAY(oop, 2));
|
p->set_loaders(NEW_C_HEAP_ARRAY(oop, 2, mtClass));
|
||||||
p->set_loader(0, class_loader1());
|
p->set_loader(0, class_loader1());
|
||||||
p->set_loader(1, class_loader2());
|
p->set_loader(1, class_loader2());
|
||||||
p->set_klass(klass);
|
p->set_klass(klass);
|
||||||
|
@ -340,10 +340,10 @@ void LoaderConstraintTable::ensure_loader_constraint_capacity(
|
||||||
int nfree) {
|
int nfree) {
|
||||||
if (p->max_loaders() - p->num_loaders() < nfree) {
|
if (p->max_loaders() - p->num_loaders() < nfree) {
|
||||||
int n = nfree + p->num_loaders();
|
int n = nfree + p->num_loaders();
|
||||||
oop* new_loaders = NEW_C_HEAP_ARRAY(oop, n);
|
oop* new_loaders = NEW_C_HEAP_ARRAY(oop, n, mtClass);
|
||||||
memcpy(new_loaders, p->loaders(), sizeof(oop) * p->num_loaders());
|
memcpy(new_loaders, p->loaders(), sizeof(oop) * p->num_loaders());
|
||||||
p->set_max_loaders(n);
|
p->set_max_loaders(n);
|
||||||
FREE_C_HEAP_ARRAY(oop, p->loaders());
|
FREE_C_HEAP_ARRAY(oop, p->loaders(), mtClass);
|
||||||
p->set_loaders(new_loaders);
|
p->set_loaders(new_loaders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,7 +425,7 @@ void LoaderConstraintTable::merge_loader_constraints(
|
||||||
}
|
}
|
||||||
|
|
||||||
*pp2 = p2->next();
|
*pp2 = p2->next();
|
||||||
FREE_C_HEAP_ARRAY(oop, p2->loaders());
|
FREE_C_HEAP_ARRAY(oop, p2->loaders(), mtClass);
|
||||||
free_entry(p2);
|
free_entry(p2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
class LoaderConstraintEntry;
|
class LoaderConstraintEntry;
|
||||||
|
|
||||||
class LoaderConstraintTable : public Hashtable<klassOop> {
|
class LoaderConstraintTable : public Hashtable<klassOop, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -53,11 +53,11 @@ public:
|
||||||
void free_entry(LoaderConstraintEntry *entry);
|
void free_entry(LoaderConstraintEntry *entry);
|
||||||
|
|
||||||
LoaderConstraintEntry* bucket(int i) {
|
LoaderConstraintEntry* bucket(int i) {
|
||||||
return (LoaderConstraintEntry*)Hashtable<klassOop>::bucket(i);
|
return (LoaderConstraintEntry*)Hashtable<klassOop, mtClass>::bucket(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoaderConstraintEntry** bucket_addr(int i) {
|
LoaderConstraintEntry** bucket_addr(int i) {
|
||||||
return (LoaderConstraintEntry**)Hashtable<klassOop>::bucket_addr(i);
|
return (LoaderConstraintEntry**)Hashtable<klassOop, mtClass>::bucket_addr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GC support
|
// GC support
|
||||||
|
@ -94,7 +94,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class LoaderConstraintEntry : public HashtableEntry<klassOop> {
|
class LoaderConstraintEntry : public HashtableEntry<klassOop, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
Symbol* _name; // class name
|
Symbol* _name; // class name
|
||||||
|
@ -109,14 +109,14 @@ public:
|
||||||
void set_klass(klassOop k) { set_literal(k); }
|
void set_klass(klassOop k) { set_literal(k); }
|
||||||
|
|
||||||
LoaderConstraintEntry* next() {
|
LoaderConstraintEntry* next() {
|
||||||
return (LoaderConstraintEntry*)HashtableEntry<klassOop>::next();
|
return (LoaderConstraintEntry*)HashtableEntry<klassOop, mtClass>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
LoaderConstraintEntry** next_addr() {
|
LoaderConstraintEntry** next_addr() {
|
||||||
return (LoaderConstraintEntry**)HashtableEntry<klassOop>::next_addr();
|
return (LoaderConstraintEntry**)HashtableEntry<klassOop, mtClass>::next_addr();
|
||||||
}
|
}
|
||||||
void set_next(LoaderConstraintEntry* next) {
|
void set_next(LoaderConstraintEntry* next) {
|
||||||
HashtableEntry<klassOop>::set_next(next);
|
HashtableEntry<klassOop, mtClass>::set_next(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* name() { return _name; }
|
Symbol* name() { return _name; }
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name,
|
PlaceholderEntry* PlaceholderTable::new_entry(int hash, Symbol* name,
|
||||||
oop loader, bool havesupername,
|
oop loader, bool havesupername,
|
||||||
Symbol* supername) {
|
Symbol* supername) {
|
||||||
PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable<Symbol*>::new_entry(hash, name);
|
PlaceholderEntry* entry = (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::new_entry(hash, name);
|
||||||
// Hashtable with Symbol* literal must increment and decrement refcount.
|
// Hashtable with Symbol* literal must increment and decrement refcount.
|
||||||
name->increment_refcount();
|
name->increment_refcount();
|
||||||
entry->set_loader(loader);
|
entry->set_loader(loader);
|
||||||
|
@ -52,7 +52,7 @@ void PlaceholderTable::free_entry(PlaceholderEntry* entry) {
|
||||||
// decrement Symbol refcount here because Hashtable doesn't.
|
// decrement Symbol refcount here because Hashtable doesn't.
|
||||||
entry->literal()->decrement_refcount();
|
entry->literal()->decrement_refcount();
|
||||||
if (entry->supername() != NULL) entry->supername()->decrement_refcount();
|
if (entry->supername() != NULL) entry->supername()->decrement_refcount();
|
||||||
Hashtable<Symbol*>::free_entry(entry);
|
Hashtable<Symbol*, mtClass>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ void PlaceholderTable::find_and_remove(int index, unsigned int hash,
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaceholderTable::PlaceholderTable(int table_size)
|
PlaceholderTable::PlaceholderTable(int table_size)
|
||||||
: TwoOopHashtable<Symbol*>(table_size, sizeof(PlaceholderEntry)) {
|
: TwoOopHashtable<Symbol*, mtClass>(table_size, sizeof(PlaceholderEntry)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class PlaceholderEntry;
|
||||||
// being loaded, as well as arrays of primitives.
|
// being loaded, as well as arrays of primitives.
|
||||||
//
|
//
|
||||||
|
|
||||||
class PlaceholderTable : public TwoOopHashtable<Symbol*> {
|
class PlaceholderTable : public TwoOopHashtable<Symbol*, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -44,15 +44,15 @@ public:
|
||||||
void free_entry(PlaceholderEntry* entry);
|
void free_entry(PlaceholderEntry* entry);
|
||||||
|
|
||||||
PlaceholderEntry* bucket(int i) {
|
PlaceholderEntry* bucket(int i) {
|
||||||
return (PlaceholderEntry*)Hashtable<Symbol*>::bucket(i);
|
return (PlaceholderEntry*)Hashtable<Symbol*, mtClass>::bucket(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaceholderEntry** bucket_addr(int i) {
|
PlaceholderEntry** bucket_addr(int i) {
|
||||||
return (PlaceholderEntry**)Hashtable<Symbol*>::bucket_addr(i);
|
return (PlaceholderEntry**)Hashtable<Symbol*, mtClass>::bucket_addr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, PlaceholderEntry* new_entry) {
|
void add_entry(int index, PlaceholderEntry* new_entry) {
|
||||||
Hashtable<Symbol*>::add_entry(index, (HashtableEntry<Symbol*>*)new_entry);
|
Hashtable<Symbol*, mtClass>::add_entry(index, (HashtableEntry<Symbol*, mtClass>*)new_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, unsigned int hash, Symbol* name,
|
void add_entry(int index, unsigned int hash, Symbol* name,
|
||||||
|
@ -116,7 +116,7 @@ public:
|
||||||
// For DEFINE_CLASS, the head of the queue owns the
|
// For DEFINE_CLASS, the head of the queue owns the
|
||||||
// define token and the rest of the threads wait to return the
|
// define token and the rest of the threads wait to return the
|
||||||
// result the first thread gets.
|
// result the first thread gets.
|
||||||
class SeenThread: public CHeapObj {
|
class SeenThread: public CHeapObj<mtInternal> {
|
||||||
private:
|
private:
|
||||||
Thread *_thread;
|
Thread *_thread;
|
||||||
SeenThread* _stnext;
|
SeenThread* _stnext;
|
||||||
|
@ -152,7 +152,7 @@ public:
|
||||||
// on store ordering here.
|
// on store ordering here.
|
||||||
// The system dictionary is the only user of this class.
|
// The system dictionary is the only user of this class.
|
||||||
|
|
||||||
class PlaceholderEntry : public HashtableEntry<Symbol*> {
|
class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,11 +206,11 @@ class PlaceholderEntry : public HashtableEntry<Symbol*> {
|
||||||
void set_defineThreadQ(SeenThread* SeenThread) { _defineThreadQ = SeenThread; }
|
void set_defineThreadQ(SeenThread* SeenThread) { _defineThreadQ = SeenThread; }
|
||||||
|
|
||||||
PlaceholderEntry* next() const {
|
PlaceholderEntry* next() const {
|
||||||
return (PlaceholderEntry*)HashtableEntry<Symbol*>::next();
|
return (PlaceholderEntry*)HashtableEntry<Symbol*, mtClass>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaceholderEntry** next_addr() {
|
PlaceholderEntry** next_addr() {
|
||||||
return (PlaceholderEntry**)HashtableEntry<Symbol*>::next_addr();
|
return (PlaceholderEntry**)HashtableEntry<Symbol*, mtClass>::next_addr();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for equality
|
// Test for equality
|
||||||
|
|
|
@ -67,7 +67,7 @@ void ResolutionErrorEntry::set_error(Symbol* e) {
|
||||||
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, constantPoolOop pool,
|
ResolutionErrorEntry* ResolutionErrorTable::new_entry(int hash, constantPoolOop pool,
|
||||||
int cp_index, Symbol* error)
|
int cp_index, Symbol* error)
|
||||||
{
|
{
|
||||||
ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<constantPoolOop>::new_entry(hash, pool);
|
ResolutionErrorEntry* entry = (ResolutionErrorEntry*)Hashtable<constantPoolOop, mtClass>::new_entry(hash, pool);
|
||||||
entry->set_cp_index(cp_index);
|
entry->set_cp_index(cp_index);
|
||||||
NOT_PRODUCT(entry->set_error(NULL);)
|
NOT_PRODUCT(entry->set_error(NULL);)
|
||||||
entry->set_error(error);
|
entry->set_error(error);
|
||||||
|
@ -79,13 +79,13 @@ void ResolutionErrorTable::free_entry(ResolutionErrorEntry *entry) {
|
||||||
// decrement error refcount
|
// decrement error refcount
|
||||||
assert(entry->error() != NULL, "error should be set");
|
assert(entry->error() != NULL, "error should be set");
|
||||||
entry->error()->decrement_refcount();
|
entry->error()->decrement_refcount();
|
||||||
Hashtable<constantPoolOop>::free_entry(entry);
|
Hashtable<constantPoolOop, mtClass>::free_entry(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create resolution error table
|
// create resolution error table
|
||||||
ResolutionErrorTable::ResolutionErrorTable(int table_size)
|
ResolutionErrorTable::ResolutionErrorTable(int table_size)
|
||||||
: Hashtable<constantPoolOop>(table_size, sizeof(ResolutionErrorEntry)) {
|
: Hashtable<constantPoolOop, mtClass>(table_size, sizeof(ResolutionErrorEntry)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GC support
|
// GC support
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ResolutionErrorEntry;
|
||||||
// ResolutionError objects are used to record errors encountered during
|
// ResolutionError objects are used to record errors encountered during
|
||||||
// constant pool resolution (JVMS 5.4.3).
|
// constant pool resolution (JVMS 5.4.3).
|
||||||
|
|
||||||
class ResolutionErrorTable : public Hashtable<constantPoolOop> {
|
class ResolutionErrorTable : public Hashtable<constantPoolOop, mtClass> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ResolutionErrorTable(int table_size);
|
ResolutionErrorTable(int table_size);
|
||||||
|
@ -42,15 +42,16 @@ public:
|
||||||
void free_entry(ResolutionErrorEntry *entry);
|
void free_entry(ResolutionErrorEntry *entry);
|
||||||
|
|
||||||
ResolutionErrorEntry* bucket(int i) {
|
ResolutionErrorEntry* bucket(int i) {
|
||||||
return (ResolutionErrorEntry*)Hashtable<constantPoolOop>::bucket(i);
|
return (ResolutionErrorEntry*)Hashtable<constantPoolOop, mtClass>::bucket(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResolutionErrorEntry** bucket_addr(int i) {
|
ResolutionErrorEntry** bucket_addr(int i) {
|
||||||
return (ResolutionErrorEntry**)Hashtable<constantPoolOop>::bucket_addr(i);
|
return (ResolutionErrorEntry**)Hashtable<constantPoolOop, mtClass>::bucket_addr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, ResolutionErrorEntry* new_entry) {
|
void add_entry(int index, ResolutionErrorEntry* new_entry) {
|
||||||
Hashtable<constantPoolOop>::add_entry(index, (HashtableEntry<constantPoolOop>*)new_entry);
|
Hashtable<constantPoolOop, mtClass>::add_entry(index,
|
||||||
|
(HashtableEntry<constantPoolOop, mtClass>*)new_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_entry(int index, unsigned int hash,
|
void add_entry(int index, unsigned int hash,
|
||||||
|
@ -74,7 +75,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ResolutionErrorEntry : public HashtableEntry<constantPoolOop> {
|
class ResolutionErrorEntry : public HashtableEntry<constantPoolOop, mtClass> {
|
||||||
private:
|
private:
|
||||||
int _cp_index;
|
int _cp_index;
|
||||||
Symbol* _error;
|
Symbol* _error;
|
||||||
|
@ -90,11 +91,11 @@ class ResolutionErrorEntry : public HashtableEntry<constantPoolOop> {
|
||||||
void set_error(Symbol* e);
|
void set_error(Symbol* e);
|
||||||
|
|
||||||
ResolutionErrorEntry* next() const {
|
ResolutionErrorEntry* next() const {
|
||||||
return (ResolutionErrorEntry*)HashtableEntry<constantPoolOop>::next();
|
return (ResolutionErrorEntry*)HashtableEntry<constantPoolOop, mtClass>::next();
|
||||||
}
|
}
|
||||||
|
|
||||||
ResolutionErrorEntry** next_addr() {
|
ResolutionErrorEntry** next_addr() {
|
||||||
return (ResolutionErrorEntry**)HashtableEntry<constantPoolOop>::next_addr();
|
return (ResolutionErrorEntry**)HashtableEntry<constantPoolOop, mtClass>::next_addr();
|
||||||
}
|
}
|
||||||
|
|
||||||
// GC support
|
// GC support
|
||||||
|
|
|
@ -64,9 +64,9 @@ Symbol* SymbolTable::allocate_symbol(const u1* name, int len, bool c_heap, TRAPS
|
||||||
void SymbolTable::initialize_symbols(int arena_alloc_size) {
|
void SymbolTable::initialize_symbols(int arena_alloc_size) {
|
||||||
// Initialize the arena for global symbols, size passed in depends on CDS.
|
// Initialize the arena for global symbols, size passed in depends on CDS.
|
||||||
if (arena_alloc_size == 0) {
|
if (arena_alloc_size == 0) {
|
||||||
_arena = new Arena();
|
_arena = new (mtSymbol) Arena();
|
||||||
} else {
|
} else {
|
||||||
_arena = new Arena(arena_alloc_size);
|
_arena = new (mtSymbol) Arena(arena_alloc_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ void SymbolTable::initialize_symbols(int arena_alloc_size) {
|
||||||
void SymbolTable::symbols_do(SymbolClosure *cl) {
|
void SymbolTable::symbols_do(SymbolClosure *cl) {
|
||||||
const int n = the_table()->table_size();
|
const int n = the_table()->table_size();
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
for (HashtableEntry<Symbol*>* p = the_table()->bucket(i);
|
for (HashtableEntry<Symbol*, mtSymbol>* p = the_table()->bucket(i);
|
||||||
p != NULL;
|
p != NULL;
|
||||||
p = p->next()) {
|
p = p->next()) {
|
||||||
cl->do_symbol(p->literal_addr());
|
cl->do_symbol(p->literal_addr());
|
||||||
|
@ -92,8 +92,8 @@ void SymbolTable::unlink() {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
size_t memory_total = 0;
|
size_t memory_total = 0;
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<Symbol*>** p = the_table()->bucket_addr(i);
|
HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||||
HashtableEntry<Symbol*>* entry = the_table()->bucket(i);
|
HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
// Shared entries are normally at the end of the bucket and if we run into
|
// Shared entries are normally at the end of the bucket and if we run into
|
||||||
// a shared entry, then there is nothing more to remove. However, if we
|
// a shared entry, then there is nothing more to remove. However, if we
|
||||||
|
@ -117,7 +117,7 @@ void SymbolTable::unlink() {
|
||||||
p = entry->next_addr();
|
p = entry->next_addr();
|
||||||
}
|
}
|
||||||
// get next entry
|
// get next entry
|
||||||
entry = (HashtableEntry<Symbol*>*)HashtableEntry<Symbol*>::make_ptr(*p);
|
entry = (HashtableEntry<Symbol*, mtSymbol>*)HashtableEntry<Symbol*, mtSymbol>::make_ptr(*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
symbols_removed += removed;
|
symbols_removed += removed;
|
||||||
|
@ -164,7 +164,7 @@ void SymbolTable::rehash_table() {
|
||||||
Symbol* SymbolTable::lookup(int index, const char* name,
|
Symbol* SymbolTable::lookup(int index, const char* name,
|
||||||
int len, unsigned int hash) {
|
int len, unsigned int hash) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (HashtableEntry<Symbol*>* e = bucket(index); e != NULL; e = e->next()) {
|
for (HashtableEntry<Symbol*, mtSymbol>* e = bucket(index); e != NULL; e = e->next()) {
|
||||||
count++; // count all entries in this bucket, not just ones with same hash
|
count++; // count all entries in this bucket, not just ones with same hash
|
||||||
if (e->hash() == hash) {
|
if (e->hash() == hash) {
|
||||||
Symbol* sym = e->literal();
|
Symbol* sym = e->literal();
|
||||||
|
@ -176,7 +176,7 @@ Symbol* SymbolTable::lookup(int index, const char* name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If the bucket size is too deep check if this hash code is insufficient.
|
// If the bucket size is too deep check if this hash code is insufficient.
|
||||||
if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
|
if (count >= BasicHashtable<mtSymbol>::rehash_count && !needs_rehashing()) {
|
||||||
_needs_rehashing = check_rehash_table(count);
|
_needs_rehashing = check_rehash_table(count);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -268,7 +268,7 @@ Symbol** SymbolTable::lookup_symbol_addr(Symbol* sym){
|
||||||
unsigned int hash = hash_symbol((char*)sym->bytes(), sym->utf8_length());
|
unsigned int hash = hash_symbol((char*)sym->bytes(), sym->utf8_length());
|
||||||
int index = the_table()->hash_to_index(hash);
|
int index = the_table()->hash_to_index(hash);
|
||||||
|
|
||||||
for (HashtableEntry<Symbol*>* e = the_table()->bucket(index); e != NULL; e = e->next()) {
|
for (HashtableEntry<Symbol*, mtSymbol>* e = the_table()->bucket(index); e != NULL; e = e->next()) {
|
||||||
if (e->hash() == hash) {
|
if (e->hash() == hash) {
|
||||||
Symbol* literal_sym = e->literal();
|
Symbol* literal_sym = e->literal();
|
||||||
if (sym == literal_sym) {
|
if (sym == literal_sym) {
|
||||||
|
@ -387,7 +387,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
|
||||||
Symbol* sym = allocate_symbol(name, len, c_heap, CHECK_NULL);
|
Symbol* sym = allocate_symbol(name, len, c_heap, CHECK_NULL);
|
||||||
assert(sym->equals((char*)name, len), "symbol must be properly initialized");
|
assert(sym->equals((char*)name, len), "symbol must be properly initialized");
|
||||||
|
|
||||||
HashtableEntry<Symbol*>* entry = new_entry(hashValue, sym);
|
HashtableEntry<Symbol*, mtSymbol>* entry = new_entry(hashValue, sym);
|
||||||
add_entry(index, entry);
|
add_entry(index, entry);
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ bool SymbolTable::basic_add(Handle class_loader, constantPoolHandle cp,
|
||||||
bool c_heap = class_loader() != NULL;
|
bool c_heap = class_loader() != NULL;
|
||||||
Symbol* sym = allocate_symbol((const u1*)names[i], lengths[i], c_heap, CHECK_(false));
|
Symbol* sym = allocate_symbol((const u1*)names[i], lengths[i], c_heap, CHECK_(false));
|
||||||
assert(sym->equals(names[i], lengths[i]), "symbol must be properly initialized"); // why wouldn't it be???
|
assert(sym->equals(names[i], lengths[i]), "symbol must be properly initialized"); // why wouldn't it be???
|
||||||
HashtableEntry<Symbol*>* entry = new_entry(hashValue, sym);
|
HashtableEntry<Symbol*, mtSymbol>* entry = new_entry(hashValue, sym);
|
||||||
add_entry(index, entry);
|
add_entry(index, entry);
|
||||||
cp->symbol_at_put(cp_indices[i], sym);
|
cp->symbol_at_put(cp_indices[i], sym);
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ bool SymbolTable::basic_add(Handle class_loader, constantPoolHandle cp,
|
||||||
|
|
||||||
void SymbolTable::verify() {
|
void SymbolTable::verify() {
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<Symbol*>* p = the_table()->bucket(i);
|
HashtableEntry<Symbol*, mtSymbol>* p = the_table()->bucket(i);
|
||||||
for ( ; p != NULL; p = p->next()) {
|
for ( ; p != NULL; p = p->next()) {
|
||||||
Symbol* s = (Symbol*)(p->literal());
|
Symbol* s = (Symbol*)(p->literal());
|
||||||
guarantee(s != NULL, "symbol is NULL");
|
guarantee(s != NULL, "symbol is NULL");
|
||||||
|
@ -462,7 +462,7 @@ void SymbolTable::dump(outputStream* st) {
|
||||||
NumberSeq summary;
|
NumberSeq summary;
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (HashtableEntry<Symbol*>* e = the_table()->bucket(i);
|
for (HashtableEntry<Symbol*, mtSymbol>* e = the_table()->bucket(i);
|
||||||
e != NULL; e = e->next()) {
|
e != NULL; e = e->next()) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ void SymbolTable::print_histogram() {
|
||||||
int memory_total = 0;
|
int memory_total = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (i = 0; i < the_table()->table_size(); i++) {
|
for (i = 0; i < the_table()->table_size(); i++) {
|
||||||
HashtableEntry<Symbol*>* p = the_table()->bucket(i);
|
HashtableEntry<Symbol*, mtSymbol>* p = the_table()->bucket(i);
|
||||||
for ( ; p != NULL; p = p->next()) {
|
for ( ; p != NULL; p = p->next()) {
|
||||||
memory_total += p->literal()->object_size();
|
memory_total += p->literal()->object_size();
|
||||||
count++;
|
count++;
|
||||||
|
@ -560,15 +560,15 @@ void SymbolTable::print_histogram() {
|
||||||
|
|
||||||
void SymbolTable::print() {
|
void SymbolTable::print() {
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<Symbol*>** p = the_table()->bucket_addr(i);
|
HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||||
HashtableEntry<Symbol*>* entry = the_table()->bucket(i);
|
HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
|
||||||
if (entry != NULL) {
|
if (entry != NULL) {
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
tty->print(PTR_FORMAT " ", entry->literal());
|
tty->print(PTR_FORMAT " ", entry->literal());
|
||||||
entry->literal()->print();
|
entry->literal()->print();
|
||||||
tty->print(" %d", entry->literal()->refcount());
|
tty->print(" %d", entry->literal()->refcount());
|
||||||
p = entry->next_addr();
|
p = entry->next_addr();
|
||||||
entry = (HashtableEntry<Symbol*>*)HashtableEntry<Symbol*>::make_ptr(*p);
|
entry = (HashtableEntry<Symbol*, mtSymbol>*)HashtableEntry<Symbol*, mtSymbol>::make_ptr(*p);
|
||||||
}
|
}
|
||||||
tty->cr();
|
tty->cr();
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,7 @@ unsigned int StringTable::hash_string(const jchar* s, int len) {
|
||||||
oop StringTable::lookup(int index, jchar* name,
|
oop StringTable::lookup(int index, jchar* name,
|
||||||
int len, unsigned int hash) {
|
int len, unsigned int hash) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (HashtableEntry<oop>* l = bucket(index); l != NULL; l = l->next()) {
|
for (HashtableEntry<oop, mtSymbol>* l = bucket(index); l != NULL; l = l->next()) {
|
||||||
count++;
|
count++;
|
||||||
if (l->hash() == hash) {
|
if (l->hash() == hash) {
|
||||||
if (java_lang_String::equals(l->literal(), name, len)) {
|
if (java_lang_String::equals(l->literal(), name, len)) {
|
||||||
|
@ -640,7 +640,7 @@ oop StringTable::lookup(int index, jchar* name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If the bucket size is too deep check if this hash code is insufficient.
|
// If the bucket size is too deep check if this hash code is insufficient.
|
||||||
if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
|
if (count >= BasicHashtable<mtSymbol>::rehash_count && !needs_rehashing()) {
|
||||||
_needs_rehashing = check_rehash_table(count);
|
_needs_rehashing = check_rehash_table(count);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -676,7 +676,7 @@ oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashtableEntry<oop>* entry = new_entry(hashValue, string());
|
HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
|
||||||
add_entry(index, entry);
|
add_entry(index, entry);
|
||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
|
@ -761,8 +761,8 @@ void StringTable::unlink(BoolObjectClosure* is_alive) {
|
||||||
// entries at a safepoint.
|
// entries at a safepoint.
|
||||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<oop>** p = the_table()->bucket_addr(i);
|
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||||
HashtableEntry<oop>* entry = the_table()->bucket(i);
|
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
// Shared entries are normally at the end of the bucket and if we run into
|
// Shared entries are normally at the end of the bucket and if we run into
|
||||||
// a shared entry, then there is nothing more to remove. However, if we
|
// a shared entry, then there is nothing more to remove. However, if we
|
||||||
|
@ -778,15 +778,15 @@ void StringTable::unlink(BoolObjectClosure* is_alive) {
|
||||||
*p = entry->next();
|
*p = entry->next();
|
||||||
the_table()->free_entry(entry);
|
the_table()->free_entry(entry);
|
||||||
}
|
}
|
||||||
entry = (HashtableEntry<oop>*)HashtableEntry<oop>::make_ptr(*p);
|
entry = (HashtableEntry<oop, mtSymbol>*)HashtableEntry<oop, mtSymbol>::make_ptr(*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringTable::oops_do(OopClosure* f) {
|
void StringTable::oops_do(OopClosure* f) {
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<oop>** p = the_table()->bucket_addr(i);
|
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||||
HashtableEntry<oop>* entry = the_table()->bucket(i);
|
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
f->do_oop((oop*)entry->literal_addr());
|
f->do_oop((oop*)entry->literal_addr());
|
||||||
|
|
||||||
|
@ -798,14 +798,14 @@ void StringTable::oops_do(OopClosure* f) {
|
||||||
} else {
|
} else {
|
||||||
p = entry->next_addr();
|
p = entry->next_addr();
|
||||||
}
|
}
|
||||||
entry = (HashtableEntry<oop>*)HashtableEntry<oop>::make_ptr(*p);
|
entry = (HashtableEntry<oop, mtSymbol>*)HashtableEntry<oop, mtSymbol>::make_ptr(*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringTable::verify() {
|
void StringTable::verify() {
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<oop>* p = the_table()->bucket(i);
|
HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
|
||||||
for ( ; p != NULL; p = p->next()) {
|
for ( ; p != NULL; p = p->next()) {
|
||||||
oop s = p->literal();
|
oop s = p->literal();
|
||||||
guarantee(s != NULL, "interned string is NULL");
|
guarantee(s != NULL, "interned string is NULL");
|
||||||
|
@ -821,7 +821,7 @@ void StringTable::verify() {
|
||||||
void StringTable::dump(outputStream* st) {
|
void StringTable::dump(outputStream* st) {
|
||||||
NumberSeq summary;
|
NumberSeq summary;
|
||||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||||
HashtableEntry<oop>* p = the_table()->bucket(i);
|
HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for ( ; p != NULL; p = p->next()) {
|
for ( ; p != NULL; p = p->next()) {
|
||||||
count++;
|
count++;
|
||||||
|
|
|
@ -71,7 +71,7 @@ class TempNewSymbol : public StackObj {
|
||||||
operator Symbol*() { return _temp; }
|
operator Symbol*() { return _temp; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class SymbolTable : public Hashtable<Symbol*> {
|
class SymbolTable : public Hashtable<Symbol*, mtSymbol> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
friend class ClassFileParser;
|
friend class ClassFileParser;
|
||||||
|
|
||||||
|
@ -113,10 +113,10 @@ private:
|
||||||
Symbol* lookup(int index, const char* name, int len, unsigned int hash);
|
Symbol* lookup(int index, const char* name, int len, unsigned int hash);
|
||||||
|
|
||||||
SymbolTable()
|
SymbolTable()
|
||||||
: Hashtable<Symbol*>(symbol_table_size, sizeof (HashtableEntry<Symbol*>)) {}
|
: Hashtable<Symbol*, mtSymbol>(symbol_table_size, sizeof (HashtableEntry<Symbol*, mtSymbol>)) {}
|
||||||
|
|
||||||
SymbolTable(HashtableBucket* t, int number_of_entries)
|
SymbolTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
|
||||||
: Hashtable<Symbol*>(symbol_table_size, sizeof (HashtableEntry<Symbol*>), t,
|
: Hashtable<Symbol*, mtSymbol>(symbol_table_size, sizeof (HashtableEntry<Symbol*, mtSymbol>), t,
|
||||||
number_of_entries) {}
|
number_of_entries) {}
|
||||||
|
|
||||||
// Arena for permanent symbols (null class loader) that are never unloaded
|
// Arena for permanent symbols (null class loader) that are never unloaded
|
||||||
|
@ -145,10 +145,10 @@ public:
|
||||||
initialize_symbols(symbol_alloc_arena_size);
|
initialize_symbols(symbol_alloc_arena_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_table(HashtableBucket* t, int length,
|
static void create_table(HashtableBucket<mtSymbol>* t, int length,
|
||||||
int number_of_entries) {
|
int number_of_entries) {
|
||||||
assert(_the_table == NULL, "One symbol table allowed.");
|
assert(_the_table == NULL, "One symbol table allowed.");
|
||||||
assert(length == symbol_table_size * sizeof(HashtableBucket),
|
assert(length == symbol_table_size * sizeof(HashtableBucket<mtSymbol>),
|
||||||
"bad shared symbol size.");
|
"bad shared symbol size.");
|
||||||
_the_table = new SymbolTable(t, number_of_entries);
|
_the_table = new SymbolTable(t, number_of_entries);
|
||||||
// if CDS give symbol table a default arena size since most symbols
|
// if CDS give symbol table a default arena size since most symbols
|
||||||
|
@ -224,13 +224,13 @@ public:
|
||||||
|
|
||||||
// Sharing
|
// Sharing
|
||||||
static void copy_buckets(char** top, char*end) {
|
static void copy_buckets(char** top, char*end) {
|
||||||
the_table()->Hashtable<Symbol*>::copy_buckets(top, end);
|
the_table()->Hashtable<Symbol*, mtSymbol>::copy_buckets(top, end);
|
||||||
}
|
}
|
||||||
static void copy_table(char** top, char*end) {
|
static void copy_table(char** top, char*end) {
|
||||||
the_table()->Hashtable<Symbol*>::copy_table(top, end);
|
the_table()->Hashtable<Symbol*, mtSymbol>::copy_table(top, end);
|
||||||
}
|
}
|
||||||
static void reverse(void* boundary = NULL) {
|
static void reverse(void* boundary = NULL) {
|
||||||
the_table()->Hashtable<Symbol*>::reverse(boundary);
|
the_table()->Hashtable<Symbol*, mtSymbol>::reverse(boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rehash the symbol table if it gets out of balance
|
// Rehash the symbol table if it gets out of balance
|
||||||
|
@ -238,8 +238,7 @@ public:
|
||||||
static bool needs_rehashing() { return _needs_rehashing; }
|
static bool needs_rehashing() { return _needs_rehashing; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class StringTable : public Hashtable<oop, mtSymbol> {
|
||||||
class StringTable : public Hashtable<oop> {
|
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -256,11 +255,11 @@ private:
|
||||||
|
|
||||||
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
|
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
|
||||||
|
|
||||||
StringTable() : Hashtable<oop>((int)StringTableSize,
|
StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
|
||||||
sizeof (HashtableEntry<oop>)) {}
|
sizeof (HashtableEntry<oop, mtSymbol>)) {}
|
||||||
|
|
||||||
StringTable(HashtableBucket* t, int number_of_entries)
|
StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
|
||||||
: Hashtable<oop>((int)StringTableSize, sizeof (HashtableEntry<oop>), t,
|
: Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
|
||||||
number_of_entries) {}
|
number_of_entries) {}
|
||||||
|
|
||||||
static bool use_alternate_hashcode() { return _seed != 0; }
|
static bool use_alternate_hashcode() { return _seed != 0; }
|
||||||
|
@ -276,10 +275,10 @@ public:
|
||||||
_the_table = new StringTable();
|
_the_table = new StringTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_table(HashtableBucket* t, int length,
|
static void create_table(HashtableBucket<mtSymbol>* t, int length,
|
||||||
int number_of_entries) {
|
int number_of_entries) {
|
||||||
assert(_the_table == NULL, "One string table allowed.");
|
assert(_the_table == NULL, "One string table allowed.");
|
||||||
assert((size_t)length == StringTableSize * sizeof(HashtableBucket),
|
assert((size_t)length == StringTableSize * sizeof(HashtableBucket<mtSymbol>),
|
||||||
"bad shared string size.");
|
"bad shared string size.");
|
||||||
_the_table = new StringTable(t, number_of_entries);
|
_the_table = new StringTable(t, number_of_entries);
|
||||||
}
|
}
|
||||||
|
@ -313,13 +312,13 @@ public:
|
||||||
|
|
||||||
// Sharing
|
// Sharing
|
||||||
static void copy_buckets(char** top, char*end) {
|
static void copy_buckets(char** top, char*end) {
|
||||||
the_table()->Hashtable<oop>::copy_buckets(top, end);
|
the_table()->Hashtable<oop, mtSymbol>::copy_buckets(top, end);
|
||||||
}
|
}
|
||||||
static void copy_table(char** top, char*end) {
|
static void copy_table(char** top, char*end) {
|
||||||
the_table()->Hashtable<oop>::copy_table(top, end);
|
the_table()->Hashtable<oop, mtSymbol>::copy_table(top, end);
|
||||||
}
|
}
|
||||||
static void reverse() {
|
static void reverse() {
|
||||||
the_table()->Hashtable<oop>::reverse();
|
the_table()->Hashtable<oop, mtSymbol>::reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rehash the symbol table if it gets out of balance
|
// Rehash the symbol table if it gets out of balance
|
||||||
|
|
|
@ -1168,9 +1168,9 @@ klassOop SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SystemDictionary::set_shared_dictionary(HashtableBucket* t, int length,
|
void SystemDictionary::set_shared_dictionary(HashtableBucket<mtClass>* t, int length,
|
||||||
int number_of_entries) {
|
int number_of_entries) {
|
||||||
assert(length == _nof_buckets * sizeof(HashtableBucket),
|
assert(length == _nof_buckets * sizeof(HashtableBucket<mtClass>),
|
||||||
"bad shared dictionary size.");
|
"bad shared dictionary size.");
|
||||||
_shared_dictionary = new Dictionary(_nof_buckets, t, number_of_entries);
|
_shared_dictionary = new Dictionary(_nof_buckets, t, number_of_entries);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
#include "runtime/reflectionUtils.hpp"
|
#include "runtime/reflectionUtils.hpp"
|
||||||
#include "utilities/hashtable.hpp"
|
#include "utilities/hashtable.hpp"
|
||||||
|
#include "utilities/hashtable.inline.hpp"
|
||||||
|
|
||||||
// The system dictionary stores all loaded classes and maps:
|
// The system dictionary stores all loaded classes and maps:
|
||||||
//
|
//
|
||||||
|
@ -72,7 +73,7 @@
|
||||||
class Dictionary;
|
class Dictionary;
|
||||||
class PlaceholderTable;
|
class PlaceholderTable;
|
||||||
class LoaderConstraintTable;
|
class LoaderConstraintTable;
|
||||||
class HashtableBucket;
|
template <MEMFLAGS F> class HashtableBucket;
|
||||||
class ResolutionErrorTable;
|
class ResolutionErrorTable;
|
||||||
class SymbolPropertyTable;
|
class SymbolPropertyTable;
|
||||||
|
|
||||||
|
@ -363,7 +364,7 @@ public:
|
||||||
static void copy_buckets(char** top, char* end);
|
static void copy_buckets(char** top, char* end);
|
||||||
static void copy_table(char** top, char* end);
|
static void copy_table(char** top, char* end);
|
||||||
static void reverse();
|
static void reverse();
|
||||||
static void set_shared_dictionary(HashtableBucket* t, int length,
|
static void set_shared_dictionary(HashtableBucket<mtClass>* t, int length,
|
||||||
int number_of_entries);
|
int number_of_entries);
|
||||||
// Printing
|
// Printing
|
||||||
static void print() PRODUCT_RETURN;
|
static void print() PRODUCT_RETURN;
|
||||||
|
|
|
@ -144,7 +144,7 @@ void CodeBlob::set_oop_maps(OopMapSet* p) {
|
||||||
// chunk of memory, its your job to free it.
|
// chunk of memory, its your job to free it.
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
// We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps
|
// We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps
|
||||||
_oop_maps = (OopMapSet* )NEW_C_HEAP_ARRAY(unsigned char, p->heap_size());
|
_oop_maps = (OopMapSet* )NEW_C_HEAP_ARRAY(unsigned char, p->heap_size(), mtCode);
|
||||||
p->copy_to((address)_oop_maps);
|
p->copy_to((address)_oop_maps);
|
||||||
} else {
|
} else {
|
||||||
_oop_maps = NULL;
|
_oop_maps = NULL;
|
||||||
|
@ -180,7 +180,7 @@ void CodeBlob::trace_new_stub(CodeBlob* stub, const char* name1, const char* nam
|
||||||
|
|
||||||
void CodeBlob::flush() {
|
void CodeBlob::flush() {
|
||||||
if (_oop_maps) {
|
if (_oop_maps) {
|
||||||
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
|
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode);
|
||||||
_oop_maps = NULL;
|
_oop_maps = NULL;
|
||||||
}
|
}
|
||||||
_comments.free();
|
_comments.free();
|
||||||
|
|
|
@ -856,7 +856,7 @@ void CodeCache::print_internals() {
|
||||||
|
|
||||||
int bucketSize = 512;
|
int bucketSize = 512;
|
||||||
int bucketLimit = maxCodeSize / bucketSize + 1;
|
int bucketLimit = maxCodeSize / bucketSize + 1;
|
||||||
int *buckets = NEW_C_HEAP_ARRAY(int, bucketLimit);
|
int *buckets = NEW_C_HEAP_ARRAY(int, bucketLimit, mtCode);
|
||||||
memset(buckets,0,sizeof(int) * bucketLimit);
|
memset(buckets,0,sizeof(int) * bucketLimit);
|
||||||
|
|
||||||
for (cb = first(); cb != NULL; cb = next(cb)) {
|
for (cb = first(); cb != NULL; cb = next(cb)) {
|
||||||
|
@ -893,7 +893,7 @@ void CodeCache::print_internals() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_C_HEAP_ARRAY(int, buckets);
|
FREE_C_HEAP_ARRAY(int, buckets, mtCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeCache::print() {
|
void CodeCache::print() {
|
||||||
|
|
|
@ -88,6 +88,9 @@ class CodeCache : AllStatic {
|
||||||
// Lookup that does not fail if you lookup a zombie method (if you call this, be sure to know
|
// Lookup that does not fail if you lookup a zombie method (if you call this, be sure to know
|
||||||
// what you are doing)
|
// what you are doing)
|
||||||
static CodeBlob* find_blob_unsafe(void* start) {
|
static CodeBlob* find_blob_unsafe(void* start) {
|
||||||
|
// NMT can walk the stack before code cache is created
|
||||||
|
if (_heap == NULL) return NULL;
|
||||||
|
|
||||||
CodeBlob* result = (CodeBlob*)_heap->find_start(start);
|
CodeBlob* result = (CodeBlob*)_heap->find_start(start);
|
||||||
// this assert is too strong because the heap code will return the
|
// this assert is too strong because the heap code will return the
|
||||||
// heapblock containing start. That block can often be larger than
|
// heapblock containing start. That block can often be larger than
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
// This class is used internally by nmethods, to cache
|
// This class is used internally by nmethods, to cache
|
||||||
// exception/pc/handler information.
|
// exception/pc/handler information.
|
||||||
|
|
||||||
class ExceptionCache : public CHeapObj {
|
class ExceptionCache : public CHeapObj<mtCode> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
enum { cache_size = 16 };
|
enum { cache_size = 16 };
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Stub VALUE_OBJ_CLASS_SPEC {
|
||||||
// of the concrete stub (see also macro below). There's exactly
|
// of the concrete stub (see also macro below). There's exactly
|
||||||
// one stub interface instance required per stub queue.
|
// one stub interface instance required per stub queue.
|
||||||
|
|
||||||
class StubInterface: public CHeapObj {
|
class StubInterface: public CHeapObj<mtCode> {
|
||||||
public:
|
public:
|
||||||
// Initialization/finalization
|
// Initialization/finalization
|
||||||
virtual void initialize(Stub* self, int size) = 0; // called after creation (called twice if allocated via (request, commit))
|
virtual void initialize(Stub* self, int size) = 0; // called after creation (called twice if allocated via (request, commit))
|
||||||
|
@ -152,7 +152,7 @@ class StubInterface: public CHeapObj {
|
||||||
// A StubQueue maintains a queue of stubs.
|
// A StubQueue maintains a queue of stubs.
|
||||||
// Note: All sizes (spaces) are given in bytes.
|
// Note: All sizes (spaces) are given in bytes.
|
||||||
|
|
||||||
class StubQueue: public CHeapObj {
|
class StubQueue: public CHeapObj<mtCode> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
StubInterface* _stub_interface; // the interface prototype
|
StubInterface* _stub_interface; // the interface prototype
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
typedef void (*initializer)(void);
|
typedef void (*initializer)(void);
|
||||||
|
|
||||||
class AbstractCompiler : public CHeapObj {
|
class AbstractCompiler : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
bool _is_initialized; // Mark whether compiler object is initialized
|
bool _is_initialized; // Mark whether compiler object is initialized
|
||||||
|
|
||||||
|
|
|
@ -951,7 +951,7 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler
|
||||||
int compiler_count = c1_compiler_count + c2_compiler_count;
|
int compiler_count = c1_compiler_count + c2_compiler_count;
|
||||||
|
|
||||||
_method_threads =
|
_method_threads =
|
||||||
new (ResourceObj::C_HEAP) GrowableArray<CompilerThread*>(compiler_count, true);
|
new (ResourceObj::C_HEAP, mtCompiler) GrowableArray<CompilerThread*>(compiler_count, true);
|
||||||
|
|
||||||
char name_buffer[256];
|
char name_buffer[256];
|
||||||
for (int i = 0; i < c2_compiler_count; i++) {
|
for (int i = 0; i < c2_compiler_count; i++) {
|
||||||
|
@ -1627,7 +1627,7 @@ void CompileBroker::init_compiler_thread_log() {
|
||||||
}
|
}
|
||||||
fp = fopen(fileBuf, "at");
|
fp = fopen(fileBuf, "at");
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
file = NEW_C_HEAP_ARRAY(char, strlen(fileBuf)+1);
|
file = NEW_C_HEAP_ARRAY(char, strlen(fileBuf)+1, mtCompiler);
|
||||||
strcpy(file, fileBuf);
|
strcpy(file, fileBuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1637,7 +1637,7 @@ void CompileBroker::init_compiler_thread_log() {
|
||||||
} else {
|
} else {
|
||||||
if (LogCompilation && Verbose)
|
if (LogCompilation && Verbose)
|
||||||
tty->print_cr("Opening compilation log %s", file);
|
tty->print_cr("Opening compilation log %s", file);
|
||||||
CompileLog* log = new(ResourceObj::C_HEAP) CompileLog(file, fp, thread_id);
|
CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file, fp, thread_id);
|
||||||
thread->init_log(log);
|
thread->init_log(log);
|
||||||
|
|
||||||
if (xtty != NULL) {
|
if (xtty != NULL) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class nmethodLocker;
|
||||||
//
|
//
|
||||||
// An entry in the compile queue. It represents a pending or current
|
// An entry in the compile queue. It represents a pending or current
|
||||||
// compilation.
|
// compilation.
|
||||||
class CompileTask : public CHeapObj {
|
class CompileTask : public CHeapObj<mtCompiler> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
//
|
//
|
||||||
// Per Compiler Performance Counters.
|
// Per Compiler Performance Counters.
|
||||||
//
|
//
|
||||||
class CompilerCounters : public CHeapObj {
|
class CompilerCounters : public CHeapObj<mtCompiler> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
|
@ -175,7 +175,7 @@ class CompilerCounters : public CHeapObj {
|
||||||
// CompileQueue
|
// CompileQueue
|
||||||
//
|
//
|
||||||
// A list of CompileTasks.
|
// A list of CompileTasks.
|
||||||
class CompileQueue : public CHeapObj {
|
class CompileQueue : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
const char* _name;
|
const char* _name;
|
||||||
Monitor* _lock;
|
Monitor* _lock;
|
||||||
|
|
|
@ -37,14 +37,14 @@ CompileLog* CompileLog::_first = NULL;
|
||||||
CompileLog::CompileLog(const char* file, FILE* fp, intx thread_id)
|
CompileLog::CompileLog(const char* file, FILE* fp, intx thread_id)
|
||||||
: _context(_context_buffer, sizeof(_context_buffer))
|
: _context(_context_buffer, sizeof(_context_buffer))
|
||||||
{
|
{
|
||||||
initialize(new(ResourceObj::C_HEAP) fileStream(fp));
|
initialize(new(ResourceObj::C_HEAP, mtCompiler) fileStream(fp));
|
||||||
_file = file;
|
_file = file;
|
||||||
_file_end = 0;
|
_file_end = 0;
|
||||||
_thread_id = thread_id;
|
_thread_id = thread_id;
|
||||||
|
|
||||||
_identities_limit = 0;
|
_identities_limit = 0;
|
||||||
_identities_capacity = 400;
|
_identities_capacity = 400;
|
||||||
_identities = NEW_C_HEAP_ARRAY(char, _identities_capacity);
|
_identities = NEW_C_HEAP_ARRAY(char, _identities_capacity, mtCompiler);
|
||||||
|
|
||||||
// link into the global list
|
// link into the global list
|
||||||
{ MutexLocker locker(CompileTaskAlloc_lock);
|
{ MutexLocker locker(CompileTaskAlloc_lock);
|
||||||
|
@ -56,7 +56,7 @@ CompileLog::CompileLog(const char* file, FILE* fp, intx thread_id)
|
||||||
CompileLog::~CompileLog() {
|
CompileLog::~CompileLog() {
|
||||||
delete _out;
|
delete _out;
|
||||||
_out = NULL;
|
_out = NULL;
|
||||||
FREE_C_HEAP_ARRAY(char, _identities);
|
FREE_C_HEAP_ARRAY(char, _identities, mtCompiler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ int CompileLog::identify(ciObject* obj) {
|
||||||
if (id >= _identities_capacity) {
|
if (id >= _identities_capacity) {
|
||||||
int new_cap = _identities_capacity * 2;
|
int new_cap = _identities_capacity * 2;
|
||||||
if (new_cap <= id) new_cap = id + 100;
|
if (new_cap <= id) new_cap = id + 100;
|
||||||
_identities = REALLOC_C_HEAP_ARRAY(char, _identities, new_cap);
|
_identities = REALLOC_C_HEAP_ARRAY(char, _identities, new_cap, mtCompiler);
|
||||||
_identities_capacity = new_cap;
|
_identities_capacity = new_cap;
|
||||||
}
|
}
|
||||||
while (id >= _identities_limit) {
|
while (id >= _identities_limit) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/jniHandles.hpp"
|
#include "runtime/jniHandles.hpp"
|
||||||
|
|
||||||
class MethodMatcher : public CHeapObj {
|
class MethodMatcher : public CHeapObj<mtCompiler> {
|
||||||
public:
|
public:
|
||||||
enum Mode {
|
enum Mode {
|
||||||
Exact,
|
Exact,
|
||||||
|
|
|
@ -599,7 +599,7 @@ void OopMapSet::print_on(outputStream* st) const {
|
||||||
|
|
||||||
#ifdef COMPILER2
|
#ifdef COMPILER2
|
||||||
|
|
||||||
class DerivedPointerEntry : public CHeapObj {
|
class DerivedPointerEntry : public CHeapObj<mtCompiler> {
|
||||||
private:
|
private:
|
||||||
oop* _location; // Location of derived pointer (also pointing to the base)
|
oop* _location; // Location of derived pointer (also pointing to the base)
|
||||||
intptr_t _offset; // Offset from base pointer
|
intptr_t _offset; // Offset from base pointer
|
||||||
|
@ -621,7 +621,7 @@ void DerivedPointerTable::clear() {
|
||||||
assert (!_active, "should not be active");
|
assert (!_active, "should not be active");
|
||||||
assert(_list == NULL || _list->length() == 0, "table not empty");
|
assert(_list == NULL || _list->length() == 0, "table not empty");
|
||||||
if (_list == NULL) {
|
if (_list == NULL) {
|
||||||
_list = new (ResourceObj::C_HEAP) GrowableArray<DerivedPointerEntry*>(10, true); // Allocated on C heap
|
_list = new (ResourceObj::C_HEAP, mtCompiler) GrowableArray<DerivedPointerEntry*>(10, true); // Allocated on C heap
|
||||||
}
|
}
|
||||||
_active = true;
|
_active = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -617,7 +617,7 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
||||||
|
|
||||||
// A parallel-GC-thread-local allocation buffer for allocation into a
|
// A parallel-GC-thread-local allocation buffer for allocation into a
|
||||||
// CompactibleFreeListSpace.
|
// CompactibleFreeListSpace.
|
||||||
class CFLS_LAB : public CHeapObj {
|
class CFLS_LAB : public CHeapObj<mtGC> {
|
||||||
// The space that this buffer allocates into.
|
// The space that this buffer allocates into.
|
||||||
CompactibleFreeListSpace* _cfls;
|
CompactibleFreeListSpace* _cfls;
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ NOT_PRODUCT(CompactibleFreeListSpace* debug_cms_space;)
|
||||||
|
|
||||||
// This struct contains per-thread things necessary to support parallel
|
// This struct contains per-thread things necessary to support parallel
|
||||||
// young-gen collection.
|
// young-gen collection.
|
||||||
class CMSParGCThreadState: public CHeapObj {
|
class CMSParGCThreadState: public CHeapObj<mtGC> {
|
||||||
public:
|
public:
|
||||||
CFLS_LAB lab;
|
CFLS_LAB lab;
|
||||||
PromotionInfo promo;
|
PromotionInfo promo;
|
||||||
|
@ -229,7 +229,7 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
|
||||||
if (CollectedHeap::use_parallel_gc_threads()) {
|
if (CollectedHeap::use_parallel_gc_threads()) {
|
||||||
typedef CMSParGCThreadState* CMSParGCThreadStatePtr;
|
typedef CMSParGCThreadState* CMSParGCThreadStatePtr;
|
||||||
_par_gc_thread_states =
|
_par_gc_thread_states =
|
||||||
NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads);
|
NEW_C_HEAP_ARRAY(CMSParGCThreadStatePtr, ParallelGCThreads, mtGC);
|
||||||
if (_par_gc_thread_states == NULL) {
|
if (_par_gc_thread_states == NULL) {
|
||||||
vm_exit_during_initialization("Could not allocate par gc structs");
|
vm_exit_during_initialization("Could not allocate par gc structs");
|
||||||
}
|
}
|
||||||
|
@ -687,7 +687,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||||
warning("task_queues allocation failure.");
|
warning("task_queues allocation failure.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_hash_seed = NEW_C_HEAP_ARRAY(int, num_queues);
|
_hash_seed = NEW_C_HEAP_ARRAY(int, num_queues, mtGC);
|
||||||
if (_hash_seed == NULL) {
|
if (_hash_seed == NULL) {
|
||||||
warning("_hash_seed array allocation failure");
|
warning("_hash_seed array allocation failure");
|
||||||
return;
|
return;
|
||||||
|
@ -737,7 +737,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||||
assert(_young_gen != NULL, "no _young_gen");
|
assert(_young_gen != NULL, "no _young_gen");
|
||||||
_eden_chunk_index = 0;
|
_eden_chunk_index = 0;
|
||||||
_eden_chunk_capacity = (_young_gen->max_capacity()+CMSSamplingGrain)/CMSSamplingGrain;
|
_eden_chunk_capacity = (_young_gen->max_capacity()+CMSSamplingGrain)/CMSSamplingGrain;
|
||||||
_eden_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, _eden_chunk_capacity);
|
_eden_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, _eden_chunk_capacity, mtGC);
|
||||||
if (_eden_chunk_array == NULL) {
|
if (_eden_chunk_array == NULL) {
|
||||||
_eden_chunk_capacity = 0;
|
_eden_chunk_capacity = 0;
|
||||||
warning("GC/CMS: _eden_chunk_array allocation failure");
|
warning("GC/CMS: _eden_chunk_array allocation failure");
|
||||||
|
@ -750,35 +750,35 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||||
const size_t max_plab_samples =
|
const size_t max_plab_samples =
|
||||||
((DefNewGeneration*)_young_gen)->max_survivor_size()/MinTLABSize;
|
((DefNewGeneration*)_young_gen)->max_survivor_size()/MinTLABSize;
|
||||||
|
|
||||||
_survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads);
|
_survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC);
|
||||||
_survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples);
|
_survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC);
|
||||||
_cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads);
|
_cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads, mtGC);
|
||||||
if (_survivor_plab_array == NULL || _survivor_chunk_array == NULL
|
if (_survivor_plab_array == NULL || _survivor_chunk_array == NULL
|
||||||
|| _cursor == NULL) {
|
|| _cursor == NULL) {
|
||||||
warning("Failed to allocate survivor plab/chunk array");
|
warning("Failed to allocate survivor plab/chunk array");
|
||||||
if (_survivor_plab_array != NULL) {
|
if (_survivor_plab_array != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array);
|
FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array, mtGC);
|
||||||
_survivor_plab_array = NULL;
|
_survivor_plab_array = NULL;
|
||||||
}
|
}
|
||||||
if (_survivor_chunk_array != NULL) {
|
if (_survivor_chunk_array != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array);
|
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array, mtGC);
|
||||||
_survivor_chunk_array = NULL;
|
_survivor_chunk_array = NULL;
|
||||||
}
|
}
|
||||||
if (_cursor != NULL) {
|
if (_cursor != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(size_t, _cursor);
|
FREE_C_HEAP_ARRAY(size_t, _cursor, mtGC);
|
||||||
_cursor = NULL;
|
_cursor = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_survivor_chunk_capacity = 2*max_plab_samples;
|
_survivor_chunk_capacity = 2*max_plab_samples;
|
||||||
for (uint i = 0; i < ParallelGCThreads; i++) {
|
for (uint i = 0; i < ParallelGCThreads; i++) {
|
||||||
HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples);
|
HeapWord** vec = NEW_C_HEAP_ARRAY(HeapWord*, max_plab_samples, mtGC);
|
||||||
if (vec == NULL) {
|
if (vec == NULL) {
|
||||||
warning("Failed to allocate survivor plab array");
|
warning("Failed to allocate survivor plab array");
|
||||||
for (int j = i; j > 0; j--) {
|
for (int j = i; j > 0; j--) {
|
||||||
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_plab_array[j-1].array());
|
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_plab_array[j-1].array(), mtGC);
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array);
|
FREE_C_HEAP_ARRAY(ChunkArray, _survivor_plab_array, mtGC);
|
||||||
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array);
|
FREE_C_HEAP_ARRAY(HeapWord*, _survivor_chunk_array, mtGC);
|
||||||
_survivor_plab_array = NULL;
|
_survivor_plab_array = NULL;
|
||||||
_survivor_chunk_array = NULL;
|
_survivor_chunk_array = NULL;
|
||||||
_survivor_chunk_capacity = 0;
|
_survivor_chunk_capacity = 0;
|
||||||
|
|
|
@ -161,7 +161,7 @@ class CMSBitMap VALUE_OBJ_CLASS_SPEC {
|
||||||
|
|
||||||
// Represents a marking stack used by the CMS collector.
|
// Represents a marking stack used by the CMS collector.
|
||||||
// Ideally this should be GrowableArray<> just like MSC's marking stack(s).
|
// Ideally this should be GrowableArray<> just like MSC's marking stack(s).
|
||||||
class CMSMarkStack: public CHeapObj {
|
class CMSMarkStack: public CHeapObj<mtGC> {
|
||||||
//
|
//
|
||||||
friend class CMSCollector; // to get at expasion stats further below
|
friend class CMSCollector; // to get at expasion stats further below
|
||||||
//
|
//
|
||||||
|
@ -265,7 +265,7 @@ class ModUnionClosurePar: public ModUnionClosure {
|
||||||
|
|
||||||
// Survivor Chunk Array in support of parallelization of
|
// Survivor Chunk Array in support of parallelization of
|
||||||
// Survivor Space rescan.
|
// Survivor Space rescan.
|
||||||
class ChunkArray: public CHeapObj {
|
class ChunkArray: public CHeapObj<mtGC> {
|
||||||
size_t _index;
|
size_t _index;
|
||||||
size_t _capacity;
|
size_t _capacity;
|
||||||
size_t _overflows;
|
size_t _overflows;
|
||||||
|
@ -506,7 +506,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CMSCollector: public CHeapObj {
|
class CMSCollector: public CHeapObj<mtGC> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
friend class ConcurrentMarkSweepThread;
|
friend class ConcurrentMarkSweepThread;
|
||||||
friend class ConcurrentMarkSweepGeneration;
|
friend class ConcurrentMarkSweepGeneration;
|
||||||
|
@ -553,8 +553,8 @@ class CMSCollector: public CHeapObj {
|
||||||
// The following array-pair keeps track of mark words
|
// The following array-pair keeps track of mark words
|
||||||
// displaced for accomodating overflow list above.
|
// displaced for accomodating overflow list above.
|
||||||
// This code will likely be revisited under RFE#4922830.
|
// This code will likely be revisited under RFE#4922830.
|
||||||
Stack<oop> _preserved_oop_stack;
|
Stack<oop, mtGC> _preserved_oop_stack;
|
||||||
Stack<markOop> _preserved_mark_stack;
|
Stack<markOop, mtGC> _preserved_mark_stack;
|
||||||
|
|
||||||
int* _hash_seed;
|
int* _hash_seed;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "gc_implementation/g1/heapRegion.hpp"
|
#include "gc_implementation/g1/heapRegion.hpp"
|
||||||
#include "utilities/growableArray.hpp"
|
#include "utilities/growableArray.hpp"
|
||||||
|
|
||||||
class CollectionSetChooser: public CHeapObj {
|
class CollectionSetChooser: public CHeapObj<mtGC> {
|
||||||
|
|
||||||
GrowableArray<HeapRegion*> _regions;
|
GrowableArray<HeapRegion*> _regions;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ ConcurrentG1Refine::ConcurrentG1Refine() :
|
||||||
_n_threads = _n_worker_threads + 1;
|
_n_threads = _n_worker_threads + 1;
|
||||||
reset_threshold_step();
|
reset_threshold_step();
|
||||||
|
|
||||||
_threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads);
|
_threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads, mtGC);
|
||||||
int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids();
|
int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids();
|
||||||
ConcurrentG1RefineThread *next = NULL;
|
ConcurrentG1RefineThread *next = NULL;
|
||||||
for (int i = _n_threads - 1; i >= 0; i--) {
|
for (int i = _n_threads - 1; i >= 0; i--) {
|
||||||
|
@ -157,7 +157,7 @@ void ConcurrentG1Refine::init() {
|
||||||
_def_use_cache = true;
|
_def_use_cache = true;
|
||||||
_use_cache = true;
|
_use_cache = true;
|
||||||
_hot_cache_size = (1 << G1ConcRSLogCacheSize);
|
_hot_cache_size = (1 << G1ConcRSLogCacheSize);
|
||||||
_hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size);
|
_hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size, mtGC);
|
||||||
_n_hot = 0;
|
_n_hot = 0;
|
||||||
_hot_cache_idx = 0;
|
_hot_cache_idx = 0;
|
||||||
|
|
||||||
|
@ -191,18 +191,18 @@ ConcurrentG1Refine::~ConcurrentG1Refine() {
|
||||||
// Please see the comment in allocate_card_count_cache
|
// Please see the comment in allocate_card_count_cache
|
||||||
// for why we call os::malloc() and os::free() directly.
|
// for why we call os::malloc() and os::free() directly.
|
||||||
assert(_card_counts != NULL, "Logic");
|
assert(_card_counts != NULL, "Logic");
|
||||||
os::free(_card_counts);
|
os::free(_card_counts, mtGC);
|
||||||
assert(_card_epochs != NULL, "Logic");
|
assert(_card_epochs != NULL, "Logic");
|
||||||
os::free(_card_epochs);
|
os::free(_card_epochs, mtGC);
|
||||||
|
|
||||||
assert(_hot_cache != NULL, "Logic");
|
assert(_hot_cache != NULL, "Logic");
|
||||||
FREE_C_HEAP_ARRAY(jbyte*, _hot_cache);
|
FREE_C_HEAP_ARRAY(jbyte*, _hot_cache, mtGC);
|
||||||
}
|
}
|
||||||
if (_threads != NULL) {
|
if (_threads != NULL) {
|
||||||
for (int i = 0; i < _n_threads; i++) {
|
for (int i = 0; i < _n_threads; i++) {
|
||||||
delete _threads[i];
|
delete _threads[i];
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads);
|
FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads, mtGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,17 +436,17 @@ bool ConcurrentG1Refine::allocate_card_count_cache(size_t n,
|
||||||
size_t counts_size = n * sizeof(CardCountCacheEntry);
|
size_t counts_size = n * sizeof(CardCountCacheEntry);
|
||||||
size_t epochs_size = n * sizeof(CardEpochCacheEntry);
|
size_t epochs_size = n * sizeof(CardEpochCacheEntry);
|
||||||
|
|
||||||
*counts = (CardCountCacheEntry*) os::malloc(counts_size);
|
*counts = (CardCountCacheEntry*) os::malloc(counts_size, mtGC);
|
||||||
if (*counts == NULL) {
|
if (*counts == NULL) {
|
||||||
// allocation was unsuccessful
|
// allocation was unsuccessful
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*epochs = (CardEpochCacheEntry*) os::malloc(epochs_size);
|
*epochs = (CardEpochCacheEntry*) os::malloc(epochs_size, mtGC);
|
||||||
if (*epochs == NULL) {
|
if (*epochs == NULL) {
|
||||||
// allocation was unsuccessful - free counts array
|
// allocation was unsuccessful - free counts array
|
||||||
assert(*counts != NULL, "must be");
|
assert(*counts != NULL, "must be");
|
||||||
os::free(*counts);
|
os::free(*counts, mtGC);
|
||||||
*counts = NULL;
|
*counts = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -479,8 +479,8 @@ bool ConcurrentG1Refine::expand_card_count_cache(int cache_size_idx) {
|
||||||
// Allocation was successful.
|
// Allocation was successful.
|
||||||
// We can just free the old arrays; we're
|
// We can just free the old arrays; we're
|
||||||
// not interested in preserving the contents
|
// not interested in preserving the contents
|
||||||
if (_card_counts != NULL) os::free(_card_counts);
|
if (_card_counts != NULL) os::free(_card_counts, mtGC);
|
||||||
if (_card_epochs != NULL) os::free(_card_epochs);
|
if (_card_epochs != NULL) os::free(_card_epochs, mtGC);
|
||||||
|
|
||||||
// Cache the size of the arrays and the index that got us there.
|
// Cache the size of the arrays and the index that got us there.
|
||||||
_n_card_counts = cache_size;
|
_n_card_counts = cache_size;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
class ConcurrentG1RefineThread;
|
class ConcurrentG1RefineThread;
|
||||||
class G1RemSet;
|
class G1RemSet;
|
||||||
|
|
||||||
class ConcurrentG1Refine: public CHeapObj {
|
class ConcurrentG1Refine: public CHeapObj<mtGC> {
|
||||||
ConcurrentG1RefineThread** _threads;
|
ConcurrentG1RefineThread** _threads;
|
||||||
int _n_threads;
|
int _n_threads;
|
||||||
int _n_worker_threads;
|
int _n_worker_threads;
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/handles.inline.hpp"
|
#include "runtime/handles.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
|
|
||||||
// Concurrent marking bit map wrapper
|
// Concurrent marking bit map wrapper
|
||||||
|
|
||||||
|
@ -53,6 +54,8 @@ CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter) :
|
||||||
ReservedSpace brs(ReservedSpace::allocation_align_size_up(
|
ReservedSpace brs(ReservedSpace::allocation_align_size_up(
|
||||||
(_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
|
(_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
|
||||||
|
|
||||||
|
MemTracker::record_virtual_memory_type((address)brs.base(), mtGC);
|
||||||
|
|
||||||
guarantee(brs.is_reserved(), "couldn't allocate concurrent marking bit map");
|
guarantee(brs.is_reserved(), "couldn't allocate concurrent marking bit map");
|
||||||
// For now we'll just commit all of the bit map up fromt.
|
// For now we'll just commit all of the bit map up fromt.
|
||||||
// Later on we'll try to be more parsimonious with swap.
|
// Later on we'll try to be more parsimonious with swap.
|
||||||
|
@ -161,7 +164,7 @@ CMMarkStack::CMMarkStack(ConcurrentMark* cm) :
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void CMMarkStack::allocate(size_t size) {
|
void CMMarkStack::allocate(size_t size) {
|
||||||
_base = NEW_C_HEAP_ARRAY(oop, size);
|
_base = NEW_C_HEAP_ARRAY(oop, size, mtGC);
|
||||||
if (_base == NULL) {
|
if (_base == NULL) {
|
||||||
vm_exit_during_initialization("Failed to allocate CM region mark stack");
|
vm_exit_during_initialization("Failed to allocate CM region mark stack");
|
||||||
}
|
}
|
||||||
|
@ -173,7 +176,7 @@ void CMMarkStack::allocate(size_t size) {
|
||||||
|
|
||||||
CMMarkStack::~CMMarkStack() {
|
CMMarkStack::~CMMarkStack() {
|
||||||
if (_base != NULL) {
|
if (_base != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(oop, _base);
|
FREE_C_HEAP_ARRAY(oop, _base, mtGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,11 +483,11 @@ ConcurrentMark::ConcurrentMark(ReservedSpace rs, uint max_regions) :
|
||||||
|
|
||||||
_root_regions.init(_g1h, this);
|
_root_regions.init(_g1h, this);
|
||||||
|
|
||||||
_tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_task_num);
|
_tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_task_num, mtGC);
|
||||||
_accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_task_num);
|
_accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_task_num, mtGC);
|
||||||
|
|
||||||
_count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_task_num);
|
_count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_task_num, mtGC);
|
||||||
_count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_task_num);
|
_count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_task_num, mtGC);
|
||||||
|
|
||||||
BitMap::idx_t card_bm_size = _card_bm.size();
|
BitMap::idx_t card_bm_size = _card_bm.size();
|
||||||
|
|
||||||
|
@ -496,7 +499,7 @@ ConcurrentMark::ConcurrentMark(ReservedSpace rs, uint max_regions) :
|
||||||
_task_queues->register_queue(i, task_queue);
|
_task_queues->register_queue(i, task_queue);
|
||||||
|
|
||||||
_count_card_bitmaps[i] = BitMap(card_bm_size, false);
|
_count_card_bitmaps[i] = BitMap(card_bm_size, false);
|
||||||
_count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, (size_t) max_regions);
|
_count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, (size_t) max_regions, mtGC);
|
||||||
|
|
||||||
_tasks[i] = new CMTask(i, this,
|
_tasks[i] = new CMTask(i, this,
|
||||||
_count_marked_bytes[i],
|
_count_marked_bytes[i],
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
class G1CollectedHeap;
|
class G1CollectedHeap;
|
||||||
class CMTask;
|
class CMTask;
|
||||||
typedef GenericTaskQueue<oop> CMTaskQueue;
|
typedef GenericTaskQueue<oop, mtGC> CMTaskQueue;
|
||||||
typedef GenericTaskQueueSet<CMTaskQueue> CMTaskQueueSet;
|
typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
|
||||||
|
|
||||||
// Closure used by CM during concurrent reference discovery
|
// Closure used by CM during concurrent reference discovery
|
||||||
// and reference processing (during remarking) to determine
|
// and reference processing (during remarking) to determine
|
||||||
|
@ -343,7 +343,7 @@ public:
|
||||||
|
|
||||||
class ConcurrentMarkThread;
|
class ConcurrentMarkThread;
|
||||||
|
|
||||||
class ConcurrentMark : public CHeapObj {
|
class ConcurrentMark: public CHeapObj<mtGC> {
|
||||||
friend class ConcurrentMarkThread;
|
friend class ConcurrentMarkThread;
|
||||||
friend class CMTask;
|
friend class CMTask;
|
||||||
friend class CMBitMapClosure;
|
friend class CMBitMapClosure;
|
||||||
|
|
|
@ -32,7 +32,7 @@ class FreeIdSet;
|
||||||
|
|
||||||
// A closure class for processing card table entries. Note that we don't
|
// A closure class for processing card table entries. Note that we don't
|
||||||
// require these closure objects to be stack-allocated.
|
// require these closure objects to be stack-allocated.
|
||||||
class CardTableEntryClosure: public CHeapObj {
|
class CardTableEntryClosure: public CHeapObj<mtGC> {
|
||||||
public:
|
public:
|
||||||
// Process the card whose card table entry is "card_ptr". If returns
|
// Process the card whose card table entry is "card_ptr". If returns
|
||||||
// "false", terminate the iteration early.
|
// "false", terminate the iteration early.
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "memory/space.hpp"
|
#include "memory/space.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// G1BlockOffsetSharedArray
|
// G1BlockOffsetSharedArray
|
||||||
|
@ -44,6 +45,9 @@ G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion reserved,
|
||||||
if (!_vs.initialize(rs, 0)) {
|
if (!_vs.initialize(rs, 0)) {
|
||||||
vm_exit_during_initialization("Could not reserve enough space for heap offset array");
|
vm_exit_during_initialization("Could not reserve enough space for heap offset array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MemTracker::record_virtual_memory_type((address)rs.base(), mtGC);
|
||||||
|
|
||||||
_offset_array = (u_char*)_vs.low_boundary();
|
_offset_array = (u_char*)_vs.low_boundary();
|
||||||
resize(init_word_size);
|
resize(init_word_size);
|
||||||
if (TraceBlockOffsetTable) {
|
if (TraceBlockOffsetTable) {
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
|
|
||||||
// Here is the shared array type.
|
// Here is the shared array type.
|
||||||
|
|
||||||
class G1BlockOffsetSharedArray: public CHeapObj {
|
class G1BlockOffsetSharedArray: public CHeapObj<mtGC> {
|
||||||
friend class G1BlockOffsetArray;
|
friend class G1BlockOffsetArray;
|
||||||
friend class G1BlockOffsetArrayContigSpace;
|
friend class G1BlockOffsetArrayContigSpace;
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
|
@ -1916,14 +1916,14 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
|
||||||
assert(n_rem_sets > 0, "Invariant.");
|
assert(n_rem_sets > 0, "Invariant.");
|
||||||
|
|
||||||
HeapRegionRemSetIterator** iter_arr =
|
HeapRegionRemSetIterator** iter_arr =
|
||||||
NEW_C_HEAP_ARRAY(HeapRegionRemSetIterator*, n_queues);
|
NEW_C_HEAP_ARRAY(HeapRegionRemSetIterator*, n_queues, mtGC);
|
||||||
for (int i = 0; i < n_queues; i++) {
|
for (int i = 0; i < n_queues; i++) {
|
||||||
iter_arr[i] = new HeapRegionRemSetIterator();
|
iter_arr[i] = new HeapRegionRemSetIterator();
|
||||||
}
|
}
|
||||||
_rem_set_iterator = iter_arr;
|
_rem_set_iterator = iter_arr;
|
||||||
|
|
||||||
_worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues);
|
_worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
|
||||||
_worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues);
|
_worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC);
|
||||||
|
|
||||||
for (int i = 0; i < n_queues; i++) {
|
for (int i = 0; i < n_queues; i++) {
|
||||||
RefToScanQueue* q = new RefToScanQueue();
|
RefToScanQueue* q = new RefToScanQueue();
|
||||||
|
@ -2082,7 +2082,7 @@ jint G1CollectedHeap::initialize() {
|
||||||
|
|
||||||
_in_cset_fast_test_length = max_regions();
|
_in_cset_fast_test_length = max_regions();
|
||||||
_in_cset_fast_test_base =
|
_in_cset_fast_test_base =
|
||||||
NEW_C_HEAP_ARRAY(bool, (size_t) _in_cset_fast_test_length);
|
NEW_C_HEAP_ARRAY(bool, (size_t) _in_cset_fast_test_length, mtGC);
|
||||||
|
|
||||||
// We're biasing _in_cset_fast_test to avoid subtracting the
|
// We're biasing _in_cset_fast_test to avoid subtracting the
|
||||||
// beginning of the heap every time we want to index; basically
|
// beginning of the heap every time we want to index; basically
|
||||||
|
@ -3505,7 +3505,7 @@ void
|
||||||
G1CollectedHeap::setup_surviving_young_words() {
|
G1CollectedHeap::setup_surviving_young_words() {
|
||||||
assert(_surviving_young_words == NULL, "pre-condition");
|
assert(_surviving_young_words == NULL, "pre-condition");
|
||||||
uint array_length = g1_policy()->young_cset_region_length();
|
uint array_length = g1_policy()->young_cset_region_length();
|
||||||
_surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length);
|
_surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC);
|
||||||
if (_surviving_young_words == NULL) {
|
if (_surviving_young_words == NULL) {
|
||||||
vm_exit_out_of_memory(sizeof(size_t) * array_length,
|
vm_exit_out_of_memory(sizeof(size_t) * array_length,
|
||||||
"Not enough space for young surv words summary.");
|
"Not enough space for young surv words summary.");
|
||||||
|
@ -3530,7 +3530,7 @@ G1CollectedHeap::update_surviving_young_words(size_t* surv_young_words) {
|
||||||
void
|
void
|
||||||
G1CollectedHeap::cleanup_surviving_young_words() {
|
G1CollectedHeap::cleanup_surviving_young_words() {
|
||||||
guarantee( _surviving_young_words != NULL, "pre-condition" );
|
guarantee( _surviving_young_words != NULL, "pre-condition" );
|
||||||
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words);
|
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words, mtGC);
|
||||||
_surviving_young_words = NULL;
|
_surviving_young_words = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4073,7 +4073,7 @@ void G1CollectedHeap::abandon_gc_alloc_regions() {
|
||||||
void G1CollectedHeap::init_for_evac_failure(OopsInHeapRegionClosure* cl) {
|
void G1CollectedHeap::init_for_evac_failure(OopsInHeapRegionClosure* cl) {
|
||||||
_drain_in_progress = false;
|
_drain_in_progress = false;
|
||||||
set_evac_failure_closure(cl);
|
set_evac_failure_closure(cl);
|
||||||
_evac_failure_scan_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(40, true);
|
_evac_failure_scan_stack = new (ResourceObj::C_HEAP, mtGC) GrowableArray<oop>(40, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1CollectedHeap::finalize_for_evac_failure() {
|
void G1CollectedHeap::finalize_for_evac_failure() {
|
||||||
|
@ -4207,9 +4207,9 @@ void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) {
|
||||||
if (_objs_with_preserved_marks == NULL) {
|
if (_objs_with_preserved_marks == NULL) {
|
||||||
assert(_preserved_marks_of_objs == NULL, "Both or none.");
|
assert(_preserved_marks_of_objs == NULL, "Both or none.");
|
||||||
_objs_with_preserved_marks =
|
_objs_with_preserved_marks =
|
||||||
new (ResourceObj::C_HEAP) GrowableArray<oop>(40, true);
|
new (ResourceObj::C_HEAP, mtGC) GrowableArray<oop>(40, true);
|
||||||
_preserved_marks_of_objs =
|
_preserved_marks_of_objs =
|
||||||
new (ResourceObj::C_HEAP) GrowableArray<markOop>(40, true);
|
new (ResourceObj::C_HEAP, mtGC) GrowableArray<markOop>(40, true);
|
||||||
}
|
}
|
||||||
_objs_with_preserved_marks->push(obj);
|
_objs_with_preserved_marks->push(obj);
|
||||||
_preserved_marks_of_objs->push(m);
|
_preserved_marks_of_objs->push(m);
|
||||||
|
@ -4269,7 +4269,7 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num)
|
||||||
uint array_length = PADDING_ELEM_NUM +
|
uint array_length = PADDING_ELEM_NUM +
|
||||||
real_length +
|
real_length +
|
||||||
PADDING_ELEM_NUM;
|
PADDING_ELEM_NUM;
|
||||||
_surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length);
|
_surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
|
||||||
if (_surviving_young_words_base == NULL)
|
if (_surviving_young_words_base == NULL)
|
||||||
vm_exit_out_of_memory(array_length * sizeof(size_t),
|
vm_exit_out_of_memory(array_length * sizeof(size_t),
|
||||||
"Not enough space for young surv histo.");
|
"Not enough space for young surv histo.");
|
||||||
|
|
|
@ -62,8 +62,8 @@ class ConcurrentMarkThread;
|
||||||
class ConcurrentG1Refine;
|
class ConcurrentG1Refine;
|
||||||
class GenerationCounters;
|
class GenerationCounters;
|
||||||
|
|
||||||
typedef OverflowTaskQueue<StarTask> RefToScanQueue;
|
typedef OverflowTaskQueue<StarTask, mtGC> RefToScanQueue;
|
||||||
typedef GenericTaskQueueSet<RefToScanQueue> RefToScanQueueSet;
|
typedef GenericTaskQueueSet<RefToScanQueue, mtGC> RefToScanQueueSet;
|
||||||
|
|
||||||
typedef int RegionIdx_t; // needs to hold [ 0..max_regions() )
|
typedef int RegionIdx_t; // needs to hold [ 0..max_regions() )
|
||||||
typedef int CardIdx_t; // needs to hold [ 0..CardsPerRegion )
|
typedef int CardIdx_t; // needs to hold [ 0..CardsPerRegion )
|
||||||
|
@ -74,7 +74,7 @@ enum GCAllocPurpose {
|
||||||
GCAllocPurposeCount
|
GCAllocPurposeCount
|
||||||
};
|
};
|
||||||
|
|
||||||
class YoungList : public CHeapObj {
|
class YoungList : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
|
|
||||||
|
@ -1772,7 +1772,7 @@ public:
|
||||||
G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num);
|
G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num);
|
||||||
|
|
||||||
~G1ParScanThreadState() {
|
~G1ParScanThreadState() {
|
||||||
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
|
FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base, mtGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
RefToScanQueue* refs() { return _refs; }
|
RefToScanQueue* refs() { return _refs; }
|
||||||
|
|
|
@ -40,7 +40,7 @@ class CollectionSetChooser;
|
||||||
// TraceGen0Time collects data on _both_ young and mixed evacuation pauses
|
// TraceGen0Time collects data on _both_ young and mixed evacuation pauses
|
||||||
// (the latter may contain non-young regions - i.e. regions that are
|
// (the latter may contain non-young regions - i.e. regions that are
|
||||||
// technically in Gen1) while TraceGen1Time collects data about full GCs.
|
// technically in Gen1) while TraceGen1Time collects data about full GCs.
|
||||||
class TraceGen0TimeData : public CHeapObj {
|
class TraceGen0TimeData : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
unsigned _young_pause_num;
|
unsigned _young_pause_num;
|
||||||
unsigned _mixed_pause_num;
|
unsigned _mixed_pause_num;
|
||||||
|
@ -86,7 +86,7 @@ public:
|
||||||
void print() const;
|
void print() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TraceGen1TimeData : public CHeapObj {
|
class TraceGen1TimeData : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
NumberSeq _all_full_gc_times;
|
NumberSeq _all_full_gc_times;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class TraceGen1TimeData : public CHeapObj {
|
||||||
//
|
//
|
||||||
// NewSize and MaxNewSize override NewRatio. So, NewRatio is ignored if it is
|
// NewSize and MaxNewSize override NewRatio. So, NewRatio is ignored if it is
|
||||||
// combined with either NewSize or MaxNewSize. (A warning message is printed.)
|
// combined with either NewSize or MaxNewSize. (A warning message is printed.)
|
||||||
class G1YoungGenSizer : public CHeapObj {
|
class G1YoungGenSizer : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
enum SizerKind {
|
enum SizerKind {
|
||||||
SizerDefaults,
|
SizerDefaults,
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
/***** ALL TIMES ARE IN SECS!!!!!!! *****/
|
/***** ALL TIMES ARE IN SECS!!!!!!! *****/
|
||||||
|
|
||||||
// this is the "interface"
|
// this is the "interface"
|
||||||
class G1MMUTracker: public CHeapObj {
|
class G1MMUTracker: public CHeapObj<mtGC> {
|
||||||
protected:
|
protected:
|
||||||
double _time_slice;
|
double _time_slice;
|
||||||
double _max_gc_time; // this is per time slice
|
double _max_gc_time; // this is per time slice
|
||||||
|
|
|
@ -112,7 +112,7 @@ class G1CollectedHeap;
|
||||||
// do which is important as we want to keep the eden region allocation
|
// do which is important as we want to keep the eden region allocation
|
||||||
// path as low-overhead as possible.
|
// path as low-overhead as possible.
|
||||||
|
|
||||||
class G1MonitoringSupport : public CHeapObj {
|
class G1MonitoringSupport : public CHeapObj<mtGC> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
|
|
|
@ -75,7 +75,7 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs)
|
||||||
{
|
{
|
||||||
_seq_task = new SubTasksDone(NumSeqTasks);
|
_seq_task = new SubTasksDone(NumSeqTasks);
|
||||||
guarantee(n_workers() > 0, "There should be some workers");
|
guarantee(n_workers() > 0, "There should be some workers");
|
||||||
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers());
|
_cset_rs_update_cl = NEW_C_HEAP_ARRAY(OopsInHeapRegionClosure*, n_workers(), mtGC);
|
||||||
for (uint i = 0; i < n_workers(); i++) {
|
for (uint i = 0; i < n_workers(); i++) {
|
||||||
_cset_rs_update_cl[i] = NULL;
|
_cset_rs_update_cl[i] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ G1RemSet::~G1RemSet() {
|
||||||
for (uint i = 0; i < n_workers(); i++) {
|
for (uint i = 0; i < n_workers(); i++) {
|
||||||
assert(_cset_rs_update_cl[i] == NULL, "it should be");
|
assert(_cset_rs_update_cl[i] == NULL, "it should be");
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(OopsInHeapRegionClosure*, _cset_rs_update_cl);
|
FREE_C_HEAP_ARRAY(OopsInHeapRegionClosure*, _cset_rs_update_cl, mtGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) {
|
void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) {
|
||||||
|
@ -416,7 +416,7 @@ void G1RemSet::prepare_for_oops_into_collection_set_do() {
|
||||||
// _seq_task->set_n_termination((int)n_workers());
|
// _seq_task->set_n_termination((int)n_workers());
|
||||||
}
|
}
|
||||||
guarantee( _cards_scanned == NULL, "invariant" );
|
guarantee( _cards_scanned == NULL, "invariant" );
|
||||||
_cards_scanned = NEW_C_HEAP_ARRAY(size_t, n_workers());
|
_cards_scanned = NEW_C_HEAP_ARRAY(size_t, n_workers(), mtGC);
|
||||||
for (uint i = 0; i < n_workers(); ++i) {
|
for (uint i = 0; i < n_workers(); ++i) {
|
||||||
_cards_scanned[i] = 0;
|
_cards_scanned[i] = 0;
|
||||||
}
|
}
|
||||||
|
@ -487,7 +487,7 @@ void G1RemSet::cleanup_after_oops_into_collection_set_do() {
|
||||||
for (uint i = 0; i < n_workers(); ++i) {
|
for (uint i = 0; i < n_workers(); ++i) {
|
||||||
_total_cards_scanned += _cards_scanned[i];
|
_total_cards_scanned += _cards_scanned[i];
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(size_t, _cards_scanned);
|
FREE_C_HEAP_ARRAY(size_t, _cards_scanned, mtGC);
|
||||||
_cards_scanned = NULL;
|
_cards_scanned = NULL;
|
||||||
// Cleanup after copy
|
// Cleanup after copy
|
||||||
_g1->set_refine_cte_cl_concurrency(true);
|
_g1->set_refine_cte_cl_concurrency(true);
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ConcurrentG1Refine;
|
||||||
// external heap references into it. Uses a mod ref bs to track updates,
|
// external heap references into it. Uses a mod ref bs to track updates,
|
||||||
// so that they can be used to update the individual region remsets.
|
// so that they can be used to update the individual region remsets.
|
||||||
|
|
||||||
class G1RemSet: public CHeapObj {
|
class G1RemSet: public CHeapObj<mtGC> {
|
||||||
protected:
|
protected:
|
||||||
G1CollectedHeap* _g1;
|
G1CollectedHeap* _g1;
|
||||||
unsigned _conc_refine_cards;
|
unsigned _conc_refine_cards;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
// OtherRegionsTable
|
// OtherRegionsTable
|
||||||
|
|
||||||
class PerRegionTable: public CHeapObj {
|
class PerRegionTable: public CHeapObj<mtGC> {
|
||||||
friend class OtherRegionsTable;
|
friend class OtherRegionsTable;
|
||||||
friend class HeapRegionRemSetIterator;
|
friend class HeapRegionRemSetIterator;
|
||||||
|
|
||||||
|
@ -272,9 +272,9 @@ void OtherRegionsTable::init_from_card_cache(size_t max_regions) {
|
||||||
_from_card_cache_max_regions = max_regions;
|
_from_card_cache_max_regions = max_regions;
|
||||||
|
|
||||||
int n_par_rs = HeapRegionRemSet::num_par_rem_sets();
|
int n_par_rs = HeapRegionRemSet::num_par_rem_sets();
|
||||||
_from_card_cache = NEW_C_HEAP_ARRAY(int*, n_par_rs);
|
_from_card_cache = NEW_C_HEAP_ARRAY(int*, n_par_rs, mtGC);
|
||||||
for (int i = 0; i < n_par_rs; i++) {
|
for (int i = 0; i < n_par_rs; i++) {
|
||||||
_from_card_cache[i] = NEW_C_HEAP_ARRAY(int, max_regions);
|
_from_card_cache[i] = NEW_C_HEAP_ARRAY(int, max_regions, mtGC);
|
||||||
for (size_t j = 0; j < max_regions; j++) {
|
for (size_t j = 0; j < max_regions; j++) {
|
||||||
_from_card_cache[i][j] = -1; // An invalid value.
|
_from_card_cache[i][j] = -1; // An invalid value.
|
||||||
}
|
}
|
||||||
|
@ -977,9 +977,9 @@ void HeapRegionRemSet::record(HeapRegion* hr, OopOrNarrowOopStar f) {
|
||||||
&& _recorded_cards == NULL
|
&& _recorded_cards == NULL
|
||||||
&& _recorded_regions == NULL,
|
&& _recorded_regions == NULL,
|
||||||
"Inv");
|
"Inv");
|
||||||
_recorded_oops = NEW_C_HEAP_ARRAY(OopOrNarrowOopStar, MaxRecorded);
|
_recorded_oops = NEW_C_HEAP_ARRAY(OopOrNarrowOopStar, MaxRecorded, mtGC);
|
||||||
_recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded);
|
_recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded, mtGC);
|
||||||
_recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded);
|
_recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded, mtGC);
|
||||||
}
|
}
|
||||||
if (_n_recorded == MaxRecorded) {
|
if (_n_recorded == MaxRecorded) {
|
||||||
gclog_or_tty->print_cr("Filled up 'recorded' (%d).", MaxRecorded);
|
gclog_or_tty->print_cr("Filled up 'recorded' (%d).", MaxRecorded);
|
||||||
|
@ -1000,8 +1000,8 @@ void HeapRegionRemSet::record_event(Event evnt) {
|
||||||
assert(_n_recorded_events == 0
|
assert(_n_recorded_events == 0
|
||||||
&& _recorded_event_index == NULL,
|
&& _recorded_event_index == NULL,
|
||||||
"Inv");
|
"Inv");
|
||||||
_recorded_events = NEW_C_HEAP_ARRAY(Event, MaxRecordedEvents);
|
_recorded_events = NEW_C_HEAP_ARRAY(Event, MaxRecordedEvents, mtGC);
|
||||||
_recorded_event_index = NEW_C_HEAP_ARRAY(int, MaxRecordedEvents);
|
_recorded_event_index = NEW_C_HEAP_ARRAY(int, MaxRecordedEvents, mtGC);
|
||||||
}
|
}
|
||||||
if (_n_recorded_events == MaxRecordedEvents) {
|
if (_n_recorded_events == MaxRecordedEvents) {
|
||||||
gclog_or_tty->print_cr("Filled up 'recorded_events' (%d).", MaxRecordedEvents);
|
gclog_or_tty->print_cr("Filled up 'recorded_events' (%d).", MaxRecordedEvents);
|
||||||
|
|
|
@ -165,7 +165,7 @@ public:
|
||||||
static void print_from_card_cache();
|
static void print_from_card_cache();
|
||||||
};
|
};
|
||||||
|
|
||||||
class HeapRegionRemSet : public CHeapObj {
|
class HeapRegionRemSet : public CHeapObj<mtGC> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
friend class HeapRegionRemSetIterator;
|
friend class HeapRegionRemSetIterator;
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class HeapRegionRemSetIterator : public CHeapObj {
|
class HeapRegionRemSetIterator : public CHeapObj<mtGC> {
|
||||||
|
|
||||||
// The region over which we're iterating.
|
// The region over which we're iterating.
|
||||||
const HeapRegionRemSet* _hrrs;
|
const HeapRegionRemSet* _hrrs;
|
||||||
|
|
|
@ -86,7 +86,7 @@ void HeapRegionSeq::initialize(HeapWord* bottom, HeapWord* end,
|
||||||
_allocated_length = 0;
|
_allocated_length = 0;
|
||||||
_max_length = max_length;
|
_max_length = max_length;
|
||||||
|
|
||||||
_regions = NEW_C_HEAP_ARRAY(HeapRegion*, max_length);
|
_regions = NEW_C_HEAP_ARRAY(HeapRegion*, max_length, mtGC);
|
||||||
memset(_regions, 0, (size_t) max_length * sizeof(HeapRegion*));
|
memset(_regions, 0, (size_t) max_length * sizeof(HeapRegion*));
|
||||||
_regions_biased = _regions - ((uintx) bottom >> _region_shift);
|
_regions_biased = _regions - ((uintx) bottom >> _region_shift);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class FreeRegionList;
|
||||||
//
|
//
|
||||||
// and maintain that: _length <= _allocated_length <= _max_length
|
// and maintain that: _length <= _allocated_length <= _max_length
|
||||||
|
|
||||||
class HeapRegionSeq: public CHeapObj {
|
class HeapRegionSeq: public CHeapObj<mtGC> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
|
|
||||||
// The array that holds the HeapRegions.
|
// The array that holds the HeapRegions.
|
||||||
|
|
|
@ -126,7 +126,7 @@ void** PtrQueueSet::allocate_buffer() {
|
||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
// Allocate space for the BufferNode in front of the buffer.
|
// Allocate space for the BufferNode in front of the buffer.
|
||||||
char *b = NEW_C_HEAP_ARRAY(char, _sz + BufferNode::aligned_size());
|
char *b = NEW_C_HEAP_ARRAY(char, _sz + BufferNode::aligned_size(), mtGC);
|
||||||
return BufferNode::make_buffer_from_block(b);
|
return BufferNode::make_buffer_from_block(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ void PtrQueueSet::reduce_free_list() {
|
||||||
assert(_buf_free_list != NULL, "_buf_free_list_sz must be wrong.");
|
assert(_buf_free_list != NULL, "_buf_free_list_sz must be wrong.");
|
||||||
void* b = BufferNode::make_block_from_node(_buf_free_list);
|
void* b = BufferNode::make_block_from_node(_buf_free_list);
|
||||||
_buf_free_list = _buf_free_list->next();
|
_buf_free_list = _buf_free_list->next();
|
||||||
FREE_C_HEAP_ARRAY(char, b);
|
FREE_C_HEAP_ARRAY(char, b, mtGC);
|
||||||
_buf_free_list_sz --;
|
_buf_free_list_sz --;
|
||||||
n--;
|
n--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
|
||||||
PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
|
PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1);
|
||||||
_shared_satb_queue.set_lock(lock);
|
_shared_satb_queue.set_lock(lock);
|
||||||
if (ParallelGCThreads > 0) {
|
if (ParallelGCThreads > 0) {
|
||||||
_par_closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads);
|
_par_closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads, mtGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,8 +148,8 @@ void SparsePRTEntry::copy_cards(SparsePRTEntry* e) const {
|
||||||
RSHashTable::RSHashTable(size_t capacity) :
|
RSHashTable::RSHashTable(size_t capacity) :
|
||||||
_capacity(capacity), _capacity_mask(capacity-1),
|
_capacity(capacity), _capacity_mask(capacity-1),
|
||||||
_occupied_entries(0), _occupied_cards(0),
|
_occupied_entries(0), _occupied_cards(0),
|
||||||
_entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity)),
|
_entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity, mtGC)),
|
||||||
_buckets(NEW_C_HEAP_ARRAY(int, capacity)),
|
_buckets(NEW_C_HEAP_ARRAY(int, capacity, mtGC)),
|
||||||
_free_list(NullEntry), _free_region(0)
|
_free_list(NullEntry), _free_region(0)
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
|
@ -157,11 +157,11 @@ RSHashTable::RSHashTable(size_t capacity) :
|
||||||
|
|
||||||
RSHashTable::~RSHashTable() {
|
RSHashTable::~RSHashTable() {
|
||||||
if (_entries != NULL) {
|
if (_entries != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
|
FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries, mtGC);
|
||||||
_entries = NULL;
|
_entries = NULL;
|
||||||
}
|
}
|
||||||
if (_buckets != NULL) {
|
if (_buckets != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(int, _buckets);
|
FREE_C_HEAP_ARRAY(int, _buckets, mtGC);
|
||||||
_buckets = NULL;
|
_buckets = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
// insertions only enqueue old versions for deletions, but do not delete
|
// insertions only enqueue old versions for deletions, but do not delete
|
||||||
// old versions synchronously.
|
// old versions synchronously.
|
||||||
|
|
||||||
class SparsePRTEntry: public CHeapObj {
|
class SparsePRTEntry: public CHeapObj<mtGC> {
|
||||||
public:
|
public:
|
||||||
enum SomePublicConstants {
|
enum SomePublicConstants {
|
||||||
NullEntry = -1,
|
NullEntry = -1,
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class RSHashTable : public CHeapObj {
|
class RSHashTable : public CHeapObj<mtGC> {
|
||||||
|
|
||||||
friend class RSHashTableIter;
|
friend class RSHashTableIter;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
|
||||||
reset();
|
reset();
|
||||||
if (summary_surv_rates_len > 0) {
|
if (summary_surv_rates_len > 0) {
|
||||||
size_t length = summary_surv_rates_len;
|
size_t length = summary_surv_rates_len;
|
||||||
_summary_surv_rates = NEW_C_HEAP_ARRAY(NumberSeq*, length);
|
_summary_surv_rates = NEW_C_HEAP_ARRAY(NumberSeq*, length, mtGC);
|
||||||
for (size_t i = 0; i < length; ++i) {
|
for (size_t i = 0; i < length; ++i) {
|
||||||
_summary_surv_rates[i] = new NumberSeq();
|
_summary_surv_rates[i] = new NumberSeq();
|
||||||
}
|
}
|
||||||
|
@ -90,9 +90,9 @@ SurvRateGroup::stop_adding_regions() {
|
||||||
double* old_accum_surv_rate_pred = _accum_surv_rate_pred;
|
double* old_accum_surv_rate_pred = _accum_surv_rate_pred;
|
||||||
TruncatedSeq** old_surv_rate_pred = _surv_rate_pred;
|
TruncatedSeq** old_surv_rate_pred = _surv_rate_pred;
|
||||||
|
|
||||||
_surv_rate = NEW_C_HEAP_ARRAY(double, _region_num);
|
_surv_rate = NEW_C_HEAP_ARRAY(double, _region_num, mtGC);
|
||||||
_accum_surv_rate_pred = NEW_C_HEAP_ARRAY(double, _region_num);
|
_accum_surv_rate_pred = NEW_C_HEAP_ARRAY(double, _region_num, mtGC);
|
||||||
_surv_rate_pred = NEW_C_HEAP_ARRAY(TruncatedSeq*, _region_num);
|
_surv_rate_pred = NEW_C_HEAP_ARRAY(TruncatedSeq*, _region_num, mtGC);
|
||||||
|
|
||||||
for (size_t i = 0; i < _stats_arrays_length; ++i) {
|
for (size_t i = 0; i < _stats_arrays_length; ++i) {
|
||||||
_surv_rate_pred[i] = old_surv_rate_pred[i];
|
_surv_rate_pred[i] = old_surv_rate_pred[i];
|
||||||
|
@ -104,13 +104,13 @@ SurvRateGroup::stop_adding_regions() {
|
||||||
_stats_arrays_length = _region_num;
|
_stats_arrays_length = _region_num;
|
||||||
|
|
||||||
if (old_surv_rate != NULL) {
|
if (old_surv_rate != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(double, old_surv_rate);
|
FREE_C_HEAP_ARRAY(double, old_surv_rate, mtGC);
|
||||||
}
|
}
|
||||||
if (old_accum_surv_rate_pred != NULL) {
|
if (old_accum_surv_rate_pred != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(double, old_accum_surv_rate_pred);
|
FREE_C_HEAP_ARRAY(double, old_accum_surv_rate_pred, mtGC);
|
||||||
}
|
}
|
||||||
if (old_surv_rate_pred != NULL) {
|
if (old_surv_rate_pred != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(TruncatedSeq*, old_surv_rate_pred);
|
FREE_C_HEAP_ARRAY(TruncatedSeq*, old_surv_rate_pred, mtGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
class G1CollectorPolicy;
|
class G1CollectorPolicy;
|
||||||
|
|
||||||
class SurvRateGroup : public CHeapObj {
|
class SurvRateGroup : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
G1CollectorPolicy* _g1p;
|
G1CollectorPolicy* _g1p;
|
||||||
const char* _name;
|
const char* _name;
|
||||||
|
|
|
@ -457,12 +457,12 @@ get_LNC_array_for_space(Space* sp,
|
||||||
if (_lowest_non_clean[i] != NULL) {
|
if (_lowest_non_clean[i] != NULL) {
|
||||||
assert(n_chunks != _lowest_non_clean_chunk_size[i],
|
assert(n_chunks != _lowest_non_clean_chunk_size[i],
|
||||||
"logical consequence");
|
"logical consequence");
|
||||||
FREE_C_HEAP_ARRAY(CardPtr, _lowest_non_clean[i]);
|
FREE_C_HEAP_ARRAY(CardPtr, _lowest_non_clean[i], mtGC);
|
||||||
_lowest_non_clean[i] = NULL;
|
_lowest_non_clean[i] = NULL;
|
||||||
}
|
}
|
||||||
// Now allocate a new one if necessary.
|
// Now allocate a new one if necessary.
|
||||||
if (_lowest_non_clean[i] == NULL) {
|
if (_lowest_non_clean[i] == NULL) {
|
||||||
_lowest_non_clean[i] = NEW_C_HEAP_ARRAY(CardPtr, n_chunks);
|
_lowest_non_clean[i] = NEW_C_HEAP_ARRAY(CardPtr, n_chunks, mtGC);
|
||||||
_lowest_non_clean_chunk_size[i] = n_chunks;
|
_lowest_non_clean_chunk_size[i] = n_chunks;
|
||||||
_lowest_non_clean_base_chunk_index[i] = addr_to_chunk_index(covered.start());
|
_lowest_non_clean_base_chunk_index[i] = addr_to_chunk_index(covered.start());
|
||||||
for (int j = 0; j < (int)n_chunks; j++)
|
for (int j = 0; j < (int)n_chunks; j++)
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
class PLABStats;
|
class PLABStats;
|
||||||
|
|
||||||
// A per-thread allocation buffer used during GC.
|
// A per-thread allocation buffer used during GC.
|
||||||
class ParGCAllocBuffer: public CHeapObj {
|
class ParGCAllocBuffer: public CHeapObj<mtGC> {
|
||||||
protected:
|
protected:
|
||||||
char head[32];
|
char head[32];
|
||||||
size_t _word_sz; // in HeapWord units
|
size_t _word_sz; // in HeapWord units
|
||||||
|
|
|
@ -59,7 +59,7 @@ ParScanThreadState::ParScanThreadState(Space* to_space_,
|
||||||
Generation* old_gen_,
|
Generation* old_gen_,
|
||||||
int thread_num_,
|
int thread_num_,
|
||||||
ObjToScanQueueSet* work_queue_set_,
|
ObjToScanQueueSet* work_queue_set_,
|
||||||
Stack<oop>* overflow_stacks_,
|
Stack<oop, mtGC>* overflow_stacks_,
|
||||||
size_t desired_plab_sz_,
|
size_t desired_plab_sz_,
|
||||||
ParallelTaskTerminator& term_) :
|
ParallelTaskTerminator& term_) :
|
||||||
_to_space(to_space_), _old_gen(old_gen_), _young_gen(gen_), _thread_num(thread_num_),
|
_to_space(to_space_), _old_gen(old_gen_), _young_gen(gen_), _thread_num(thread_num_),
|
||||||
|
@ -184,7 +184,7 @@ bool ParScanThreadState::take_from_overflow_stack() {
|
||||||
assert(ParGCUseLocalOverflow, "Else should not call");
|
assert(ParGCUseLocalOverflow, "Else should not call");
|
||||||
assert(young_gen()->overflow_list() == NULL, "Error");
|
assert(young_gen()->overflow_list() == NULL, "Error");
|
||||||
ObjToScanQueue* queue = work_queue();
|
ObjToScanQueue* queue = work_queue();
|
||||||
Stack<oop>* const of_stack = overflow_stack();
|
Stack<oop, mtGC>* const of_stack = overflow_stack();
|
||||||
const size_t num_overflow_elems = of_stack->size();
|
const size_t num_overflow_elems = of_stack->size();
|
||||||
const size_t space_available = queue->max_elems() - queue->size();
|
const size_t space_available = queue->max_elems() - queue->size();
|
||||||
const size_t num_take_elems = MIN3(space_available / 4,
|
const size_t num_take_elems = MIN3(space_available / 4,
|
||||||
|
@ -297,7 +297,7 @@ public:
|
||||||
ParNewGeneration& gen,
|
ParNewGeneration& gen,
|
||||||
Generation& old_gen,
|
Generation& old_gen,
|
||||||
ObjToScanQueueSet& queue_set,
|
ObjToScanQueueSet& queue_set,
|
||||||
Stack<oop>* overflow_stacks_,
|
Stack<oop, mtGC>* overflow_stacks_,
|
||||||
size_t desired_plab_sz,
|
size_t desired_plab_sz,
|
||||||
ParallelTaskTerminator& term);
|
ParallelTaskTerminator& term);
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ private:
|
||||||
ParScanThreadStateSet::ParScanThreadStateSet(
|
ParScanThreadStateSet::ParScanThreadStateSet(
|
||||||
int num_threads, Space& to_space, ParNewGeneration& gen,
|
int num_threads, Space& to_space, ParNewGeneration& gen,
|
||||||
Generation& old_gen, ObjToScanQueueSet& queue_set,
|
Generation& old_gen, ObjToScanQueueSet& queue_set,
|
||||||
Stack<oop>* overflow_stacks,
|
Stack<oop, mtGC>* overflow_stacks,
|
||||||
size_t desired_plab_sz, ParallelTaskTerminator& term)
|
size_t desired_plab_sz, ParallelTaskTerminator& term)
|
||||||
: ResourceArray(sizeof(ParScanThreadState), num_threads),
|
: ResourceArray(sizeof(ParScanThreadState), num_threads),
|
||||||
_gen(gen), _next_gen(old_gen), _term(term)
|
_gen(gen), _next_gen(old_gen), _term(term)
|
||||||
|
@ -649,9 +649,14 @@ ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level)
|
||||||
|
|
||||||
_overflow_stacks = NULL;
|
_overflow_stacks = NULL;
|
||||||
if (ParGCUseLocalOverflow) {
|
if (ParGCUseLocalOverflow) {
|
||||||
_overflow_stacks = NEW_C_HEAP_ARRAY(Stack<oop>, ParallelGCThreads);
|
|
||||||
|
// typedef to workaround NEW_C_HEAP_ARRAY macro, which can not deal
|
||||||
|
// with ','
|
||||||
|
typedef Stack<oop, mtGC> GCOopStack;
|
||||||
|
|
||||||
|
_overflow_stacks = NEW_C_HEAP_ARRAY(GCOopStack, ParallelGCThreads, mtGC);
|
||||||
for (size_t i = 0; i < ParallelGCThreads; ++i) {
|
for (size_t i = 0; i < ParallelGCThreads; ++i) {
|
||||||
new (_overflow_stacks + i) Stack<oop>();
|
new (_overflow_stacks + i) Stack<oop, mtGC>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1401,7 +1406,7 @@ void ParNewGeneration::push_on_overflow_list(oop from_space_obj, ParScanThreadSt
|
||||||
assert(_num_par_pushes > 0, "Tautology");
|
assert(_num_par_pushes > 0, "Tautology");
|
||||||
#endif
|
#endif
|
||||||
if (from_space_obj->forwardee() == from_space_obj) {
|
if (from_space_obj->forwardee() == from_space_obj) {
|
||||||
oopDesc* listhead = NEW_C_HEAP_ARRAY(oopDesc, 1);
|
oopDesc* listhead = NEW_C_HEAP_ARRAY(oopDesc, 1, mtGC);
|
||||||
listhead->forward_to(from_space_obj);
|
listhead->forward_to(from_space_obj);
|
||||||
from_space_obj = listhead;
|
from_space_obj = listhead;
|
||||||
}
|
}
|
||||||
|
@ -1553,7 +1558,7 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan
|
||||||
// This can become a scaling bottleneck when there is work queue overflow coincident
|
// This can become a scaling bottleneck when there is work queue overflow coincident
|
||||||
// with promotion failure.
|
// with promotion failure.
|
||||||
oopDesc* f = cur;
|
oopDesc* f = cur;
|
||||||
FREE_C_HEAP_ARRAY(oopDesc, f);
|
FREE_C_HEAP_ARRAY(oopDesc, f, mtGC);
|
||||||
} else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) {
|
} else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) {
|
||||||
assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned");
|
assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned");
|
||||||
obj_to_push = cur;
|
obj_to_push = cur;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ParEvacuateFollowersClosure;
|
||||||
// in genOopClosures.inline.hpp.
|
// in genOopClosures.inline.hpp.
|
||||||
|
|
||||||
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
||||||
typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet;
|
typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
|
||||||
|
|
||||||
class ParKeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
|
class ParKeepAliveClosure: public DefNewGeneration::KeepAliveClosure {
|
||||||
private:
|
private:
|
||||||
|
@ -59,7 +59,7 @@ class ParScanThreadState {
|
||||||
friend class ParScanThreadStateSet;
|
friend class ParScanThreadStateSet;
|
||||||
private:
|
private:
|
||||||
ObjToScanQueue *_work_queue;
|
ObjToScanQueue *_work_queue;
|
||||||
Stack<oop>* const _overflow_stack;
|
Stack<oop, mtGC>* const _overflow_stack;
|
||||||
|
|
||||||
ParGCAllocBuffer _to_space_alloc_buffer;
|
ParGCAllocBuffer _to_space_alloc_buffer;
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class ParScanThreadState {
|
||||||
ParScanThreadState(Space* to_space_, ParNewGeneration* gen_,
|
ParScanThreadState(Space* to_space_, ParNewGeneration* gen_,
|
||||||
Generation* old_gen_, int thread_num_,
|
Generation* old_gen_, int thread_num_,
|
||||||
ObjToScanQueueSet* work_queue_set_,
|
ObjToScanQueueSet* work_queue_set_,
|
||||||
Stack<oop>* overflow_stacks_,
|
Stack<oop, mtGC>* overflow_stacks_,
|
||||||
size_t desired_plab_sz_,
|
size_t desired_plab_sz_,
|
||||||
ParallelTaskTerminator& term_);
|
ParallelTaskTerminator& term_);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ class ParScanThreadState {
|
||||||
void trim_queues(int max_size);
|
void trim_queues(int max_size);
|
||||||
|
|
||||||
// Private overflow stack usage
|
// Private overflow stack usage
|
||||||
Stack<oop>* overflow_stack() { return _overflow_stack; }
|
Stack<oop, mtGC>* overflow_stack() { return _overflow_stack; }
|
||||||
bool take_from_overflow_stack();
|
bool take_from_overflow_stack();
|
||||||
void push_on_overflow_stack(oop p);
|
void push_on_overflow_stack(oop p);
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ class ParNewGeneration: public DefNewGeneration {
|
||||||
ObjToScanQueueSet* _task_queues;
|
ObjToScanQueueSet* _task_queues;
|
||||||
|
|
||||||
// Per-worker-thread local overflow stacks
|
// Per-worker-thread local overflow stacks
|
||||||
Stack<oop>* _overflow_stacks;
|
Stack<oop, mtGC>* _overflow_stacks;
|
||||||
|
|
||||||
// Desired size of survivor space plab's
|
// Desired size of survivor space plab's
|
||||||
PLABStats _plab_stats;
|
PLABStats _plab_stats;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
class ParScanThreadState;
|
class ParScanThreadState;
|
||||||
class ParNewGeneration;
|
class ParNewGeneration;
|
||||||
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
typedef Padded<OopTaskQueue> ObjToScanQueue;
|
||||||
typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet;
|
typedef GenericTaskQueueSet<ObjToScanQueue, mtGC> ObjToScanQueueSet;
|
||||||
class ParallelTaskTerminator;
|
class ParallelTaskTerminator;
|
||||||
|
|
||||||
class ParScanClosure: public OopsInGenClosure {
|
class ParScanClosure: public OopsInGenClosure {
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
// must be shrunk. Adjusting the boundary between the generations
|
// must be shrunk. Adjusting the boundary between the generations
|
||||||
// is called for in this class.
|
// is called for in this class.
|
||||||
|
|
||||||
class AdjoiningGenerations : public CHeapObj {
|
class AdjoiningGenerations : public CHeapObj<mtGC> {
|
||||||
friend class VMStructs;
|
friend class VMStructs;
|
||||||
private:
|
private:
|
||||||
// The young generation and old generation, respectively
|
// The young generation and old generation, respectively
|
||||||
|
|
|
@ -116,7 +116,7 @@ GCTaskQueue* GCTaskQueue::create() {
|
||||||
}
|
}
|
||||||
|
|
||||||
GCTaskQueue* GCTaskQueue::create_on_c_heap() {
|
GCTaskQueue* GCTaskQueue::create_on_c_heap() {
|
||||||
GCTaskQueue* result = new(ResourceObj::C_HEAP) GCTaskQueue(true);
|
GCTaskQueue* result = new(ResourceObj::C_HEAP, mtGC) GCTaskQueue(true);
|
||||||
if (TraceGCTaskQueue) {
|
if (TraceGCTaskQueue) {
|
||||||
tty->print_cr("GCTaskQueue::create_on_c_heap()"
|
tty->print_cr("GCTaskQueue::create_on_c_heap()"
|
||||||
" returns " INTPTR_FORMAT,
|
" returns " INTPTR_FORMAT,
|
||||||
|
@ -403,19 +403,19 @@ void GCTaskManager::initialize() {
|
||||||
_queue = SynchronizedGCTaskQueue::create(unsynchronized_queue, lock());
|
_queue = SynchronizedGCTaskQueue::create(unsynchronized_queue, lock());
|
||||||
_noop_task = NoopGCTask::create_on_c_heap();
|
_noop_task = NoopGCTask::create_on_c_heap();
|
||||||
_idle_inactive_task = WaitForBarrierGCTask::create_on_c_heap();
|
_idle_inactive_task = WaitForBarrierGCTask::create_on_c_heap();
|
||||||
_resource_flag = NEW_C_HEAP_ARRAY(bool, workers());
|
_resource_flag = NEW_C_HEAP_ARRAY(bool, workers(), mtGC);
|
||||||
{
|
{
|
||||||
// Set up worker threads.
|
// Set up worker threads.
|
||||||
// Distribute the workers among the available processors,
|
// Distribute the workers among the available processors,
|
||||||
// unless we were told not to, or if the os doesn't want to.
|
// unless we were told not to, or if the os doesn't want to.
|
||||||
uint* processor_assignment = NEW_C_HEAP_ARRAY(uint, workers());
|
uint* processor_assignment = NEW_C_HEAP_ARRAY(uint, workers(), mtGC);
|
||||||
if (!BindGCTaskThreadsToCPUs ||
|
if (!BindGCTaskThreadsToCPUs ||
|
||||||
!os::distribute_processes(workers(), processor_assignment)) {
|
!os::distribute_processes(workers(), processor_assignment)) {
|
||||||
for (uint a = 0; a < workers(); a += 1) {
|
for (uint a = 0; a < workers(); a += 1) {
|
||||||
processor_assignment[a] = sentinel_worker();
|
processor_assignment[a] = sentinel_worker();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_thread = NEW_C_HEAP_ARRAY(GCTaskThread*, workers());
|
_thread = NEW_C_HEAP_ARRAY(GCTaskThread*, workers(), mtGC);
|
||||||
for (uint t = 0; t < workers(); t += 1) {
|
for (uint t = 0; t < workers(); t += 1) {
|
||||||
set_thread(t, GCTaskThread::create(this, t, processor_assignment[t]));
|
set_thread(t, GCTaskThread::create(this, t, processor_assignment[t]));
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,7 @@ void GCTaskManager::initialize() {
|
||||||
}
|
}
|
||||||
tty->cr();
|
tty->cr();
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(uint, processor_assignment);
|
FREE_C_HEAP_ARRAY(uint, processor_assignment, mtGC);
|
||||||
}
|
}
|
||||||
reset_busy_workers();
|
reset_busy_workers();
|
||||||
set_unblocked();
|
set_unblocked();
|
||||||
|
@ -455,11 +455,11 @@ GCTaskManager::~GCTaskManager() {
|
||||||
GCTaskThread::destroy(thread(i));
|
GCTaskThread::destroy(thread(i));
|
||||||
set_thread(i, NULL);
|
set_thread(i, NULL);
|
||||||
}
|
}
|
||||||
FREE_C_HEAP_ARRAY(GCTaskThread*, _thread);
|
FREE_C_HEAP_ARRAY(GCTaskThread*, _thread, mtGC);
|
||||||
_thread = NULL;
|
_thread = NULL;
|
||||||
}
|
}
|
||||||
if (_resource_flag != NULL) {
|
if (_resource_flag != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(bool, _resource_flag);
|
FREE_C_HEAP_ARRAY(bool, _resource_flag, mtGC);
|
||||||
_resource_flag = NULL;
|
_resource_flag = NULL;
|
||||||
}
|
}
|
||||||
if (queue() != NULL) {
|
if (queue() != NULL) {
|
||||||
|
@ -817,7 +817,7 @@ NoopGCTask* NoopGCTask::create() {
|
||||||
}
|
}
|
||||||
|
|
||||||
NoopGCTask* NoopGCTask::create_on_c_heap() {
|
NoopGCTask* NoopGCTask::create_on_c_heap() {
|
||||||
NoopGCTask* result = new(ResourceObj::C_HEAP) NoopGCTask(true);
|
NoopGCTask* result = new(ResourceObj::C_HEAP, mtGC) NoopGCTask(true);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -848,7 +848,7 @@ IdleGCTask* IdleGCTask::create() {
|
||||||
}
|
}
|
||||||
|
|
||||||
IdleGCTask* IdleGCTask::create_on_c_heap() {
|
IdleGCTask* IdleGCTask::create_on_c_heap() {
|
||||||
IdleGCTask* result = new(ResourceObj::C_HEAP) IdleGCTask(true);
|
IdleGCTask* result = new(ResourceObj::C_HEAP, mtGC) IdleGCTask(true);
|
||||||
assert(UseDynamicNumberOfGCThreads,
|
assert(UseDynamicNumberOfGCThreads,
|
||||||
"Should only be used with dynamic GC thread");
|
"Should only be used with dynamic GC thread");
|
||||||
return result;
|
return result;
|
||||||
|
@ -984,7 +984,7 @@ WaitForBarrierGCTask* WaitForBarrierGCTask::create() {
|
||||||
|
|
||||||
WaitForBarrierGCTask* WaitForBarrierGCTask::create_on_c_heap() {
|
WaitForBarrierGCTask* WaitForBarrierGCTask::create_on_c_heap() {
|
||||||
WaitForBarrierGCTask* result =
|
WaitForBarrierGCTask* result =
|
||||||
new (ResourceObj::C_HEAP) WaitForBarrierGCTask(true);
|
new (ResourceObj::C_HEAP, mtGC) WaitForBarrierGCTask(true);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ Monitor* MonitorSupply::reserve() {
|
||||||
// Lazy initialization.
|
// Lazy initialization.
|
||||||
if (freelist() == NULL) {
|
if (freelist() == NULL) {
|
||||||
_freelist =
|
_freelist =
|
||||||
new(ResourceObj::C_HEAP) GrowableArray<Monitor*>(ParallelGCThreads,
|
new(ResourceObj::C_HEAP, mtGC) GrowableArray<Monitor*>(ParallelGCThreads,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
if (! freelist()->is_empty()) {
|
if (! freelist()->is_empty()) {
|
||||||
|
|
|
@ -216,7 +216,7 @@ protected:
|
||||||
|
|
||||||
// A GCTaskQueue that can be synchronized.
|
// A GCTaskQueue that can be synchronized.
|
||||||
// This "has-a" GCTaskQueue and a mutex to do the exclusion.
|
// This "has-a" GCTaskQueue and a mutex to do the exclusion.
|
||||||
class SynchronizedGCTaskQueue : public CHeapObj {
|
class SynchronizedGCTaskQueue : public CHeapObj<mtGC> {
|
||||||
private:
|
private:
|
||||||
// Instance state.
|
// Instance state.
|
||||||
GCTaskQueue* _unsynchronized_queue; // Has-a unsynchronized queue.
|
GCTaskQueue* _unsynchronized_queue; // Has-a unsynchronized queue.
|
||||||
|
@ -278,7 +278,7 @@ protected:
|
||||||
|
|
||||||
// This is an abstract base class for getting notifications
|
// This is an abstract base class for getting notifications
|
||||||
// when a GCTaskManager is done.
|
// when a GCTaskManager is done.
|
||||||
class NotifyDoneClosure : public CHeapObj {
|
class NotifyDoneClosure : public CHeapObj<mtGC> {
|
||||||
public:
|
public:
|
||||||
// The notification callback method.
|
// The notification callback method.
|
||||||
virtual void notify(GCTaskManager* manager) = 0;
|
virtual void notify(GCTaskManager* manager) = 0;
|
||||||
|
@ -355,7 +355,7 @@ protected:
|
||||||
// held in the GCTaskThread** _thread array in GCTaskManager.
|
// held in the GCTaskThread** _thread array in GCTaskManager.
|
||||||
|
|
||||||
|
|
||||||
class GCTaskManager : public CHeapObj {
|
class GCTaskManager : public CHeapObj<mtGC> {
|
||||||
friend class ParCompactionManager;
|
friend class ParCompactionManager;
|
||||||
friend class PSParallelCompact;
|
friend class PSParallelCompact;
|
||||||
friend class PSScavenge;
|
friend class PSScavenge;
|
||||||
|
|
|
@ -46,7 +46,7 @@ GCTaskThread::GCTaskThread(GCTaskManager* manager,
|
||||||
vm_exit_out_of_memory(0, "Cannot create GC thread. Out of system resources.");
|
vm_exit_out_of_memory(0, "Cannot create GC thread. Out of system resources.");
|
||||||
|
|
||||||
if (PrintGCTaskTimeStamps) {
|
if (PrintGCTaskTimeStamps) {
|
||||||
_time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries );
|
_time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC);
|
||||||
|
|
||||||
guarantee(_time_stamps != NULL, "Sanity");
|
guarantee(_time_stamps != NULL, "Sanity");
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ GCTaskThread::GCTaskThread(GCTaskManager* manager,
|
||||||
|
|
||||||
GCTaskThread::~GCTaskThread() {
|
GCTaskThread::~GCTaskThread() {
|
||||||
if (_time_stamps != NULL) {
|
if (_time_stamps != NULL) {
|
||||||
FREE_C_HEAP_ARRAY(GCTaskTimeStamp, _time_stamps);
|
FREE_C_HEAP_ARRAY(GCTaskTimeStamp, _time_stamps, mtGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ protected:
|
||||||
void set_is_working(bool v) { _is_working = v; }
|
void set_is_working(bool v) { _is_working = v; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class GCTaskTimeStamp : public CHeapObj
|
class GCTaskTimeStamp : public CHeapObj<mtGC>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
jlong _entry_time;
|
jlong _entry_time;
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "memory/cardTableModRefBS.hpp"
|
#include "memory/cardTableModRefBS.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/java.hpp"
|
#include "runtime/java.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
|
|
||||||
void ObjectStartArray::initialize(MemRegion reserved_region) {
|
void ObjectStartArray::initialize(MemRegion reserved_region) {
|
||||||
// We're based on the assumption that we use the same
|
// We're based on the assumption that we use the same
|
||||||
|
@ -50,6 +51,7 @@ void ObjectStartArray::initialize(MemRegion reserved_region) {
|
||||||
if (!backing_store.is_reserved()) {
|
if (!backing_store.is_reserved()) {
|
||||||
vm_exit_during_initialization("Could not reserve space for ObjectStartArray");
|
vm_exit_during_initialization("Could not reserve space for ObjectStartArray");
|
||||||
}
|
}
|
||||||
|
MemTracker::record_virtual_memory_type((address)backing_store.base(), mtGC);
|
||||||
|
|
||||||
// We do not commit any memory initially
|
// We do not commit any memory initially
|
||||||
if (!_virtual_space.initialize(backing_store, 0)) {
|
if (!_virtual_space.initialize(backing_store, 0)) {
|
||||||
|
@ -57,10 +59,14 @@ void ObjectStartArray::initialize(MemRegion reserved_region) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_raw_base = (jbyte*)_virtual_space.low_boundary();
|
_raw_base = (jbyte*)_virtual_space.low_boundary();
|
||||||
|
|
||||||
if (_raw_base == NULL) {
|
if (_raw_base == NULL) {
|
||||||
vm_exit_during_initialization("Could not get raw_base address");
|
vm_exit_during_initialization("Could not get raw_base address");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MemTracker::record_virtual_memory_type((address)_raw_base, mtGC);
|
||||||
|
|
||||||
|
|
||||||
_offset_base = _raw_base - (size_t(reserved_region.start()) >> block_shift);
|
_offset_base = _raw_base - (size_t(reserved_region.start()) >> block_shift);
|
||||||
|
|
||||||
_covered_region.set_start(reserved_region.start());
|
_covered_region.set_start(reserved_region.start());
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
// covered region.
|
// covered region.
|
||||||
//
|
//
|
||||||
|
|
||||||
class ObjectStartArray : public CHeapObj {
|
class ObjectStartArray : public CHeapObj<mtGC> {
|
||||||
friend class VerifyObjectStartArrayClosure;
|
friend class VerifyObjectStartArrayClosure;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "utilities/bitMap.inline.hpp"
|
#include "utilities/bitMap.inline.hpp"
|
||||||
|
#include "services/memTracker.hpp"
|
||||||
#ifdef TARGET_OS_FAMILY_linux
|
#ifdef TARGET_OS_FAMILY_linux
|
||||||
# include "os_linux.inline.hpp"
|
# include "os_linux.inline.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,6 +62,9 @@ ParMarkBitMap::initialize(MemRegion covered_region)
|
||||||
ReservedSpace rs(bytes, rs_align, rs_align > 0);
|
ReservedSpace rs(bytes, rs_align, rs_align > 0);
|
||||||
os::trace_page_sizes("par bitmap", raw_bytes, raw_bytes, page_sz,
|
os::trace_page_sizes("par bitmap", raw_bytes, raw_bytes, page_sz,
|
||||||
rs.base(), rs.size());
|
rs.base(), rs.size());
|
||||||
|
|
||||||
|
MemTracker::record_virtual_memory_type((address)rs.base(), mtGC);
|
||||||
|
|
||||||
_virtual_space = new PSVirtualSpace(rs, page_sz);
|
_virtual_space = new PSVirtualSpace(rs, page_sz);
|
||||||
if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) {
|
if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) {
|
||||||
_region_start = covered_region.start();
|
_region_start = covered_region.start();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue