diff --git a/js/src/jsotypes.h b/js/src/jsotypes.h index a79044f29aa7..bfc85ccc2367 100644 --- a/js/src/jsotypes.h +++ b/js/src/jsotypes.h @@ -91,6 +91,14 @@ typedef JSIntn intn; */ #if defined(AIX) && defined(HAVE_SYS_INTTYPES_H) #include +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +typedef JSInt64 int64; + +/* Explicit signed keyword for bitfield types is required. */ +/* Some compilers may treat them as unsigned without it. */ +typedef signed int int32; +typedef signed short int16; +typedef signed char int8; #else typedef JSInt64 int64; diff --git a/js/src/methodjit/MethodJIT.h b/js/src/methodjit/MethodJIT.h index 0773445f74eb..f5b43470fbaf 100644 --- a/js/src/methodjit/MethodJIT.h +++ b/js/src/methodjit/MethodJIT.h @@ -87,7 +87,7 @@ struct VMFrame # ifdef JS_NO_FASTCALL inline void** returnAddressLocation() { - return reinterpret_cast(this) - 3; + return reinterpret_cast(this) - 5; } # else inline void** returnAddressLocation() { diff --git a/js/src/methodjit/TrampolineCompiler.cpp b/js/src/methodjit/TrampolineCompiler.cpp index fb266e5f42a8..24531a6e0196 100644 --- a/js/src/methodjit/TrampolineCompiler.cpp +++ b/js/src/methodjit/TrampolineCompiler.cpp @@ -146,7 +146,7 @@ TrampolineCompiler::generateForceReturnFast(Assembler &masm) #else // In case of no fast call, when we change the return address, // we need to make sure add esp by 8. - masm.addPtr(Imm32(8), Registers::StackPointer); + masm.addPtr(Imm32(16), Registers::StackPointer); #endif return generateForceReturn(masm); } diff --git a/js/src/methodjit/TrampolineSUNWX86.s b/js/src/methodjit/TrampolineSUNWX86.s index 16ee60fcb6bc..dbc75a49106e 100644 --- a/js/src/methodjit/TrampolineSUNWX86.s +++ b/js/src/methodjit/TrampolineSUNWX86.s @@ -1,4 +1,4 @@ -/ -*- Mode: C++/ tab-width: 4/ indent-tabs-mode: nil/ c-basic-offset: 4 -*- +/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / ***** BEGIN LICENSE BLOCK ***** / Version: MPL 1.1/GPL 2.0/LGPL 2.1 / @@ -92,8 +92,8 @@ JaegerTrampolineReturn: .type JaegerThrowpoline, @function JaegerThrowpoline: /* For Sun Studio there is no fast call. */ - /* We add the stack by 8 before. */ - addl $0x8, %esp + /* We add the stack by 16 before. */ + addl $0x10, %esp /* Align the stack to 16 bytes. */ pushl %esp pushl (%esp) @@ -127,8 +127,8 @@ InjectJaegerReturn: movl 0x1C(%ebx), %ecx /* fp->rval_ type */ movl 0x14(%ebx), %eax /* fp->ncode_ */ /* For Sun Studio there is no fast call. */ - /* We add the stack by 8 before. */ - addl $0x8, %esp + /* We add the stack by 16 before. */ + addl $0x10, %esp /* Restore frame regs. */ movl 0x1C(%esp), %ebx /* f.fp */ jmp *%eax