Skip to content

Commit

Permalink
Start of support for using native thread's stack and automatic stack …
Browse files Browse the repository at this point in the history
…growth via signal handlers.
  • Loading branch information
Ian Rogers committed Apr 16, 2009
1 parent 4ea7527 commit a7f9242
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions rvm/src/org/jikesrvm/Properties.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public class Properties extends Options {
*/
public static boolean verboseJNI = false;

/**
* Is stack growth managed by the OS/signals or automatic tests?
*/
public static final boolean AutomaticStackGrowth = Configuration.BuildForWindows;

// Runtime subsystem tracing.
//
public static final boolean TraceDictionaries = false;
Expand Down
12 changes: 7 additions & 5 deletions rvm/src/org/jikesrvm/VM.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2532,11 +2532,13 @@ public static void disableGC(boolean recursiveOK) {
}

// 1.
//
if (Magic.getFramePointer().minus(ArchitectureSpecific.StackframeLayoutConstants.STACK_SIZE_GCDISABLED)
.LT(myThread.stackLimit) && !myThread.hasNativeStackFrame()) {
RVMThread.resizeCurrentStack(myThread.getStackLength()+
ArchitectureSpecific.StackframeLayoutConstants.STACK_SIZE_GCDISABLED, null);
//
if (!VM.AutomaticStackGrowth) {
if (Magic.getFramePointer().minus(ArchitectureSpecific.StackframeLayoutConstants.STACK_SIZE_GCDISABLED)
.LT(myThread.stackLimit) && !myThread.hasNativeStackFrame()) {
RVMThread.resizeCurrentStack(myThread.getStackLength()+
ArchitectureSpecific.StackframeLayoutConstants.STACK_SIZE_GCDISABLED, null);
}
}

// 2.
Expand Down
2 changes: 1 addition & 1 deletion rvm/src/org/jikesrvm/compilers/baseline/ia32/BaselineCompilerImpl.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3721,7 +3721,7 @@ private void genPrologue() {
/*
* generate stacklimit check
*/
if (isInterruptible) {
if (!VM.AutomaticStackGrowth && isInterruptible) {
// S0<-limit
if (VM.BuildFor32Addr) {
asm.emitCMP_Reg_RegDisp(SP, TR, Entrypoints.stackLimitField.getOffset());
Expand Down
2 changes: 1 addition & 1 deletion rvm/src/org/jikesrvm/mm/mminterface/MemoryManager.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public static boolean mightBeFP(Address address) {
// In general we don't know which spaces may hold allocated stacks.
// If we want to be more specific than the space being mapped we
// will need to add a check in Plan that can be overriden.
return Space.isMappedAddress(address);
return VM.AutomaticStackGrowth || Space.isMappedAddress(address);
}
/***********************************************************************
*
Expand Down

0 comments on commit a7f9242

Please sign in to comment.