Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MMTk/src/org/mmtk/utility/options/NoReferenceTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public final class NoReferenceTypes extends org.vmutil.options.BooleanOption {
public NoReferenceTypes() {
super(Options.set, "No Reference Types",
"Should reference type processing be disabled?",
false);
true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not ideal, as this also affects the stock JikesRVM build. But I cannot think of a better workaround. It is not a big issue if this is just temporary.

}
}
10 changes: 10 additions & 0 deletions rvm/src/org/jikesrvm/options/OptionSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ public boolean process(String arg) {
byte[] valueBytes = stringToBytes("converting value", value);

if (VM.BuildWithRustMMTk) {
if (name.equals("noReferenceTypes")) {
Option o = getOption(name);
if (o != null) {
if (value.equals("true")) {
((BooleanOption) o).setValue(true);
} else if (value.equals("false")) {
((BooleanOption) o).setValue(false);
}
}
}
if (SysCall.sysCall.sysProcess(nameBytes, valueBytes)) {
return true;
}
Expand Down
12 changes: 3 additions & 9 deletions rvm/src/org/jikesrvm/runtime/BootRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ public void setHeapRange(int id, Address start, Address end) {
public Address alignedSysAllocSlowLargeobjectRIP;
public Address alignedStartControlCollectorRIP;
public Address alignedWillNeverMoveRIP;
public Address alignedReportDelayedRootEdgeRIP;
public Address alignedWillNotMoveInCurrentCollectionRIP;
public Address alignedProcessInteriorEdgeRIP;
public Address alignedStartWorkerRIP;
public Address alignedEnableCollectionRIP;
public Address alignedProcessRIP;
public Address alignedPostAllocRIP;
public Address alignedHandleUserCollectionRequestRIP;
public Address sysDynamicCall1RIP;
public Address sysDynamicCall2RIP;

//mmtk.h - Rust Functions
public Address release_bufferRIP;
public Address jikesrvm_gc_initRIP;
public Address test_stack_alignmentRIP;
public Address test_stack_alignment1RIP;
Expand All @@ -270,9 +270,6 @@ public void setHeapRange(int id, Address start, Address end) {
public Address jikesrvm_alloc_slow_largeobjectRIP;
public Address start_control_collectorRIP;
public Address will_never_moveRIP;
public Address report_delayed_root_edgeRIP;
public Address will_not_move_in_current_collectionRIP;
public Address process_interior_edgeRIP;
public Address start_workerRIP;
public Address enable_collectionRIP;
public Address processRIP;
Expand All @@ -281,9 +278,6 @@ public void setHeapRange(int id, Address start, Address end) {
public Address total_bytesRIP;
public Address starting_heap_addressRIP;
public Address last_heap_addressRIP;
public Address trace_get_forwarded_referenceRIP;
public Address trace_get_forwarded_referentRIP;
public Address trace_retain_referentRIP;
public Address is_live_objectRIP;
public Address is_mapped_objectRIP;
public Address is_mapped_addressRIP;
Expand Down
68 changes: 9 additions & 59 deletions rvm/src/org/jikesrvm/runtime/SysCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,35 +150,34 @@ public abstract class SysCall {

@RustSysCall
@SysCallTemplate
public abstract void alignedReportDelayedRootEdge(Address trace_local, Address addr);
public abstract void alignedStartWorker(Address tls, Address workerInstance);

@RustSysCall
@SysCallTemplate
public abstract boolean alignedWillNotMoveInCurrentCollection(Address trace_local, ObjectReference obj);
public abstract void alignedEnableCollection(Address tls);

@RustSysCall
@SysCallTemplate
public abstract void alignedProcessInteriorEdge(Address trace_local, ObjectReference target, Address slot, boolean root);
public abstract boolean alignedProcess(byte[] name, byte[] value);

@RustSysCall
@SysCallTemplate
public abstract void alignedStartWorker(Address tls, Address workerInstance);
public abstract void alignedPostAlloc(Address mutator, ObjectReference ref, ObjectReference typeRef, int bytes, int allocator);

@RustSysCall
@SysCallTemplate
public abstract void alignedEnableCollection(Address tls);
public abstract void alignedHandleUserCollectionRequest(Address tls);

@RustSysCall
@SysCallTemplate
public abstract boolean alignedProcess(byte[] name, byte[] value);

public abstract Address sysDynamicCall1(Address funcPtr, Word arg0);
@RustSysCall
@SysCallTemplate
public abstract void alignedPostAlloc(Address mutator, ObjectReference ref, ObjectReference typeRef, int bytes, int allocator);
public abstract Address sysDynamicCall2(Address funcPtr, Word arg0, Word arg1);

@RustSysCall
@SysCallTemplate
public abstract void alignedHandleUserCollectionRequest(Address tls);
@SysCallAlignedTemplate
public abstract void release_buffer(Address buffer);


/**
Expand Down Expand Up @@ -292,31 +291,6 @@ public boolean sysProcess(byte[] name, byte[] value) {
@SysCallAlignedTemplate
public abstract boolean process(byte[] name, byte[] value);


@Inline
public void sysReportDelayedRootEdge(Address trace_local, Address addr) {
report_delayed_root_edge(trace_local,addr);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract void report_delayed_root_edge(Address trace_local, Address addr);

@Inline
public boolean sysWillNotMoveInCurrentCollection(Address trace_local, ObjectReference obj) {
return will_not_move_in_current_collection(trace_local, obj);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract boolean will_not_move_in_current_collection(Address trace_local, ObjectReference obj);

@Inline
public void sysProcessInteriorEdge(Address trace_local, ObjectReference target, Address slot, boolean root) {
process_interior_edge(trace_local, target, slot, root);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract void process_interior_edge(Address trace_local, ObjectReference target, Address slot, boolean root);

@Inline
public void sysStartWorker(Address tls, Address workerInstance) {
start_worker(tls, workerInstance);
Expand Down Expand Up @@ -373,22 +347,6 @@ public Address sysLastHeapAddress() {
@SysCallAlignedTemplate
public abstract Address last_heap_address();

@Inline
public ObjectReference sysTraceGetForwardedReferent(Address trace, ObjectReference object) {
return trace_get_forwarded_referent(trace, object);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract ObjectReference trace_get_forwarded_referent(Address trace, ObjectReference object);

@Inline
public ObjectReference sysTraceGetForwardedReference(Address trace, ObjectReference object) {
return trace_get_forwarded_reference(trace, object);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract ObjectReference trace_get_forwarded_reference(Address trace, ObjectReference object);

@Inline
public boolean sysIsLiveObject(ObjectReference object) {
return is_live_object(object);
Expand All @@ -397,14 +355,6 @@ public boolean sysIsLiveObject(ObjectReference object) {
@SysCallAlignedTemplate
public abstract boolean is_live_object(ObjectReference object);

@Inline
public ObjectReference sysTraceRetainReferent(Address trace, ObjectReference object) {
return trace_retain_referent(trace, object);
}
@RustSysCall
@SysCallAlignedTemplate
public abstract ObjectReference trace_retain_referent(Address trace, ObjectReference object);

@Inline
public boolean sysIsMappedObject(ObjectReference object) {
return is_mapped_object(object);
Expand Down
15 changes: 3 additions & 12 deletions tools/bootloader/sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,13 @@ EXTERNAL void* alignedSysAllocSlowBumpMonotoneCopy(void* mutator, int size, int
EXTERNAL void* alignedSysAllocSlowLargeobject(void* mutator, int size, int align, int offset, int allocator) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedStartControlCollector(size_t thread_id) __attribute__((force_align_arg_pointer));
EXTERNAL bool alignedWillNeverMove(void* object) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedReportDelayedRootEdge(void* trace_local, void* addr) __attribute__((force_align_arg_pointer));
EXTERNAL bool alignedWillNotMoveInCurrentCollection(void* trace_local, void* obj) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedProcessInteriorEdge(void* trace_local, void* target, void* slot, bool root) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedStartWorker(size_t thread_id, void* worker) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedEnableCollection(size_t thread_id) __attribute__((force_align_arg_pointer));
EXTERNAL bool alignedProcess(char* name, char* value) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedPostAlloc(void* mutator, void* refer, void* type_refer, int bytes, int allocator) __attribute__((force_align_arg_pointer));
EXTERNAL void alignedHandleUserCollectionRequest(size_t thread_id) __attribute__((force_align_arg_pointer));
EXTERNAL void sysDynamicCall1(void* (*func_ptr)(void*), void* arg0) __attribute__((force_align_arg_pointer));
EXTERNAL void sysDynamicCall2(void* (*func_ptr)(void*, void*), void* arg0, void* arg1) __attribute__((force_align_arg_pointer));

EXTERNAL void* bind_mutator(void *tls);
EXTERNAL void destroy_mutator(void* mutator);
Expand All @@ -274,15 +273,6 @@ EXTERNAL bool is_mapped_object(void* ref);
EXTERNAL bool is_mapped_address(void* addr);
EXTERNAL bool is_live_object(void* obj);
EXTERNAL void modify_check(void* ref);
EXTERNAL void report_delayed_root_edge(void* trace_local,
void* addr);
EXTERNAL bool will_not_move_in_current_collection(void* trace_local,
void* obj);
EXTERNAL void process_interior_edge(void* trace_local, void* target,
void* slot, bool root);
EXTERNAL void* trace_get_forwarded_referent(void* trace_local, void* obj);
EXTERNAL void* trace_get_forwarded_reference(void* trace_local, void* obj);
EXTERNAL void* trace_retain_referent(void* trace_local, void* obj);
EXTERNAL void* trace_root_object(void* trace_local, void* obj);
EXTERNAL void process_edge(void* trace, void* obj);
EXTERNAL void gc_init(size_t heap_size);
Expand Down Expand Up @@ -314,6 +304,7 @@ EXTERNAL void add_soft_candidate(void* ref, void* referent);
EXTERNAL void add_phantom_candidate(void* ref, void* referent);
EXTERNAL void harness_begin(void *tls);
EXTERNAL void harness_end();
EXTERNAL void release_buffer(void* buffer);
#endif

// sysMisc
Expand Down
20 changes: 8 additions & 12 deletions tools/bootloader/sysMMTk.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ EXTERNAL bool alignedWillNeverMove(void* object){
return will_never_move(object);
}

EXTERNAL void alignedReportDelayedRootEdge(void* trace_local, void* addr){
report_delayed_root_edge(trace_local, addr);
}

EXTERNAL bool alignedWillNotMoveInCurrentCollection(void* trace_local, void* obj){
return will_not_move_in_current_collection(trace_local, obj);
}

EXTERNAL void alignedProcessInteriorEdge(void* trace_local, void* target, void* slot, bool root){
process_interior_edge(trace_local, target, slot, root);
}

EXTERNAL void alignedStartWorker(size_t thread_id, void* worker){
start_worker(thread_id, worker);
}
Expand All @@ -78,4 +66,12 @@ EXTERNAL void alignedPostAlloc(void* mutator, void* refer, void* type_refer, int
EXTERNAL void alignedHandleUserCollectionRequest(size_t thread_id) {
return handle_user_collection_request(thread_id);
}

EXTERNAL void sysDynamicCall1(void* (*func_ptr)(void*), void* arg0){
return func_ptr(arg0);
}

EXTERNAL void sysDynamicCall2(void* (*func_ptr)(void*, void*), void* arg0, void* arg1) {
return func_ptr(arg0, arg1);
}
#endif