Replace JSValue #defines with static constexpr values.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2019 16:14:47 +0000 (16:14 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2019 16:14:47 +0000 (16:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201966

Reviewed by Yusuke Suzuki.

static constexpr is the modern C++ way to define these constants.

Some of the values are typed int64_t and some are int32_t.  The original #define
values are int64_t.  Hence, we adopt int64_t as the default type to use here.

However, some of these constants are being used as 32-bit values, and the code
was static_cast'ing them into int32_t.  This set of constants are all the small
values that fit in an int32_t anyway.  So, we're putting these in int32_t instead
so that we don't have to keep casting them.  In the few places where they are
used as int64_t, they will automatically get up-casted anyway.

In this patch, we also did the following:

1. Renamed TagMask to NotCellMask, because everywhere in the code, we're
   basically using it to filter out cells like this:

      if (value & NotCellMask) then goto handleNotCellCase;

2. Renamed TagTypeNumber to NumberTag for a shorter name.

   Ditto for TagBitTypeOther, TagBitBool, TagBitUndefined, TagBitsWasm, and TagWasmMask.
   They are now OtherTag, BoolTag, UndefinedTag, WasmTag, and WasmMask.

3. Introduced DoubleEncodeOffsetBit so that client code do not embed this value
   as a literal constant.  We now define DoubleEncodeOffset based on
   DoubleEncodeOffsetBit ensuring consistency.

4. Introduced MiscTag so that clients don't have to put this set of tags together
   themselves.

5. Removed static asserts for tags in LLIntData.cpp because the offlineasm now
   captures these values correctly with constexpr statements.  These static
   asserts were holdovers from the old days back when we had to define LLInt
   constant values manually, and we needed a mechanism to detect when the values
   have changed in the source.

6. Replaced some runtime asserts in RegisterSet.cpp with static_asserts.

7. In Wasm::wasmToJS(), we were constructing the value of JSValue::DoubleEncodeOffset
   constant by left shifting 1 by JSValue::DoubleEncodeOffsetBit.  There's no need
   to do this for ARM64 because the constant can be loaded efficiently with a single
   MOVZ instruction.  So, we add a CPU(ARM64) case to just move the constant into
   the target register.

* assembler/AbortReason.h:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::silentFill):
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileDoubleRep):
(JSC::DFG::SpeculativeJIT::getIntTypedArrayStoreOperand):
(JSC::DFG::SpeculativeJIT::speculateMisc):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::spill):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compileObjectStrictEquality):
(JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
(JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
(JSC::DFG::SpeculativeJIT::compileInt52Compare):
(JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::moveTrueTo):
(JSC::DFG::SpeculativeJIT::moveFalseTo):
(JSC::DFG::SpeculativeJIT::blessBoolean):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep):
(JSC::FTL::DFG::LowerDFGToB3::compileBooleanToNumber):
(JSC::FTL::DFG::LowerDFGToB3::compileUnaryMathIC):
(JSC::FTL::DFG::LowerDFGToB3::compileBinaryMathIC):
(JSC::FTL::DFG::LowerDFGToB3::compilePutById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileArrayIndexOf):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgument):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::compileInById):
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
(JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorStructurePname):
(JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorGenericPname):
(JSC::FTL::DFG::LowerDFGToB3::getById):
(JSC::FTL::DFG::LowerDFGToB3::getByIdWithThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):
(JSC::FTL::DFG::LowerDFGToB3::emitBinarySnippet):
(JSC::FTL::DFG::LowerDFGToB3::emitBinaryBitOpSnippet):
(JSC::FTL::DFG::LowerDFGToB3::emitRightShiftSnippet):
(JSC::FTL::DFG::LowerDFGToB3::equalNullOrUndefined):
(JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isInt32):
(JSC::FTL::DFG::LowerDFGToB3::isNotInt32):
(JSC::FTL::DFG::LowerDFGToB3::boxInt32):
(JSC::FTL::DFG::LowerDFGToB3::isCellOrMisc):
(JSC::FTL::DFG::LowerDFGToB3::isNotCellOrMisc):
(JSC::FTL::DFG::LowerDFGToB3::unboxDouble):
(JSC::FTL::DFG::LowerDFGToB3::boxDouble):
(JSC::FTL::DFG::LowerDFGToB3::isNotCell):
(JSC::FTL::DFG::LowerDFGToB3::isCell):
(JSC::FTL::DFG::LowerDFGToB3::isNotMisc):
(JSC::FTL::DFG::LowerDFGToB3::isNotBoolean):
(JSC::FTL::DFG::LowerDFGToB3::boxBoolean):
(JSC::FTL::DFG::LowerDFGToB3::isNotOther):
(JSC::FTL::DFG::LowerDFGToB3::isOther):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::reboxAccordingToFormat):
(JSC::FTL::compileStub):
* interpreter/CalleeBits.h:
(JSC::CalleeBits::boxWasm):
(JSC::CalleeBits::isWasm const):
(JSC::CalleeBits::asWasmCallee const):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertIsJSInt32):
(JSC::AssemblyHelpers::jitAssertIsJSNumber):
(JSC::AssemblyHelpers::jitAssertIsJSDouble):
(JSC::AssemblyHelpers::jitAssertIsCell):
(JSC::AssemblyHelpers::jitAssertTagsInPlace):
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitSaveThenMaterializeTagRegisters):
(JSC::AssemblyHelpers::emitRestoreSavedTagRegisters):
(JSC::AssemblyHelpers::emitMaterializeTagCheckRegisters):
(JSC::AssemblyHelpers::branchIfNotCell):
(JSC::AssemblyHelpers::branchIfCell):
(JSC::AssemblyHelpers::branchIfOther):
(JSC::AssemblyHelpers::branchIfNotOther):
(JSC::AssemblyHelpers::branchIfInt32):
(JSC::AssemblyHelpers::branchIfNotInt32):
(JSC::AssemblyHelpers::branchIfNumber):
(JSC::AssemblyHelpers::branchIfNotNumber):
(JSC::AssemblyHelpers::branchIfNotDoubleKnownNotInt32):
(JSC::AssemblyHelpers::branchIfBoolean):
(JSC::AssemblyHelpers::branchIfNotBoolean):
(JSC::AssemblyHelpers::boxDouble):
(JSC::AssemblyHelpers::unboxDoubleWithoutAssertions):
(JSC::AssemblyHelpers::boxInt52):
(JSC::AssemblyHelpers::boxBooleanPayload):
(JSC::AssemblyHelpers::boxInt32):
* jit/CallFrameShuffleData.h:
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::CallFrameShuffler):
(JSC::CallFrameShuffler::dump const):
(JSC::CallFrameShuffler::prepareAny):
* jit/CallFrameShuffler.h:
(JSC::CallFrameShuffler::getFreeRegister const):
* jit/CallFrameShuffler64.cpp:
(JSC::CallFrameShuffler::emitBox):
(JSC::CallFrameShuffler::tryAcquireNumberTagRegister):
(JSC::CallFrameShuffler::tryAcquireTagTypeNumber): Deleted.
* jit/GPRInfo.h:
(JSC::GPRInfo::reservedRegisters):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_compareAndJumpSlow):
* jit/JITBitAndGenerator.cpp:
(JSC::JITBitAndGenerator::generateFastPath):
* jit/JITBitOrGenerator.cpp:
(JSC::JITBitOrGenerator::generateFastPath):
* jit/JITBitXorGenerator.cpp:
(JSC::JITBitXorGenerator::generateFastPath):
* jit/JITCall.cpp:
(JSC::JIT::compileTailCall):
* jit/JITDivGenerator.cpp:
(JSC::JITDivGenerator::generateFastPath):
* jit/JITInlines.h:
(JSC::JIT::emitPatchableJumpIfNotInt):
* jit/JITLeftShiftGenerator.cpp:
(JSC::JITLeftShiftGenerator::generateFastPath):
* jit/JITMulGenerator.cpp:
(JSC::JITMulGenerator::generateFastPath):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_undefined_or_null):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jundefined_or_null):
(JSC::JIT::emit_op_jnundefined_or_null):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* jit/JITRightShiftGenerator.cpp:
(JSC::JITRightShiftGenerator::generateFastPath):
* jit/RegisterSet.cpp:
(JSC::RegisterSet::runtimeTagRegisters):
(JSC::RegisterSet::llintBaselineCalleeSaveRegisters):
(JSC::RegisterSet::dfgCalleeSaveRegisters):
(JSC::RegisterSet::ftlCalleeSaveRegisters):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::returnDouble):
(JSC::SpecializedThunkJIT::tagReturnAsInt32):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::absThunkGenerator):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* llint/LowLevelInterpreter64.asm:
* offlineasm/arm64.rb:
* offlineasm/cloop.rb:
* offlineasm/x86.rb:
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isUndefinedOrNull const):
(JSC::JSValue::isCell const):
(JSC::JSValue::isInt32 const):
(JSC::JSValue::JSValue):
(JSC::JSValue::asDouble const):
(JSC::JSValue::isNumber const):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

43 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/AbortReason.h
Source/JavaScriptCore/bytecode/AccessCase.cpp
Source/JavaScriptCore/dfg/DFGOSRExit.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
Source/JavaScriptCore/interpreter/CalleeBits.h
Source/JavaScriptCore/jit/AssemblyHelpers.cpp
Source/JavaScriptCore/jit/AssemblyHelpers.h
Source/JavaScriptCore/jit/CallFrameShuffleData.h
Source/JavaScriptCore/jit/CallFrameShuffler.cpp
Source/JavaScriptCore/jit/CallFrameShuffler.h
Source/JavaScriptCore/jit/CallFrameShuffler64.cpp
Source/JavaScriptCore/jit/GPRInfo.h
Source/JavaScriptCore/jit/JITArithmetic.cpp
Source/JavaScriptCore/jit/JITBitAndGenerator.cpp
Source/JavaScriptCore/jit/JITBitOrGenerator.cpp
Source/JavaScriptCore/jit/JITBitXorGenerator.cpp
Source/JavaScriptCore/jit/JITCall.cpp
Source/JavaScriptCore/jit/JITDivGenerator.cpp
Source/JavaScriptCore/jit/JITInlines.h
Source/JavaScriptCore/jit/JITLeftShiftGenerator.cpp
Source/JavaScriptCore/jit/JITMulGenerator.cpp
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITRightShiftGenerator.cpp
Source/JavaScriptCore/jit/RegisterSet.cpp
Source/JavaScriptCore/jit/SpecializedThunkJIT.h
Source/JavaScriptCore/jit/ThunkGenerators.cpp
Source/JavaScriptCore/llint/LLIntData.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/offlineasm/arm64.rb
Source/JavaScriptCore/offlineasm/cloop.rb
Source/JavaScriptCore/offlineasm/x86.rb
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/runtime/JSCJSValueInlines.h
Source/JavaScriptCore/wasm/js/WasmToJS.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp

index 9c3810e..0854674 100644 (file)
@@ -1,3 +1,250 @@
+2019-09-19  Mark Lam  <mark.lam@apple.com>
+
+        Replace JSValue #defines with static constexpr values.
+        https://bugs.webkit.org/show_bug.cgi?id=201966
+
+        Reviewed by Yusuke Suzuki.
+
+        static constexpr is the modern C++ way to define these constants.
+
+        Some of the values are typed int64_t and some are int32_t.  The original #define
+        values are int64_t.  Hence, we adopt int64_t as the default type to use here.
+
+        However, some of these constants are being used as 32-bit values, and the code
+        was static_cast'ing them into int32_t.  This set of constants are all the small
+        values that fit in an int32_t anyway.  So, we're putting these in int32_t instead
+        so that we don't have to keep casting them.  In the few places where they are
+        used as int64_t, they will automatically get up-casted anyway.
+
+        In this patch, we also did the following:
+
+        1. Renamed TagMask to NotCellMask, because everywhere in the code, we're
+           basically using it to filter out cells like this:
+
+              if (value & NotCellMask) then goto handleNotCellCase;
+
+        2. Renamed TagTypeNumber to NumberTag for a shorter name.
+
+           Ditto for TagBitTypeOther, TagBitBool, TagBitUndefined, TagBitsWasm, and TagWasmMask.
+           They are now OtherTag, BoolTag, UndefinedTag, WasmTag, and WasmMask.
+
+        3. Introduced DoubleEncodeOffsetBit so that client code do not embed this value
+           as a literal constant.  We now define DoubleEncodeOffset based on
+           DoubleEncodeOffsetBit ensuring consistency.
+
+        4. Introduced MiscTag so that clients don't have to put this set of tags together
+           themselves.
+
+        5. Removed static asserts for tags in LLIntData.cpp because the offlineasm now
+           captures these values correctly with constexpr statements.  These static
+           asserts were holdovers from the old days back when we had to define LLInt
+           constant values manually, and we needed a mechanism to detect when the values
+           have changed in the source.
+
+        6. Replaced some runtime asserts in RegisterSet.cpp with static_asserts.
+
+        7. In Wasm::wasmToJS(), we were constructing the value of JSValue::DoubleEncodeOffset
+           constant by left shifting 1 by JSValue::DoubleEncodeOffsetBit.  There's no need
+           to do this for ARM64 because the constant can be loaded efficiently with a single
+           MOVZ instruction.  So, we add a CPU(ARM64) case to just move the constant into
+           the target register.
+
+        * assembler/AbortReason.h:
+        * bytecode/AccessCase.cpp:
+        (JSC::AccessCase::generateWithGuard):
+        * dfg/DFGOSRExit.cpp:
+        (JSC::DFG::OSRExit::executeOSRExit):
+        (JSC::DFG::OSRExit::compileExit):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::silentFill):
+        (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
+        (JSC::DFG::SpeculativeJIT::compileValueToInt32):
+        (JSC::DFG::SpeculativeJIT::compileDoubleRep):
+        (JSC::DFG::SpeculativeJIT::getIntTypedArrayStoreOperand):
+        (JSC::DFG::SpeculativeJIT::speculateMisc):
+        * dfg/DFGSpeculativeJIT.h:
+        (JSC::DFG::SpeculativeJIT::spill):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::fillJSValue):
+        (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined):
+        (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined):
+        (JSC::DFG::SpeculativeJIT::emitCall):
+        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
+        (JSC::DFG::SpeculativeJIT::compileObjectStrictEquality):
+        (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
+        (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
+        (JSC::DFG::SpeculativeJIT::compileInt52Compare):
+        (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
+        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
+        (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
+        (JSC::DFG::SpeculativeJIT::emitBranch):
+        (JSC::DFG::SpeculativeJIT::compile):
+        (JSC::DFG::SpeculativeJIT::moveTrueTo):
+        (JSC::DFG::SpeculativeJIT::moveFalseTo):
+        (JSC::DFG::SpeculativeJIT::blessBoolean):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::lower):
+        (JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep):
+        (JSC::FTL::DFG::LowerDFGToB3::compileBooleanToNumber):
+        (JSC::FTL::DFG::LowerDFGToB3::compileUnaryMathIC):
+        (JSC::FTL::DFG::LowerDFGToB3::compileBinaryMathIC):
+        (JSC::FTL::DFG::LowerDFGToB3::compilePutById):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
+        (JSC::FTL::DFG::LowerDFGToB3::compileArrayIndexOf):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetArgument):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
+        (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
+        (JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
+        (JSC::FTL::DFG::LowerDFGToB3::compileInById):
+        (JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorStructurePname):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetEnumeratorGenericPname):
+        (JSC::FTL::DFG::LowerDFGToB3::getById):
+        (JSC::FTL::DFG::LowerDFGToB3::getByIdWithThis):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCallDOMGetter):
+        (JSC::FTL::DFG::LowerDFGToB3::emitBinarySnippet):
+        (JSC::FTL::DFG::LowerDFGToB3::emitBinaryBitOpSnippet):
+        (JSC::FTL::DFG::LowerDFGToB3::emitRightShiftSnippet):
+        (JSC::FTL::DFG::LowerDFGToB3::equalNullOrUndefined):
+        (JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
+        (JSC::FTL::DFG::LowerDFGToB3::isInt32):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotInt32):
+        (JSC::FTL::DFG::LowerDFGToB3::boxInt32):
+        (JSC::FTL::DFG::LowerDFGToB3::isCellOrMisc):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotCellOrMisc):
+        (JSC::FTL::DFG::LowerDFGToB3::unboxDouble):
+        (JSC::FTL::DFG::LowerDFGToB3::boxDouble):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotCell):
+        (JSC::FTL::DFG::LowerDFGToB3::isCell):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotMisc):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotBoolean):
+        (JSC::FTL::DFG::LowerDFGToB3::boxBoolean):
+        (JSC::FTL::DFG::LowerDFGToB3::isNotOther):
+        (JSC::FTL::DFG::LowerDFGToB3::isOther):
+        * ftl/FTLOSRExitCompiler.cpp:
+        (JSC::FTL::reboxAccordingToFormat):
+        (JSC::FTL::compileStub):
+        * interpreter/CalleeBits.h:
+        (JSC::CalleeBits::boxWasm):
+        (JSC::CalleeBits::isWasm const):
+        (JSC::CalleeBits::asWasmCallee const):
+        * jit/AssemblyHelpers.cpp:
+        (JSC::AssemblyHelpers::jitAssertIsJSInt32):
+        (JSC::AssemblyHelpers::jitAssertIsJSNumber):
+        (JSC::AssemblyHelpers::jitAssertIsJSDouble):
+        (JSC::AssemblyHelpers::jitAssertIsCell):
+        (JSC::AssemblyHelpers::jitAssertTagsInPlace):
+        (JSC::AssemblyHelpers::emitConvertValueToBoolean):
+        * jit/AssemblyHelpers.h:
+        (JSC::AssemblyHelpers::emitSaveThenMaterializeTagRegisters):
+        (JSC::AssemblyHelpers::emitRestoreSavedTagRegisters):
+        (JSC::AssemblyHelpers::emitMaterializeTagCheckRegisters):
+        (JSC::AssemblyHelpers::branchIfNotCell):
+        (JSC::AssemblyHelpers::branchIfCell):
+        (JSC::AssemblyHelpers::branchIfOther):
+        (JSC::AssemblyHelpers::branchIfNotOther):
+        (JSC::AssemblyHelpers::branchIfInt32):
+        (JSC::AssemblyHelpers::branchIfNotInt32):
+        (JSC::AssemblyHelpers::branchIfNumber):
+        (JSC::AssemblyHelpers::branchIfNotNumber):
+        (JSC::AssemblyHelpers::branchIfNotDoubleKnownNotInt32):
+        (JSC::AssemblyHelpers::branchIfBoolean):
+        (JSC::AssemblyHelpers::branchIfNotBoolean):
+        (JSC::AssemblyHelpers::boxDouble):
+        (JSC::AssemblyHelpers::unboxDoubleWithoutAssertions):
+        (JSC::AssemblyHelpers::boxInt52):
+        (JSC::AssemblyHelpers::boxBooleanPayload):
+        (JSC::AssemblyHelpers::boxInt32):
+        * jit/CallFrameShuffleData.h:
+        * jit/CallFrameShuffler.cpp:
+        (JSC::CallFrameShuffler::CallFrameShuffler):
+        (JSC::CallFrameShuffler::dump const):
+        (JSC::CallFrameShuffler::prepareAny):
+        * jit/CallFrameShuffler.h:
+        (JSC::CallFrameShuffler::getFreeRegister const):
+        * jit/CallFrameShuffler64.cpp:
+        (JSC::CallFrameShuffler::emitBox):
+        (JSC::CallFrameShuffler::tryAcquireNumberTagRegister):
+        (JSC::CallFrameShuffler::tryAcquireTagTypeNumber): Deleted.
+        * jit/GPRInfo.h:
+        (JSC::GPRInfo::reservedRegisters):
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emit_compareAndJumpSlow):
+        * jit/JITBitAndGenerator.cpp:
+        (JSC::JITBitAndGenerator::generateFastPath):
+        * jit/JITBitOrGenerator.cpp:
+        (JSC::JITBitOrGenerator::generateFastPath):
+        * jit/JITBitXorGenerator.cpp:
+        (JSC::JITBitXorGenerator::generateFastPath):
+        * jit/JITCall.cpp:
+        (JSC::JIT::compileTailCall):
+        * jit/JITDivGenerator.cpp:
+        (JSC::JITDivGenerator::generateFastPath):
+        * jit/JITInlines.h:
+        (JSC::JIT::emitPatchableJumpIfNotInt):
+        * jit/JITLeftShiftGenerator.cpp:
+        (JSC::JITLeftShiftGenerator::generateFastPath):
+        * jit/JITMulGenerator.cpp:
+        (JSC::JITMulGenerator::generateFastPath):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_overrides_has_instance):
+        (JSC::JIT::emit_op_is_undefined):
+        (JSC::JIT::emit_op_is_undefined_or_null):
+        (JSC::JIT::emit_op_is_boolean):
+        (JSC::JIT::emit_op_is_number):
+        (JSC::JIT::emit_op_is_cell_with_type):
+        (JSC::JIT::emit_op_is_object):
+        (JSC::JIT::emit_op_not):
+        (JSC::JIT::emit_op_jeq_null):
+        (JSC::JIT::emit_op_jneq_null):
+        (JSC::JIT::emit_op_jundefined_or_null):
+        (JSC::JIT::emit_op_jnundefined_or_null):
+        (JSC::JIT::emit_op_eq_null):
+        (JSC::JIT::emit_op_neq_null):
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::emitGenericContiguousPutByVal):
+        (JSC::JIT::emitFloatTypedArrayPutByVal):
+        * jit/JITRightShiftGenerator.cpp:
+        (JSC::JITRightShiftGenerator::generateFastPath):
+        * jit/RegisterSet.cpp:
+        (JSC::RegisterSet::runtimeTagRegisters):
+        (JSC::RegisterSet::llintBaselineCalleeSaveRegisters):
+        (JSC::RegisterSet::dfgCalleeSaveRegisters):
+        (JSC::RegisterSet::ftlCalleeSaveRegisters):
+        * jit/SpecializedThunkJIT.h:
+        (JSC::SpecializedThunkJIT::returnDouble):
+        (JSC::SpecializedThunkJIT::tagReturnAsInt32):
+        * jit/ThunkGenerators.cpp:
+        (JSC::virtualThunkFor):
+        (JSC::nativeForGenerator):
+        (JSC::arityFixupGenerator):
+        (JSC::absThunkGenerator):
+        * llint/LLIntData.cpp:
+        (JSC::LLInt::Data::performAssertions):
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter.cpp:
+        (JSC::CLoop::execute):
+        * llint/LowLevelInterpreter64.asm:
+        * offlineasm/arm64.rb:
+        * offlineasm/cloop.rb:
+        * offlineasm/x86.rb:
+        * runtime/JSCJSValue.h:
+        * runtime/JSCJSValueInlines.h:
+        (JSC::JSValue::isUndefinedOrNull const):
+        (JSC::JSValue::isCell const):
+        (JSC::JSValue::isInt32 const):
+        (JSC::JSValue::JSValue):
+        (JSC::JSValue::asDouble const):
+        (JSC::JSValue::isNumber const):
+        * wasm/js/WasmToJS.cpp:
+        (JSC::Wasm::wasmToJS):
+        * wasm/js/WebAssemblyFunction.cpp:
+        (JSC::WebAssemblyFunction::jsCallEntrypointSlow):
+
 2019-09-18  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Better handling for large arrays and collections in Object Trees
