Ensure that computed new stack pointer values do not underflow.
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jun 2017 18:12:35 +0000 (18:12 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jun 2017 18:12:35 +0000 (18:12 +0000)
commitc43818f2d2922ca2e386e01f9a720c426bd6a921
tree017d03d34675d267cd2a45586b798fb2a7f7832a
parent5b4f0744905c83ae3ad94aec491d18c899b1187c
Ensure that computed new stack pointer values do not underflow.

Re-apply this patch, it originally broke the ARM build because the llint code
generated `subs xzr, x3, sp` which isn't valid ARM64: the third operand cannot
be SP (that encoding would be ZR instead, subtracting zero). Flip the comparison
and operands to emit valid code (because the second operand can be SP).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/dfg/DFGGraph.cpp
Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/SetupVarargsFrame.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/MinimumReservedZoneSize.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/Options.cpp
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp