diff --git a/rvm/src/org/jikesrvm/jni/ia32/JNICompiler.java b/rvm/src/org/jikesrvm/jni/ia32/JNICompiler.java index 9af33ea83..64195ace0 100755 --- a/rvm/src/org/jikesrvm/jni/ia32/JNICompiler.java +++ b/rvm/src/org/jikesrvm/jni/ia32/JNICompiler.java @@ -433,17 +433,17 @@ public static synchronized CompiledMethod compile(NativeMethod method) { if (!VM.BuildForWindows) { // TODO: optimize stack adjustment if (VM.BuildFor32Addr) { - // throw away args, class/this ptr and env - int argsToThrowAway = method.getParameterWords()+2-argsPassedInRegister; - if (argsToThrowAway != 0) { - asm.emitADD_Reg_Imm(SP, argsToThrowAway << LG_WORDSIZE); - } + // throw away args, class/this ptr and env + int argsToThrowAway = method.getParameterWords()+2-argsPassedInRegister; + if (argsToThrowAway != 0) { + asm.emitADD_Reg_Imm(SP, argsToThrowAway << LG_WORDSIZE); + } } else { - // throw away args, class/this ptr and env - int argsToThrowAway = args.length+2-argsPassedInRegister; - if (argsToThrowAway != 0) { - asm.emitADD_Reg_Imm_Quad(SP, argsToThrowAway << LG_WORDSIZE); - } + // throw away args, class/this ptr and env + int argsToThrowAway = args.length+2-argsPassedInRegister; + if (argsToThrowAway != 0) { + asm.emitADD_Reg_Imm_Quad(SP, argsToThrowAway << LG_WORDSIZE); + } } } @@ -961,9 +961,9 @@ public static void generateEpilogForJNIMethod(Assembler asm, RVMMethod method) { bytesToRelease = method.getParameterTypes().length * WORDSIZE; // TODO: take care of Win64 conventions for (TypeReference arg : method.getParameterTypes()) { - if (arg.isLongType() || arg.isDoubleType()) { - bytesToRelease += WORDSIZE; - } + if (arg.isLongType() || arg.isDoubleType()) { + bytesToRelease += WORDSIZE; + } } } if (bytesToRelease == 0) { diff --git a/rvm/src/org/jikesrvm/runtime/DynamicLibrary.java b/rvm/src/org/jikesrvm/runtime/DynamicLibrary.java index 79ada4581..882cf0856 100755 --- a/rvm/src/org/jikesrvm/runtime/DynamicLibrary.java +++ b/rvm/src/org/jikesrvm/runtime/DynamicLibrary.java @@ -208,18 +208,18 @@ public static synchronized int load(String libname) { byte[] asciiName = StringUtilities.stringToBytesNullTerminated(libname); if (!VM.AutomaticStackGrowth) { - // make sure we have enough stack to load the library. - // This operation has been known to require more than 20K of stack. - RVMThread myThread = RVMThread.getCurrentThread(); - Offset remaining = Magic.getFramePointer().diff(myThread.stackLimit); - int stackNeededInBytes = StackframeLayoutConstants.STACK_SIZE_DLOPEN - remaining.toInt(); - if (stackNeededInBytes > 0) { - if (myThread.hasNativeStackFrame()) { - throw new java.lang.StackOverflowError("Not enough space to open shared library"); - } else { - RVMThread.resizeCurrentStack(myThread.getStackLength() + stackNeededInBytes, null); - } - } + // make sure we have enough stack to load the library. + // This operation has been known to require more than 20K of stack. + RVMThread myThread = RVMThread.getCurrentThread(); + Offset remaining = Magic.getFramePointer().diff(myThread.stackLimit); + int stackNeededInBytes = StackframeLayoutConstants.STACK_SIZE_DLOPEN - remaining.toInt(); + if (stackNeededInBytes > 0) { + if (myThread.hasNativeStackFrame()) { + throw new java.lang.StackOverflowError("Not enough space to open shared library"); + } else { + RVMThread.resizeCurrentStack(myThread.getStackLength() + stackNeededInBytes, null); + } + } } Address libHandler = SysCall.sysCall.sysDlopen(asciiName);