Switch int8_t to GPRReg in StructureStubInfo because sizeof(GPRReg) == sizeof(int8_t)
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 22:37:34 +0000 (22:37 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 22:37:34 +0000 (22:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189166

Reviewed by Mark Lam.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::emitDOMJITGetter):
* bytecode/InlineAccess.cpp:
(JSC::getScratchRegister):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::valueRegs const):
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
(JSC::JITInstanceOfGenerator::JITInstanceOfGenerator):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/AccessCase.cpp
Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp
Source/JavaScriptCore/bytecode/InlineAccess.cpp
Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp

index 83f8565..9c558d8 100644 (file)
@@ -1,5 +1,27 @@
 2018-08-30  Saam barati  <sbarati@apple.com>
 
+        Switch int8_t to GPRReg in StructureStubInfo because sizeof(GPRReg) == sizeof(int8_t)
+        https://bugs.webkit.org/show_bug.cgi?id=189166
+
+        Reviewed by Mark Lam.
+
+        * bytecode/AccessCase.cpp:
+        (JSC::AccessCase::generateImpl):
+        * bytecode/GetterSetterAccessCase.cpp:
+        (JSC::GetterSetterAccessCase::emitDOMJITGetter):
+        * bytecode/InlineAccess.cpp:
+        (JSC::getScratchRegister):
+        * bytecode/PolymorphicAccess.cpp:
+        (JSC::PolymorphicAccess::regenerate):
+        * bytecode/StructureStubInfo.h:
+        (JSC::StructureStubInfo::valueRegs const):
+        * jit/JITInlineCacheGenerator.cpp:
+        (JSC::JITByIdGenerator::JITByIdGenerator):
+        (JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
+        (JSC::JITInstanceOfGenerator::JITInstanceOfGenerator):
+
+2018-08-30  Saam barati  <sbarati@apple.com>
+
         InlineAccess should do StringLength
         https://bugs.webkit.org/show_bug.cgi?id=158911
 
index 7daf85a..59596b6 100644 (file)
@@ -1066,7 +1066,7 @@ void AccessCase::generateImpl(AccessGenerationState& state)
         ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
         allocator.lock(baseGPR);
 #if USE(JSVALUE32_64)
-        allocator.lock(static_cast<GPRReg>(stubInfo.patch.baseTagGPR));
+        allocator.lock(stubInfo.patch.baseTagGPR);
 #endif
         allocator.lock(valueRegs);
         allocator.lock(scratchGPR);
index ce9f517..e7698f9 100644 (file)
@@ -141,7 +141,7 @@ void GetterSetterAccessCase::emitDOMJITGetter(AccessGenerationState& state, cons
     ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
     allocator.lock(baseGPR);
 #if USE(JSVALUE32_64)
-    allocator.lock(static_cast<GPRReg>(stubInfo.patch.baseTagGPR));
+    allocator.lock(stubInfo.patch.baseTagGPR);
 #endif
     allocator.lock(valueRegs);
     allocator.lock(scratchGPR);
index 86ec29b..4592a18 100644 (file)
@@ -198,10 +198,10 @@ ALWAYS_INLINE static GPRReg getScratchRegister(StructureStubInfo& stubInfo)
 {
     ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
     allocator.lock(stubInfo.baseGPR());
-    allocator.lock(static_cast<GPRReg>(stubInfo.patch.valueGPR));
+    allocator.lock(stubInfo.patch.valueGPR);
 #if USE(JSVALUE32_64)
-    allocator.lock(static_cast<GPRReg>(stubInfo.patch.baseTagGPR));
-    allocator.lock(static_cast<GPRReg>(stubInfo.patch.valueTagGPR));
+    allocator.lock(stubInfo.patch.baseTagGPR);
+    allocator.lock(stubInfo.patch.valueTagGPR);
 #endif
     GPRReg scratch = allocator.allocateScratchGPR();
     if (allocator.didReuseRegisters())
index fc44d4e..b68089d 100644 (file)
@@ -382,7 +382,7 @@ AccessGenerationResult PolymorphicAccess::regenerate(
     state.ident = &ident;
     
     state.baseGPR = stubInfo.baseGPR();
-    state.thisGPR = static_cast<GPRReg>(stubInfo.patch.thisGPR);
+    state.thisGPR = stubInfo.patch.thisGPR;
     state.valueRegs = stubInfo.valueRegs();
 
     ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
@@ -392,7 +392,7 @@ AccessGenerationResult PolymorphicAccess::regenerate(
         allocator.lock(state.thisGPR);
     allocator.lock(state.valueRegs);
 #if USE(JSVALUE32_64)
-    allocator.lock(static_cast<GPRReg>(stubInfo.patch.baseTagGPR));
+    allocator.lock(stubInfo.patch.baseTagGPR);
 #endif
 
     state.scratchGPR = allocator.allocateScratchGPR();
index 170826d..914991e 100644 (file)
@@ -191,19 +191,19 @@ public:
         int32_t deltaFromStartToSlowPathCallLocation;
         int32_t deltaFromStartToSlowPathStart;
 
-        int8_t baseGPR;
-        int8_t valueGPR;
-        int8_t thisGPR;
+        GPRReg baseGPR;
+        GPRReg valueGPR;
+        GPRReg thisGPR;
 #if USE(JSVALUE32_64)
-        int8_t valueTagGPR;
-        int8_t baseTagGPR;
-        int8_t thisTagGPR;
+        GPRReg valueTagGPR;
+        GPRReg baseTagGPR;
+        GPRReg thisTagGPR;
 #endif
     } patch;
 
     GPRReg baseGPR() const
     {
-        return static_cast<GPRReg>(patch.baseGPR);
+        return patch.baseGPR;
     }
 
     CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return patch.start.callAtOffset<JSInternalPtrTag>(patch.deltaFromStartToSlowPathCallLocation); }
@@ -219,9 +219,9 @@ public:
     {
         return JSValueRegs(
 #if USE(JSVALUE32_64)
-            static_cast<GPRReg>(patch.valueTagGPR),
+            patch.valueTagGPR,
 #endif
-            static_cast<GPRReg>(patch.valueGPR));
+            patch.valueGPR);
     }
 
 
index 2f96977..baf2799 100644 (file)
@@ -76,13 +76,13 @@ JITByIdGenerator::JITByIdGenerator(
     , m_base(base)
     , m_value(value)
 {
-    m_stubInfo->patch.baseGPR = static_cast<int8_t>(base.payloadGPR());
-    m_stubInfo->patch.valueGPR = static_cast<int8_t>(value.payloadGPR());
-    m_stubInfo->patch.thisGPR = static_cast<int8_t>(InvalidGPRReg);
+    m_stubInfo->patch.baseGPR = base.payloadGPR();
+    m_stubInfo->patch.valueGPR = value.payloadGPR();
+    m_stubInfo->patch.thisGPR = InvalidGPRReg;
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.baseTagGPR = static_cast<int8_t>(base.tagGPR());
-    m_stubInfo->patch.valueTagGPR = static_cast<int8_t>(value.tagGPR());
-    m_stubInfo->patch.thisTagGPR = static_cast<int8_t>(InvalidGPRReg);
+    m_stubInfo->patch.baseTagGPR = base.tagGPR();
+    m_stubInfo->patch.valueTagGPR = value.tagGPR();
+    m_stubInfo->patch.thisTagGPR = InvalidGPRReg;
 #endif
 }
 
@@ -126,9 +126,9 @@ JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator(
 {
     RELEASE_ASSERT(thisRegs.payloadGPR() != thisRegs.tagGPR());
 
-    m_stubInfo->patch.thisGPR = static_cast<int8_t>(thisRegs.payloadGPR());
+    m_stubInfo->patch.thisGPR = thisRegs.payloadGPR();
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.thisTagGPR = static_cast<int8_t>(thisRegs.tagGPR());
+    m_stubInfo->patch.thisTagGPR = thisRegs.tagGPR();
 #endif
 }
 
@@ -188,13 +188,13 @@ JITInstanceOfGenerator::JITInstanceOfGenerator(
     : JITInlineCacheGenerator(
         codeBlock, codeOrigin, callSiteIndex, AccessType::InstanceOf, usedRegisters)
 {
-    m_stubInfo->patch.baseGPR = static_cast<int8_t>(value);
-    m_stubInfo->patch.valueGPR = static_cast<int8_t>(result);
-    m_stubInfo->patch.thisGPR = static_cast<int8_t>(prototype);
+    m_stubInfo->patch.baseGPR = value;
+    m_stubInfo->patch.valueGPR = result;
+    m_stubInfo->patch.thisGPR = prototype;
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.baseTagGPR = static_cast<int8_t>(InvalidGPRReg);
-    m_stubInfo->patch.valueTagGPR = static_cast<int8_t>(InvalidGPRReg);
-    m_stubInfo->patch.thisTagGPR = static_cast<int8_t>(InvalidGPRReg);
+    m_stubInfo->patch.baseTagGPR = InvalidGPRReg;
+    m_stubInfo->patch.valueTagGPR = InvalidGPRReg;
+    m_stubInfo->patch.thisTagGPR = InvalidGPRReg;
 #endif
 
     m_stubInfo->patch.usedRegisters.clear(result);