[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
authoryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2018 00:50:50 +0000 (00:50 +0000)
committeryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2018 00:50:50 +0000 (00:50 +0000)
commit74f6aca980b0bb89d7cf9553979db86c93673aca
tree534764536e256b8e706ceda9185dd59d8897731b
parente5235bcedfc2afab11762e25a9f9448e8db292ea
[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
https://bugs.webkit.org/show_bug.cgi?id=188589

Reviewed by Mark Lam.

Source/JavaScriptCore:

Since GPRReg(RegisterID) and FPRReg(FPRegisterID) do not include -1 in their enum values,
UBSan dumps bunch of warnings "runtime error: load of value 4294967295, which is not a valid value for type 'RegisterID'".

1. We add InvalidGPRReg and InvalidFPRReg to enum values of GPRReg and FPRReg to suppress the above warnings.
2. We make GPRReg and FPRReg int8_t enums.
3. We replace `#define InvalidGPRReg ((JSC::GPRReg)-1)` to `static constexpr GPRReg InvalidGPRReg { GPRReg::InvalidGPRReg };`.

* assembler/ARM64Assembler.h:
* assembler/ARMAssembler.h:
* assembler/ARMv7Assembler.h:
* assembler/MIPSAssembler.h:
* assembler/X86Assembler.h:
* jit/FPRInfo.h:
* jit/GPRInfo.h:
(JSC::JSValueRegs::JSValueRegs):
(JSC::JSValueRegs::tagGPR const):
(JSC::JSValueRegs::payloadGPR const):
(JSC::JSValueSource::JSValueSource):
(JSC::JSValueSource::unboxedCell):
(JSC::JSValueSource::operator bool const):
(JSC::JSValueSource::base const):
(JSC::JSValueSource::tagGPR const):
(JSC::JSValueSource::payloadGPR const):
(JSC::JSValueSource::hasKnownTag const):

Source/WebCore:

No behavior change.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/ARM64Assembler.h
Source/JavaScriptCore/assembler/ARMAssembler.h
Source/JavaScriptCore/assembler/ARMv7Assembler.h
Source/JavaScriptCore/assembler/MIPSAssembler.h
Source/JavaScriptCore/assembler/X86Assembler.h
Source/JavaScriptCore/jit/CCallHelpers.h
Source/JavaScriptCore/jit/FPRInfo.h
Source/JavaScriptCore/jit/GPRInfo.h
Source/WebCore/ChangeLog
Source/WebCore/cssjit/FunctionCall.h
Source/WebCore/cssjit/SelectorCompiler.cpp