index c053457..429d435 100644 (file)
@@ -43,8 +43,8 @@ enum AbortReason {
     AHIsNotNull                                       =  90,
     AHStackPointerMisaligned                          = 100,
     AHStructureIDIsValid                              = 110,
-    AHTagMaskNotInPlace                               = 120,
-    AHTagTypeNumberNotInPlace                         = 130,
+    AHNotCellMaskNotInPlace                           = 120,
+    AHNumberTagNotInPlace                             = 130,
     AHTypeInfoInlineTypeFlagsAreValid                 = 140,
     AHTypeInfoIsValid                                 = 150,
     B3Oops                                            = 155,
index 170c4dd..3ec366e 100644 (file)
@@ -417,7 +417,7 @@ void AccessCase::generateWithGuard(
                         // has the property.
 #if USE(JSVALUE64)
                         jit.load64(MacroAssembler::Address(baseForAccessGPR, offsetRelativeToBase(knownPolyProtoOffset)), baseForAccessGPR);
-                        fallThrough.append(jit.branch64(CCallHelpers::NotEqual, baseForAccessGPR, CCallHelpers::TrustedImm64(ValueNull)));
+                        fallThrough.append(jit.branch64(CCallHelpers::NotEqual, baseForAccessGPR, CCallHelpers::TrustedImm64(JSValue::ValueNull)));
 #else
                         jit.load32(MacroAssembler::Address(baseForAccessGPR, offsetRelativeToBase(knownPolyProtoOffset) + PayloadOffset), baseForAccessGPR);
                         fallThrough.append(jit.branchTestPtr(CCallHelpers::NonZero, baseForAccessGPR));
@@ -432,7 +432,7 @@ void AccessCase::generateWithGuard(
                         RELEASE_ASSERT(structure->isObject()); // Primitives must have a stored prototype. We use prototypeForLookup for them.
 #if USE(JSVALUE64)
                         jit.load64(MacroAssembler::Address(baseForAccessGPR, offsetRelativeToBase(knownPolyProtoOffset)), baseForAccessGPR);
-                        fallThrough.append(jit.branch64(CCallHelpers::Equal, baseForAccessGPR, CCallHelpers::TrustedImm64(ValueNull)));
+                        fallThrough.append(jit.branch64(CCallHelpers::Equal, baseForAccessGPR, CCallHelpers::TrustedImm64(JSValue::ValueNull)));
 #else
                         jit.load32(MacroAssembler::Address(baseForAccessGPR, offsetRelativeToBase(knownPolyProtoOffset) + PayloadOffset), baseForAccessGPR);
                         fallThrough.append(jit.branchTestPtr(CCallHelpers::Zero, baseForAccessGPR));
index 4351596..04692ec 100644 (file)
@@ -471,7 +471,7 @@ void OSRExit::executeOSRExit(Context& context)
                 cpu.gpr(recovery->dest()) = cpu.gpr<uint32_t>(recovery->dest()) - cpu.gpr<uint32_t>(recovery->src());
 #if USE(JSVALUE64)
                 ASSERT(!(cpu.gpr(recovery->dest()) >> 32));
-                cpu.gpr(recovery->dest()) |= TagTypeNumber;
+                cpu.gpr(recovery->dest()) |= JSValue::NumberTag;
 #endif
                 break;
 
@@ -479,7 +479,7 @@ void OSRExit::executeOSRExit(Context& context)
                 cpu.gpr(recovery->dest()) = static_cast<uint32_t>(cpu.gpr<int32_t>(recovery->dest()) >> 1) ^ 0x80000000U;
 #if USE(JSVALUE64)
                 ASSERT(!(cpu.gpr(recovery->dest()) >> 32));
-                cpu.gpr(recovery->dest()) |= TagTypeNumber;
+                cpu.gpr(recovery->dest()) |= JSValue::NumberTag;
 #endif
                 break;
 
@@ -487,13 +487,13 @@ void OSRExit::executeOSRExit(Context& context)
                 cpu.gpr(recovery->dest()) = (cpu.gpr<uint32_t>(recovery->dest()) - recovery->immediate());
 #if USE(JSVALUE64)
                 ASSERT(!(cpu.gpr(recovery->dest()) >> 32));
-                cpu.gpr(recovery->dest()) |= TagTypeNumber;
+                cpu.gpr(recovery->dest()) |= JSValue::NumberTag;
 #endif
                 break;
 
             case BooleanSpeculationCheck:
 #if USE(JSVALUE64)
-                cpu.gpr(recovery->dest()) = cpu.gpr(recovery->dest()) ^ ValueFalse;
+                cpu.gpr(recovery->dest()) = cpu.gpr(recovery->dest()) ^ JSValue::ValueFalse;
 #endif
                 break;
 
@@ -546,8 +546,8 @@ void OSRExit::executeOSRExit(Context& context)
     ASSERT(!(context.fp<uintptr_t>() & 0x7));
 
 #if USE(JSVALUE64)
-    ASSERT(cpu.gpr(GPRInfo::tagTypeNumberRegister) == TagTypeNumber);
-    ASSERT(cpu.gpr(GPRInfo::tagMaskRegister) == TagMask);
+    ASSERT(cpu.gpr<int64_t>(GPRInfo::numberTagRegister) == JSValue::NumberTag);
+    ASSERT(cpu.gpr<int64_t>(GPRInfo::notCellMaskRegister) == JSValue::NotCellMask);
 #endif
 
     // Do all data format conversions and store the results into the stack.
@@ -686,8 +686,8 @@ void OSRExit::executeOSRExit(Context& context)
     saveCalleeSavesFor(context, baselineCodeBlock);
 
 #if USE(JSVALUE64)
-    cpu.gpr(GPRInfo::tagTypeNumberRegister) = static_cast<uintptr_t>(TagTypeNumber);
-    cpu.gpr(GPRInfo::tagMaskRegister) = static_cast<uintptr_t>(TagTypeNumber | TagBitTypeOther);
+    cpu.gpr(GPRInfo::numberTagRegister) = JSValue::NumberTag;
+    cpu.gpr(GPRInfo::notCellMaskRegister) = JSValue::NotCellMask;
 #endif
 
     if (exit.isExceptionHandler())
@@ -1121,7 +1121,7 @@ void OSRExit::compileExit(CCallHelpers& jit, VM& vm, const OSRExit& exit, const
         case SpeculativeAdd:
             jit.sub32(recovery->src(), recovery->dest());
 #if USE(JSVALUE64)
-            jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest());
+            jit.or64(GPRInfo::numberTagRegister, recovery->dest());
 #endif
             break;
 
@@ -1130,20 +1130,20 @@ void OSRExit::compileExit(CCallHelpers& jit, VM& vm, const OSRExit& exit, const
             jit.rshift32(AssemblyHelpers::TrustedImm32(1), recovery->dest());
             jit.xor32(AssemblyHelpers::TrustedImm32(0x80000000), recovery->dest());
 #if USE(JSVALUE64)
-            jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest());
+            jit.or64(GPRInfo::numberTagRegister, recovery->dest());
 #endif
             break;
 
         case SpeculativeAddImmediate:
             jit.sub32(AssemblyHelpers::Imm32(recovery->immediate()), recovery->dest());
 #if USE(JSVALUE64)
-            jit.or64(GPRInfo::tagTypeNumberRegister, recovery->dest());
+            jit.or64(GPRInfo::numberTagRegister, recovery->dest());
 #endif
             break;
 
         case BooleanSpeculationCheck:
 #if USE(JSVALUE64)
-            jit.xor64(AssemblyHelpers::TrustedImm32(static_cast<int32_t>(ValueFalse)), recovery->dest());
+            jit.xor64(AssemblyHelpers::TrustedImm32(JSValue::ValueFalse), recovery->dest());
 #endif
             break;
 
@@ -1248,11 +1248,11 @@ void OSRExit::compileExit(CCallHelpers& jit, VM& vm, const OSRExit& exit, const
         if (MethodOfGettingAValueProfile profile = exit.m_valueProfile) {
 #if USE(JSVALUE64)
             if (exit.m_jsValueSource.isAddress()) {
-                // We can't be sure that we have a spare register. So use the tagTypeNumberRegister,
+                // We can't be sure that we have a spare register. So use the numberTagRegister,
                 // since we know how to restore it.
-                jit.load64(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), GPRInfo::tagTypeNumberRegister);
-                profile.emitReportValue(jit, JSValueRegs(GPRInfo::tagTypeNumberRegister));
-                jit.move(AssemblyHelpers::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister);
+                jit.load64(AssemblyHelpers::Address(exit.m_jsValueSource.asAddress()), GPRInfo::numberTagRegister);
+                profile.emitReportValue(jit, JSValueRegs(GPRInfo::numberTagRegister));
+                jit.move(AssemblyHelpers::TrustedImm64(JSValue::NumberTag), GPRInfo::numberTagRegister);
             } else
                 profile.emitReportValue(jit, JSValueRegs(exit.m_jsValueSource.gpr()));
 #else // not USE(JSVALUE64)
@@ -1519,7 +1519,7 @@ void OSRExit::compileExit(CCallHelpers& jit, VM& vm, const OSRExit& exit, const
 #if USE(JSVALUE64)
             jit.load64(scratch + index, GPRInfo::regT0);
             jit.zeroExtend32ToPtr(GPRInfo::regT0, GPRInfo::regT0);
-            jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
+            jit.or64(GPRInfo::numberTagRegister, GPRInfo::regT0);
             jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
 #else
             jit.load32(
index 37c53a8..51ba348 100644 (file)
@@ -670,7 +670,7 @@ void SpeculativeJIT::silentFill(const SilentRegisterSavePlan& plan)
         break;
     case Load32PayloadBoxInt:
         m_jit.load32(JITCompiler::payloadFor(plan.node()->virtualRegister()), plan.gpr());
-        m_jit.or64(GPRInfo::tagTypeNumberRegister, plan.gpr());
+        m_jit.or64(GPRInfo::numberTagRegister, plan.gpr());
         break;
     case Load32PayloadConvertToInt52:
         m_jit.load32(JITCompiler::payloadFor(plan.node()->virtualRegister()), plan.gpr());
@@ -1931,18 +1931,18 @@ void SpeculativeJIT::checkArgumentTypes()
 #if USE(JSVALUE64)
         switch (format) {
         case FlushedInt32: {
-            speculationCheck(BadType, valueSource, node, m_jit.branch64(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister));
+            speculationCheck(BadType, valueSource, node, m_jit.branch64(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::numberTagRegister));
             break;
         }
         case FlushedBoolean: {
             GPRTemporary temp(this);
             m_jit.load64(JITCompiler::addressFor(virtualRegister), temp.gpr());
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), temp.gpr());
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), temp.gpr());
             speculationCheck(BadType, valueSource, node, m_jit.branchTest64(MacroAssembler::NonZero, temp.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
             break;
         }
         case FlushedCell: {
-            speculationCheck(BadType, valueSource, node, m_jit.branchTest64(MacroAssembler::NonZero, JITCompiler::addressFor(virtualRegister), GPRInfo::tagMaskRegister));
+            speculationCheck(BadType, valueSource, node, m_jit.branchTest64(MacroAssembler::NonZero, JITCompiler::addressFor(virtualRegister), GPRInfo::notCellMaskRegister));
             break;
         }
         default:
@@ -2409,7 +2409,7 @@ void SpeculativeJIT::compileValueToInt32(Node* node)
                     JSValueRegs(gpr), node->child1(), ~SpecCellCheck, m_jit.branchIfCell(JSValueRegs(gpr)));
                 
                 // It's not a cell: so true turns into 1 and all else turns into 0.
-                m_jit.compare64(JITCompiler::Equal, gpr, TrustedImm32(ValueTrue), resultGpr);
+                m_jit.compare64(JITCompiler::Equal, gpr, TrustedImm32(JSValue::ValueTrue), resultGpr);
                 converted.append(m_jit.jump());
                 
                 isNumber.link(&m_jit);
@@ -2637,9 +2637,9 @@ void SpeculativeJIT::compileDoubleRep(Node* node)
             done.append(isNull);
 
             DFG_TYPE_CHECK(JSValueRegs(op1GPR), node->child1(), ~SpecCellCheck,
-                m_jit.branchTest64(JITCompiler::Zero, op1GPR, TrustedImm32(static_cast<int32_t>(TagBitBool))));
+                m_jit.branchTest64(JITCompiler::Zero, op1GPR, TrustedImm32(JSValue::BoolTag)));
 
-            JITCompiler::Jump isFalse = m_jit.branch64(JITCompiler::Equal, op1GPR, TrustedImm64(ValueFalse));
+            JITCompiler::Jump isFalse = m_jit.branch64(JITCompiler::Equal, op1GPR, TrustedImm64(JSValue::ValueFalse));
             static constexpr double one = 1;
             m_jit.loadDouble(TrustedImmPtr(&one), resultFPR);
             done.append(m_jit.jump());
@@ -3072,7 +3072,7 @@ bool SpeculativeJIT::getIntTypedArrayStoreOperand(
                     fpr, gpr, MacroAssembler::BranchIfTruncateSuccessful));
 
 #if USE(JSVALUE64)
-                m_jit.or64(GPRInfo::tagTypeNumberRegister, property);
+                m_jit.or64(GPRInfo::numberTagRegister, property);
                 boxDouble(fpr, gpr);
 #else
                 UNUSED_PARAM(property);
@@ -10485,7 +10485,7 @@ void SpeculativeJIT::speculateMisc(Edge edge, JSValueRegs regs)
 #if USE(JSVALUE64)
     DFG_TYPE_CHECK(
         regs, edge, SpecMisc,
-        m_jit.branch64(MacroAssembler::Above, regs.gpr(), MacroAssembler::TrustedImm64(TagBitTypeOther | TagBitBool | TagBitUndefined)));
+        m_jit.branch64(MacroAssembler::Above, regs.gpr(), MacroAssembler::TrustedImm64(JSValue::MiscTag)));
 #else
     IGNORE_WARNINGS_BEGIN("enum-compare")
     static_assert(JSValue::Int32Tag >= JSValue::UndefinedTag, "Int32Tag is included in >= JSValue::UndefinedTag range.");
index 2d322d4..3ee7ace 100644 (file)
@@ -538,7 +538,7 @@ public:
             // We need to box int32 and cell values ...
             // but on JSVALUE64 boxing a cell is a no-op!
             if (spillFormat == DataFormatInt32)
-                m_jit.or64(GPRInfo::tagTypeNumberRegister, reg);
+                m_jit.or64(GPRInfo::numberTagRegister, reg);
             
             // Spill the value, and record it as spilled in its boxed form.
             m_jit.store64(reg, JITCompiler::addressFor(spillMe));
index 3733843..68980c0 100644 (file)
@@ -101,7 +101,7 @@ GPRReg SpeculativeJIT::fillJSValue(Edge edge)
             switch (spillFormat) {
             case DataFormatInt32: {
                 m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
-                m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
+                m_jit.or64(GPRInfo::numberTagRegister, gpr);
                 spillFormat = DataFormatJSInt32;
                 break;
             }
@@ -122,11 +122,11 @@ GPRReg SpeculativeJIT::fillJSValue(Edge edge)
         // If not, we'll zero extend in place, so mark on the info that this is now type DataFormatInt32, not DataFormatJSInt32.
         if (m_gprs.isLocked(gpr)) {
             GPRReg result = allocate();
-            m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr, result);
+            m_jit.or64(GPRInfo::numberTagRegister, gpr, result);
             return result;
         }
         m_gprs.lock(gpr);
-        m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
+        m_jit.or64(GPRInfo::numberTagRegister, gpr);
         info.fillJSValue(*m_stream, gpr, DataFormatJSInt32);
         return gpr;
     }
@@ -257,13 +257,13 @@ void SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined(Edge operan
  
     if (!isKnownNotOther(operand.node())) {
         m_jit.move(argGPR, resultGPR);
-        m_jit.and64(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
-        m_jit.compare64(JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm32(ValueNull), resultGPR);
+        m_jit.and64(JITCompiler::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
+        m_jit.compare64(JITCompiler::Equal, resultGPR, JITCompiler::TrustedImm32(JSValue::ValueNull), resultGPR);
     }
 
     done.link(&m_jit);
  
-    m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+    m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
     jsValueResult(resultGPR, m_currentNode, DataFormatJSBoolean);
 }
 
@@ -319,8 +319,8 @@ void SpeculativeJIT::nonSpeculativePeepholeBranchNullOrUndefined(Edge operand, N
             std::swap(taken, notTaken);
         }
         m_jit.move(argGPR, resultGPR);
-        m_jit.and64(JITCompiler::TrustedImm32(~TagBitUndefined), resultGPR);
-        branch64(condition, resultGPR, JITCompiler::TrustedImm64(ValueNull), taken);
+        m_jit.and64(JITCompiler::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
+        branch64(condition, resultGPR, JITCompiler::TrustedImm64(JSValue::ValueNull), taken);
         jump(notTaken);
     }
 }
@@ -672,7 +672,7 @@ void SpeculativeJIT::emitCall(Node* node)
             if (!isDirect)
                 callee.use();
 
-            shuffleData.tagTypeNumber = GPRInfo::tagTypeNumberRegister;
+            shuffleData.numberTagRegister = GPRInfo::numberTagRegister;
             shuffleData.numLocals = m_jit.graph().frameRegisterCount();
             shuffleData.callee = ValueRecovery::inGPR(calleeGPR, DataFormatJS);
             shuffleData.args.resize(numAllocatedArgs);
@@ -1272,9 +1272,9 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(Edge edge)
 
         info.fillJSValue(*m_stream, gpr, DataFormatJS);
         if (type & ~SpecBoolean) {
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), gpr);
             speculationCheck(BadType, JSValueRegs(gpr), edge, m_jit.branchTest64(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), gpr);
         }
         info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
         return gpr;
