2967 lines
120 KiB
Rust
2967 lines
120 KiB
Rust
use crate::classfile::FieldInfo;
|
|
use crate::classstore::ClassStore;
|
|
use crate::stackframe::StackFrame;
|
|
use crate::heap_area::ObjectReference;
|
|
use crate::heap_area::FieldValue;
|
|
use crate::jvm::wrap_stackframe_error;
|
|
use crate::stackframe::StackValue;
|
|
use crate::iterators::ClassFieldIterator;
|
|
use crate::classfile::{ AbstractTypeDescription, AbstractTypeKind, MethodDescriptor };
|
|
use crate::native_registry::NativeMethodCallable;
|
|
use crate::jvm::JVM;
|
|
use crate::jvm::Error;
|
|
use crate::jvm::JVMCallbackOperation;
|
|
|
|
pub fn ignore_call(_: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
Ok(JVMCallbackOperation::PopFrame())
|
|
}
|
|
|
|
pub fn todo_call(_: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
todo!()
|
|
}
|
|
|
|
pub struct EntryPoint {}
|
|
|
|
impl EntryPoint {
|
|
pub fn populate_unsafe_constants(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
jvm.heap_area.static_area.set(&String::from("jdk/internal/misc/UnsafeConstants"), &String::from("ADDRESS_SIZE0"), FieldValue::Int(4))?; // objectreference use u32
|
|
|
|
jvm.heap_area.static_area.set(&String::from("jdk/internal/misc/UnsafeConstants"), &String::from("PAGE_SIZE"), FieldValue::Int(4096))?;
|
|
// TODO: Get actual page size
|
|
|
|
jvm.heap_area.static_area.set(&String::from("jdk/internal/misc/UnsafeConstants"), &String::from("BIG_ENDIAN"), FieldValue::Boolean(cfg!(target_endian = "big")))?;
|
|
|
|
// This is the safe version, TODO: Change it to the actual value
|
|
jvm.heap_area.static_area.set(&String::from("jdk/internal/misc/UnsafeConstants"), &String::from("UNALIGNED_ACCESS"), FieldValue::Boolean(false))?;
|
|
|
|
// This is the safe version, TODO: Change it to the actual value
|
|
jvm.heap_area.static_area.set(&String::from("jdk/internal/misc/UnsafeConstants"), &String::from("DATA_CACHE_LINE_FLUSH_SIZE"), FieldValue::Int(0))?;
|
|
|
|
Ok(JVMCallbackOperation::PopFrame())
|
|
}
|
|
}
|
|
|
|
struct JavaLangClass {}
|
|
|
|
impl JavaLangClass {
|
|
pub fn get_primitive_class(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
// max_locals: 1
|
|
// max_stack: 1
|
|
let class = jvm.class_store.class_file_from_idx(frame.class_index).unwrap();
|
|
let method = &class.methods[frame.method_index as usize];
|
|
let class_class_index = jvm.class_store.class_idx_from_name(&String::from("java/lang/Class")).unwrap();
|
|
let (string_class_file, string_class_index) = jvm.class_store.get_class(&String::from("java/lang/String")).unwrap();
|
|
let string_equals_index = string_class_file.find_method_index(&String::from("equals")).unwrap();
|
|
let passed_wanted_string = match frame.locals[0] {
|
|
StackValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
frame.instruction_pointer += 1;
|
|
|
|
match frame.instruction_pointer - 1 {
|
|
0 => {
|
|
let boolean_class_ref = jvm.class_store.primitive_classes.boolean_class;
|
|
let boolean_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
boolean_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(boolean_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
|
|
1 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let boolean_class_ref = jvm.class_store.primitive_classes.boolean_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(boolean_class_ref)))
|
|
} else {
|
|
let byte_class_ref = jvm.class_store.primitive_classes.byte_class;
|
|
let byte_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
byte_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(byte_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
2 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let char_class_ref = jvm.class_store.primitive_classes.char_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(char_class_ref)))
|
|
} else {
|
|
let char_class_ref = jvm.class_store.primitive_classes.char_class;
|
|
let char_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
char_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(char_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
3 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let short_class_ref = jvm.class_store.primitive_classes.short_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(short_class_ref)))
|
|
} else {
|
|
let short_class_ref = jvm.class_store.primitive_classes.short_class;
|
|
let short_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
short_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(short_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
4 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let int_class_ref = jvm.class_store.primitive_classes.int_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(int_class_ref)))
|
|
} else {
|
|
let int_class_ref = jvm.class_store.primitive_classes.int_class;
|
|
let int_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
int_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(int_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
5 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let float_class_ref = jvm.class_store.primitive_classes.float_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(float_class_ref)))
|
|
} else {
|
|
let float_class_ref = jvm.class_store.primitive_classes.float_class;
|
|
let float_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
float_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(float_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
6 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let double_class_ref = jvm.class_store.primitive_classes.double_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(double_class_ref)))
|
|
} else {
|
|
let double_class_ref = jvm.class_store.primitive_classes.double_class;
|
|
let double_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
double_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(double_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
7 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let long_class_ref = jvm.class_store.primitive_classes.long_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(long_class_ref)))
|
|
} else {
|
|
let long_class_ref = jvm.class_store.primitive_classes.long_class;
|
|
let long_class_name_ref = match jvm.heap_area.object_area.get_object_field(
|
|
long_class_ref,
|
|
"name",
|
|
class_class_index,
|
|
&jvm.class_store
|
|
).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
let string_compare_frame = StackFrame::new(
|
|
string_class_file,
|
|
string_class_index,
|
|
string_equals_index as u16,
|
|
&[StackValue::Reference(long_class_name_ref), StackValue::Reference(passed_wanted_string)],
|
|
);
|
|
|
|
Ok(JVMCallbackOperation::PushFrame(string_compare_frame))
|
|
}
|
|
}
|
|
|
|
8 => {
|
|
if wrap_stackframe_error(class, method, frame.operand_stack.pop_int(0))? == 1 {
|
|
let long_class_ref = jvm.class_store.primitive_classes.long_class;
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(long_class_ref)))
|
|
} else {
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(ObjectReference::NULL)))
|
|
}
|
|
}
|
|
_ => Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(ObjectReference::NULL)))
|
|
}
|
|
}
|
|
|
|
pub fn desired_assertion_status_0(_: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(1)))
|
|
}
|
|
}
|
|
|
|
struct JavaLangFloat {}
|
|
|
|
impl JavaLangFloat {
|
|
pub fn float_to_raw_int_bits(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
let class = jvm.class_store.class_file_from_idx(frame.class_index).unwrap();
|
|
let method = & class.methods[frame.method_index as usize];
|
|
|
|
let float_value = wrap_stackframe_error(class, method, frame.load_local_float(0))?;
|
|
let ubits = float_value.to_bits();
|
|
let ibits = i32::from_ne_bytes(ubits.to_ne_bytes());
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(ibits)))
|
|
}
|
|
}
|
|
|
|
struct JavaLangDouble {}
|
|
|
|
impl JavaLangDouble {
|
|
pub fn double_to_raw_long_bits(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
let class = jvm.class_store.class_file_from_idx(frame.class_index).unwrap();
|
|
let method = & class.methods[frame.method_index as usize];
|
|
|
|
let double_value = wrap_stackframe_error(class, method, frame.load_local_double(0))?;
|
|
let ubits = double_value.to_bits();
|
|
let ibits = i64::from_ne_bytes(ubits.to_ne_bytes());
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Long(ibits)))
|
|
}
|
|
}
|
|
|
|
struct JavaLangRuntime {}
|
|
|
|
impl JavaLangRuntime {
|
|
pub fn available_processors(_jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(1)))
|
|
}
|
|
}
|
|
|
|
struct JavaLangStringUTF16 {}
|
|
|
|
impl JavaLangStringUTF16 {
|
|
pub fn is_big_endian(_jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(if cfg!(target_endian = "big") {1} else {0})))
|
|
}
|
|
}
|
|
|
|
struct JavaLangSystem {}
|
|
|
|
impl JavaLangSystem {
|
|
pub fn arraycopy(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
let src = frame.load_local_reference(0).unwrap();
|
|
let src_pos = frame.load_local_int(1).unwrap();
|
|
let dest = frame.load_local_reference(2).unwrap();
|
|
let dest_pos = frame.load_local_int(3).unwrap();
|
|
let length = frame.load_local_int(4).unwrap();
|
|
|
|
for i in 0..length {
|
|
let src_value = jvm.heap_area.object_area.get_array_element(src, src_pos + i);
|
|
jvm.heap_area.object_area.set_array_element(dest, (dest_pos + i) as usize, src_value);
|
|
}
|
|
|
|
Ok(JVMCallbackOperation::PopFrame())
|
|
}
|
|
}
|
|
|
|
struct JavaLangThrowable {}
|
|
|
|
impl JavaLangThrowable {
|
|
pub fn fill_in_stacktrace(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
if ! jvm.class_store.have_class(&String::from("java/lang/StackTraceElement")) {
|
|
return Ok(JVMCallbackOperation::LoadClass(String::from("java/lang/StackTraceElement")));
|
|
}
|
|
if ! jvm.class_store.was_init(&String::from("java/lang/StackTraceElement")).unwrap() {
|
|
return Ok(JVMCallbackOperation::LoadClass(String::from("java/lang/StackTraceElement")));
|
|
}
|
|
|
|
let stackelement_class_index = jvm.class_store.class_idx_from_name(&String::from("java/lang/StackTraceElement")).unwrap();
|
|
let stackelement_class_ref = jvm.class_store.get_class_objectref_from_index(stackelement_class_index);
|
|
let stackelement_type = AbstractTypeDescription::class_type("java/lang/StackTraceElement");
|
|
let _ = match jvm.class_store.get_array_class_ref(&stackelement_type.array()) {
|
|
Some(r) => r,
|
|
None => return Ok(JVMCallbackOperation::MakeArrayClass(stackelement_class_ref, stackelement_type)),
|
|
};
|
|
|
|
let this = {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&jvm.stack_frames[frame_index]
|
|
};
|
|
frame.load_local_reference(0).unwrap()
|
|
};
|
|
|
|
let stackelement_array = jvm.heap_area.make_empty_array(&jvm.class_store, AbstractTypeDescription::class_type("java/lang/StackTraceElement"), jvm.stack_frames.len());
|
|
|
|
jvm.heap_area.object_area.set_object_field(
|
|
this,
|
|
"stackTrace",
|
|
stackelement_array.into(),
|
|
stackelement_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
|
|
for (index, frame) in (&jvm.stack_frames).into_iter().enumerate() {
|
|
let class_file = jvm.class_store.class_file_from_idx(frame.class_index).unwrap();
|
|
let method_info = &class_file.methods[frame.method_index as usize];
|
|
|
|
let class_name = class_file.get_classname()?;
|
|
|
|
let line_number = method_info.get_bytecode_linenumber(frame.instruction_pointer.try_into().unwrap());
|
|
|
|
let stackelement = jvm.heap_area.make_object(&jvm.class_store, stackelement_class_index);
|
|
|
|
let class_name_string = jvm.heap_area.make_handmade_string(class_name, &jvm.class_store);
|
|
let method_name_string = jvm.heap_area.make_handmade_string(&method_info.name, &jvm.class_store);
|
|
|
|
let sourcefile = class_file.sourcefile()?;
|
|
let sourcefile_string = match sourcefile {
|
|
Some(string) => jvm.heap_area.make_handmade_string(string, &jvm.class_store),
|
|
None => jvm.heap_area.static_area.get(&String::from("StackTraceElement"), &String::from("UNKNOWN_SOURCE"), AbstractTypeDescription::class_type("java/lang/String")).unwrap().expect_reference(),
|
|
};
|
|
|
|
jvm.heap_area.object_area.set_object_field(
|
|
stackelement,
|
|
"declaringClass",
|
|
FieldValue::Reference(class_name_string),
|
|
stackelement_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
jvm.heap_area.object_area.set_object_field(
|
|
stackelement,
|
|
"methodName",
|
|
FieldValue::Reference(method_name_string),
|
|
stackelement_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
jvm.heap_area.object_area.set_object_field(
|
|
stackelement,
|
|
"lineNumber",
|
|
FieldValue::Int(line_number.unwrap_or(1) as i32),
|
|
stackelement_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
jvm.heap_area.object_area.set_object_field(
|
|
stackelement,
|
|
"fileName",
|
|
FieldValue::Reference(sourcefile_string),
|
|
stackelement_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
|
|
jvm.heap_area.object_area.set_array_element(stackelement_array, index, stackelement.into());
|
|
}
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(this.into()))
|
|
}
|
|
}
|
|
|
|
struct JdkInternalMiscUnsafe {}
|
|
|
|
impl JdkInternalMiscUnsafe {
|
|
|
|
fn class_field_at_offset(class_index: usize, class_store: &ClassStore, offset: i64) -> Result<&FieldInfo, Error> {
|
|
let mut offset_counter = offset;
|
|
match ClassFieldIterator::new(class_index, class_store)
|
|
.take_while(|f| {
|
|
let result = offset_counter >= 0;
|
|
offset_counter -= f.descriptor.storage_size() as i64;
|
|
|
|
result
|
|
})
|
|
.last() {
|
|
Some(f) => Ok(f),
|
|
None => Err(Error::RunTimeError(format!("Couldn't find int field at offset {offset} in class {}", class_store.class_name_from_index(class_index).unwrap())))
|
|
}
|
|
}
|
|
|
|
fn array_class_reference_index_scale(class_reference: ObjectReference, jvm: &JVM) -> i32 {
|
|
let class_class_index = jvm.class_store.class_idx_from_name(&String::from("java/lang/Class")).unwrap();
|
|
let component_class_reference = match jvm.heap_area.object_area.get_object_field(class_reference, "componentType", class_class_index, &jvm.class_store).unwrap() {
|
|
FieldValue::Reference(r) => r,
|
|
_ => unreachable!(),
|
|
};
|
|
|
|
if component_class_reference == jvm.class_store.primitive_classes.boolean_class {
|
|
1
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.byte_class {
|
|
1
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.short_class {
|
|
2
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.char_class {
|
|
2
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.int_class {
|
|
4
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.float_class {
|
|
4
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.double_class {
|
|
8
|
|
} else if component_class_reference == jvm.class_store.primitive_classes.long_class {
|
|
8
|
|
} else {
|
|
std::mem::size_of::<usize>() as i32
|
|
}
|
|
}
|
|
|
|
pub fn compare_and_set_reference(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let object = frame.load_local_reference(1).unwrap();
|
|
let offset = frame.load_local_long(2).unwrap();
|
|
let expected = frame.load_local_reference(4).unwrap();
|
|
let replacement = frame.load_local_reference(5).unwrap();
|
|
|
|
if jvm.heap_area.object_area.is_array_reference(object) {
|
|
let class_reference = jvm.heap_area.object_area.get_reference_class_ref(object, &jvm.class_store);
|
|
let scale = JdkInternalMiscUnsafe::array_class_reference_index_scale(class_reference, jvm);
|
|
let index = offset / (scale as i64);
|
|
|
|
let value = jvm.heap_area.object_area.get_array_element(object, index as i32);
|
|
|
|
let success = if value.expect_reference() == expected {
|
|
jvm.heap_area.object_area.set_array_element(object, index as usize, replacement.into());
|
|
true
|
|
} else {
|
|
false
|
|
};
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Boolean(success)))
|
|
} else {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
pub fn put_reference_volatile(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let object = frame.load_local_reference(1).unwrap();
|
|
let offset = frame.load_local_long(2).unwrap();
|
|
let replacement = frame.load_local_reference(4).unwrap();
|
|
|
|
if jvm.heap_area.object_area.is_array_reference(object) {
|
|
let class_reference = jvm.heap_area.object_area.get_reference_class_ref(object, &jvm.class_store);
|
|
let scale = JdkInternalMiscUnsafe::array_class_reference_index_scale(class_reference, jvm);
|
|
let index = offset / (scale as i64);
|
|
|
|
jvm.heap_area.object_area.set_array_element(object, index as usize, replacement.into());
|
|
|
|
Ok(JVMCallbackOperation::PopFrame())
|
|
} else {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
pub fn get_reference_volatile(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let object = frame.load_local_reference(1).unwrap();
|
|
let offset = frame.load_local_long(2).unwrap();
|
|
|
|
if jvm.heap_area.object_area.is_array_reference(object) {
|
|
let class_reference = jvm.heap_area.object_area.get_reference_class_ref(object, &jvm.class_store);
|
|
let scale = JdkInternalMiscUnsafe::array_class_reference_index_scale(class_reference, jvm);
|
|
let index = offset / (scale as i64);
|
|
|
|
let value = jvm.heap_area.object_area.get_array_element(object, index as i32);
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(value))
|
|
} else {
|
|
let object_class_descriptor = jvm.heap_area.object_area.get_reference_native_class_name(object, &jvm.class_store);
|
|
let object_class_index = jvm.class_store.class_index_for_type(AbstractTypeDescription::parse_full(object_class_descriptor).unwrap()).unwrap();
|
|
|
|
let field = JdkInternalMiscUnsafe::class_field_at_offset(object_class_index, &jvm.class_store, offset)?;
|
|
|
|
// TODO: Type checking
|
|
let value = jvm.heap_area.object_area.get_object_field(
|
|
object,
|
|
&field.name,
|
|
object_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(value))
|
|
}
|
|
}
|
|
|
|
pub fn compare_and_set_long(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let object = frame.load_local_reference(1).unwrap();
|
|
let offset = frame.load_local_long(2).unwrap();
|
|
let expected = frame.load_local_long(4).unwrap();
|
|
let replacement = frame.load_local_long(6).unwrap();
|
|
|
|
let object_class_descriptor = jvm.heap_area.object_area.get_reference_native_class_name(object, &jvm.class_store);
|
|
let object_class_index = jvm.class_store.class_index_for_type(AbstractTypeDescription::parse_full(object_class_descriptor).unwrap()).unwrap();
|
|
|
|
let field = JdkInternalMiscUnsafe::class_field_at_offset(object_class_index, &jvm.class_store, offset)?;
|
|
|
|
// TODO: Type checking
|
|
let function_result = if jvm.heap_area.object_area.get_object_field(object, &field.name, object_class_index, &jvm.class_store)? == FieldValue::Long(expected) {
|
|
jvm.heap_area.object_area.set_object_field(
|
|
object,
|
|
&field.name,
|
|
FieldValue::Long(replacement),
|
|
object_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
true
|
|
} else {
|
|
false
|
|
};
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Boolean(function_result)))
|
|
}
|
|
|
|
pub fn compare_and_set_int(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let object = frame.load_local_reference(1).unwrap();
|
|
let offset = frame.load_local_long(2).unwrap();
|
|
let expected = frame.load_local_int(4).unwrap();
|
|
let replacement = frame.load_local_int(5).unwrap();
|
|
|
|
let object_class_descriptor = jvm.heap_area.object_area.get_reference_native_class_name(object, &jvm.class_store);
|
|
let object_class_index = jvm.class_store.class_index_for_type(AbstractTypeDescription::parse_full(object_class_descriptor).unwrap()).unwrap();
|
|
|
|
let field = JdkInternalMiscUnsafe::class_field_at_offset(object_class_index, &jvm.class_store, offset)?;
|
|
|
|
// TODO: Type checking
|
|
let function_result = if jvm.heap_area.object_area.get_object_field(object, &field.name, object_class_index, &jvm.class_store)? == FieldValue::Int(expected) {
|
|
jvm.heap_area.object_area.set_object_field(
|
|
object,
|
|
&field.name,
|
|
FieldValue::Int(replacement),
|
|
object_class_index,
|
|
&jvm.class_store
|
|
)?;
|
|
true
|
|
} else {
|
|
false
|
|
};
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Boolean(function_result)))
|
|
}
|
|
|
|
pub fn object_field_offset_1(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
// args: Class class, String fieldName
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
|
|
let class_object_reference = frame.load_local_reference(1).unwrap();
|
|
let class_descriptor = jvm.heap_area.object_area.get_class_ref_native_class_name(class_object_reference, &jvm.class_store);
|
|
let class_index = jvm.class_store.class_index_for_type(AbstractTypeDescription::parse_full(class_descriptor).unwrap()).unwrap();
|
|
let field_name_string_reference = frame.load_local_reference(2).unwrap();
|
|
|
|
let rust_field_name_string = jvm.heap_area.decode_java_string(field_name_string_reference, &jvm.class_store);
|
|
|
|
let byte_offset: i64 = ClassFieldIterator::new(class_index as usize, &jvm.class_store)
|
|
.take_while(|f| f.name != rust_field_name_string)
|
|
.map(|f| f.descriptor.storage_size() as i64)
|
|
.sum();
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Long(byte_offset)))
|
|
}
|
|
|
|
pub fn array_index_scale_0(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let frame = {
|
|
let frame_index = jvm.stack_frames.len() - 1;
|
|
&mut jvm.stack_frames[frame_index]
|
|
};
|
|
let class = jvm.class_store.class_file_from_idx(frame.class_index).unwrap();
|
|
let method = & class.methods[frame.method_index as usize];
|
|
|
|
let class_reference = wrap_stackframe_error(class, method, frame.load_local_reference(1))?;
|
|
|
|
let index_scale = JdkInternalMiscUnsafe::array_class_reference_index_scale(class_reference, jvm);
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(index_scale)))
|
|
}
|
|
|
|
pub fn array_base_offset_0(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
// TODO: Check passed class
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Int(0)))
|
|
}
|
|
}
|
|
|
|
pub struct JdkInternalUtilSystemPropsRaw {}
|
|
|
|
impl JdkInternalUtilSystemPropsRaw {
|
|
pub fn platform_properties(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let array_length = jvm.heap_area.static_area.
|
|
get(
|
|
&String::from("jdk/internal/util/SystemProps$Raw"),
|
|
&String::from("FIXED_LENGTH"),
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() })
|
|
.unwrap();
|
|
let array_length = match array_length {
|
|
FieldValue::Int(i) => i as usize,
|
|
_ => unreachable!()
|
|
};
|
|
|
|
let array_reference = jvm.heap_area.make_empty_array(&jvm.class_store, AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".into()) }, array_length);
|
|
let utf8_string_ref = jvm.heap_area.make_handmade_string(&String::from("UTF-8"), &jvm.class_store);
|
|
|
|
{
|
|
let stdout_encoding_ndx_result = jvm.heap_area.static_area.get(
|
|
&String::from("jdk/internal/util/SystemProps$Raw"),
|
|
&String::from("_stdout_encoding_NDX"),
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() }
|
|
);
|
|
let stdout_encoding_ndx = match stdout_encoding_ndx_result {
|
|
Ok(FieldValue::Int(i)) => i as usize,
|
|
_ => unreachable!(),
|
|
};
|
|
jvm.heap_area.object_area.set_array_element(array_reference, stdout_encoding_ndx, FieldValue::Reference(utf8_string_ref));
|
|
|
|
}
|
|
{
|
|
let stderr_encoding_ndx_result = jvm.heap_area.static_area.get(
|
|
&String::from("jdk/internal/util/SystemProps$Raw"),
|
|
&String::from("_stderr_encoding_NDX"),
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() }
|
|
);
|
|
let stderr_encoding_ndx = match stderr_encoding_ndx_result {
|
|
Ok(FieldValue::Int(i)) => i as usize,
|
|
_ => unreachable!(),
|
|
};
|
|
jvm.heap_area.object_area.set_array_element(array_reference, stderr_encoding_ndx, FieldValue::Reference(utf8_string_ref));
|
|
|
|
}
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(array_reference)))
|
|
}
|
|
|
|
// command-line configured properties, should return at least java.home
|
|
pub fn vm_properties(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
let native_array = vec![
|
|
("java.home", "./"), // TODO
|
|
("stdout.encoding", "UTF-8"),
|
|
("java.io.tmpdir", "/tmp"),
|
|
("user.language", "en"),
|
|
("user.script", ""),
|
|
("user.country", "US"),
|
|
("user.variant", ""),
|
|
("user.dir", "./"),
|
|
("user.home", "./"), // TODO
|
|
("user.name", "java"), // TODO
|
|
("sun.nio.MaxDirectMemorySize", "9223372036854775807"),
|
|
("sun.nio.PageAlignDirectMemory", "false"),
|
|
];
|
|
// TODO: Cross-Platform tmpdir
|
|
// TODO: locale detection
|
|
let array_length = native_array.len() * 2 + 2;
|
|
let array_reference = jvm.heap_area.make_empty_array(&jvm.class_store, AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".into()) }, array_length);
|
|
|
|
for (index, (key, value)) in native_array.iter().enumerate() {
|
|
let key_string: String = key.to_string();
|
|
let value_string: String = value.to_string();
|
|
let key_reference = jvm.heap_area.make_handmade_string(&key_string, &jvm.class_store);
|
|
let value_reference = jvm.heap_area.make_handmade_string(&value_string, &jvm.class_store);
|
|
|
|
jvm.heap_area.object_area.set_array_element(array_reference, index * 2 , key_reference.into());
|
|
jvm.heap_area.object_area.set_array_element(array_reference, index * 2 + 1, value_reference.into());
|
|
}
|
|
|
|
Ok(JVMCallbackOperation::ReturnFrame(FieldValue::Reference(array_reference)))
|
|
}
|
|
}
|
|
|
|
pub struct JdkInternalMiscVM {}
|
|
|
|
impl JdkInternalMiscVM {
|
|
pub fn initialize(jvm: &mut JVM) -> Result<JVMCallbackOperation, Error> {
|
|
Ok(JVMCallbackOperation::PopFrame())
|
|
}
|
|
}
|
|
|
|
|
|
pub fn function_for(class_name: &str, m: &crate::classfile::MethodInfo) -> Result<NativeMethodCallable, Error> {
|
|
let method_name: &str = &m.name;
|
|
let native_mappings: Vec<(&str, &str, MethodDescriptor, NativeMethodCallable)> = vec![
|
|
(
|
|
"java/lang/Class",
|
|
"forName0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/ClassLoader".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Class"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"desiredAssertionStatus0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
JavaLangClass::desired_assertion_status_0
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getClassAccessFlagsRaw0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getClassFileVersion0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getConstantPool",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("jdk/internal/reflect/ConstantPool".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getDeclaredClasses0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getDeclaredConstructors0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/reflect/Constructor".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getDeclaredFields0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/reflect/Field".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getDeclaredMethods0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/reflect/Method".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getDeclaringClass0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getEnclosingMethod0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getGenericSignature0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getInterfaces0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getNestMembers0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getModifiers",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getNestHost0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getPermittedSubclasses0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getPrimitiveClass",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
JavaLangClass::get_primitive_class
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getProtectionDomain0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/security/ProtectionDomain".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getRawAnnotations",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Byte() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getRawTypeAnnotations",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Byte() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getRecordComponents0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/reflect/RecordComponent".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getSimpleBinaryName0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getSigners",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"getSuperclass",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isAssignableFrom",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"initClassName",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isArray",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isHidden",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isInstance",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isInterface",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isPrimitive",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"isRecord0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"registerNatives",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
ignore_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Class",
|
|
"setSigners",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Double",
|
|
"doubleToRawLongBits",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
},
|
|
JavaLangDouble::double_to_raw_long_bits
|
|
),
|
|
|
|
(
|
|
"java/lang/Double",
|
|
"longBitsToDouble",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
},
|
|
JavaLangDouble::double_to_raw_long_bits
|
|
),
|
|
|
|
(
|
|
"java/lang/Float",
|
|
"intBitsToFloat",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Float",
|
|
"floatToRawIntBits",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
JavaLangFloat::float_to_raw_int_bits
|
|
),
|
|
|
|
(
|
|
"java/lang/String",
|
|
"intern",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/String"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
// until JDK 23
|
|
(
|
|
"java/lang/StringUTF16",
|
|
"isBigEndian",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
JavaLangStringUTF16::is_big_endian
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"clone",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"getClass",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Class"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"hashCode",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"notifyAll",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"notify",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Object",
|
|
"wait0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Runtime",
|
|
"availableProcessors",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
JavaLangRuntime::available_processors
|
|
),
|
|
|
|
(
|
|
"java/lang/Runtime",
|
|
"freeMemory",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Runtime",
|
|
"gc",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Runtime",
|
|
"maxMemory",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Runtime",
|
|
"totalMemory",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"arraycopy",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
JavaLangSystem::arraycopy
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"currentTimeMillis",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"identityHashCode",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"mapLibraryName",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"nanoTime",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"registerNatives",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
ignore_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"setIn0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/io/InputStream".to_string()) }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"setOut0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/io/PrintStream".to_string()) }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/System",
|
|
"setErr0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/io/PrintStream".to_string()) }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"registerNatives",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
ignore_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"arrayBaseOffset0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
JdkInternalMiscUnsafe::array_base_offset_0
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"arrayIndexScale0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
JdkInternalMiscUnsafe::array_index_scale_0
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"allocateInstance",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"allocateMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"copyMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"copySwapMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"freeMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"reallocateMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"setMemory0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetBoolean",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetByte",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetChar",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetDouble",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetFloat",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetInt",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
JdkInternalMiscUnsafe::compare_and_set_int
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetLong",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
JdkInternalMiscUnsafe::compare_and_set_long
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetReference",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
JdkInternalMiscUnsafe::compare_and_set_reference
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndSetShort",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeBoolean",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeByte",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeChar",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeDouble",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeFloat",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeInt",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeLong",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeShort",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"compareAndExchangeReference",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"defineClass0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Byte() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/ClassLoader".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/security/ProtectionDomain".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Class"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"ensureClassInitialized0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"fullFence",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
ignore_call // TODO: Understand and implement
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getBooleanVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getByteVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getCharVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getFloatVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getDoubleVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getIntVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getLongVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getShortVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getReferenceVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
JdkInternalMiscUnsafe::get_reference_volatile
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getBoolean",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getByte",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getChar",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getDouble",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getFloat",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getInt",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getLoadAverage0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Double() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getLong",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getReference",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getShort",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"getUncompressedObject",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname(String::from("java/lang/Object"))},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"objectFieldOffset0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/reflect/Field".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"objectFieldOffset1",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
JdkInternalMiscUnsafe::object_field_offset_1
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"registerNatives",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
ignore_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"park",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putBoolean",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putByte",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putChar",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putDouble",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putFloat",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putInt",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putLong",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putReference",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putShort",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putBooleanVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putByteVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Byte() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putCharVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Char() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putFloatVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Float() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putDoubleVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Double() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putIntVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putLongVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putShortVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Short() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"putReferenceVolatile",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
JdkInternalMiscUnsafe::put_reference_volatile
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"shouldBeInitialized0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"staticFieldOffset0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/reflect/Field".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"staticFieldOffset1",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Class".to_string()) },
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"staticFieldBase0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/reflect/Field".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"unpark",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void() },
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"throwException",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Throwable".to_string()) },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"writeback0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() },
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call,
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"writebackPostSync0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/Unsafe",
|
|
"writebackPreSync0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"getgid",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"getegid",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"geteuid",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"getuid",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"getNanoTimeAdjustment",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"getRuntimeArguments",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/String".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"initialize",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
JdkInternalMiscVM::initialize
|
|
),
|
|
|
|
(
|
|
"jdk/internal/misc/VM",
|
|
"latestUserDefinedLoader0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/ClassLoader".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"jdk/internal/util/SystemProps$Raw",
|
|
"platformProperties",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/String".to_string())},
|
|
},
|
|
JdkInternalUtilSystemPropsRaw::platform_properties
|
|
),
|
|
|
|
(
|
|
"jdk/internal/util/SystemProps$Raw",
|
|
"vmProperties",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/String".to_string())},
|
|
},
|
|
JdkInternalUtilSystemPropsRaw::vm_properties
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"findScopedValueBindings",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"currentCarrierThread",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Thread".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"currentThread",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Thread".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"setCurrentThread",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Thread".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"scopedValueCache",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"setScopedValueCache",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"ensureMaterializedForStackWalk",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"ensureMaterializedForStackWalk",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"yield0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"sleepNanos0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long() }
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"start0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"holdsLock",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Boolean()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"getStackTrace0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"dumpThreads",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Thread".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 2, kind: AbstractTypeKind::Classname("java/lang/StackTraceElement".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"getThreads",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/Thread".to_string())},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"setPriority0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"interrupt0",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"clearInterruptEvent",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
(
|
|
"java/lang/Thread",
|
|
"setNativeName",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/String".to_string())}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Thread",
|
|
"getNextThreadIdOffset",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Long()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/StackTraceElement",
|
|
"initStackTraceElements",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 1, kind: AbstractTypeKind::Classname("java/lang/StackTraceElement".to_string())},
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Object".to_string())},
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/StackTraceElement",
|
|
"initStackTraceElement",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/StackTraceElement".to_string())},
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/StackFrameInfo".to_string())},
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Void()},
|
|
},
|
|
todo_call
|
|
),
|
|
|
|
(
|
|
"java/lang/Throwable",
|
|
"fillInStackTrace",
|
|
MethodDescriptor {
|
|
argument_types: Box::new([
|
|
AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Int()}
|
|
]),
|
|
return_type: AbstractTypeDescription { array_level: 0, kind: AbstractTypeKind::Classname("java/lang/Throwable".to_string())},
|
|
},
|
|
JavaLangThrowable::fill_in_stacktrace
|
|
),
|
|
];
|
|
|
|
for (classname, methodname, methoddescriptor, binding) in native_mappings {
|
|
if classname != class_name || methodname != method_name {
|
|
continue;
|
|
}
|
|
if methoddescriptor != m.descriptor {
|
|
return Err(Error::RunTimeError(format!("Descriptor mismatch in native method resolution: internal is {} but classfile wants {}", methoddescriptor.source_string(), m.descriptor.source_string())));
|
|
}
|
|
|
|
return Ok(binding);
|
|
}
|
|
|
|
|
|
Err(Error::RunTimeError(format!("Failed to find native implementation for method '{class_name}.{method_name}'")))
|
|
}
|