Changeset 189891 in webkit
- Timestamp:
- Sep 16, 2015 6:16:09 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r189889 r189891 1 2015-09-16 Sukolsak Sakshuwong <sukolsak@gmail.com> 2 3 Fix 32-bit build issues in WebAssembly 4 https://bugs.webkit.org/show_bug.cgi?id=149240 5 6 Reviewed by Geoffrey Garen. 7 8 Fix the syntax error and replace the instructions that are not available on 9 64-bit platforms. 10 11 * wasm/WASMFunctionCompiler.h: 12 (JSC::WASMFunctionCompiler::startFunction): 13 (JSC::WASMFunctionCompiler::endFunction): 14 (JSC::WASMFunctionCompiler::buildReturn): 15 (JSC::WASMFunctionCompiler::callAndUnboxResult): 16 (JSC::WASMFunctionCompiler::loadValueAndConvertToDouble): 17 1 18 2015-09-16 Geoffrey Garen <ggaren@apple.com> 2 19 -
trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h
r189822 r189891 136 136 for (uint32_t i = 0; i < numberOfF32LocalVariables; ++i) 137 137 store32(TrustedImm32(0), localAddress(localIndex++)); 138 for (uint32_t i = 0; i < numberOfF64LocalVariables; ++i) 138 for (uint32_t i = 0; i < numberOfF64LocalVariables; ++i) { 139 #if USE(JSVALUE64) 139 140 store64(TrustedImm64(0), localAddress(localIndex++)); 141 #else 142 store32(TrustedImm32(0), localAddress(localIndex)); 143 store32(TrustedImm32(0), localAddress(localIndex).withOffset(4)); 144 localIndex++; 145 #endif 146 } 140 147 141 148 m_codeBlock->setNumParameters(1 + arguments.size()); … … 147 154 148 155 // FIXME: Remove these if the last statement is a return statement. 149 move(TrustedImm64(JSValue::encode(jsUndefined())), GPRInfo::returnValueGPR); 156 #if USE(JSVALUE64) 157 JSValueRegs returnValueRegs(GPRInfo::returnValueGPR); 158 #else 159 JSValueRegs returnValueRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR); 160 #endif 161 moveTrustedValue(jsUndefined(), returnValueRegs); 150 162 emitFunctionEpilogue(); 151 163 ret(); … … 245 257 void buildReturn(int, WASMExpressionType returnType) 246 258 { 259 #if USE(JSVALUE64) 260 JSValueRegs returnValueRegs(GPRInfo::returnValueGPR); 261 #else 262 JSValueRegs returnValueRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR); 263 #endif 247 264 switch (returnType) { 248 265 case WASMExpressionType::I32: … … 268 285 break; 269 286 case WASMExpressionType::Void: 270 move (TrustedImm64(JSValue::encode(jsUndefined())), GPRInfo::returnValueGPR);287 moveTrustedValue(jsUndefined(), returnValueRegs); 271 288 break; 272 289 default: … … 840 857 } 841 858 #else 859 // EncodedJSValue in JSVALUE32_64 is a 64-bit integer. When being compiled in ARM EABI, it must be aligned even-numbered register (r0, r2 or [sp]). 860 // To avoid assemblies from using wrong registers, let's occupy r1 or r3 with a dummy argument when necessary. 861 #if (COMPILER_SUPPORTS(EABI) && CPU(ARM)) || CPU(MIPS) 862 #define EABI_32BIT_DUMMY_ARG TrustedImm32(0), 863 #else 864 #define EABI_32BIT_DUMMY_ARG 865 #endif 866 842 867 void callOperation(Z_JITOperation_EJ operation, GPRReg srcTag, GPRReg srcPayload, GPRReg dst) 843 868 { … … 907 932 store64(GPRInfo::regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC))); 908 933 #else 909 store32( regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));910 store32(TrustedImm32( CellTag), Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC)));934 store32(GPRInfo::regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 935 store32(TrustedImm32(JSValue::CellTag), Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC))); 911 936 #endif 912 937 … … 1000 1025 1001 1026 checkJSNumber.link(this); 1002 unboxDouble(tempRegs.tagGPR(), tempRegs.payloadGPR(), dst, fpScratch) 1027 unboxDouble(tempRegs.tagGPR(), tempRegs.payloadGPR(), dst, fpScratch); 1003 1028 end.link(this); 1004 1029 }
Note: See TracChangeset
for help on using the changeset viewer.