@@ -1291,9 +1291,9 @@ GPRReg SpeculativeJIT::fillSpeculateBoolean(Edge edge)
         GPRReg gpr = info.gpr();
         m_gprs.lock(gpr);
         if (type & ~SpecBoolean) {
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), gpr);
             speculationCheck(BadType, JSValueRegs(gpr), edge, m_jit.branchTest64(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr);
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), gpr);
         }
         info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean);
         return gpr;
@@ -1331,7 +1331,7 @@ void SpeculativeJIT::compileObjectStrictEquality(Edge objectChild, Edge otherChi
     // At this point we know that we can perform a straight-forward equality comparison on pointer
     // values because we are doing strict equality.
     m_jit.compare64(MacroAssembler::Equal, op1GPR, op2GPR, resultGPR);
-    m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+    m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
     jsValueResult(resultGPR, m_currentNode, DataFormatJSBoolean);
 }
     
@@ -1413,18 +1413,18 @@ void SpeculativeJIT::compileObjectToObjectOrOtherEquality(Edge leftChild, Edge r
     // prove that it is either null or undefined.
     if (needsTypeCheck(rightChild, SpecCellCheck | SpecOther)) {
         m_jit.move(op2GPR, resultGPR);
-        m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+        m_jit.and64(MacroAssembler::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
         
         typeCheck(
             JSValueRegs(op2GPR), rightChild, SpecCellCheck | SpecOther,
             m_jit.branch64(
                 MacroAssembler::NotEqual, resultGPR,
-                MacroAssembler::TrustedImm64(ValueNull)));
+                MacroAssembler::TrustedImm64(JSValue::ValueNull)));
     }
     m_jit.move(TrustedImm32(0), result.gpr());
 
     done.link(&m_jit);
-    m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+    m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
     jsValueResult(resultGPR, m_currentNode, DataFormatJSBoolean);
 }
 
@@ -1489,12 +1489,12 @@ void SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality(Edge leftChild
         
         rightNotCell.link(&m_jit);
         m_jit.move(op2GPR, resultGPR);
-        m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+        m_jit.and64(MacroAssembler::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
         
         typeCheck(
             JSValueRegs(op2GPR), rightChild, SpecCellCheck | SpecOther, m_jit.branch64(
                 MacroAssembler::NotEqual, resultGPR,
-                MacroAssembler::TrustedImm64(ValueNull)));
+                MacroAssembler::TrustedImm64(JSValue::ValueNull)));
     }
     
     jump(notTaken);
@@ -1527,7 +1527,7 @@ void SpeculativeJIT::compileInt52Compare(Node* node, MacroAssembler::RelationalC
     m_jit.compare64(condition, op1.gpr(), op2.gpr(), result.gpr());
     
     // If we add a DataFormatBool, we should use it here.
-    m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+    m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
     jsValueResult(result.gpr(), m_currentNode, DataFormatJSBoolean);
 }
 
@@ -1612,21 +1612,21 @@ void SpeculativeJIT::compileObjectOrOtherLogicalNot(Edge nodeUse)
 
         isNotMasqueradesAsUndefined.link(&m_jit);
     }
-    m_jit.move(TrustedImm32(ValueFalse), resultGPR);
+    m_jit.move(TrustedImm32(JSValue::ValueFalse), resultGPR);
     MacroAssembler::Jump done = m_jit.jump();
     
     notCell.link(&m_jit);
 
     if (needsTypeCheck(nodeUse, SpecCellCheck | SpecOther)) {
         m_jit.move(valueGPR, resultGPR);
-        m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR);
+        m_jit.and64(MacroAssembler::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
         typeCheck(
             JSValueRegs(valueGPR), nodeUse, SpecCellCheck | SpecOther, m_jit.branch64(
                 MacroAssembler::NotEqual, 
                 resultGPR, 
-                MacroAssembler::TrustedImm64(ValueNull)));
+                MacroAssembler::TrustedImm64(JSValue::ValueNull)));
     }
-    m_jit.move(TrustedImm32(ValueTrue), resultGPR);
+    m_jit.move(TrustedImm32(JSValue::ValueTrue), resultGPR);
     
     done.link(&m_jit);
     
@@ -1645,7 +1645,7 @@ void SpeculativeJIT::compileLogicalNot(Node* node)
         SpeculateInt32Operand value(this, node->child1());
         GPRTemporary result(this, Reuse, value);
         m_jit.compare32(MacroAssembler::Equal, value.gpr(), MacroAssembler::TrustedImm32(0), result.gpr());
-        m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
         return;
     }
@@ -1654,7 +1654,7 @@ void SpeculativeJIT::compileLogicalNot(Node* node)
         SpeculateDoubleOperand value(this, node->child1());
         FPRTemporary scratch(this);
         GPRTemporary result(this);
-        m_jit.move(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.move(TrustedImm32(JSValue::ValueFalse), result.gpr());
         MacroAssembler::Jump nonZero = m_jit.branchDoubleNonZero(value.fpr(), scratch.fpr());
         m_jit.xor32(TrustedImm32(true), result.gpr());
         nonZero.link(&m_jit);
@@ -1679,11 +1679,11 @@ void SpeculativeJIT::compileLogicalNot(Node* node)
         GPRTemporary result(this); // FIXME: We could reuse, but on speculation fail would need recovery to restore tag (akin to add).
         
         m_jit.move(value.gpr(), result.gpr());
-        m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr());
+        m_jit.xor64(TrustedImm32(JSValue::ValueFalse), result.gpr());
         typeCheck(
             JSValueRegs(value.gpr()), node->child1(), SpecBoolean, m_jit.branchTest64(
                 JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
-        m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueTrue)), result.gpr());
+        m_jit.xor64(TrustedImm32(JSValue::ValueTrue), result.gpr());
         
         // If we add a DataFormatBool, we should use it here.
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
@@ -1710,7 +1710,7 @@ void SpeculativeJIT::compileLogicalNot(Node* node)
         }
         bool negateResult = true;
         m_jit.emitConvertValueToBoolean(vm(), JSValueRegs(arg1GPR), resultGPR, scratchGPR, valueFPR.fpr(), tempFPR.fpr(), shouldCheckMasqueradesAsUndefined, globalObject, negateResult);
-        m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
         jsValueResult(resultGPR, node, DataFormatJSBoolean);
         return;
     }
@@ -1769,10 +1769,10 @@ void SpeculativeJIT::emitObjectOrOtherBranch(Edge nodeUse, BasicBlock* taken, Ba
     
     if (needsTypeCheck(nodeUse, SpecCellCheck | SpecOther)) {
         m_jit.move(valueGPR, scratchGPR);
-        m_jit.and64(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR);
+        m_jit.and64(MacroAssembler::TrustedImm32(~JSValue::UndefinedTag), scratchGPR);
         typeCheck(
             JSValueRegs(valueGPR), nodeUse, SpecCellCheck | SpecOther, m_jit.branch64(
-                MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImm64(ValueNull)));
+                MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImm64(JSValue::ValueNull)));
     }
     jump(notTaken);
     
@@ -1871,7 +1871,7 @@ void SpeculativeJIT::emitBranch(Node* node)
             
             if (node->child1()->prediction() & SpecInt32Only) {
                 branch64(MacroAssembler::Equal, valueGPR, MacroAssembler::TrustedImm64(JSValue::encode(jsNumber(0))), notTaken);
-                branch64(MacroAssembler::AboveOrEqual, valueGPR, GPRInfo::tagTypeNumberRegister, taken);
+                branch64(MacroAssembler::AboveOrEqual, valueGPR, GPRInfo::numberTagRegister, taken);
             }
     
             if (node->child1()->prediction() & SpecBoolean) {
@@ -2391,7 +2391,7 @@ void SpeculativeJIT::compile(Node* node)
             use(m_graph.varArgChild(node, 0));
             index.use();
 
-            m_jit.move(MacroAssembler::TrustedImm64(ValueUndefined), resultGPR);
+            m_jit.move(MacroAssembler::TrustedImm64(JSValue::ValueUndefined), resultGPR);
             jsValueResult(resultGPR, node, UseChildrenCalledExplicitly);
             break;
         }
@@ -3101,12 +3101,12 @@ void SpeculativeJIT::compile(Node* node)
         GPRTemporary result(this);
         GPRReg operandGPR = operand.gpr();
         GPRReg resultGPR = result.gpr();
-        m_jit.move(TrustedImm32(ValueTrue), resultGPR);
+        m_jit.move(TrustedImm32(JSValue::ValueTrue), resultGPR);
         JITCompiler::JumpList done;
         done.append(m_jit.branch32(JITCompiler::Equal, operandGPR, TrustedImm32(4)));
         done.append(m_jit.branch32(JITCompiler::Equal, operandGPR, TrustedImm32(1)));
         done.append(m_jit.branch32(JITCompiler::Equal, operandGPR, TrustedImm32(2)));
-        m_jit.move(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.move(TrustedImm32(JSValue::ValueFalse), resultGPR);
         done.link(&m_jit);
         jsValueResult(resultGPR, node);
         break;
@@ -3321,7 +3321,7 @@ void SpeculativeJIT::compile(Node* node)
             GPRTemporary result(this); // FIXME: We could reuse, but on speculation fail would need recovery to restore tag (akin to add).
             
             m_jit.move(value.gpr(), result.gpr());
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr());
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), result.gpr());
             DFG_TYPE_CHECK(
                 JSValueRegs(value.gpr()), node->child1(), SpecBoolean, m_jit.branchTest64(
                     JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1))));
@@ -3342,13 +3342,13 @@ void SpeculativeJIT::compile(Node* node)
             }
             
             m_jit.move(value.gpr(), result.gpr());
-            m_jit.xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr());
+            m_jit.xor64(TrustedImm32(JSValue::ValueFalse), result.gpr());
             JITCompiler::Jump isBoolean = m_jit.branchTest64(
                 JITCompiler::Zero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1)));
             m_jit.move(value.gpr(), result.gpr());
             JITCompiler::Jump done = m_jit.jump();
             isBoolean.link(&m_jit);
-            m_jit.or64(GPRInfo::tagTypeNumberRegister, result.gpr());
+            m_jit.or64(GPRInfo::numberTagRegister, result.gpr());
             done.link(&m_jit);
             
             jsValueResult(result.gpr(), node);
@@ -3912,7 +3912,7 @@ void SpeculativeJIT::compile(Node* node)
         GPRTemporary result(this, Reuse, value);
 
         m_jit.comparePtr(JITCompiler::Equal, value.gpr(), TrustedImm32(JSValue::encode(JSValue())), result.gpr());
-        m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
 
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
         break;
@@ -3927,7 +3927,7 @@ void SpeculativeJIT::compile(Node* node)
 
         JITCompiler::Jump isCell = m_jit.branchIfCell(value.jsValueRegs());
 
-        m_jit.compare64(JITCompiler::Equal, value.gpr(), TrustedImm32(ValueUndefined), result.gpr());
+        m_jit.compare64(JITCompiler::Equal, value.gpr(), TrustedImm32(JSValue::ValueUndefined), result.gpr());
         JITCompiler::Jump done = m_jit.jump();
         
         isCell.link(&m_jit);
@@ -3954,7 +3954,7 @@ void SpeculativeJIT::compile(Node* node)
 
         notMasqueradesAsUndefined.link(&m_jit);
         done.link(&m_jit);
-        m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
         break;
     }
@@ -3967,8 +3967,8 @@ void SpeculativeJIT::compile(Node* node)
         GPRReg resultGPR = result.gpr();
 
         m_jit.move(valueGPR, resultGPR);
-        m_jit.and64(CCallHelpers::TrustedImm32(~TagBitUndefined), resultGPR);
-        m_jit.compare64(CCallHelpers::Equal, resultGPR, CCallHelpers::TrustedImm32(ValueNull), resultGPR);
+        m_jit.and64(CCallHelpers::TrustedImm32(~JSValue::UndefinedTag), resultGPR);
+        m_jit.compare64(CCallHelpers::Equal, resultGPR, CCallHelpers::TrustedImm32(JSValue::ValueNull), resultGPR);
 
         unblessedBooleanResult(resultGPR, node);
         break;
@@ -3979,9 +3979,9 @@ void SpeculativeJIT::compile(Node* node)
         GPRTemporary result(this, Reuse, value);
         
         m_jit.move(value.gpr(), result.gpr());
-        m_jit.xor64(JITCompiler::TrustedImm32(ValueFalse), result.gpr());
+        m_jit.xor64(JITCompiler::TrustedImm32(JSValue::ValueFalse), result.gpr());
         m_jit.test64(JITCompiler::Zero, result.gpr(), JITCompiler::TrustedImm32(static_cast<int32_t>(~1)), result.gpr());
-        m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
         break;
     }
@@ -3990,8 +3990,8 @@ void SpeculativeJIT::compile(Node* node)
         JSValueOperand value(this, node->child1());
         GPRTemporary result(this, Reuse, value);
         
-        m_jit.test64(JITCompiler::NonZero, value.gpr(), GPRInfo::tagTypeNumberRegister, result.gpr());
-        m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
+        m_jit.test64(JITCompiler::NonZero, value.gpr(), GPRInfo::numberTagRegister, result.gpr());
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), result.gpr());
         jsValueResult(result.gpr(), node, DataFormatJSBoolean);
         break;
     }
@@ -4019,21 +4019,21 @@ void SpeculativeJIT::compile(Node* node)
         m_jit.urshift64(TrustedImm32(52), resultGPR);
         m_jit.and32(TrustedImm32(0x7ff), resultGPR);
         auto notNanNorInfinity = m_jit.branch32(JITCompiler::NotEqual, TrustedImm32(0x7ff), resultGPR);
-        m_jit.move(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.move(TrustedImm32(JSValue::ValueFalse), resultGPR);
         done.append(m_jit.jump());
 
         notNanNorInfinity.link(&m_jit);
         m_jit.roundTowardZeroDouble(tempFPR1, tempFPR2);
         m_jit.compareDouble(JITCompiler::DoubleEqual, tempFPR1, tempFPR2, resultGPR);
-        m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
         done.append(m_jit.jump());
 
         isInt32.link(&m_jit);
-        m_jit.move(TrustedImm32(ValueTrue), resultGPR);
+        m_jit.move(TrustedImm32(JSValue::ValueTrue), resultGPR);
         done.append(m_jit.jump());
 
         notNumber.link(&m_jit);
-        m_jit.move(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.move(TrustedImm32(JSValue::ValueFalse), resultGPR);
 
         done.link(&m_jit);
         jsValueResult(resultGPR, node, DataFormatJSBoolean);
@@ -4560,7 +4560,7 @@ void SpeculativeJIT::compile(Node* node)
         m_jit.exceptionCheck();
 
         done.link(&m_jit);
-        m_jit.or32(TrustedImm32(ValueFalse), resultGPR);
+        m_jit.or32(TrustedImm32(JSValue::ValueFalse), resultGPR);
         jsValueResult(resultGPR, node, DataFormatJSBoolean);
         break;
     }
@@ -5201,17 +5201,17 @@ void SpeculativeJIT::compile(Node* node)
 
 void SpeculativeJIT::moveTrueTo(GPRReg gpr)
 {
-    m_jit.move(TrustedImm32(ValueTrue), gpr);
+    m_jit.move(TrustedImm32(JSValue::ValueTrue), gpr);
 }
 
 void SpeculativeJIT::moveFalseTo(GPRReg gpr)
 {
-    m_jit.move(TrustedImm32(ValueFalse), gpr);
+    m_jit.move(TrustedImm32(JSValue::ValueFalse), gpr);
 }
 
 void SpeculativeJIT::blessBoolean(GPRReg gpr)
 {
-    m_jit.or32(TrustedImm32(ValueFalse), gpr);
+    m_jit.or32(TrustedImm32(JSValue::ValueFalse), gpr);
 }
 
 void SpeculativeJIT::convertAnyInt(Edge valueEdge, GPRReg resultGPR)
index 8b9b58a..b259893 100644 (file)
@@ -260,13 +260,13 @@ public:
         auto preOrder = m_graph.blocksInPreOrder();
 
         m_callFrame = m_out.framePointer();
-        m_tagTypeNumber = m_out.constInt64(TagTypeNumber);
-        m_tagMask = m_out.constInt64(TagMask);
+        m_numberTag = m_out.constInt64(JSValue::NumberTag);
+        m_notCellMask = m_out.constInt64(JSValue::NotCellMask);
 
         // Make sure that B3 knows that we really care about the mask registers. This forces the
         // constants to be materialized in registers.
-        m_proc.addFastConstant(m_tagTypeNumber->key());
-        m_proc.addFastConstant(m_tagMask->key());
+        m_proc.addFastConstant(m_numberTag->key());
+        m_proc.addFastConstant(m_notCellMask->key());
         
         // We don't want the CodeBlock to have a weak pointer to itself because
         // that would cause it to always get collected.
@@ -1738,7 +1738,7 @@ private:
                 LBasicBlock convertBooleanFalseCase = m_out.newBlock();
 
                 m_out.appendTo(nonDoubleCase, undefinedCase);
-                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(ValueUndefined));
+                LValue valueIsUndefined = m_out.equal(value, m_out.constInt64(JSValue::ValueUndefined));
                 m_out.branch(valueIsUndefined, unsure(undefinedCase), unsure(testNullCase));
 
                 m_out.appendTo(undefinedCase, testNullCase);
@@ -1746,7 +1746,7 @@ private:
                 m_out.jump(continuation);
 
                 m_out.appendTo(testNullCase, nullCase);
-                LValue valueIsNull = m_out.equal(value, m_out.constInt64(ValueNull));
+                LValue valueIsNull = m_out.equal(value, m_out.constInt64(JSValue::ValueNull));
                 m_out.branch(valueIsNull, unsure(nullCase), unsure(testBooleanTrueCase));
 
                 m_out.appendTo(nullCase, testBooleanTrueCase);
@@ -1754,7 +1754,7 @@ private:
                 m_out.jump(continuation);
 
                 m_out.appendTo(testBooleanTrueCase, convertBooleanTrueCase);
-                LValue valueIsBooleanTrue = m_out.equal(value, m_out.constInt64(ValueTrue));
+                LValue valueIsBooleanTrue = m_out.equal(value, m_out.constInt64(JSValue::ValueTrue));
                 m_out.branch(valueIsBooleanTrue, unsure(convertBooleanTrueCase), unsure(convertBooleanFalseCase));
 
                 m_out.appendTo(convertBooleanTrueCase, convertBooleanFalseCase);
@@ -1763,7 +1763,7 @@ private:
 
                 m_out.appendTo(convertBooleanFalseCase, continuation);
 
-                LValue valueIsNotBooleanFalse = m_out.notEqual(value, m_out.constInt64(ValueFalse));
+                LValue valueIsNotBooleanFalse = m_out.notEqual(value, m_out.constInt64(JSValue::ValueFalse));
                 FTL_TYPE_CHECK(jsValueValue(value), m_node->child1(), ~SpecCellCheck, valueIsNotBooleanFalse);
                 ValueFromBlock convertedFalse = m_out.anchor(m_out.constDouble(0));
                 m_out.jump(continuation);
@@ -1913,7 +1913,7 @@ private:
             
             LBasicBlock lastNext = m_out.appendTo(booleanCase, continuation);
             ValueFromBlock booleanResult = m_out.anchor(m_out.bitOr(
-                m_out.zeroExt(unboxBoolean(value), Int64), m_tagTypeNumber));
+                m_out.zeroExt(unboxBoolean(value), Int64), m_numberTag));
             m_out.jump(continuation);
             
             m_out.appendTo(continuation, lastNext);
@@ -2151,8 +2151,8 @@ private:
 
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(operand);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint);
         patchpoint->numGPScratchRegisters = 1;
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
@@ -2242,8 +2242,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(left);
         patchpoint->appendSomeRegister(right);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         patchpoint->numGPScratchRegisters = 1;
@@ -3821,8 +3821,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Void);
         patchpoint->appendSomeRegister(base);
         patchpoint->appendSomeRegister(value);
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
 
         // FIXME: If this is a PutByIdFlush, we might want to late-clobber volatile registers.
@@ -4256,7 +4256,7 @@ private:
             LValue index = lowInt32(m_graph.varArgChild(m_node, 1));
 
             speculate(OutOfBounds, noValue(), m_node, m_out.lessThan(index, m_out.int32Zero));
-            setJSValue(m_out.constInt64(ValueUndefined));
+            setJSValue(m_out.constInt64(JSValue::ValueUndefined));
             return;
         }
             
