/* * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
CollectedHeap* CompilerToVM::Data::Universe_collectedHeap; int CompilerToVM::Data::Universe_base_vtable_size;
address CompilerToVM::Data::Universe_narrow_oop_base; int CompilerToVM::Data::Universe_narrow_oop_shift;
address CompilerToVM::Data::Universe_narrow_klass_base; int CompilerToVM::Data::Universe_narrow_klass_shift; void* CompilerToVM::Data::Universe_non_oop_bits;
uintptr_t CompilerToVM::Data::Universe_verify_oop_mask;
uintptr_t CompilerToVM::Data::Universe_verify_oop_bits;
bool CompilerToVM::Data::_supports_inline_contig_alloc;
HeapWord** CompilerToVM::Data::_heap_end_addr;
HeapWord* volatile* CompilerToVM::Data::_heap_top_addr; int CompilerToVM::Data::_max_oop_map_stack_offset; int CompilerToVM::Data::_fields_annotations_base_offset;
CardTable::CardValue* CompilerToVM::Data::cardtable_start_address; int CompilerToVM::Data::cardtable_shift;
int CompilerToVM::Data::vm_page_size;
int CompilerToVM::Data::sizeof_vtableEntry = sizeof(vtableEntry); int CompilerToVM::Data::sizeof_ExceptionTableElement = sizeof(ExceptionTableElement); int CompilerToVM::Data::sizeof_LocalVariableTableElement = sizeof(LocalVariableTableElement); int CompilerToVM::Data::sizeof_ConstantPool = sizeof(ConstantPool); int CompilerToVM::Data::sizeof_narrowKlass = sizeof(narrowKlass); int CompilerToVM::Data::sizeof_arrayOopDesc = sizeof(arrayOopDesc); int CompilerToVM::Data::sizeof_BasicLock = sizeof(BasicLock);
int len = JVMCIVMStructs::localHotSpotVMStructs_count();
JVMCIObjectArray vmFields = JVMCIENV->new_VMField_array(len, JVMCI_CHECK_NULL); for (int i = 0; i < len ; i++) {
VMStructEntry vmField = JVMCIVMStructs::localHotSpotVMStructs[i];
size_t name_buf_len = strlen(vmField.typeName) + strlen(vmField.fieldName) + 2 /* "::" */; char* name_buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, name_buf_len + 1);
sprintf(name_buf, "%s::%s", vmField.typeName, vmField.fieldName);
CSTRING_TO_JSTRING(name, name_buf);
CSTRING_TO_JSTRING(type, vmField.typeString);
JVMCIObject box; if (vmField.isStatic && vmField.typeString != NULL) { if (strcmp(vmField.typeString, "bool") == 0) {
BOXED_BOOLEAN(box, *(jbyte*) vmField.address);
assert(box.is_non_null(), "must have a box");
} elseif (strcmp(vmField.typeString, "int") == 0 ||
strcmp(vmField.typeString, "jint") == 0 ||
strcmp(vmField.typeString, "uint32_t") == 0) {
BOXED_LONG(box, *(jint*) vmField.address);
assert(box.is_non_null(), "must have a box");
} elseif (strcmp(vmField.typeString, "uint64_t") == 0) {
BOXED_LONG(box, *(uint64_t*) vmField.address);
assert(box.is_non_null(), "must have a box");
} elseif (strcmp(vmField.typeString, "address") == 0 ||
strcmp(vmField.typeString, "intptr_t") == 0 ||
strcmp(vmField.typeString, "uintptr_t") == 0 ||
strcmp(vmField.typeString, "OopHandle") == 0 ||
strcmp(vmField.typeString, "size_t") == 0 || // All foo* types are addresses.
vmField.typeString[strlen(vmField.typeString) - 1] == '*') {
BOXED_LONG(box, *((address*) vmField.address));
assert(box.is_non_null(), "must have a box");
} else {
JVMCI_ERROR_NULL("VM field %s has unsupported type %s", name_buf, vmField.typeString);
}
}
JVMCIObject vmFieldObj = JVMCIENV->new_VMField(name, type, vmField.offset, (jlong) vmField.address, box, JVMCI_CHECK_NULL);
JVMCIENV->put_object_at(vmFields, i, vmFieldObj);
}
int ints_len = JVMCIVMStructs::localHotSpotVMIntConstants_count(); int longs_len = JVMCIVMStructs::localHotSpotVMLongConstants_count();
len = ints_len + longs_len;
JVMCIObjectArray vmConstants = JVMCIENV->new_Object_array(len * 2, JVMCI_CHECK_NULL); int insert = 0; for (int i = 0; i < ints_len ; i++) {
VMIntConstantEntry c = JVMCIVMStructs::localHotSpotVMIntConstants[i];
CSTRING_TO_JSTRING(name, c.name);
JVMCIObject value;
BOXED_LONG(value, c.value);
JVMCIENV->put_object_at(vmConstants, insert++, name);
JVMCIENV->put_object_at(vmConstants, insert++, value);
} for (int i = 0; i < longs_len ; i++) {
VMLongConstantEntry c = JVMCIVMStructs::localHotSpotVMLongConstants[i];
CSTRING_TO_JSTRING(name, c.name);
JVMCIObject value;
BOXED_LONG(value, c.value);
JVMCIENV->put_object_at(vmConstants, insert++, name);
JVMCIENV->put_object_at(vmConstants, insert++, value);
}
assert(insert == len * 2, "must be");
len = JVMCIVMStructs::localHotSpotVMAddresses_count();
JVMCIObjectArray vmAddresses = JVMCIENV->new_Object_array(len * 2, JVMCI_CHECK_NULL); for (int i = 0; i < len ; i++) {
VMAddressEntry a = JVMCIVMStructs::localHotSpotVMAddresses[i];
CSTRING_TO_JSTRING(name, a.name);
JVMCIObject value;
BOXED_LONG(value, a.value);
JVMCIENV->put_object_at(vmAddresses, i * 2, name);
JVMCIENV->put_object_at(vmAddresses, i * 2 + 1, value);
}
#define COUNT_FLAG(ignore) +1 #ifdef ASSERT #define CHECK_FLAG(type, name) { \ const JVMFlag* flag = JVMFlag::find_declared_flag(#name); \
assert(flag != NULL, "No such flag named "#name); \
assert(flag->is_##type(), "JVMFlag "#name" is not of type "#type); \
} #else #define CHECK_FLAG(type, name) #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.