@@ -5292,7 +5292,7 @@ private:
             ValueFromBlock foundResult = m_out.anchor(index);
             switch (searchElementEdge.useKind()) {
             case Int32Use: {
-                // Empty value is ignored because of TagTypeNumber.
+                // Empty value is ignored because of JSValue::NumberTag.
                 LValue value = m_out.load64(m_out.baseIndex(m_heaps.indexedInt32Properties, storage, index));
                 m_out.branch(m_out.equal(value, searchElement), unsure(continuation), unsure(loopNext));
                 break;
@@ -7682,7 +7682,7 @@ private:
         m_out.jump(continuation);
 
         m_out.appendTo(outOfBounds, continuation);
-        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(ValueUndefined));
+        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(JSValue::ValueUndefined));
         m_out.jump(continuation);
 
         m_out.appendTo(continuation, lastNext);
@@ -8123,8 +8123,8 @@ private:
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
         patchpoint->clobberLate(RegisterSet::volatileRegistersForJSCall());
         patchpoint->resultConstraints = { ValueRep::reg(GPRInfo::returnValueGPR) };
@@ -8239,8 +8239,8 @@ private:
         
         if (isTail) {
             // The shuffler needs tags.
-            patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-            patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+            patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+            patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
         }
         
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
@@ -8425,8 +8425,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Void);
         patchpoint->appendVector(arguments);
 
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
 
         // Prevent any of the arguments from using the scratch register.
         patchpoint->clobberEarly(RegisterSet::macroScratchRegisters());
@@ -8560,8 +8560,8 @@ private:
         patchpoint->append(thisArg, ValueRep::WarmAny);
         patchpoint->append(argumentCountIncludingThis, ValueRep::WarmAny);
         patchpoint->appendVectorWithRep(patchpointArguments, ValueRep::WarmAny);
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
 
         RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint);
 
@@ -8864,8 +8864,8 @@ private:
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
 
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
         patchpoint->clobberLate(RegisterSet::volatileRegistersForJSCall());
@@ -9122,8 +9122,8 @@ private:
         
         RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint);
         
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
         patchpoint->clobberLate(RegisterSet::volatileRegistersForJSCall());
         patchpoint->resultConstraints = { ValueRep::reg(GPRInfo::returnValueGPR) };
@@ -10646,8 +10646,8 @@ private:
 
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(base);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
 
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
 
@@ -10887,8 +10887,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(value);
         patchpoint->appendSomeRegister(prototype);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         patchpoint->numGPScratchRegisters = 2;
         patchpoint->resultConstraints = { ValueRep::SomeEarlyRegister };
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
@@ -11229,7 +11229,7 @@ private:
         m_out.jump(continuation);
 
         m_out.appendTo(outOfBounds, continuation);
-        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(ValueNull));
+        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(JSValue::ValueNull));
         m_out.jump(continuation);
         
         m_out.appendTo(continuation, lastNext);
@@ -11255,7 +11255,7 @@ private:
         m_out.jump(continuation);
 
         m_out.appendTo(outOfBounds, continuation);
-        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(ValueNull));
+        ValueFromBlock outOfBoundsResult = m_out.anchor(m_out.constInt64(JSValue::ValueNull));
         m_out.jump(continuation);
         
         m_out.appendTo(continuation, lastNext);
@@ -12285,8 +12285,8 @@ private:
 
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(base);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
 
         // FIXME: If this is a GetByIdFlush/GetByIdDirectFlush, we might get some performance boost if we claim that it
         // clobbers volatile registers late. It's not necessary for correctness, though, since the
@@ -12358,8 +12358,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(base);
         patchpoint->appendSomeRegister(thisValue);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
 
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
 
@@ -12740,8 +12740,8 @@ private:
         RefPtr<Snippet> domJIT = classInfo->checkSubClassSnippet();
         PatchpointValue* patchpoint = m_out.patchpoint(Void);
         patchpoint->appendSomeRegister(cell);
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
 
         NodeOrigin origin = m_origin;
         unsigned osrExitArgumentOffset = patchpoint->numChildren();
@@ -12865,8 +12865,8 @@ private:
         patchpoint->appendSomeRegister(base);
         if (domJIT->requireGlobalObject)
             patchpoint->appendSomeRegister(globalObject);
-        patchpoint->append(m_tagMask, ValueRep::reg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::reg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::reg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::reg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle = preparePatchpointForExceptions(patchpoint);
         patchpoint->clobber(RegisterSet::macroScratchRegisters());
         patchpoint->numGPScratchRegisters = domJIT->numGPScratchRegisters;
@@ -13468,8 +13468,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(left);
         patchpoint->appendSomeRegister(right);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         patchpoint->numGPScratchRegisters = 1;
@@ -13534,8 +13534,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(left);
         patchpoint->appendSomeRegister(right);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         patchpoint->numGPScratchRegisters = 1;
@@ -13589,8 +13589,8 @@ private:
         PatchpointValue* patchpoint = m_out.patchpoint(Int64);
         patchpoint->appendSomeRegister(left);
         patchpoint->appendSomeRegister(right);
-        patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister));
-        patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister));
+        patchpoint->append(m_notCellMask, ValueRep::lateReg(GPRInfo::notCellMaskRegister));
+        patchpoint->append(m_numberTag, ValueRep::lateReg(GPRInfo::numberTagRegister));
         RefPtr<PatchpointExceptionHandle> exceptionHandle =
             preparePatchpointForExceptions(patchpoint);
         patchpoint->numGPScratchRegisters = 1;
@@ -14322,10 +14322,10 @@ private:
         LValue primitiveResult;
         switch (primitiveMode) {
         case EqualNull:
-            primitiveResult = m_out.equal(value, m_out.constInt64(ValueNull));
+            primitiveResult = m_out.equal(value, m_out.constInt64(JSValue::ValueNull));
             break;
         case EqualUndefined:
-            primitiveResult = m_out.equal(value, m_out.constInt64(ValueUndefined));
+            primitiveResult = m_out.equal(value, m_out.constInt64(JSValue::ValueUndefined));
             break;
         case EqualNullOrUndefined:
             primitiveResult = isOther(value, provenType(edge));
@@ -14947,7 +14947,7 @@ private:
         m_out.appendTo(notNumberCase, notNullCase);
         LValue isNull;
         if (provenType(child) & SpecOther)
-            isNull = m_out.equal(value, m_out.constInt64(ValueNull));
+            isNull = m_out.equal(value, m_out.constInt64(JSValue::ValueNull));
         else
             isNull = m_out.booleanFalse;
         m_out.branch(isNull, unsure(reallyObjectCase), unsure(notNullCase));
@@ -15807,13 +15807,13 @@ private:
     {
         if (LValue proven = isProvenValue(type, SpecInt32Only))
             return proven;
-        return m_out.aboveOrEqual(jsValue, m_tagTypeNumber);
+        return m_out.aboveOrEqual(jsValue, m_numberTag);
     }
     LValue isNotInt32(LValue jsValue, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, ~SpecInt32Only))
             return proven;
-        return m_out.below(jsValue, m_tagTypeNumber);
+        return m_out.below(jsValue, m_numberTag);
     }
     LValue unboxInt32(LValue jsValue)
     {
@@ -15821,32 +15821,32 @@ private:
     }
     LValue boxInt32(LValue value)
     {
-        return m_out.add(m_out.zeroExt(value, Int64), m_tagTypeNumber);
+        return m_out.add(m_out.zeroExt(value, Int64), m_numberTag);
     }
     
     LValue isCellOrMisc(LValue jsValue, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, SpecCellCheck | SpecMisc))
             return proven;
-        return m_out.testIsZero64(jsValue, m_tagTypeNumber);
+        return m_out.testIsZero64(jsValue, m_numberTag);
     }
     LValue isNotCellOrMisc(LValue jsValue, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, ~(SpecCellCheck | SpecMisc)))
             return proven;
-        return m_out.testNonZero64(jsValue, m_tagTypeNumber);
+        return m_out.testNonZero64(jsValue, m_numberTag);
     }
 
     LValue unboxDouble(LValue jsValue, LValue* unboxedAsInt = nullptr)
     {
-        LValue asInt = m_out.add(jsValue, m_tagTypeNumber);
+        LValue asInt = m_out.add(jsValue, m_numberTag);
         if (unboxedAsInt)
             *unboxedAsInt = asInt;
         return m_out.bitCast(asInt, Double);
     }
     LValue boxDouble(LValue doubleValue)
     {
-        return m_out.sub(m_out.bitCast(doubleValue, Int64), m_tagTypeNumber);
+        return m_out.sub(m_out.bitCast(doubleValue, Int64), m_numberTag);
     }
     
     LValue jsValueToStrictInt52(Edge edge, LValue boxedValue)
@@ -15938,21 +15938,21 @@ private:
     {
         if (LValue proven = isProvenValue(type, ~SpecCellCheck))
             return proven;
-        return m_out.testNonZero64(jsValue, m_tagMask);
+        return m_out.testNonZero64(jsValue, m_notCellMask);
     }
     
     LValue isCell(LValue jsValue, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, SpecCellCheck))
             return proven;
-        return m_out.testIsZero64(jsValue, m_tagMask);
+        return m_out.testIsZero64(jsValue, m_notCellMask);
     }
     
     LValue isNotMisc(LValue value, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, ~SpecMisc))
             return proven;
-        return m_out.above(value, m_out.constInt64(TagBitTypeOther | TagBitBool | TagBitUndefined));
+        return m_out.above(value, m_out.constInt64(JSValue::MiscTag));
     }
     
     LValue isMisc(LValue value, SpeculatedType type = SpecFullTop)
@@ -15967,7 +15967,7 @@ private:
         if (LValue proven = isProvenValue(type, ~SpecBoolean))
             return proven;
         return m_out.testNonZero64(
-            m_out.bitXor(jsValue, m_out.constInt64(ValueFalse)),
+            m_out.bitXor(jsValue, m_out.constInt64(JSValue::ValueFalse)),
             m_out.constInt64(~1));
     }
     LValue isBoolean(LValue jsValue, SpeculatedType type = SpecFullTop)
@@ -15985,7 +15985,7 @@ private:
     LValue boxBoolean(LValue value)
     {
         return m_out.select(
-            value, m_out.constInt64(ValueTrue), m_out.constInt64(ValueFalse));
+            value, m_out.constInt64(JSValue::ValueTrue), m_out.constInt64(JSValue::ValueFalse));
     }
     
     LValue isNotOther(LValue value, SpeculatedType type = SpecFullTop)
@@ -15993,16 +15993,16 @@ private:
         if (LValue proven = isProvenValue(type, ~SpecOther))
             return proven;
         return m_out.notEqual(
-            m_out.bitAnd(value, m_out.constInt64(~TagBitUndefined)),
-            m_out.constInt64(ValueNull));
+            m_out.bitAnd(value, m_out.constInt64(~JSValue::UndefinedTag)),
+            m_out.constInt64(JSValue::ValueNull));
     }
     LValue isOther(LValue value, SpeculatedType type = SpecFullTop)
     {
         if (LValue proven = isProvenValue(type, SpecOther))
             return proven;
         return m_out.equal(
-            m_out.bitAnd(value, m_out.constInt64(~TagBitUndefined)),
-            m_out.constInt64(ValueNull));
+            m_out.bitAnd(value, m_out.constInt64(~JSValue::UndefinedTag)),
+            m_out.constInt64(JSValue::ValueNull));
     }
     
     LValue isProvenValue(SpeculatedType provenType, SpeculatedType wantedType)
@@ -17722,8 +17722,8 @@ private:
     
     LValue m_callFrame;
     LValue m_captured;
-    LValue m_tagTypeNumber;
-    LValue m_tagMask;
+    LValue m_numberTag;
+    LValue m_notCellMask;
     
     HashMap<Node*, LoweredNodeValue> m_int32Values;
     HashMap<Node*, LoweredNodeValue> m_strictInt52Values;
index ceb9f0a..cf205cd 100644 (file)
@@ -52,7 +52,7 @@ static void reboxAccordingToFormat(
     switch (format) {
     case DataFormatInt32: {
         jit.zeroExtend32ToPtr(value, value);
-        jit.or64(GPRInfo::tagTypeNumberRegister, value);
+        jit.or64(GPRInfo::numberTagRegister, value);
         break;
     }
 
@@ -73,7 +73,7 @@ static void reboxAccordingToFormat(
 
     case DataFormatBoolean: {
         jit.zeroExtend32ToPtr(value, value);
-        jit.or32(MacroAssembler::TrustedImm32(ValueFalse), value);
+        jit.or32(MacroAssembler::TrustedImm32(JSValue::ValueFalse), value);
         break;
     }
 
@@ -237,8 +237,8 @@ static void compileStub(
     
     // Get the call frame and tag thingies.
     // Restore the exiting function's callFrame value into a regT4
-    jit.move(MacroAssembler::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister);
-    jit.move(MacroAssembler::TrustedImm64(TagMask), GPRInfo::tagMaskRegister);
+    jit.move(MacroAssembler::TrustedImm64(JSValue::NumberTag), GPRInfo::numberTagRegister);
+    jit.move(MacroAssembler::TrustedImm64(JSValue::NotCellMask), GPRInfo::notCellMaskRegister);
     
     // Do some value profiling.
     if (exit.m_descriptor->m_profileDataFormat != DataFormatNone) {
@@ -451,11 +451,11 @@ static void compileStub(
     }
 
     if (exit.isExceptionHandler()) {
-        RegisterAtOffset* vmCalleeSave = vmCalleeSaves->find(GPRInfo::tagTypeNumberRegister);
-        jit.store64(GPRInfo::tagTypeNumberRegister, MacroAssembler::Address(GPRInfo::regT1, vmCalleeSave->offset()));
+        RegisterAtOffset* vmCalleeSave = vmCalleeSaves->find(GPRInfo::numberTagRegister);
+        jit.store64(GPRInfo::numberTagRegister, MacroAssembler::Address(GPRInfo::regT1, vmCalleeSave->offset()));
 
-        vmCalleeSave = vmCalleeSaves->find(GPRInfo::tagMaskRegister);
-        jit.store64(GPRInfo::tagMaskRegister, MacroAssembler::Address(GPRInfo::regT1, vmCalleeSave->offset()));
+        vmCalleeSave = vmCalleeSaves->find(GPRInfo::notCellMaskRegister);
+        jit.store64(GPRInfo::notCellMaskRegister, MacroAssembler::Address(GPRInfo::regT1, vmCalleeSave->offset()));
     }
 
     size_t baselineVirtualRegistersForCalleeSaves = baselineCodeBlock->calleeSaveSpaceAsVirtualRegisters();
index 85c3ed8..18bb7ef 100644 (file)
@@ -51,7 +51,7 @@ public:
 #if ENABLE(WEBASSEMBLY)
     static void* boxWasm(Wasm::Callee* callee)
     {
-        CalleeBits result(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(callee) | TagBitsWasm));
+        CalleeBits result(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(callee) | JSValue::WasmTag));
         ASSERT(result.isWasm());
         return result.rawPtr();
     }
@@ -60,7 +60,7 @@ public:
     bool isWasm() const
     {
 #if ENABLE(WEBASSEMBLY)
-        return (reinterpret_cast<uintptr_t>(m_ptr) & TagWasmMask) == TagBitsWasm;
+        return (reinterpret_cast<uintptr_t>(m_ptr) & JSValue::WasmMask) == JSValue::WasmTag;
 #else
         return false;
 #endif
@@ -77,7 +77,7 @@ public:
     Wasm::Callee* asWasmCallee() const
     {
         ASSERT(isWasm());
-        return reinterpret_cast<Wasm::Callee*>(reinterpret_cast<uintptr_t>(m_ptr) & ~TagBitsWasm);
+        return reinterpret_cast<Wasm::Callee*>(reinterpret_cast<uintptr_t>(m_ptr) & ~JSValue::WasmTag);
     }
 #endif
 
index 3d17601..3a829c1 100644 (file)
@@ -115,22 +115,22 @@ void AssemblyHelpers::jitAssertIsInt32(GPRReg gpr)
 
 void AssemblyHelpers::jitAssertIsJSInt32(GPRReg gpr)
 {
-    Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
+    Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::numberTagRegister);
     abortWithReason(AHIsNotJSInt32);
     checkJSInt32.link(this);
 }
 
 void AssemblyHelpers::jitAssertIsJSNumber(GPRReg gpr)
 {
-    Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
+    Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::numberTagRegister);
     abortWithReason(AHIsNotJSNumber);
     checkJSNumber.link(this);
 }
 
 void AssemblyHelpers::jitAssertIsJSDouble(GPRReg gpr)
 {
-    Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
-    Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::tagTypeNumberRegister);
+    Jump checkJSInt32 = branch64(AboveOrEqual, gpr, GPRInfo::numberTagRegister);
+    Jump checkJSNumber = branchTest64(MacroAssembler::NonZero, gpr, GPRInfo::numberTagRegister);
     checkJSInt32.link(this);
     abortWithReason(AHIsNotJSDouble);
     checkJSNumber.link(this);
@@ -138,20 +138,20 @@ void AssemblyHelpers::jitAssertIsJSDouble(GPRReg gpr)
 
 void AssemblyHelpers::jitAssertIsCell(GPRReg gpr)
 {
-    Jump checkCell = branchTest64(MacroAssembler::Zero, gpr, GPRInfo::tagMaskRegister);
+    Jump checkCell = branchTest64(MacroAssembler::Zero, gpr, GPRInfo::notCellMaskRegister);
     abortWithReason(AHIsNotCell);
     checkCell.link(this);
 }
 
 void AssemblyHelpers::jitAssertTagsInPlace()
 {
-    Jump ok = branch64(Equal, GPRInfo::tagTypeNumberRegister, TrustedImm64(TagTypeNumber));
-    abortWithReason(AHTagTypeNumberNotInPlace);
+    Jump ok = branch64(Equal, GPRInfo::numberTagRegister, TrustedImm64(JSValue::NumberTag));
+    abortWithReason(AHNumberTagNotInPlace);
     breakpoint();
     ok.link(this);
     
-    ok = branch64(Equal, GPRInfo::tagMaskRegister, TrustedImm64(TagMask));
-    abortWithReason(AHTagMaskNotInPlace);
+    ok = branch64(Equal, GPRInfo::notCellMaskRegister, TrustedImm64(JSValue::NotCellMask));
+    abortWithReason(AHNotCellMaskNotInPlace);
     ok.link(this);
 }
 #elif USE(JSVALUE32_64)
@@ -751,8 +751,7 @@ void AssemblyHelpers::emitConvertValueToBoolean(VM& vm, JSValueRegs value, GPRRe
 
     notDouble.link(this);
 #if USE(JSVALUE64)
-    static_assert(static_cast<int32_t>(ValueTrue) == ValueTrue, "");
-    compare64(invert ? NotEqual : Equal, value.gpr(), TrustedImm32(ValueTrue), result);
+    compare64(invert ? NotEqual : Equal, value.gpr(), TrustedImm32(JSValue::ValueTrue), result);
 #else
     move(invert ? TrustedImm32(1) : TrustedImm32(0), result);
     done.append(branchIfNotBoolean(value, InvalidGPRReg));
index c783af4..97957a6 100644 (file)
@@ -334,10 +334,10 @@ public:
     {
 #if USE(JSVALUE64)
 #if CPU(ARM64)
-        pushPair(GPRInfo::tagTypeNumberRegister, GPRInfo::tagMaskRegister);
+        pushPair(GPRInfo::numberTagRegister, GPRInfo::notCellMaskRegister);
 #else
-        push(GPRInfo::tagTypeNumberRegister);
-        push(GPRInfo::tagMaskRegister);
+        push(GPRInfo::numberTagRegister);
+        push(GPRInfo::notCellMaskRegister);
 #endif
         emitMaterializeTagCheckRegisters();
 #endif
@@ -352,10 +352,10 @@ public:
     {
 #if USE(JSVALUE64)
 #if CPU(ARM64)
-        popPair(GPRInfo::tagTypeNumberRegister, GPRInfo::tagMaskRegister);
+        popPair(GPRInfo::numberTagRegister, GPRInfo::notCellMaskRegister);
 #else
-        pop(GPRInfo::tagMaskRegister);
-        pop(GPRInfo::tagTypeNumberRegister);
+        pop(GPRInfo::notCellMaskRegister);
+        pop(GPRInfo::numberTagRegister);
 #endif
 #endif
     }
@@ -452,8 +452,8 @@ public:
     void emitMaterializeTagCheckRegisters()
     {
 #if USE(JSVALUE64)
-        move(MacroAssembler::TrustedImm64(TagTypeNumber), GPRInfo::tagTypeNumberRegister);
-        orPtr(MacroAssembler::TrustedImm32(TagBitTypeOther), GPRInfo::tagTypeNumberRegister, GPRInfo::tagMaskRegister);
+        move(MacroAssembler::TrustedImm64(JSValue::NumberTag), GPRInfo::numberTagRegister);
+        orPtr(MacroAssembler::TrustedImm32(JSValue::OtherTag), GPRInfo::numberTagRegister, GPRInfo::notCellMaskRegister);
 #endif
     }
 
@@ -701,8 +701,8 @@ public:
     {
 #if USE(JSVALUE64)
         if (mode == HaveTagRegisters)
-            return branchTest64(NonZero, reg, GPRInfo::tagMaskRegister);
-        return branchTest64(NonZero, reg, TrustedImm64(TagMask));
+            return branchTest64(NonZero, reg, GPRInfo::notCellMaskRegister);
+        return branchTest64(NonZero, reg, TrustedImm64(JSValue::NotCellMask));
 #else
         UNUSED_PARAM(mode);
         return branch32(MacroAssembler::NotEqual, reg, TrustedImm32(JSValue::CellTag));
@@ -722,8 +722,8 @@ public:
     {
 #if USE(JSVALUE64)
         if (mode == HaveTagRegisters)
-            return branchTest64(Zero, reg, GPRInfo::tagMaskRegister);
-        return branchTest64(Zero, reg, TrustedImm64(TagMask));
+            return branchTest64(Zero, reg, GPRInfo::notCellMaskRegister);
+        return branchTest64(Zero, reg, TrustedImm64(JSValue::NotCellMask));
 #else
         UNUSED_PARAM(mode);
         return branch32(MacroAssembler::Equal, reg, TrustedImm32(JSValue::CellTag));
@@ -742,8 +742,8 @@ public:
     {
 #if USE(JSVALUE64)
         move(regs.gpr(), tempGPR);
-        and64(TrustedImm32(~TagBitUndefined), tempGPR);
-        return branch64(Equal, tempGPR, TrustedImm64(ValueNull));
+        and64(TrustedImm32(~JSValue::UndefinedTag), tempGPR);
+        return branch64(Equal, tempGPR, TrustedImm64(JSValue::ValueNull));
 #else
         or32(TrustedImm32(1), regs.tagGPR(), tempGPR);
         return branch32(Equal, tempGPR, TrustedImm32(JSValue::NullTag));
@@ -754,8 +754,8 @@ public:
     {
 #if USE(JSVALUE64)
         move(regs.gpr(), tempGPR);
-        and64(TrustedImm32(~TagBitUndefined), tempGPR);
-        return branch64(NotEqual, tempGPR, TrustedImm64(ValueNull));
+        and64(TrustedImm32(~JSValue::UndefinedTag), tempGPR);
+        return branch64(NotEqual, tempGPR, TrustedImm64(JSValue::ValueNull));
 #else
         or32(TrustedImm32(1), regs.tagGPR(), tempGPR);
         return branch32(NotEqual, tempGPR, TrustedImm32(JSValue::NullTag));
@@ -766,8 +766,8 @@ public:
     {
 #if USE(JSVALUE64)
         if (mode == HaveTagRegisters)
-            return branch64(AboveOrEqual, gpr, GPRInfo::tagTypeNumberRegister);
-        return branch64(AboveOrEqual, gpr, TrustedImm64(TagTypeNumber));
+            return branch64(AboveOrEqual, gpr, GPRInfo::numberTagRegister);
+        return branch64(AboveOrEqual, gpr, TrustedImm64(JSValue::NumberTag));
 #else
         UNUSED_PARAM(mode);
         return branch32(Equal, gpr, TrustedImm32(JSValue::Int32Tag));
@@ -787,8 +787,8 @@ public:
     {
 #if USE(JSVALUE64)
         if (mode == HaveTagRegisters)
-            return branch64(Below, gpr, GPRInfo::tagTypeNumberRegister);
-        return branch64(Below, gpr, TrustedImm64(TagTypeNumber));
+            return branch64(Below, gpr, GPRInfo::numberTagRegister);
+        return branch64(Below, gpr, TrustedImm64(JSValue::NumberTag));
 #else
         UNUSED_PARAM(mode);
         return branch32(NotEqual, gpr, TrustedImm32(JSValue::Int32Tag));
@@ -822,8 +822,8 @@ public:
     Jump branchIfNumber(GPRReg gpr, TagRegistersMode mode = HaveTagRegisters)
     {
         if (mode == HaveTagRegisters)
-            return branchTest64(NonZero, gpr, GPRInfo::tagTypeNumberRegister);
-        return branchTest64(NonZero, gpr, TrustedImm64(TagTypeNumber));
+            return branchTest64(NonZero, gpr, GPRInfo::numberTagRegister);
+        return branchTest64(NonZero, gpr, TrustedImm64(JSValue::NumberTag));
     }
 #endif
     
@@ -844,8 +844,8 @@ public:
     Jump branchIfNotNumber(GPRReg gpr, TagRegistersMode mode = HaveTagRegisters)
     {
         if (mode == HaveTagRegisters)
-            return branchTest64(Zero, gpr, GPRInfo::tagTypeNumberRegister);
-        return branchTest64(Zero, gpr, TrustedImm64(TagTypeNumber));
+            return branchTest64(Zero, gpr, GPRInfo::numberTagRegister);
+        return branchTest64(Zero, gpr, TrustedImm64(JSValue::NumberTag));
     }
 #endif
 
@@ -853,8 +853,8 @@ public:
     {
 #if USE(JSVALUE64)
         if (mode == HaveTagRegisters)
-            return branchTest64(Zero, regs.gpr(), GPRInfo::tagTypeNumberRegister);
-        return branchTest64(Zero, regs.gpr(), TrustedImm64(TagTypeNumber));
+            return branchTest64(Zero, regs.gpr(), GPRInfo::numberTagRegister);
+        return branchTest64(Zero, regs.gpr(), TrustedImm64(JSValue::NumberTag));
 #else
         UNUSED_PARAM(mode);
         return branch32(AboveOrEqual, regs.tagGPR(), TrustedImm32(JSValue::LowestTag));
@@ -867,7 +867,7 @@ public:
 #if USE(JSVALUE64)
         ASSERT(tempGPR != InvalidGPRReg);
         move(gpr, tempGPR);
-        xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), tempGPR);
+        xor64(TrustedImm32(JSValue::ValueFalse), tempGPR);
         return branchTest64(Zero, tempGPR, TrustedImm32(static_cast<int32_t>(~1)));
 #else
         UNUSED_PARAM(tempGPR);
@@ -891,7 +891,7 @@ public:
 #if USE(JSVALUE64)
         ASSERT(tempGPR != InvalidGPRReg);
         move(gpr, tempGPR);
-        xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), tempGPR);
+        xor64(TrustedImm32(JSValue::ValueFalse), tempGPR);
         return branchTest64(NonZero, tempGPR, TrustedImm32(static_cast<int32_t>(~1)));
 #else
         UNUSED_PARAM(tempGPR);
@@ -1264,16 +1264,16 @@ public:
     {
         moveDoubleTo64(fpr, gpr);
         if (mode == DoNotHaveTagRegisters)
-            sub64(TrustedImm64(TagTypeNumber), gpr);
+            sub64(TrustedImm64(JSValue::NumberTag), gpr);
         else {
-            sub64(GPRInfo::tagTypeNumberRegister, gpr);
+            sub64(GPRInfo::numberTagRegister, gpr);
             jitAssertIsJSDouble(gpr);
         }
         return gpr;
     }
     FPRReg unboxDoubleWithoutAssertions(GPRReg gpr, GPRReg resultGPR, FPRReg fpr)
     {
-        add64(GPRInfo::tagTypeNumberRegister, gpr, resultGPR);
+        add64(GPRInfo::numberTagRegister, gpr, resultGPR);
         move64ToDouble(resultGPR, fpr);
         return fpr;
     }
@@ -1310,7 +1310,7 @@ public:
         
         isInt32.link(this);
         zeroExtend32ToPtr(source, target);
-        or64(GPRInfo::tagTypeNumberRegister, target);
+        or64(GPRInfo::numberTagRegister, target);
         
         done.link(this);
     }
@@ -1344,7 +1344,7 @@ public:
     void boxBooleanPayload(GPRReg boolGPR, GPRReg payloadGPR)
     {
 #if USE(JSVALUE64)
-        add32(TrustedImm32(ValueFalse), boolGPR, payloadGPR);
+        add32(TrustedImm32(JSValue::ValueFalse), boolGPR, payloadGPR);
 #else
         move(boolGPR, payloadGPR);
 #endif
@@ -1353,7 +1353,7 @@ public:
     void boxBooleanPayload(bool value, GPRReg payloadGPR)
     {
 #if USE(JSVALUE64)
-        move(TrustedImm32(ValueFalse + value), payloadGPR);
+        move(TrustedImm32(JSValue::ValueFalse + value), payloadGPR);
 #else
         move(TrustedImm32(value), payloadGPR);
 #endif
@@ -1380,9 +1380,9 @@ public:
 #if USE(JSVALUE64)
         if (mode == DoNotHaveTagRegisters) {
             move(intGPR, boxedRegs.gpr());
-            or64(TrustedImm64(TagTypeNumber), boxedRegs.gpr());
+            or64(TrustedImm64(JSValue::NumberTag), boxedRegs.gpr());
         } else
-            or64(GPRInfo::tagTypeNumberRegister, intGPR, boxedRegs.gpr());
+            or64(GPRInfo::numberTagRegister, intGPR, boxedRegs.gpr());
 #else
         UNUSED_PARAM(mode);
         move(intGPR, boxedRegs.payloadGPR());
index 9e710cb..7201ee1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -40,7 +40,7 @@ public:
     unsigned numPassedArgs { UINT_MAX };
 #if USE(JSVALUE64)
     RegisterMap<ValueRecovery> registers;
-    GPRReg tagTypeNumber { InvalidGPRReg };
+    GPRReg numberTagRegister { InvalidGPRReg };
 
     void setupCalleeSaveRegisters(CodeBlock*);
 #endif
index e775259..9690e09 100644 (file)
@@ -79,9 +79,9 @@ CallFrameShuffler::CallFrameShuffler(CCallHelpers& jit, const CallFrameShuffleDa
             addNew(reg.fpr(), data.registers[reg]);
     }
 
-    m_tagTypeNumber = data.tagTypeNumber;
-    if (m_tagTypeNumber != InvalidGPRReg)
-        lockGPR(m_tagTypeNumber);
+    m_numberTagRegister = data.numberTagRegister;
+    if (m_numberTagRegister != InvalidGPRReg)
+        lockGPR(m_numberTagRegister);
 #endif
 }
 
@@ -216,8 +216,8 @@ void CallFrameShuffler::dump(PrintStream& out) const
     if (m_newFrameOffset)
         out.print("   New frame offset is ", m_newFrameOffset, "\n");
 #if USE(JSVALUE64)
-    if (m_tagTypeNumber != InvalidGPRReg)
-        out.print("   TagTypeNumber is currently in ", m_tagTypeNumber, "\n");
+    if (m_numberTagRegister != InvalidGPRReg)
+        out.print("   NumberTag is currently in ", m_numberTagRegister, "\n");
 #endif
 }
 
@@ -698,8 +698,8 @@ void CallFrameShuffler::prepareAny()
     }
 
 #if USE(JSVALUE64)
-    if (m_tagTypeNumber != InvalidGPRReg && m_newRegisters[m_tagTypeNumber])
-        releaseGPR(m_tagTypeNumber);
+    if (m_numberTagRegister != InvalidGPRReg && m_newRegisters[m_numberTagRegister])
+        releaseGPR(m_numberTagRegister);
 #endif
 
     // Handle 2) by loading all registers. We don't have to do any
@@ -717,8 +717,8 @@ void CallFrameShuffler::prepareAny()
     }
 
 #if USE(JSVALUE64)
-    if (m_tagTypeNumber != InvalidGPRReg)
-        releaseGPR(m_tagTypeNumber);
+    if (m_numberTagRegister != InvalidGPRReg)
+        releaseGPR(m_numberTagRegister);
 #endif
 
     // At this point, we have read everything we cared about from the
index 0f89a57..62439bd 100644 (file)
@@ -412,9 +412,9 @@ private:
     RegisterMap<CachedRecovery*> m_registers;
 
 #if USE(JSVALUE64)
-    mutable GPRReg m_tagTypeNumber;
+    mutable GPRReg m_numberTagRegister;
 
-    bool tryAcquireTagTypeNumber();
+    bool tryAcquireNumberTagRegister();
 #endif
 
     // This stores, for each register, information about the recovery
@@ -448,11 +448,11 @@ private:
         }
 
 #if USE(JSVALUE64)
-        if (!nonTemp && m_tagTypeNumber != InvalidGPRReg && check(Reg { m_tagTypeNumber })) {
-            ASSERT(m_lockedRegisters.get(m_tagTypeNumber));
-            m_lockedRegisters.clear(m_tagTypeNumber);
-            nonTemp = Reg { m_tagTypeNumber };
-            m_tagTypeNumber = InvalidGPRReg;
+        if (!nonTemp && m_numberTagRegister != InvalidGPRReg && check(Reg { m_numberTagRegister })) {
+            ASSERT(m_lockedRegisters.get(m_numberTagRegister));
+            m_lockedRegisters.clear(m_numberTagRegister);
+            nonTemp = Reg { m_numberTagRegister };
+            m_numberTagRegister = InvalidGPRReg;
         }
 #endif
         return nonTemp;
index 2ef6ed1..fa648d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -88,11 +88,11 @@ void CallFrameShuffler::emitBox(CachedRecovery& cachedRecovery)
                 cachedRecovery.recovery().gpr(),
                 cachedRecovery.recovery().gpr());
             m_lockedRegisters.set(cachedRecovery.recovery().gpr());
-            if (tryAcquireTagTypeNumber())
-                m_jit.or64(m_tagTypeNumber, cachedRecovery.recovery().gpr());
+            if (tryAcquireNumberTagRegister())
+                m_jit.or64(m_numberTagRegister, cachedRecovery.recovery().gpr());
             else {
                 // We have to do this the hard way
-                m_jit.or64(MacroAssembler::TrustedImm64(TagTypeNumber),
+                m_jit.or64(MacroAssembler::TrustedImm64(JSValue::NumberTag),
                     cachedRecovery.recovery().gpr());
             }
             m_lockedRegisters.clear(cachedRecovery.recovery().gpr());
@@ -125,7 +125,7 @@ void CallFrameShuffler::emitBox(CachedRecovery& cachedRecovery)
         case DataFormatBoolean:
             if (verbose)
                 dataLog("   * Boxing ", cachedRecovery.recovery());
-            m_jit.add32(MacroAssembler::TrustedImm32(ValueFalse),
+            m_jit.add32(MacroAssembler::TrustedImm32(JSValue::ValueFalse),
                 cachedRecovery.recovery().gpr());
             cachedRecovery.setRecovery(
                 ValueRecovery::inGPR(cachedRecovery.recovery().gpr(), DataFormatJS));
@@ -148,10 +148,10 @@ void CallFrameShuffler::emitBox(CachedRecovery& cachedRecovery)
             m_jit.purifyNaN(cachedRecovery.recovery().fpr());
             m_jit.moveDoubleTo64(cachedRecovery.recovery().fpr(), resultGPR);
             m_lockedRegisters.set(resultGPR);
-            if (tryAcquireTagTypeNumber())
-                m_jit.sub64(m_tagTypeNumber, resultGPR);
+            if (tryAcquireNumberTagRegister())
+                m_jit.sub64(m_numberTagRegister, resultGPR);
             else
-                m_jit.sub64(MacroAssembler::TrustedImm64(TagTypeNumber), resultGPR);
+                m_jit.sub64(MacroAssembler::TrustedImm64(JSValue::NumberTag), resultGPR);
             m_lockedRegisters.clear(resultGPR);
             updateRecovery(cachedRecovery, ValueRecovery::inGPR(resultGPR, DataFormatJS));
             if (verbose)
@@ -349,18 +349,18 @@ void CallFrameShuffler::emitDisplace(CachedRecovery& cachedRecovery)
     ASSERT(m_registers[wantedReg] == &cachedRecovery);
 }
     
-bool CallFrameShuffler::tryAcquireTagTypeNumber()
+bool CallFrameShuffler::tryAcquireNumberTagRegister()
 {
-    if (m_tagTypeNumber != InvalidGPRReg)
+    if (m_numberTagRegister != InvalidGPRReg)
         return true;
 
-    m_tagTypeNumber = getFreeGPR();
+    m_numberTagRegister = getFreeGPR();
 
-    if (m_tagTypeNumber == InvalidGPRReg)
+    if (m_numberTagRegister == InvalidGPRReg)
         return false;
 
-    m_lockedRegisters.set(m_tagTypeNumber);
-    m_jit.move(MacroAssembler::TrustedImm64(TagTypeNumber), m_tagTypeNumber);
+    m_lockedRegisters.set(m_numberTagRegister);
+    m_jit.move(MacroAssembler::TrustedImm64(JSValue::NumberTag), m_numberTagRegister);
     return true;
 }
 
index f0f5272..5953bc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -408,8 +408,8 @@ public:
 
     // These registers match the baseline JIT.
     static constexpr GPRReg callFrameRegister = X86Registers::ebp;
-    static constexpr GPRReg tagTypeNumberRegister = X86Registers::r14;
-    static constexpr GPRReg tagMaskRegister = X86Registers::r15;
+    static constexpr GPRReg numberTagRegister = X86Registers::r14;
+    static constexpr GPRReg notCellMaskRegister = X86Registers::r15;
 
     // Temporary registers.
     static constexpr GPRReg regT0 = X86Registers::eax;
@@ -515,8 +515,8 @@ public:
     {
         static const std::array<GPRReg, 3> reservedRegisters { {
             MacroAssembler::s_scratchRegister,
-            tagTypeNumberRegister,
-            tagMaskRegister,
+            numberTagRegister,
+            notCellMaskRegister,
         } };
         return reservedRegisters;
     }
@@ -608,8 +608,8 @@ public:
 
     // These registers match the baseline JIT.
     static constexpr GPRReg callFrameRegister = ARM64Registers::fp;
-    static constexpr GPRReg tagTypeNumberRegister = ARM64Registers::x27;
-    static constexpr GPRReg tagMaskRegister = ARM64Registers::x28;
+    static constexpr GPRReg numberTagRegister = ARM64Registers::x27;
+    static constexpr GPRReg notCellMaskRegister = ARM64Registers::x28;
     static constexpr GPRReg dataTempRegister = MacroAssembler::dataTempRegister;
     static constexpr GPRReg memoryTempRegister = MacroAssembler::memoryTempRegister;
     // Temporary registers.
@@ -637,8 +637,8 @@ public:
     static constexpr GPRReg regCS5 = ARM64Registers::x24; // Used by FTL only
     static constexpr GPRReg regCS6 = ARM64Registers::x25; // Used by FTL only
     static constexpr GPRReg regCS7 = ARM64Registers::x26;
-    static constexpr GPRReg regCS8 = ARM64Registers::x27; // tagTypeNumber
-    static constexpr GPRReg regCS9 = ARM64Registers::x28; // tagMask
+    static constexpr GPRReg regCS8 = ARM64Registers::x27; // numberTag
+    static constexpr GPRReg regCS9 = ARM64Registers::x28; // notCellMask
     // These constants provide the names for the general purpose argument & return value registers.
     static constexpr GPRReg argumentGPR0 = ARM64Registers::x0; // regT0
     static constexpr GPRReg argumentGPR1 = ARM64Registers::x1; // regT1
@@ -703,8 +703,8 @@ public:
         static const std::array<GPRReg, 4> reservedRegisters { {
             dataTempRegister,
             memoryTempRegister,
-            tagTypeNumberRegister,
-            tagMaskRegister,
+            numberTagRegister,
+            notCellMaskRegister,
         } };
         return reservedRegisters;
     }
index 71e33c8..f420ae9 100644 (file)
@@ -291,7 +291,7 @@ void JIT::emit_compareAndJumpSlow(const Instruction* instruction, DoubleConditio
 
         if (supportsFloatingPoint()) {
             Jump fail1 = branchIfNotNumber(regT0);
-            add64(tagTypeNumberRegister, regT0);
+            add64(numberTagRegister, regT0);
             move64ToDouble(regT0, fpRegT0);
 
             int32_t op2imm = getConstantOperand(op2).asInt32();
@@ -317,7 +317,7 @@ void JIT::emit_compareAndJumpSlow(const Instruction* instruction, DoubleConditio
 
         if (supportsFloatingPoint()) {
             Jump fail1 = branchIfNotNumber(regT1);
-            add64(tagTypeNumberRegister, regT1);
+            add64(numberTagRegister, regT1);
             move64ToDouble(regT1, fpRegT1);
 
             int32_t op1imm = getConstantOperand(op1).asInt32();
@@ -344,8 +344,8 @@ void JIT::emit_compareAndJumpSlow(const Instruction* instruction, DoubleConditio
         Jump fail1 = branchIfNotNumber(regT0);
         Jump fail2 = branchIfNotNumber(regT1);
         Jump fail3 = branchIfInt32(regT1);
-        add64(tagTypeNumberRegister, regT0);
-        add64(tagTypeNumberRegister, regT1);
+        add64(numberTagRegister, regT0);
+        add64(numberTagRegister, regT1);
         move64ToDouble(regT0, fpRegT0);
         move64ToDouble(regT1, fpRegT1);
 
index 715b503..b4183a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -56,7 +56,7 @@ void JITBitAndGenerator::generateFastPath(CCallHelpers& jit)
 #if USE(JSVALUE64)
             jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
             if (constOpr.asConstInt32() >= 0)
-                jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+                jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #else
             jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
 #endif
index 9f843c1..4936cd4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,7 +47,7 @@ void JITBitOrGenerator::generateFastPath(CCallHelpers& jit)
         if (constOpr.asConstInt32()) {
 #if USE(JSVALUE64)
             jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
-            jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+            jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #else
             jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
 #endif
index 8ccf1b5..7b90c30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@ void JITBitXorGenerator::generateFastPath(CCallHelpers& jit)
         jit.moveValueRegs(var, m_result);
 #if USE(JSVALUE64)
         jit.xor32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
-        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+        jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #else
         jit.xor32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
 #endif
@@ -61,7 +61,7 @@ void JITBitXorGenerator::generateFastPath(CCallHelpers& jit)
         jit.moveValueRegs(m_left, m_result);
 #if USE(JSVALUE64)
         jit.xor64(m_right.payloadGPR(), m_result.payloadGPR());
-        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+        jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #else
         jit.xor32(m_right.payloadGPR(), m_result.payloadGPR());
 #endif
index 1ca8817..557fd62 100644 (file)
@@ -182,7 +182,7 @@ bool JIT::compileTailCall(const OpTailCall& bytecode, CallLinkInfo* info, unsign
 {
     CallFrameShuffleData shuffleData;
     shuffleData.numPassedArgs = bytecode.m_argc;
-    shuffleData.tagTypeNumber = GPRInfo::tagTypeNumberRegister;
+    shuffleData.numberTagRegister = GPRInfo::numberTagRegister;
     shuffleData.numLocals =
         bytecode.m_argv - sizeof(CallerFrameAndPC) / sizeof(Register);
     shuffleData.args.resize(bytecode.m_argc);
index be92d3f..66e1be1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -124,7 +124,7 @@ void JITDivGenerator::generateFastPath(CCallHelpers& jit)
     jit.moveDoubleTo64(m_leftFPR, m_scratchGPR);
     CCallHelpers::Jump notDoubleZero = jit.branchTest64(CCallHelpers::NonZero, m_scratchGPR);
 
-    jit.move(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+    jit.move(GPRInfo::numberTagRegister, m_result.payloadGPR());
     m_endJumpList.append(jit.jump());
 
     notDoubleZero.link(&jit);
index 0fd4782..d483f94 100644 (file)
@@ -671,7 +671,7 @@ inline void JIT::emitLoadInt32ToDouble(int index, FPRegisterID value)
 
 ALWAYS_INLINE JIT::PatchableJump JIT::emitPatchableJumpIfNotInt(RegisterID reg)
 {
-    return patchableBranch64(Below, reg, tagTypeNumberRegister);
+    return patchableBranch64(Below, reg, numberTagRegister);
 }
 
 ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotInt(RegisterID reg1, RegisterID reg2, RegisterID scratch)
index 1ddaa6a..990ba17 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -75,7 +75,7 @@ void JITLeftShiftGenerator::generateFastPath(CCallHelpers& jit)
     }
 
 #if USE(JSVALUE64)
-    jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+    jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #endif
 }
 
index 2fae85a..83d293b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -220,7 +220,7 @@ bool JITMulGenerator::generateFastPath(CCallHelpers& jit, CCallHelpers::JumpList
         noInt52Overflow.link(&jit);
 
         done.link(&jit);
-        jit.sub64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR()); // Box the double.
+        jit.sub64(GPRInfo::numberTagRegister, m_result.payloadGPR()); // Box the double.
 #else
         jit.boxDouble(m_leftFPR, m_result);
         CCallHelpers::JumpList notNegativeZero;
index 7260668..1131b96 100644 (file)
@@ -146,7 +146,7 @@ void JIT::emit_op_overrides_has_instance(const Instruction* currentInstruction)
     Jump done = jump();
 
     customhasInstanceValue.link(this);
-    move(TrustedImm32(ValueTrue), regT0);
+    move(TrustedImm32(JSValue::ValueTrue), regT0);
 
     done.link(this);
     emitPutVirtualRegister(dst);
@@ -223,7 +223,7 @@ void JIT::emit_op_is_undefined(const Instruction* currentInstruction)
     emitGetVirtualRegister(value, regT0);
     Jump isCell = branchIfCell(regT0);
 
-    compare64(Equal, regT0, TrustedImm32(ValueUndefined), regT0);
+    compare64(Equal, regT0, TrustedImm32(JSValue::ValueUndefined), regT0);
     Jump done = jump();
     
     isCell.link(this);
@@ -251,8 +251,8 @@ void JIT::emit_op_is_undefined_or_null(const Instruction* currentInstruction)
 
     emitGetVirtualRegister(value, regT0);
 
-    and64(TrustedImm32(~TagBitUndefined), regT0);
-    compare64(Equal, regT0, TrustedImm32(ValueNull), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
+    compare64(Equal, regT0, TrustedImm32(JSValue::ValueNull), regT0);
 
     boxBoolean(regT0, JSValueRegs { regT0 });
     emitPutVirtualRegister(dst);
@@ -265,7 +265,7 @@ void JIT::emit_op_is_boolean(const Instruction* currentInstruction)
     int value = bytecode.m_operand.offset();
     
     emitGetVirtualRegister(value, regT0);
-    xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
+    xor64(TrustedImm32(JSValue::ValueFalse), regT0);
     test64(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0);
     boxBoolean(regT0, JSValueRegs { regT0 });
     emitPutVirtualRegister(dst);
@@ -278,7 +278,7 @@ void JIT::emit_op_is_number(const Instruction* currentInstruction)
     int value = bytecode.m_operand.offset();
     
     emitGetVirtualRegister(value, regT0);
-    test64(NonZero, regT0, tagTypeNumberRegister, regT0);
+    test64(NonZero, regT0, numberTagRegister, regT0);
     boxBoolean(regT0, JSValueRegs { regT0 });
     emitPutVirtualRegister(dst);
 }
@@ -298,7 +298,7 @@ void JIT::emit_op_is_cell_with_type(const Instruction* currentInstruction)
     Jump done = jump();
 
     isNotCell.link(this);
-    move(TrustedImm32(ValueFalse), regT0);
+    move(TrustedImm32(JSValue::ValueFalse), regT0);
 
     done.link(this);
     emitPutVirtualRegister(dst);
@@ -318,7 +318,7 @@ void JIT::emit_op_is_object(const Instruction* currentInstruction)
     Jump done = jump();
 
     isNotCell.link(this);
-    move(TrustedImm32(ValueFalse), regT0);
+    move(TrustedImm32(JSValue::ValueFalse), regT0);
 
     done.link(this);
     emitPutVirtualRegister(dst);
@@ -373,9 +373,9 @@ void JIT::emit_op_not(const Instruction* currentInstruction)
     // Invert against JSValue(false); if the value was tagged as a boolean, then all bits will be
     // clear other than the low bit (which will be 0 or 1 for false or true inputs respectively).
     // Then invert against JSValue(true), which will add the tag back in, and flip the low bit.
-    xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
+    xor64(TrustedImm32(JSValue::ValueFalse), regT0);
     addSlowCase(branchTestPtr(NonZero, regT0, TrustedImm32(static_cast<int32_t>(~1))));
-    xor64(TrustedImm32(static_cast<int32_t>(ValueTrue)), regT0);
+    xor64(TrustedImm32(JSValue::ValueTrue), regT0);
 
     emitPutVirtualRegister(bytecode.m_dst.offset());
 }
@@ -412,7 +412,7 @@ void JIT::emit_op_jeq_null(const Instruction* currentInstruction)
 
     // Now handle the immediate cases - undefined & null
     isImmediate.link(this);
-    and64(TrustedImm32(~TagBitUndefined), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
     addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);            
 
     isNotMasqueradesAsUndefined.link(this);
@@ -436,7 +436,7 @@ void JIT::emit_op_jneq_null(const Instruction* currentInstruction)
 
     // Now handle the immediate cases - undefined & null
     isImmediate.link(this);
-    and64(TrustedImm32(~TagBitUndefined), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
     addJump(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);            
 
     wasNotImmediate.link(this);
@@ -450,7 +450,7 @@ void JIT::emit_op_jundefined_or_null(const Instruction* currentInstruction)
 
     emitGetVirtualRegister(value, regT0);
 
-    and64(TrustedImm32(~TagBitUndefined), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
     addJump(branch64(Equal, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);
 }
 
@@ -462,7 +462,7 @@ void JIT::emit_op_jnundefined_or_null(const Instruction* currentInstruction)
 
     emitGetVirtualRegister(value, regT0);
 
-    and64(TrustedImm32(~TagBitUndefined), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
     addJump(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(jsNull()))), target);
 }
 
@@ -832,8 +832,8 @@ void JIT::emit_op_eq_null(const Instruction* currentInstruction)
 
     isImmediate.link(this);
 
-    and64(TrustedImm32(~TagBitUndefined), regT0);
-    compare64(Equal, regT0, TrustedImm32(ValueNull), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
+    compare64(Equal, regT0, TrustedImm32(JSValue::ValueNull), regT0);
 
     wasNotImmediate.link(this);
     wasNotMasqueradesAsUndefined.link(this);
@@ -865,8 +865,8 @@ void JIT::emit_op_neq_null(const Instruction* currentInstruction)
 
     isImmediate.link(this);
 
-    and64(TrustedImm32(~TagBitUndefined), regT0);
-    compare64(NotEqual, regT0, TrustedImm32(ValueNull), regT0);
+    and64(TrustedImm32(~JSValue::UndefinedTag), regT0);
+    compare64(NotEqual, regT0, TrustedImm32(JSValue::ValueNull), regT0);
 
     wasNotImmediate.link(this);
     wasNotMasqueradesAsUndefined.link(this);
index 369cb10..0b7b960 100644 (file)
@@ -289,7 +289,7 @@ JIT::JumpList JIT::emitGenericContiguousPutByVal(Op bytecode, PatchableJump& bad
         convertInt32ToDouble(regT3, fpRegT0);
         Jump ready = jump();
         notInt.link(this);
-        add64(tagTypeNumberRegister, regT3);
+        add64(numberTagRegister, regT3);
         move64ToDouble(regT3, fpRegT0);
         slowCases.append(branchIfNaN(fpRegT0));
         ready.link(this);
@@ -1902,7 +1902,7 @@ JIT::JumpList JIT::emitFloatTypedArrayPutByVal(Op bytecode, PatchableJump& badTy
     Jump ready = jump();
     doubleCase.link(this);
     slowCases.append(branchIfNotNumber(earlyScratch));
-    add64(tagTypeNumberRegister, earlyScratch);
+    add64(numberTagRegister, earlyScratch);
     move64ToDouble(earlyScratch, fpRegT0);
     ready.link(this);
 #else
index 4cfa8a4..1f19d4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -57,7 +57,7 @@ void JITRightShiftGenerator::generateFastPath(CCallHelpers& jit)
             else
                 jit.urshift32(CCallHelpers::Imm32(shiftAmount), m_result.payloadGPR());
 #if USE(JSVALUE64)
-            jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+            jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #endif
         }
 
@@ -116,7 +116,7 @@ void JITRightShiftGenerator::generateFastPath(CCallHelpers& jit)
         else
             jit.urshift32(rightOperandGPR, m_result.payloadGPR());
 #if USE(JSVALUE64)
-        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+        jit.or64(GPRInfo::numberTagRegister, m_result.payloadGPR());
 #endif
         if (m_leftOperand.isConstInt32())
             return;
index 136560c..0c22878 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -61,7 +61,7 @@ RegisterSet RegisterSet::reservedHardwareRegisters()
 RegisterSet RegisterSet::runtimeTagRegisters()
 {
 #if USE(JSVALUE64)
-    return RegisterSet(GPRInfo::tagTypeNumberRegister, GPRInfo::tagMaskRegister);
+    return RegisterSet(GPRInfo::numberTagRegister, GPRInfo::notCellMaskRegister);
 #else
     return { };
 #endif
@@ -178,15 +178,15 @@ RegisterSet RegisterSet::llintBaselineCalleeSaveRegisters()
 #if !OS(WINDOWS)
     result.set(GPRInfo::regCS1);
     result.set(GPRInfo::regCS2);
-    ASSERT(GPRInfo::regCS3 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS4 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS3);
     result.set(GPRInfo::regCS4);
 #else
     result.set(GPRInfo::regCS3);
     result.set(GPRInfo::regCS4);
-    ASSERT(GPRInfo::regCS5 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS6 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS5);
     result.set(GPRInfo::regCS6);
 #endif
@@ -195,8 +195,8 @@ RegisterSet RegisterSet::llintBaselineCalleeSaveRegisters()
 #elif CPU(ARM64)
     result.set(GPRInfo::regCS6);
     result.set(GPRInfo::regCS7);
-    ASSERT(GPRInfo::regCS8 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS9 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS8);
     result.set(GPRInfo::regCS9);
 #elif CPU(MIPS)
@@ -216,22 +216,22 @@ RegisterSet RegisterSet::dfgCalleeSaveRegisters()
     result.set(GPRInfo::regCS1);
     result.set(GPRInfo::regCS2);
 #if !OS(WINDOWS)
-    ASSERT(GPRInfo::regCS3 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS4 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS3);
     result.set(GPRInfo::regCS4);
 #else
     result.set(GPRInfo::regCS3);
     result.set(GPRInfo::regCS4);
-    ASSERT(GPRInfo::regCS5 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS6 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS5 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS6 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS5);
     result.set(GPRInfo::regCS6);
 #endif
 #elif CPU(ARM_THUMB2)
 #elif CPU(ARM64)
-    ASSERT(GPRInfo::regCS8 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS9 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS8);
     result.set(GPRInfo::regCS9);
 #elif CPU(MIPS)
@@ -249,8 +249,8 @@ RegisterSet RegisterSet::ftlCalleeSaveRegisters()
     result.set(GPRInfo::regCS0);
     result.set(GPRInfo::regCS1);
     result.set(GPRInfo::regCS2);
-    ASSERT(GPRInfo::regCS3 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS4 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS3 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS4 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS3);
     result.set(GPRInfo::regCS4);
 #elif CPU(ARM64)
@@ -263,8 +263,8 @@ RegisterSet RegisterSet::ftlCalleeSaveRegisters()
     result.set(GPRInfo::regCS5);
     result.set(GPRInfo::regCS6);
     result.set(GPRInfo::regCS7);
-    ASSERT(GPRInfo::regCS8 == GPRInfo::tagTypeNumberRegister);
-    ASSERT(GPRInfo::regCS9 == GPRInfo::tagMaskRegister);
+    static_assert(GPRInfo::regCS8 == GPRInfo::numberTagRegister, "");
+    static_assert(GPRInfo::regCS9 == GPRInfo::notCellMaskRegister, "");
     result.set(GPRInfo::regCS8);
     result.set(GPRInfo::regCS9);
     result.set(FPRInfo::fpRegCS0);
index 32b2fce..667229b 100644 (file)
@@ -114,10 +114,10 @@ namespace JSC {
 #if USE(JSVALUE64)
             moveDoubleTo64(src, regT0);
             Jump zero = branchTest64(Zero, regT0);
-            sub64(tagTypeNumberRegister, regT0);
+            sub64(numberTagRegister, regT0);
             Jump done = jump();
             zero.link(this);
-            move(tagTypeNumberRegister, regT0);
+            move(numberTagRegister, regT0);
             done.link(this);
 #else
             moveDoubleToInts(src, regT0, regT1);
@@ -182,7 +182,7 @@ namespace JSC {
         void tagReturnAsInt32()
         {
 #if USE(JSVALUE64)
-            or64(tagTypeNumberRegister, regT0);
+            or64(numberTagRegister, regT0);
 #else
             move(TrustedImm32(JSValue::Int32Tag), regT1);
 #endif
index 69cb79c..08cd1d0 100644 (file)
@@ -184,9 +184,9 @@ MacroAssemblerCodeRef<JITStubRoutinePtrTag> virtualThunkFor(VM& vm, CallLinkInfo
     
 #if USE(JSVALUE64)
     if (callLinkInfo.isTailCall()) {
-        // Tail calls could have clobbered the GPRInfo::tagMaskRegister because they
+        // Tail calls could have clobbered the GPRInfo::notCellMaskRegister because they
         // restore callee saved registers before getthing here. So, let's materialize
-        // the TagMask in a temp register and use the temp instead.
+        // the NotCellMask in a temp register and use the temp instead.
         slowCase.append(jit.branchIfNotCell(GPRInfo::regT0, DoNotHaveTagRegisters));
     } else
         slowCase.append(jit.branchIfNotCell(GPRInfo::regT0));
@@ -257,7 +257,7 @@ static MacroAssemblerCodeRef<JITThunkPtrTag> nativeForGenerator(VM& vm, ThunkFun
 #if USE(JSVALUE64)
         // We're coming from a specialized thunk that has saved the prior tag registers' contents.
         // Restore them now.
-        jit.popPair(JSInterfaceJIT::tagTypeNumberRegister, JSInterfaceJIT::tagMaskRegister);
+        jit.popPair(JSInterfaceJIT::numberTagRegister, JSInterfaceJIT::notCellMaskRegister);
 #endif
         break;
     case EnterViaJumpWithoutSavedTags:
@@ -445,7 +445,7 @@ MacroAssemblerCodeRef<JITThunkPtrTag> arityFixupGenerator(VM& vm)
     jit.move(JSInterfaceJIT::argumentGPR0, JSInterfaceJIT::argumentGPR1);
     jit.and32(JSInterfaceJIT::TrustedImm32(stackAlignmentRegisters() - 1), JSInterfaceJIT::argumentGPR1);
     JSInterfaceJIT::Jump noExtraSlot = jit.branchTest32(MacroAssembler::Zero, JSInterfaceJIT::argumentGPR1);
-    jit.move(JSInterfaceJIT::TrustedImm64(ValueUndefined), extraTemp);
+    jit.move(JSInterfaceJIT::TrustedImm64(JSValue::ValueUndefined), extraTemp);
     JSInterfaceJIT::Label fillExtraSlots(jit.label());
     jit.store64(extraTemp, MacroAssembler::BaseIndex(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::argumentGPR2, JSInterfaceJIT::TimesEight));
     jit.add32(JSInterfaceJIT::TrustedImm32(1), JSInterfaceJIT::argumentGPR2);
@@ -476,7 +476,7 @@ MacroAssemblerCodeRef<JITThunkPtrTag> arityFixupGenerator(VM& vm)
 
     // Fill in argumentGPR0 missing arg slots with undefined
     jit.move(JSInterfaceJIT::argumentGPR0, JSInterfaceJIT::argumentGPR2);
-    jit.move(JSInterfaceJIT::TrustedImm64(ValueUndefined), extraTemp);
+    jit.move(JSInterfaceJIT::TrustedImm64(JSValue::ValueUndefined), extraTemp);
     JSInterfaceJIT::Label fillUndefinedLoop(jit.label());
     jit.store64(extraTemp, MacroAssembler::BaseIndex(JSInterfaceJIT::regT3, JSInterfaceJIT::argumentGPR0, JSInterfaceJIT::TimesEight));
     jit.addPtr(JSInterfaceJIT::TrustedImm32(8), JSInterfaceJIT::regT3);
@@ -1082,7 +1082,7 @@ MacroAssemblerCodeRef<JITThunkPtrTag> absThunkGenerator(VM& vm)
     MacroAssembler::Jump integerIsIntMin = jit.branchTest32(MacroAssembler::Signed, GPRInfo::regT0);
 
     // Box and finish.
-    jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
+    jit.or64(GPRInfo::numberTagRegister, GPRInfo::regT0);
     MacroAssembler::Jump doneWithIntegers = jit.jump();
 
     // Handle Doubles.
index e34a79f..bda308c 100644 (file)
@@ -113,25 +113,6 @@ void Data::performAssertions(VM& vm)
     STATIC_ASSERT(TagOffset == 4);
     STATIC_ASSERT(PayloadOffset == 0);
 #endif
-#if USE(JSVALUE32_64)
-    STATIC_ASSERT(JSValue::Int32Tag == static_cast<unsigned>(-1));
-    STATIC_ASSERT(JSValue::BooleanTag == static_cast<unsigned>(-2));
-    STATIC_ASSERT(JSValue::NullTag == static_cast<unsigned>(-3));
-    STATIC_ASSERT(JSValue::UndefinedTag == static_cast<unsigned>(-4));
-    STATIC_ASSERT(JSValue::CellTag == static_cast<unsigned>(-5));
-    STATIC_ASSERT(JSValue::EmptyValueTag == static_cast<unsigned>(-6));
-    STATIC_ASSERT(JSValue::DeletedValueTag == static_cast<unsigned>(-7));
-    STATIC_ASSERT(JSValue::LowestTag == static_cast<unsigned>(-7));
-#else
-    STATIC_ASSERT(TagBitTypeOther == 0x2);
-    STATIC_ASSERT(TagBitBool == 0x4);
-    STATIC_ASSERT(TagBitUndefined == 0x8);
-    STATIC_ASSERT(ValueEmpty == 0x0);
-    STATIC_ASSERT(ValueFalse == (TagBitTypeOther | TagBitBool));
-    STATIC_ASSERT(ValueTrue == (TagBitTypeOther | TagBitBool | 1));
-    STATIC_ASSERT(ValueUndefined == (TagBitTypeOther | TagBitUndefined));
-    STATIC_ASSERT(ValueNull == TagBitTypeOther);
-#endif
 
 #if ENABLE(C_LOOP)
     ASSERT(CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters() == 1);
index 2576ef4..0fea096 100644 (file)
@@ -187,16 +187,16 @@ const MetadataOffsetTable32Offset = constexpr UnlinkedMetadataTable::s_offset16T
 
 # Some value representation constants.
 if JSVALUE64
-    const TagBitTypeOther = constexpr TagBitTypeOther
-    const TagBitBool      = constexpr TagBitBool
-    const TagBitUndefined = constexpr TagBitUndefined
-    const ValueEmpty      = constexpr ValueEmpty
-    const ValueFalse      = constexpr ValueFalse
-    const ValueTrue       = constexpr ValueTrue
-    const ValueUndefined  = constexpr ValueUndefined
-    const ValueNull       = constexpr ValueNull
-    const TagTypeNumber   = constexpr TagTypeNumber
-    const TagMask         = constexpr TagMask
+    const TagOther        = constexpr JSValue::OtherTag
+    const TagBool         = constexpr JSValue::BoolTag
+    const TagUndefined    = constexpr JSValue::UndefinedTag
+    const ValueEmpty      = constexpr JSValue::ValueEmpty
+    const ValueFalse      = constexpr JSValue::ValueFalse
+    const ValueTrue       = constexpr JSValue::ValueTrue
+    const ValueUndefined  = constexpr JSValue::ValueUndefined
+    const ValueNull       = constexpr JSValue::ValueNull
+    const TagNumber       = constexpr JSValue::NumberTag
+    const NotCellMask     = constexpr JSValue::NotCellMask
 else
     const Int32Tag = constexpr JSValue::Int32Tag
     const BooleanTag = constexpr JSValue::BooleanTag
@@ -266,22 +266,22 @@ if JSVALUE64
     if ARM64 or ARM64E
         const metadataTable = csr6
         const PB = csr7
-        const tagTypeNumber = csr8
-        const tagMask = csr9
+        const numberTag = csr8
+        const notCellMask = csr9
     elsif X86_64
         const metadataTable = csr1
         const PB = csr2
-        const tagTypeNumber = csr3
-        const tagMask = csr4
+        const numberTag = csr3
+        const notCellMask = csr4
     elsif X86_64_WIN
         const metadataTable = csr3
         const PB = csr4
-        const tagTypeNumber = csr5
-        const tagMask = csr6
+        const numberTag = csr5
+        const notCellMask = csr6
     elsif C_LOOP or C_LOOP_WIN
         const PB = csr0
-        const tagTypeNumber = csr1
-        const tagMask = csr2
+        const numberTag = csr1
+        const notCellMask = csr2
         const metadataTable = csr3
     end
 
@@ -1200,8 +1200,8 @@ macro prologue(codeBlockGetter, codeBlockSetter, osrSlowPath, traceSlowPath)
     loadp CodeBlock::m_metadata[t1], metadataTable
 
     if JSVALUE64
-        move TagTypeNumber, tagTypeNumber
-        addq TagBitTypeOther, tagTypeNumber, tagMask
+        move TagNumber, numberTag
+        addq TagOther, numberTag, notCellMask
     end
 end
 
index b061ff4..20063a5 100644 (file)
@@ -316,7 +316,7 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
 
     CLoopRegister t0, t1, t2, t3, t5, sp, cfr, lr, pc;
 #if USE(JSVALUE64)
-    CLoopRegister pcBase, tagTypeNumber, tagMask;
+    CLoopRegister pcBase, numberTag, notCellMask;
 #endif
     CLoopRegister metadataTable;
     CLoopDoubleRegister d0, d1;
@@ -356,8 +356,8 @@ JSValue CLoop::execute(OpcodeID entryOpcodeID, void* executableAddress, VM* vm,
 #if USE(JSVALUE64)
     // For the ASM llint, JITStubs takes care of this initialization. We do
     // it explicitly here for the C loop:
-    tagTypeNumber = 0xFFFF000000000000;
-    tagMask = 0xFFFF000000000002;
+    numberTag = JSValue::NumberTag;
+    notCellMask = JSValue::NotCellMask;
 #endif // USE(JSVALUE64)
 
     // Interpreter variables for value passing between opcodes and/or helpers:
index 2689e24..16a2393 100644 (file)
@@ -504,12 +504,12 @@ end
 
 macro loadConstantOrVariableInt32(size, index, value, slow)
     loadConstantOrVariable(size, index, value)
-    bqb value, tagTypeNumber, slow
+    bqb value, numberTag, slow
 end
 
 macro loadConstantOrVariableCell(size, index, value, slow)
     loadConstantOrVariable(size, index, value)
-    btqnz value, tagMask, slow
+    btqnz value, notCellMask, slow
 end
 
 macro writeBarrierOnCellWithReload(cell, reloadAfterSlowPath)
@@ -526,7 +526,7 @@ macro writeBarrierOnCellWithReload(cell, reloadAfterSlowPath)
 end
 
 macro writeBarrierOnCellAndValueWithReload(cell, value, reloadAfterSlowPath)
-    btqnz value, tagMask, .writeBarrierDone
+    btqnz value, notCellMask, .writeBarrierDone
     btqz value, .writeBarrierDone
     writeBarrierOnCellWithReload(cell, reloadAfterSlowPath)
 .writeBarrierDone:
@@ -724,7 +724,7 @@ end)
 llintOpWithReturn(op_argument_count, OpArgumentCount, macro (size, get, dispatch, return)
     loadi PayloadOffset + ArgumentCount[cfr], t0
     subi 1, t0
-    orq TagTypeNumber, t0
+    orq TagNumber, t0
     return(t0)
 end)
 
@@ -739,7 +739,7 @@ end)
 llintOpWithMetadata(op_to_this, OpToThis, macro (size, get, dispatch, metadata, return)
     get(m_srcDst, t0)
     loadq [cfr, t0, 8], t0
-    btqnz t0, tagMask, .opToThisSlow
+    btqnz t0, notCellMask, .opToThisSlow
     bbneq JSCell::m_type[t0], FinalObjectType, .opToThisSlow
     loadi JSCell::m_structureID[t0], t1
     metadata(t2, t3)
@@ -806,7 +806,7 @@ macro equalNullComparisonOp(opcodeName, opcodeStruct, fn)
     llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return)
         get(m_operand, t0)
         loadq [cfr, t0, 8], t0
-        btqnz t0, tagMask, .immediate
+        btqnz t0, notCellMask, .immediate
         btbnz JSCell::m_flags[t0], MasqueradesAsUndefined, .masqueradesAsUndefined
         move 0, t0
         jmp .done
@@ -817,7 +817,7 @@ macro equalNullComparisonOp(opcodeName, opcodeStruct, fn)
         cpeq Structure::m_globalObject[t2], t0, t0
         jmp .done
     .immediate:
-        andq ~TagBitUndefined, t0
+        andq ~TagUndefined, t0
         cqeq t0, ValueNull, t0
     .done:
         fn(t0)
@@ -836,7 +836,7 @@ equalNullComparisonOp(op_neq_null, OpNeqNull,
 llintOpWithReturn(op_is_undefined_or_null, OpIsUndefinedOrNull, macro (size, get, dispatch, return)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t0)
-    andq ~TagBitUndefined, t0
+    andq ~TagUndefined, t0
     cqeq t0, ValueNull, t0
     orq ValueFalse, t0
     return(t0)
@@ -851,12 +851,12 @@ macro strictEqOp(opcodeName, opcodeStruct, equalityOperation)
         loadConstantOrVariable(size, t2, t0)
         move t0, t2
         orq t1, t2
-        btqz t2, tagMask, .slow
-        bqaeq t0, tagTypeNumber, .leftOK
-        btqnz t0, tagTypeNumber, .slow
+        btqz t2, notCellMask, .slow
+        bqaeq t0, numberTag, .leftOK
+        btqnz t0, numberTag, .slow
     .leftOK:
-        bqaeq t1, tagTypeNumber, .rightOK
-        btqnz t1, tagTypeNumber, .slow
+        bqaeq t1, numberTag, .rightOK
+        btqnz t1, numberTag, .slow
     .rightOK:
         equalityOperation(t0, t1, t0)
         orq ValueFalse, t0
@@ -885,12 +885,12 @@ macro strictEqualityJumpOp(opcodeName, opcodeStruct, equalityOperation)
         loadConstantOrVariable(size, t3, t1)
         move t0, t2
         orq t1, t2
-        btqz t2, tagMask, .slow
-        bqaeq t0, tagTypeNumber, .leftOK
-        btqnz t0, tagTypeNumber, .slow
+        btqz t2, notCellMask, .slow
+        bqaeq t0, numberTag, .leftOK
+        btqnz t0, numberTag, .slow
     .leftOK:
-        bqaeq t1, tagTypeNumber, .rightOK
-        btqnz t1, tagTypeNumber, .slow
+        bqaeq t1, numberTag, .rightOK
+        btqnz t1, numberTag, .slow
     .rightOK:
         equalityOperation(t0, t1, .jumpTarget)
         dispatch()
@@ -917,9 +917,9 @@ macro preOp(opcodeName, opcodeStruct, arithmeticOperation)
     llintOp(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch)
         get(m_srcDst, t0)
         loadq [cfr, t0, 8], t1
-        bqb t1, tagTypeNumber, .slow
+        bqb t1, numberTag, .slow
         arithmeticOperation(t1, .slow)
-        orq tagTypeNumber, t1
+        orq numberTag, t1
         storeq t1, [cfr, t0, 8]
         dispatch()
     .slow:
@@ -931,8 +931,8 @@ end
 llintOpWithProfile(op_to_number, OpToNumber, macro (size, get, dispatch, return)
     get(m_operand, t0)
     loadConstantOrVariable(size, t0, t2)
-    bqaeq t2, tagTypeNumber, .opToNumberIsImmediate
-    btqz t2, tagTypeNumber, .opToNumberSlow
+    bqaeq t2, numberTag, .opToNumberIsImmediate
+    btqz t2, numberTag, .opToNumberSlow
 .opToNumberIsImmediate:
     return(t2)
 
@@ -945,7 +945,7 @@ end)
 llintOpWithReturn(op_to_string, OpToString, macro (size, get, dispatch, return)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t0)
-    btqnz t0, tagMask, .opToStringSlow
+    btqnz t0, notCellMask, .opToStringSlow
     bbneq JSCell::m_type[t0], StringType, .opToStringSlow
 .opToStringIsString:
     return(t0)
@@ -959,7 +959,7 @@ end)
 llintOpWithProfile(op_to_object, OpToObject, macro (size, get, dispatch, return)
     get(m_operand, t0)
     loadConstantOrVariable(size, t0, t2)
-    btqnz t2, tagMask, .opToObjectSlow
+    btqnz t2, notCellMask, .opToObjectSlow
     bbb JSCell::m_type[t2], ObjectType, .opToObjectSlow
     return(t2)
 
@@ -974,15 +974,15 @@ llintOpWithMetadata(op_negate, OpNegate, macro (size, get, dispatch, metadata, r
     loadConstantOrVariable(size, t0, t3)
     metadata(t1, t2)
     loadi OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1], t2
-    bqb t3, tagTypeNumber, .opNegateNotInt
+    bqb t3, numberTag, .opNegateNotInt
     btiz t3, 0x7fffffff, .opNegateSlow
     negi t3
-    orq tagTypeNumber, t3
+    orq numberTag, t3
     ori ArithProfileInt, t2
     storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1]
     return(t3)
 .opNegateNotInt:
-    btqz t3, tagTypeNumber, .opNegateSlow
+    btqz t3, numberTag, .opNegateSlow
     xorq 0x8000000000000000, t3
     ori ArithProfileNumber, t2
     storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1]
@@ -1006,8 +1006,8 @@ macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, do
         get(m_lhs, t2)
         loadConstantOrVariable(size, t0, t1)
         loadConstantOrVariable(size, t2, t0)
-        bqb t0, tagTypeNumber, .op1NotInt
-        bqb t1, tagTypeNumber, .op2NotInt
+        bqb t0, numberTag, .op1NotInt
+        bqb t1, numberTag, .op2NotInt
         get(m_dst, t2)
         integerOperationAndStore(t1, t0, .slow, t2)
 
@@ -1016,10 +1016,10 @@ macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, do
 
     .op1NotInt:
         # First operand is definitely not an int, the second operand could be anything.
-        btqz t0, tagTypeNumber, .slow
-        bqaeq t1, tagTypeNumber, .op1NotIntOp2Int
-        btqz t1, tagTypeNumber, .slow
-        addq tagTypeNumber, t1
+        btqz t0, numberTag, .slow
+        bqaeq t1, numberTag, .op1NotIntOp2Int
+        btqz t1, numberTag, .slow
+        addq numberTag, t1
         fq2d t1, ft1
         profile(ArithProfileNumberNumber)
         jmp .op1NotIntReady
@@ -1028,25 +1028,25 @@ macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, do
         ci2d t1, ft1
     .op1NotIntReady:
         get(m_dst, t2)
-        addq tagTypeNumber, t0
+        addq numberTag, t0
         fq2d t0, ft0
         doubleOperation(ft1, ft0)
         fd2q ft0, t0
-        subq tagTypeNumber, t0
+        subq numberTag, t0
         storeq t0, [cfr, t2, 8]
         dispatch()
 
     .op2NotInt:
         # First operand is definitely an int, the second is definitely not.
         get(m_dst, t2)
-        btqz t1, tagTypeNumber, .slow
+        btqz t1, numberTag, .slow
         profile(ArithProfileIntNumber)
         ci2d t0, ft0
-        addq tagTypeNumber, t1
+        addq numberTag, t1
         fq2d t1, ft1
         doubleOperation(ft1, ft0)
         fd2q ft0, t0
-        subq tagTypeNumber, t0
+        subq numberTag, t0
         storeq t0, [cfr, t2, 8]
         dispatch()
 
@@ -1072,7 +1072,7 @@ if X86_64 or X86_64_WIN
             cdqi
             idivi t3
             btinz t1, slow
-            orq tagTypeNumber, t0
+            orq numberTag, t0
             storeq t0, [cfr, index, 8]
         end,
         macro (left, right) divd left, right end)
@@ -1090,7 +1090,7 @@ binaryOpCustomStore(mul, OpMul,
         bilt left, 0, slow
         bilt right, 0, slow
     .done:
-        orq tagTypeNumber, t3
+        orq numberTag, t3
         storeq t3, [cfr, index, 8]
     end,
     macro (left, right) muld left, right end)
@@ -1100,7 +1100,7 @@ macro binaryOp(opcodeName, opcodeStruct, integerOperation, doubleOperation)
     binaryOpCustomStore(opcodeName, opcodeStruct,
         macro (left, right, slow, index)
             integerOperation(left, right, slow)
-            orq tagTypeNumber, right
+            orq numberTag, right
             storeq right, [cfr, index, 8]
         end,
         doubleOperation)
@@ -1133,10 +1133,10 @@ macro commonBitOp(opKind, opcodeName, opcodeStruct, operation)
         get(m_lhs, t2)
         loadConstantOrVariable(size, t0, t1)
         loadConstantOrVariable(size, t2, t0)
-        bqb t0, tagTypeNumber, .slow
-        bqb t1, tagTypeNumber, .slow
+        bqb t0, numberTag, .slow
+        bqb t1, numberTag, .slow
         operation(t1, t0)
-        orq tagTypeNumber, t0
+        orq numberTag, t0
         return(t0)
 
     .slow:
@@ -1177,7 +1177,7 @@ llintOpWithProfile(op_bitnot, OpBitnot, macro (size, get, dispatch, return)
     get(m_operand, t0)
     loadConstantOrVariableInt32(size, t0, t3, .opBitNotSlow)
     noti t3
-    orq tagTypeNumber, t3
+    orq numberTag, t3
     return(t3)
 .opBitNotSlow:
     callSlowPath(_slow_path_bitnot)
@@ -1220,7 +1220,7 @@ end)
 llintOpWithReturn(op_is_undefined, OpIsUndefined, macro (size, get, dispatch, return)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t0)
-    btqz t0, tagMask, .opIsUndefinedCell
+    btqz t0, notCellMask, .opIsUndefinedCell
     cqeq t0, ValueUndefined, t3
     orq ValueFalse, t3
     return(t3)
@@ -1251,7 +1251,7 @@ end)
 llintOpWithReturn(op_is_number, OpIsNumber, macro (size, get, dispatch, return)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t0)
-    tqnz t0, tagTypeNumber, t1
+    tqnz t0, numberTag, t1
     orq ValueFalse, t1
     return(t1)
 end)
@@ -1261,7 +1261,7 @@ llintOpWithReturn(op_is_cell_with_type, OpIsCellWithType, macro (size, get, disp
     getu(size, OpIsCellWithType, m_type, t0)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t3)
-    btqnz t3, tagMask, .notCellCase
+    btqnz t3, notCellMask, .notCellCase
     cbeq JSCell::m_type[t3], t0, t1
     orq ValueFalse, t1
     return(t1)
@@ -1273,7 +1273,7 @@ end)
 llintOpWithReturn(op_is_object, OpIsObject, macro (size, get, dispatch, return)
     get(m_operand, t1)
     loadConstantOrVariable(size, t1, t0)
-    btqnz t0, tagMask, .opIsObjectNotCell
+    btqnz t0, notCellMask, .opIsObjectNotCell
     cbaeq JSCell::m_type[t0], ObjectType, t1
     orq ValueFalse, t1
     return(t1)
@@ -1362,7 +1362,7 @@ llintOpWithMetadata(op_get_by_id, OpGetById, macro (size, get, dispatch, metadat
     loadCagedJSValue(JSObject::m_butterfly[t3], t0, t1)
     loadi -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], t0
     bilt t0, 0, .opGetByIdSlow
-    orq tagTypeNumber, t0
+    orq numberTag, t0
     valueProfile(OpGetById, t2, t0)
     return(t0)
 
@@ -1460,13 +1460,13 @@ llintOpWithMetadata(op_get_by_val, OpGetByVal, macro (size, get, dispatch, metad
     end
 
     macro finishIntGetByVal(result, scratch)
-        orq tagTypeNumber, result
+        orq numberTag, result
         finishGetByVal(result, scratch)
     end
 
     macro finishDoubleGetByVal(result, scratch1, scratch2)
         fd2q result, scratch1
-        subq tagTypeNumber, scratch1
+        subq numberTag, scratch1
         finishGetByVal(scratch1, scratch2)
     end
 
@@ -1482,8 +1482,8 @@ llintOpWithMetadata(op_get_by_val, OpGetByVal, macro (size, get, dispatch, metad
     loadConstantOrVariableInt32(size, t3, t1, .opGetByValSlow)
     sxi2q t1, t1
 
-    loadCagedJSValue(JSObject::m_butterfly[t0], t3, tagTypeNumber)
-    move TagTypeNumber, tagTypeNumber
+    loadCagedJSValue(JSObject::m_butterfly[t0], t3, numberTag)
+    move TagNumber, numberTag
 
     andi IndexingShapeMask, t2
     bieq t2, Int32Shape, .opGetByValIsContiguous
@@ -1503,7 +1503,7 @@ llintOpWithMetadata(op_get_by_val, OpGetByVal, macro (size, get, dispatch, metad
     loadd [t3, t1, 8], ft0
     bdnequn ft0, ft0, .opGetByValSlow
     fd2q ft0, t2
-    subq tagTypeNumber, t2
+    subq numberTag, t2
     jmp .opGetByValDone
     
 .opGetByValNotDouble:
@@ -1647,15 +1647,15 @@ macro putByValOp(opcodeName, opcodeStruct)
         get(m_property, t0)
         loadConstantOrVariableInt32(size, t0, t3, .opPutByValSlow)
         sxi2q t3, t3
-        loadCagedJSValue(JSObject::m_butterfly[t1], t0, tagTypeNumber)
-        move TagTypeNumber, tagTypeNumber
+        loadCagedJSValue(JSObject::m_butterfly[t1], t0, numberTag)
+        move TagNumber, numberTag
         btinz t2, CopyOnWrite, .opPutByValSlow
         andi IndexingShapeMask, t2
         bineq t2, Int32Shape, .opPutByValNotInt32
         contiguousPutByVal(
             macro (operand, scratch, address)
                 loadConstantOrVariable(size, operand, scratch)
-                bqb scratch, tagTypeNumber, .opPutByValSlow
+                bqb scratch, numberTag, .opPutByValSlow
                 storeq scratch, address
                 writeBarrierOnOperands(size, get, m_base, m_value)
             end)
@@ -1665,11 +1665,11 @@ macro putByValOp(opcodeName, opcodeStruct)
         contiguousPutByVal(
             macro (operand, scratch, address)
                 loadConstantOrVariable(size, operand, scratch)
-                bqb scratch, tagTypeNumber, .notInt
+                bqb scratch, numberTag, .notInt
                 ci2d scratch, ft0
                 jmp .ready
             .notInt:
-                addq tagTypeNumber, scratch
+                addq numberTag, scratch
                 fq2d scratch, ft0
                 bdnequn ft0, ft0, .opPutByValSlow
             .ready:
@@ -1741,7 +1741,7 @@ macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler)
         get(m_value, t0)
         assertNotConstant(size, t0)
         loadq [cfr, t0, 8], t0
-        btqnz t0, tagMask, .immediate
+        btqnz t0, notCellMask, .immediate
         loadStructureWithScratch(t0, t2, t1, t3)
         cellHandler(t2, JSCell::m_flags[t0], .target)
         dispatch()
@@ -1750,7 +1750,7 @@ macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler)
         jump(m_targetLabel)
 
     .immediate:
-        andq ~TagBitUndefined, t0
+        andq ~TagUndefined, t0
         immediateHandler(t0, .target)
         dispatch()
     end)
@@ -1780,7 +1780,7 @@ macro undefinedOrNullJumpOp(opcodeName, opcodeStruct, fn)
     llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch)
         get(m_value, t1)
         loadConstantOrVariable(size, t1, t0)
-        andq ~TagBitUndefined, t0
+        andq ~TagUndefined, t0
         fn(t0, .target)
         dispatch()
 
@@ -1818,30 +1818,30 @@ macro compareJumpOp(opcodeName, opcodeStruct, integerCompare, doubleCompare)
         get(m_rhs, t3)
         loadConstantOrVariable(size, t2, t0)
         loadConstantOrVariable(size, t3, t1)
-        bqb t0, tagTypeNumber, .op1NotInt
-        bqb t1, tagTypeNumber, .op2NotInt
+        bqb t0, numberTag, .op1NotInt
+        bqb t1, numberTag, .op2NotInt
         integerCompare(t0, t1, .jumpTarget)
         dispatch()
 
     .op1NotInt:
-        btqz t0, tagTypeNumber, .slow
-        bqb t1, tagTypeNumber, .op1NotIntOp2NotInt
+        btqz t0, numberTag, .slow
+        bqb t1, numberTag, .op1NotIntOp2NotInt
         ci2d t1, ft1
         jmp .op1NotIntReady
     .op1NotIntOp2NotInt:
-        btqz t1, tagTypeNumber, .slow
-        addq tagTypeNumber, t1
+        btqz t1, numberTag, .slow
+        addq numberTag, t1
         fq2d t1, ft1
     .op1NotIntReady:
-        addq tagTypeNumber, t0
+        addq numberTag, t0
         fq2d t0, ft0
         doubleCompare(ft0, ft1, .jumpTarget)
         dispatch()
 
     .op2NotInt:
         ci2d t0, ft0
-        btqz t1, tagTypeNumber, .slow
-        addq tagTypeNumber, t1
+        btqz t1, numberTag, .slow
+        addq numberTag, t1
         fq2d t1, ft1
         doubleCompare(ft0, ft1, .jumpTarget)
         dispatch()
@@ -1912,7 +1912,7 @@ llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch)
     muli sizeof SimpleJumpTable, t3
     loadp CodeBlock::RareData::m_switchJumpTables + VectorBufferOffset[t2], t2
     addp t3, t2
-    bqb t1, tagTypeNumber, .opSwitchImmNotInt
+    bqb t1, numberTag, .opSwitchImmNotInt
     subi SimpleJumpTable::min[t2], t1
     biaeq t1, SimpleJumpTable::branchOffsets + VectorSizeOffset[t2], .opSwitchImmFallThrough
     loadp SimpleJumpTable::branchOffsets + VectorBufferOffset[t2], t3
@@ -1921,7 +1921,7 @@ llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch)
     dispatchIndirect(t1)
 
 .opSwitchImmNotInt:
-    btqnz t1, tagTypeNumber, .opSwitchImmSlow   # Go slow if it's a double.
+    btqnz t1, numberTag, .opSwitchImmSlow   # Go slow if it's a double.
 .opSwitchImmFallThrough:
     jump(m_defaultOffset)
 
@@ -1940,7 +1940,7 @@ llintOpWithJump(op_switch_char, OpSwitchChar, macro (size, get, jump, dispatch)
     muli sizeof SimpleJumpTable, t3
     loadp CodeBlock::RareData::m_switchJumpTables + VectorBufferOffset[t2], t2
     addp t3, t2
-    btqnz t1, tagMask, .opSwitchCharFallThrough
+    btqnz t1, notCellMask, .opSwitchCharFallThrough
     bbneq JSCell::m_type[t1], StringType, .opSwitchCharFallThrough
     loadp JSString::m_fiber[t1], t0
     btpnz t0, isRopeInPointer, .opSwitchOnRope
@@ -1976,7 +1976,7 @@ macro arrayProfileForCall(opcodeStruct, getu)
     getu(m_argv, t3)
     negp t3
     loadq ThisArgumentOffset[cfr, t3, 8], t0
-    btqnz t0, tagMask, .done
+    btqnz t0, notCellMask, .done
     loadi JSCell::m_structureID[t0], t3
     storei t3, %opcodeStruct%::Metadata::m_callLinkInfo.m_arrayProfile.m_lastSeenStructureID[t5]
 .done:
@@ -2022,7 +2022,7 @@ end)
 llintOpWithReturn(op_to_primitive, OpToPrimitive, macro (size, get, dispatch, return)
     get(m_src, t2)
     loadConstantOrVariable(size, t2, t0)
-    btqnz t0, tagMask, .opToPrimitiveIsImm
+    btqnz t0, notCellMask, .opToPrimitiveIsImm
     bbaeq JSCell::m_type[t0], ObjectType, .opToPrimitiveSlowCase
 .opToPrimitiveIsImm:
     return(t0)
@@ -2544,7 +2544,7 @@ llintOpWithMetadata(op_profile_type, OpProfileType, macro (size, get, dispatch,
     loadp OpProfileType::Metadata::m_typeLocation[t5], t3
     storep t3, TypeProfilerLog::LogEntry::location[t2]
 
-    btqz t0, tagMask, .opProfileTypeIsCell
+    btqz t0, notCellMask, .opProfileTypeIsCell
     storei 0, TypeProfilerLog::LogEntry::structureID[t2]
     jmp .opProfileTypeSkipIsCell
 .opProfileTypeIsCell:
@@ -2583,7 +2583,7 @@ llintOpWithReturn(op_get_rest_length, OpGetRestLength, macro (size, get, dispatc
 .storeZero:
     move 0, t0
 .boxUp:
-    orq tagTypeNumber, t0
+    orq numberTag, t0
     return(t0)
 end)
 
index 23d948f..4cd8f66 100644 (file)
@@ -47,8 +47,8 @@ require "risc"
 # x16  =>                  (scratch)
 # x17  =>                  (scratch)
 # x26  =>             csr0 (PB)
-# x27  =>             csr1 (tagTypeNumber)
-# x28  =>             csr2 (tagMask)
+# x27  =>             csr1 (numberTag)
+# x28  =>             csr2 (notCellMask)
 # x29  => cfr
 #  sp  => sp
 #  lr  => lr
index 3a51a1f..8368763 100644 (file)
@@ -88,9 +88,9 @@ class RegisterID
         when "csr0"
             "pcBase"
         when "csr1"
-            "tagTypeNumber"
+            "numberTag"
         when "csr2"
-            "tagMask"
+            "notCellMask"
         when "csr3"
             "metadataTable"
         when "cfr"
index dbba78c..166f4bd 100644 (file)
@@ -54,8 +54,8 @@ require "config"
 # rbx =>             csr0 (callee-save, PB, unused in baseline)
 # r12 =>             csr1 (callee-save)
 # r13 =>             csr2 (callee-save)
-# r14 =>             csr3 (callee-save, tagTypeNumber)
-# r15 =>             csr4 (callee-save, tagMask)
+# r14 =>             csr3 (callee-save, numberTag)
+# r15 =>             csr4 (callee-save, notCellMask)
 # rsp => sp
 # rbp => cfr
 # r11 =>                  (scratch)
@@ -75,8 +75,8 @@ require "config"
 # rdi =>             csr2 (callee-save)
 # r12 =>             csr3 (callee-save)
 # r13 =>             csr4 (callee-save)
-# r14 =>             csr5 (callee-save, tagTypeNumber)
-# r15 =>             csr6 (callee-save, tagMask)
+# r14 =>             csr5 (callee-save, numberTag)
+# r15 =>             csr6 (callee-save, notCellMask)
 # rsp => sp
 # rbp => cfr
 # r11 =>                  (scratch)
index 930e18e..7402da7 100644 (file)
@@ -410,9 +410,9 @@ public:
      *     Null:      0x02
      *
      * These values have the following properties:
-     * - Bit 1 (TagBitTypeOther) is set for all four values, allowing real pointers to be
+     * - Bit 1 (OtherTag) is set for all four values, allowing real pointers to be
      *   quickly distinguished from all immediate values, including these invalid pointers.
-     * - With bit 3 is masked out (TagBitUndefined) Undefined and Null share the
+     * - With bit 3 is masked out (UndefinedTag) Undefined and Null share the
      *   same value, allowing null & undefined to be quickly detected.
      *
      * No valid JSValue will have the bit pattern 0x0, this is used to represent array
@@ -423,37 +423,40 @@ public:
 
     // This value is 2^48, used to encode doubles such that the encoded value will begin
     // with a 16-bit pattern within the range 0x0001..0xFFFE.
-    #define DoubleEncodeOffset 0x1000000000000ll
+    static constexpr size_t DoubleEncodeOffsetBit = 48;
+    static constexpr int64_t DoubleEncodeOffset = 1ll << DoubleEncodeOffsetBit;
     // If all bits in the mask are set, this indicates an integer number,
     // if any but not all are set this value is a double precision number.
-    #define TagTypeNumber 0xffff000000000000ll
+    static constexpr int64_t NumberTag = 0xffff000000000000ll;
 
     // All non-numeric (bool, null, undefined) immediates have bit 2 set.
-    #define TagBitTypeOther 0x2ll
-    #define TagBitBool      0x4ll
-    #define TagBitUndefined 0x8ll
+    static constexpr int32_t OtherTag       = 0x2;
+    static constexpr int32_t BoolTag        = 0x4;
+    static constexpr int32_t UndefinedTag   = 0x8;
     // Combined integer value for non-numeric immediates.
-    #define ValueFalse     (TagBitTypeOther | TagBitBool | false)
-    #define ValueTrue      (TagBitTypeOther | TagBitBool | true)
-    #define ValueUndefined (TagBitTypeOther | TagBitUndefined)
-    #define ValueNull      (TagBitTypeOther)
+    static constexpr int32_t ValueFalse     = OtherTag | BoolTag | false;
+    static constexpr int32_t ValueTrue      = OtherTag | BoolTag | true;
+    static constexpr int32_t ValueUndefined = OtherTag | UndefinedTag;
+    static constexpr int32_t ValueNull      = OtherTag;
 
-    // TagMask is used to check for all types of immediate values (either number or 'other').
-    #define TagMask (TagTypeNumber | TagBitTypeOther)
+    static constexpr int64_t MiscTag = OtherTag | BoolTag | UndefinedTag;
 
+    // NotCellMask is used to check for all types of immediate values (either number or 'other').
+    static constexpr int64_t NotCellMask = NumberTag | OtherTag;
+    
     // These special values are never visible to JavaScript code; Empty is used to represent
     // Array holes, and for uninitialized JSValues. Deleted is used in hash table code.
     // These values would map to cell types in the JSValue encoding, but not valid GC cell
     // pointer should have either of these values (Empty is null, deleted is at an invalid
     // alignment for a GC cell, and in the zero page).
-    #define ValueEmpty   0x0ll
-    #define ValueDeleted 0x4ll
+    static constexpr int32_t ValueEmpty   = 0x0;
+    static constexpr int32_t ValueDeleted = 0x4;
 
-    #define TagBitsWasm (TagBitTypeOther | 0x1)
-    #define TagWasmMask (TagTypeNumber | 0x7)
+    static constexpr int64_t WasmTag = OtherTag | 0x1;
+    static constexpr int64_t WasmMask = NumberTag | 0x7;
     // We tag Wasm non-JSCell pointers with a 3 at the bottom. We can test if a 64-bit JSValue pattern
     // is a Wasm callee by masking the upper 16 bits and the lower 3 bits, and seeing if
-    // the resulting value is 3. The full test is: x & TagWasmMask == TagBitsWasm
+    // the resulting value is 3. The full test is: x & WasmMask == WasmTag
     // This works because the lower 3 bits of the non-number immediate values are as follows:
     // undefined: 0b010
     // null:      0b010
@@ -465,9 +468,9 @@ public:
     // their lower 3 bits. Note, this bit pattern also allows the normal JSValue isCell(), etc,
     // predicates to work on a Wasm::Callee because the various tests will fail if you
     // bit casted a boxed Wasm::Callee* to a JSValue. isCell() would fail since it sees
-    // TagBitTypeOther. The other tests also trivially fail, since it won't be a number,
+    // OtherTag. The other tests also trivially fail, since it won't be a number,
     // and it won't be equal to null, undefined, true, or false. The isBoolean() predicate
-    // will fail because we won't have TagBitBool set.
+    // will fail because we won't have BoolTag set.
 #endif
 
 private:
index 3c4d8f7..16b0809 100644 (file)
@@ -467,7 +467,7 @@ inline JSValue::JSValue(JSFalseTag)
 inline bool JSValue::isUndefinedOrNull() const
 {
     // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
-    return (u.asInt64 & ~TagBitUndefined) == ValueNull;
+    return (u.asInt64 & ~UndefinedTag) == ValueNull;
 }
 
 inline bool JSValue::isBoolean() const
@@ -477,12 +477,12 @@ inline bool JSValue::isBoolean() const
 
 inline bool JSValue::isCell() const
 {
-    return !(u.asInt64 & TagMask);
+    return !(u.asInt64 & NotCellMask);
 }
 
 inline bool JSValue::isInt32() const
 {
-    return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
+    return (u.asInt64 & NumberTag) == NumberTag;
 }
 
 inline int64_t reinterpretDoubleToInt64(double value)
@@ -497,23 +497,23 @@ inline double reinterpretInt64ToDouble(int64_t value)
 ALWAYS_INLINE JSValue::JSValue(EncodeAsDoubleTag, double d)
 {
     ASSERT(!isImpureNaN(d));
-    u.asInt64 = reinterpretDoubleToInt64(d) + DoubleEncodeOffset;
+    u.asInt64 = reinterpretDoubleToInt64(d) + JSValue::DoubleEncodeOffset;
 }
 
 inline JSValue::JSValue(int i)
 {
-    u.asInt64 = TagTypeNumber | static_cast<uint32_t>(i);
+    u.asInt64 = JSValue::NumberTag | static_cast<uint32_t>(i);
 }
 
 inline double JSValue::asDouble() const
 {
     ASSERT(isDouble());
-    return reinterpretInt64ToDouble(u.asInt64 - DoubleEncodeOffset);
+    return reinterpretInt64ToDouble(u.asInt64 - JSValue::DoubleEncodeOffset);
 }
 
 inline bool JSValue::isNumber() const
 {
-    return u.asInt64 & TagTypeNumber;
+    return u.asInt64 & JSValue::NumberTag;
 }
 
 ALWAYS_INLINE JSCell* JSValue::asCell() const
index 5166a68..549658b 100644 (file)
@@ -420,9 +420,12 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm
         bool hasMaterializedDoubleEncodeOffset = false;
         auto materializeDoubleEncodeOffset = [&hasMaterializedDoubleEncodeOffset, &jit] (GPRReg dest) {
             if (!hasMaterializedDoubleEncodeOffset) {
-                static_assert(DoubleEncodeOffset == 1ll << 48, "codegen assumes this below");
+#if CPU(ARM64)
+                jit.move(JIT::TrustedImm64(JSValue::DoubleEncodeOffset), dest);
+#else
                 jit.move(JIT::TrustedImm32(1), dest);
-                jit.lshift64(JIT::TrustedImm32(48), dest);
+                jit.lshift64(JIT::TrustedImm32(JSValue::DoubleEncodeOffsetBit), dest);
+#endif
                 hasMaterializedDoubleEncodeOffset = true;
             }
         };
@@ -501,7 +504,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm
 
     jit.store64(importJSCellGPRReg, calleeFrame.withOffset(CallFrameSlot::callee * static_cast<int>(sizeof(Register))));
     jit.store32(JIT::TrustedImm32(numberOfParameters), calleeFrame.withOffset(CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset));
-    jit.store64(JIT::TrustedImm64(ValueUndefined), calleeFrame.withOffset(CallFrameSlot::thisArgument * static_cast<int>(sizeof(Register))));
+    jit.store64(JIT::TrustedImm64(JSValue::ValueUndefined), calleeFrame.withOffset(CallFrameSlot::thisArgument * static_cast<int>(sizeof(Register))));
 
     // FIXME Tail call if the wasm return type is void and no registers were spilled. https://bugs.webkit.org/show_bug.cgi?id=165488
 
@@ -578,7 +581,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm
         done.append(jit.jump());
 
         isDouble.link(&jit);
-        jit.move(JIT::TrustedImm64(TagTypeNumber), GPRInfo::returnValueGPR2);
+        jit.move(JIT::TrustedImm64(JSValue::NumberTag), GPRInfo::returnValueGPR2);
         jit.add64(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
         jit.move64ToDouble(GPRInfo::returnValueGPR, FPRInfo::returnValueFPR);
         jit.convertDoubleToFloat(FPRInfo::returnValueFPR, FPRInfo::returnValueFPR);
@@ -613,7 +616,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm
         done.append(jit.jump());
 
         isDouble.link(&jit);
-        jit.move(JIT::TrustedImm64(TagTypeNumber), GPRInfo::returnValueGPR2);
+        jit.move(JIT::TrustedImm64(JSValue::NumberTag), GPRInfo::returnValueGPR2);
         jit.add64(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
         jit.move64ToDouble(GPRInfo::returnValueGPR, FPRInfo::returnValueFPR);
         done.append(jit.jump());
index 057aa70..fb5e00b 100644 (file)
@@ -353,7 +353,7 @@ MacroAssemblerCodePtr<JSEntryPtrTag> WebAssemblyFunction::jsCallEntrypointSlow()
                         jit.convertDoubleToFloat(scratchFPR, scratchFPR);
                         jit.storeFloat(scratchFPR, calleeFrame.withOffset(wasmOffset));
                     } else {
-                        jit.add64(GPRInfo::tagTypeNumberRegister, scratchGPR, scratchGPR);
+                        jit.add64(GPRInfo::numberTagRegister, scratchGPR, scratchGPR);
                         jit.store64(scratchGPR, calleeFrame.withOffset(wasmOffset));
                     }
                     auto done = jit.jump();