Title: [253083] trunk/Source/_javascript_Core
Revision
253083
Author
[email protected]
Date
2019-12-03 19:04:19 -0800 (Tue, 03 Dec 2019)

Log Message

Remove "patch" struct from StructureStubInfo because it adds unnecessary padding
https://bugs.webkit.org/show_bug.cgi?id=204392

Reviewed by Tadeu Zagallo.

By doing this, we reduce the size of StructureStubInfo from 120 bytes to 112
bytes.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::emitDOMJITGetter):
* bytecode/InlineAccess.cpp:
(JSC::linkCodeInline):
(JSC::InlineAccess::generateSelfPropertyAccess):
(JSC::getScratchRegister):
(JSC::InlineAccess::generateSelfPropertyReplace):
(JSC::InlineAccess::generateArrayLength):
(JSC::InlineAccess::generateStringLength):
(JSC::InlineAccess::generateSelfInAccess):
(JSC::InlineAccess::rewireStubAsJump):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::inlineSize const):
(JSC::StructureStubInfo::patchableJump):
(JSC::StructureStubInfo::valueRegs const):
(JSC::StructureStubInfo::propertyRegs const):
(JSC::StructureStubInfo::baseRegs const):
(JSC::StructureStubInfo::baseGPR const): Deleted.
(JSC::StructureStubInfo::slowPathCallLocation): Deleted.
(JSC::StructureStubInfo::doneLocation): Deleted.
(JSC::StructureStubInfo::slowPathStartLocation): Deleted.
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::callerReturnPC):
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITInlineCacheGenerator::JITInlineCacheGenerator):
(JSC::JITInlineCacheGenerator::finalize):
(JSC::JITByIdGenerator::JITByIdGenerator):
(JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
(JSC::JITPutByIdGenerator::JITPutByIdGenerator):
(JSC::JITInstanceOfGenerator::JITInstanceOfGenerator):
(JSC::JITGetByValGenerator::JITGetByValGenerator):
* jit/Repatch.cpp:
(JSC::tryCacheGetBy):
(JSC::repatchGetBy):
(JSC::repatchArrayGetByVal):
(JSC::tryCachePutByID):
(JSC::repatchPutByID):
(JSC::tryCacheInByID):
(JSC::repatchInByID):
(JSC::repatchInstanceOf):
(JSC::resetGetBy):
(JSC::resetPutByID):
(JSC::resetPatchableJump):
(JSC::resetInByID):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (253082 => 253083)


--- trunk/Source/_javascript_Core/ChangeLog	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-12-04 03:04:19 UTC (rev 253083)
@@ -1,3 +1,63 @@
+2019-12-03  Saam Barati  <[email protected]>
+
+        Remove "patch" struct from StructureStubInfo because it adds unnecessary padding
+        https://bugs.webkit.org/show_bug.cgi?id=204392
+
+        Reviewed by Tadeu Zagallo.
+
+        By doing this, we reduce the size of StructureStubInfo from 120 bytes to 112
+        bytes.
+
+        * bytecode/AccessCase.cpp:
+        (JSC::AccessCase::generateWithGuard):
+        (JSC::AccessCase::generateImpl):
+        * bytecode/GetterSetterAccessCase.cpp:
+        (JSC::GetterSetterAccessCase::emitDOMJITGetter):
+        * bytecode/InlineAccess.cpp:
+        (JSC::linkCodeInline):
+        (JSC::InlineAccess::generateSelfPropertyAccess):
+        (JSC::getScratchRegister):
+        (JSC::InlineAccess::generateSelfPropertyReplace):
+        (JSC::InlineAccess::generateArrayLength):
+        (JSC::InlineAccess::generateStringLength):
+        (JSC::InlineAccess::generateSelfInAccess):
+        (JSC::InlineAccess::rewireStubAsJump):
+        * bytecode/PolymorphicAccess.cpp:
+        (JSC::PolymorphicAccess::regenerate):
+        * bytecode/StructureStubInfo.h:
+        (JSC::StructureStubInfo::inlineSize const):
+        (JSC::StructureStubInfo::patchableJump):
+        (JSC::StructureStubInfo::valueRegs const):
+        (JSC::StructureStubInfo::propertyRegs const):
+        (JSC::StructureStubInfo::baseRegs const):
+        (JSC::StructureStubInfo::baseGPR const): Deleted.
+        (JSC::StructureStubInfo::slowPathCallLocation): Deleted.
+        (JSC::StructureStubInfo::doneLocation): Deleted.
+        (JSC::StructureStubInfo::slowPathStartLocation): Deleted.
+        * dfg/DFGOSRExitCompilerCommon.cpp:
+        (JSC::DFG::callerReturnPC):
+        * jit/JITInlineCacheGenerator.cpp:
+        (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator):
+        (JSC::JITInlineCacheGenerator::finalize):
+        (JSC::JITByIdGenerator::JITByIdGenerator):
+        (JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator):
+        (JSC::JITPutByIdGenerator::JITPutByIdGenerator):
+        (JSC::JITInstanceOfGenerator::JITInstanceOfGenerator):
+        (JSC::JITGetByValGenerator::JITGetByValGenerator):
+        * jit/Repatch.cpp:
+        (JSC::tryCacheGetBy):
+        (JSC::repatchGetBy):
+        (JSC::repatchArrayGetByVal):
+        (JSC::tryCachePutByID):
+        (JSC::repatchPutByID):
+        (JSC::tryCacheInByID):
+        (JSC::repatchInByID):
+        (JSC::repatchInstanceOf):
+        (JSC::resetGetBy):
+        (JSC::resetPutByID):
+        (JSC::resetPatchableJump):
+        (JSC::resetInByID):
+
 2019-12-03  Yusuke Suzuki  <[email protected]>
 
         Unreviewed, fix build failure

Modified: trunk/Source/_javascript_Core/bytecode/AccessCase.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/bytecode/AccessCase.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/bytecode/AccessCase.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -870,7 +870,7 @@
         jit.load8(CCallHelpers::Address(baseGPR, JSCell::typeInfoTypeOffset()), scratchGPR);
         fallThrough.append(jit.branch32(CCallHelpers::NotEqual, scratchGPR, CCallHelpers::TrustedImm32(ScopedArgumentsType)));
 
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(stubInfo.propertyRegs());
@@ -965,7 +965,7 @@
         jit.load32(CCallHelpers::Address(baseGPR, JSArrayBufferView::offsetOfLength()), scratchGPR);
         state.failAndRepatch.append(jit.branch32(CCallHelpers::AboveOrEqual, propertyGPR, scratchGPR));
 
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(stubInfo.propertyRegs());
@@ -1047,7 +1047,7 @@
 
         fallThrough.append(jit.branchIfNotString(baseGPR));
 
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(stubInfo.propertyRegs());
@@ -1107,7 +1107,7 @@
         CCallHelpers::Jump isOutOfBounds;
         CCallHelpers::Jump isEmpty;
 
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(stubInfo.propertyRegs());
@@ -1218,7 +1218,7 @@
         
         GPRReg valueGPR = valueRegs.payloadGPR();
         
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(stubInfo.propertyRegs());
@@ -1731,7 +1731,7 @@
         bool reallocating = allocating && structure()->outOfLineCapacity();
         bool allocatingInline = allocating && !structure()->couldHaveIndexingHeader();
 
-        ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+        ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
         allocator.lock(stubInfo.baseRegs());
         allocator.lock(valueRegs);
         allocator.lock(scratchGPR);

Modified: trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/bytecode/GetterSetterAccessCase.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -138,7 +138,7 @@
     Vector<FPRReg> fpScratch;
     Vector<SnippetParams::Value> regs;
 
-    ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+    ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
     allocator.lock(stubInfo.baseRegs());
     allocator.lock(valueRegs);
     allocator.lock(scratchGPR);

Modified: trunk/Source/_javascript_Core/bytecode/InlineAccess.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/bytecode/InlineAccess.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/bytecode/InlineAccess.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -152,9 +152,9 @@
 template <typename Function>
 ALWAYS_INLINE static bool linkCodeInline(const char* name, CCallHelpers& jit, StructureStubInfo& stubInfo, const Function& function)
 {
-    if (jit.m_assembler.buffer().codeSize() <= stubInfo.patch.inlineSize()) {
+    if (jit.m_assembler.buffer().codeSize() <= stubInfo.inlineSize()) {
         bool needsBranchCompaction = true;
-        LinkBuffer linkBuffer(jit, stubInfo.patch.start, stubInfo.patch.inlineSize(), JITCompilationMustSucceed, needsBranchCompaction);
+        LinkBuffer linkBuffer(jit, stubInfo.start, stubInfo.inlineSize(), JITCompilationMustSucceed, needsBranchCompaction);
         ASSERT(linkBuffer.isValid());
         function(linkBuffer);
         FINALIZE_CODE(linkBuffer, NoPtrTag, "InlineAccessType: '%s'", name);
@@ -169,7 +169,7 @@
     constexpr bool failIfCantInline = false;
     if (failIfCantInline) {
         dataLog("Failure for: ", name, "\n");
-        dataLog("real size: ", jit.m_assembler.buffer().codeSize(), " inline size:", stubInfo.patch.inlineSize(), "\n");
+        dataLog("real size: ", jit.m_assembler.buffer().codeSize(), " inline size:", stubInfo.inlineSize(), "\n");
         CRASH();
     }
 
@@ -183,7 +183,7 @@
 
     CCallHelpers jit;
     
-    GPRReg base = stubInfo.baseGPR();
+    GPRReg base = stubInfo.baseGPR;
     JSValueRegs value = stubInfo.valueRegs();
 
     auto branchToSlowPath = jit.patchableBranch32(
@@ -202,7 +202,7 @@
         MacroAssembler::Address(storage, offsetRelativeToBase(offset)), value);
 
     bool linkedCodeInline = linkCodeInline("property access", jit, stubInfo, [&] (LinkBuffer& linkBuffer) {
-        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation());
+        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation);
     });
     return linkedCodeInline;
 }
@@ -209,12 +209,12 @@
 
 ALWAYS_INLINE static GPRReg getScratchRegister(StructureStubInfo& stubInfo)
 {
-    ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
-    allocator.lock(stubInfo.baseGPR());
-    allocator.lock(stubInfo.patch.valueGPR);
+    ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
+    allocator.lock(stubInfo.baseGPR);
+    allocator.lock(stubInfo.valueGPR);
 #if USE(JSVALUE32_64)
-    allocator.lock(stubInfo.patch.baseTagGPR);
-    allocator.lock(stubInfo.patch.valueTagGPR);
+    allocator.lock(stubInfo.baseTagGPR);
+    allocator.lock(stubInfo.valueTagGPR);
 #endif
     GPRReg scratch = allocator.allocateScratchGPR();
     if (allocator.didReuseRegisters())
@@ -247,7 +247,7 @@
 
     CCallHelpers jit;
 
-    GPRReg base = stubInfo.baseGPR();
+    GPRReg base = stubInfo.baseGPR;
     JSValueRegs value = stubInfo.valueRegs();
 
     auto branchToSlowPath = jit.patchableBranch32(
@@ -268,7 +268,7 @@
         value, MacroAssembler::Address(storage, offsetRelativeToBase(offset)));
 
     bool linkedCodeInline = linkCodeInline("property replace", jit, stubInfo, [&] (LinkBuffer& linkBuffer) {
-        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation());
+        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation);
     });
     return linkedCodeInline;
 }
@@ -295,7 +295,7 @@
 
     CCallHelpers jit;
 
-    GPRReg base = stubInfo.baseGPR();
+    GPRReg base = stubInfo.baseGPR;
     JSValueRegs value = stubInfo.valueRegs();
     GPRReg scratch = getScratchRegister(stubInfo);
 
@@ -308,7 +308,7 @@
     jit.boxInt32(value.payloadGPR(), value);
 
     bool linkedCodeInline = linkCodeInline("array length", jit, stubInfo, [&] (LinkBuffer& linkBuffer) {
-        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation());
+        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation);
     });
     return linkedCodeInline;
 }
@@ -330,7 +330,7 @@
 
     CCallHelpers jit;
 
-    GPRReg base = stubInfo.baseGPR();
+    GPRReg base = stubInfo.baseGPR;
     JSValueRegs value = stubInfo.valueRegs();
     GPRReg scratch = getScratchRegister(stubInfo);
 
@@ -351,7 +351,7 @@
     jit.boxInt32(value.payloadGPR(), value);
 
     bool linkedCodeInline = linkCodeInline("string length", jit, stubInfo, [&] (LinkBuffer& linkBuffer) {
-        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation());
+        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation);
     });
     return linkedCodeInline;
 }
@@ -364,7 +364,7 @@
     if (!stubInfo.hasConstantIdentifier)
         return false;
 
-    GPRReg base = stubInfo.baseGPR();
+    GPRReg base = stubInfo.baseGPR;
     JSValueRegs value = stubInfo.valueRegs();
 
     auto branchToSlowPath = jit.patchableBranch32(
@@ -374,7 +374,7 @@
     jit.boxBoolean(true, value);
 
     bool linkedCodeInline = linkCodeInline("in access", jit, stubInfo, [&] (LinkBuffer& linkBuffer) {
-        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation());
+        linkBuffer.link(branchToSlowPath, stubInfo.slowPathStartLocation);
     });
     return linkedCodeInline;
 }
@@ -387,7 +387,7 @@
 
     // We don't need a nop sled here because nobody should be jumping into the middle of an IC.
     bool needsBranchCompaction = false;
-    LinkBuffer linkBuffer(jit, stubInfo.patch.start, jit.m_assembler.buffer().codeSize(), JITCompilationMustSucceed, needsBranchCompaction);
+    LinkBuffer linkBuffer(jit, stubInfo.start, jit.m_assembler.buffer().codeSize(), JITCompilationMustSucceed, needsBranchCompaction);
     RELEASE_ASSERT(linkBuffer.isValid());
     linkBuffer.link(jump, target);
 

Modified: trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -392,8 +392,8 @@
     state.access = this;
     state.stubInfo = &stubInfo;
     
-    state.baseGPR = stubInfo.baseGPR();
-    state.u.thisGPR = stubInfo.patch.u.thisGPR;
+    state.baseGPR = stubInfo.baseGPR;
+    state.u.thisGPR = stubInfo.regs.thisGPR;
     state.valueRegs = stubInfo.valueRegs();
 
     // Regenerating is our opportunity to figure out what our list of cases should look like. We
@@ -444,7 +444,7 @@
     }
     m_list.resize(dstIndex);
 
-    ScratchRegisterAllocator allocator(stubInfo.patch.usedRegisters);
+    ScratchRegisterAllocator allocator(stubInfo.usedRegisters);
     state.allocator = &allocator;
     allocator.lock(state.baseGPR);
     if (state.u.thisGPR != InvalidGPRReg)
@@ -451,9 +451,9 @@
         allocator.lock(state.u.thisGPR);
     allocator.lock(state.valueRegs);
 #if USE(JSVALUE32_64)
-    allocator.lock(stubInfo.patch.baseTagGPR);
-    if (stubInfo.patch.v.thisTagGPR != InvalidGPRReg)
-        allocator.lock(stubInfo.patch.v.thisTagGPR);
+    allocator.lock(stubInfo.baseTagGPR);
+    if (stubInfo.v.thisTagGPR != InvalidGPRReg)
+        allocator.lock(stubInfo.v.thisTagGPR);
 #endif
 
     state.scratchGPR = allocator.allocateScratchGPR();
@@ -527,7 +527,7 @@
 #if USE(JSVALUE64) 
                     notInt32 = jit.branchIfNotInt32(state.u.propertyGPR);
 #else
-                    notInt32 = jit.branchIfNotInt32(state.stubInfo->patch.v.propertyTagGPR);
+                    notInt32 = jit.branchIfNotInt32(state.stubInfo->v.propertyTagGPR);
 #endif
                 }
                 for (unsigned i = cases.size(); i--;) {
@@ -553,7 +553,7 @@
                 GPRReg propertyGPR = state.u.propertyGPR;
                 if (!stubInfo.propertyIsString) {
 #if USE(JSVALUE32_64)
-                    GPRReg propertyTagGPR = state.stubInfo->patch.v.propertyTagGPR;
+                    GPRReg propertyTagGPR = state.stubInfo->v.propertyTagGPR;
                     notString.append(jit.branchIfNotCell(propertyTagGPR));
 #else
                     notString.append(jit.branchIfNotCell(propertyGPR));
@@ -585,7 +585,7 @@
                 if (!stubInfo.propertyIsSymbol) {
                     GPRReg propertyGPR = state.u.propertyGPR;
 #if USE(JSVALUE32_64)
-                    GPRReg propertyTagGPR = state.stubInfo->patch.v.propertyTagGPR;
+                    GPRReg propertyTagGPR = state.stubInfo->v.propertyTagGPR;
                     notSymbol.append(jit.branchIfNotCell(propertyTagGPR));
 #else
                     notSymbol.append(jit.branchIfNotCell(propertyGPR));
@@ -702,11 +702,11 @@
         return AccessGenerationResult::GaveUp;
     }
 
-    CodeLocationLabel<JSInternalPtrTag> successLabel = stubInfo.doneLocation();
+    CodeLocationLabel<JSInternalPtrTag> successLabel = stubInfo.doneLocation;
 
     linkBuffer.link(state.success, successLabel);
 
-    linkBuffer.link(failure, stubInfo.slowPathStartLocation());
+    linkBuffer.link(failure, stubInfo.slowPathStartLocation);
     
     if (PolymorphicAccessInternal::verbose)
         dataLog(FullCodeOrigin(codeBlock, stubInfo.codeOrigin), ": Generating polymorphic access stub for ", listDump(cases), "\n");

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h (253082 => 253083)


--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2019-12-04 03:04:19 UTC (rev 253083)
@@ -196,53 +196,42 @@
     HashSet<std::pair<Structure*, RefPtr<UniquedStringImpl>>> bufferedStructures;
 public:
     
-    struct {
-        CodeLocationLabel<JITStubRoutinePtrTag> start; // This is either the start of the inline IC for *byId caches. or the location of patchable jump for 'instanceof' caches.
-        CodeLocationLabel<JSInternalPtrTag> doneLocation;
-        CodeLocationCall<JSInternalPtrTag> slowPathCallLocation;
-        CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation;
+    CodeLocationLabel<JITStubRoutinePtrTag> start; // This is either the start of the inline IC for *byId caches. or the location of patchable jump for 'instanceof' caches.
+    CodeLocationLabel<JSInternalPtrTag> doneLocation;
+    CodeLocationCall<JSInternalPtrTag> slowPathCallLocation;
+    CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation;
 
-        RegisterSet usedRegisters;
+    RegisterSet usedRegisters;
 
-        uint32_t inlineSize() const
-        {
-            int32_t inlineSize = MacroAssembler::differenceBetweenCodePtr(start, doneLocation);
-            ASSERT(inlineSize >= 0);
-            return inlineSize;
-        }
+    uint32_t inlineSize() const
+    {
+        int32_t inlineSize = MacroAssembler::differenceBetweenCodePtr(start, doneLocation);
+        ASSERT(inlineSize >= 0);
+        return inlineSize;
+    }
 
-        GPRReg baseGPR;
-        GPRReg valueGPR;
-        union {
-            GPRReg thisGPR;
-            GPRReg prototypeGPR;
-            GPRReg propertyGPR;
-        } u;
+    GPRReg baseGPR;
+    GPRReg valueGPR;
+    union {
+        GPRReg thisGPR;
+        GPRReg prototypeGPR;
+        GPRReg propertyGPR;
+    } regs;
 #if USE(JSVALUE32_64)
-        GPRReg valueTagGPR;
-        // FIXME: [32-bits] Check if StructureStubInfo::patch.baseTagGPR is used somewhere.
-        // https://bugs.webkit.org/show_bug.cgi?id=204726
-        GPRReg baseTagGPR;
-        union {
-            GPRReg thisTagGPR;
-            GPRReg propertyTagGPR;
-        } v;
+    GPRReg valueTagGPR;
+    // FIXME: [32-bits] Check if StructureStubInfo::baseTagGPR is used somewhere.
+    // https://bugs.webkit.org/show_bug.cgi?id=204726
+    GPRReg baseTagGPR;
+    union {
+        GPRReg thisTagGPR;
+        GPRReg propertyTagGPR;
+    } v;
 #endif
-    } patch;
 
-    GPRReg baseGPR() const
-    {
-        return patch.baseGPR;
-    }
-
-    CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return patch.slowPathCallLocation; }
-    CodeLocationLabel<JSInternalPtrTag> doneLocation() { return patch.doneLocation; }
-    CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation() { return patch.slowPathStartLocation; }
-
     CodeLocationJump<JSInternalPtrTag> patchableJump()
     { 
         ASSERT(accessType == AccessType::InstanceOf);
-        return patch.start.jumpAtOffset<JSInternalPtrTag>(0);
+        return start.jumpAtOffset<JSInternalPtrTag>(0);
     }
 
     JSValueRegs valueRegs() const
@@ -249,9 +238,9 @@
     {
         return JSValueRegs(
 #if USE(JSVALUE32_64)
-            patch.valueTagGPR,
+            valueTagGPR,
 #endif
-            patch.valueGPR);
+            valueGPR);
     }
 
     JSValueRegs propertyRegs() const
@@ -258,9 +247,9 @@
     {
         return JSValueRegs(
 #if USE(JSVALUE32_64)
-            patch.v.propertyTagGPR,
+            v.propertyTagGPR,
 #endif
-            patch.u.propertyGPR);
+            regs.propertyGPR);
     }
 
     JSValueRegs baseRegs() const
@@ -267,9 +256,9 @@
     {
         return JSValueRegs(
 #if USE(JSVALUE32_64)
-            patch.baseTagGPR,
+            baseTagGPR,
 #endif
-            patch.baseGPR);
+            baseGPR);
     }
 
     bool thisValueIsInThisGPR() const { return accessType == AccessType::GetByIdWithThis; }

Modified: trunk/Source/_javascript_Core/dfg/DFGOSRExitCompilerCommon.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/dfg/DFGOSRExitCompilerCommon.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/dfg/DFGOSRExitCompilerCommon.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -206,7 +206,7 @@
                 baselineCodeBlockForCaller->findStubInfo(CodeOrigin(callBytecodeIndex));
             RELEASE_ASSERT(stubInfo);
 
-            jumpTarget = stubInfo->doneLocation().untaggedExecutableAddress();
+            jumpTarget = stubInfo->doneLocation.untaggedExecutableAddress();
             break;
         }
 

Modified: trunk/Source/_javascript_Core/jit/JITInlineCacheGenerator.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/jit/JITInlineCacheGenerator.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/jit/JITInlineCacheGenerator.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -51,18 +51,18 @@
     m_stubInfo->codeOrigin = codeOrigin;
     m_stubInfo->callSiteIndex = callSite;
 
-    m_stubInfo->patch.usedRegisters = usedRegisters;
+    m_stubInfo->usedRegisters = usedRegisters;
 }
 
 void JITInlineCacheGenerator::finalize(
     LinkBuffer& fastPath, LinkBuffer& slowPath, CodeLocationLabel<JITStubRoutinePtrTag> start)
 {
-    m_stubInfo->patch.start = start;
+    m_stubInfo->start = start;
 
-    m_stubInfo->patch.doneLocation = fastPath.locationOf<JSInternalPtrTag>(m_done);
+    m_stubInfo->doneLocation = fastPath.locationOf<JSInternalPtrTag>(m_done);
 
-    m_stubInfo->patch.slowPathCallLocation = slowPath.locationOf<JSInternalPtrTag>(m_slowPathCall);
-    m_stubInfo->patch.slowPathStartLocation = slowPath.locationOf<JITStubRoutinePtrTag>(m_slowPathBegin);
+    m_stubInfo->slowPathCallLocation = slowPath.locationOf<JSInternalPtrTag>(m_slowPathCall);
+    m_stubInfo->slowPathStartLocation = slowPath.locationOf<JITStubRoutinePtrTag>(m_slowPathBegin);
 }
 
 JITByIdGenerator::JITByIdGenerator(
@@ -72,13 +72,13 @@
     , m_base(base)
     , m_value(value)
 {
-    m_stubInfo->patch.baseGPR = base.payloadGPR();
-    m_stubInfo->patch.valueGPR = value.payloadGPR();
-    m_stubInfo->patch.u.thisGPR = InvalidGPRReg;
+    m_stubInfo->baseGPR = base.payloadGPR();
+    m_stubInfo->valueGPR = value.payloadGPR();
+    m_stubInfo->regs.thisGPR = InvalidGPRReg;
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.baseTagGPR = base.tagGPR();
-    m_stubInfo->patch.valueTagGPR = value.tagGPR();
-    m_stubInfo->patch.v.thisTagGPR = InvalidGPRReg;
+    m_stubInfo->baseTagGPR = base.tagGPR();
+    m_stubInfo->valueTagGPR = value.tagGPR();
+    m_stubInfo->v.thisTagGPR = InvalidGPRReg;
 #endif
 }
 
@@ -122,9 +122,9 @@
 {
     RELEASE_ASSERT(thisRegs.payloadGPR() != thisRegs.tagGPR());
 
-    m_stubInfo->patch.u.thisGPR = thisRegs.payloadGPR();
+    m_stubInfo->regs.thisGPR = thisRegs.payloadGPR();
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.v.thisTagGPR = thisRegs.tagGPR();
+    m_stubInfo->v.thisTagGPR = thisRegs.tagGPR();
 #endif
 }
 
@@ -142,7 +142,7 @@
     , m_ecmaMode(ecmaMode)
     , m_putKind(putKind)
 {
-    m_stubInfo->patch.usedRegisters.clear(scratch);
+    m_stubInfo->usedRegisters.clear(scratch);
 }
 
 void JITPutByIdGenerator::generateFastPath(MacroAssembler& jit)
@@ -184,20 +184,20 @@
     : JITInlineCacheGenerator(
         codeBlock, codeOrigin, callSiteIndex, AccessType::InstanceOf, usedRegisters)
 {
-    m_stubInfo->patch.baseGPR = value;
-    m_stubInfo->patch.valueGPR = result;
-    m_stubInfo->patch.u.prototypeGPR = prototype;
+    m_stubInfo->baseGPR = value;
+    m_stubInfo->valueGPR = result;
+    m_stubInfo->regs.prototypeGPR = prototype;
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.baseTagGPR = InvalidGPRReg;
-    m_stubInfo->patch.valueTagGPR = InvalidGPRReg;
-    m_stubInfo->patch.v.thisTagGPR = InvalidGPRReg;
+    m_stubInfo->baseTagGPR = InvalidGPRReg;
+    m_stubInfo->valueTagGPR = InvalidGPRReg;
+    m_stubInfo->v.thisTagGPR = InvalidGPRReg;
 #endif
 
-    m_stubInfo->patch.usedRegisters.clear(result);
+    m_stubInfo->usedRegisters.clear(result);
     if (scratch1 != InvalidGPRReg)
-        m_stubInfo->patch.usedRegisters.clear(scratch1);
+        m_stubInfo->usedRegisters.clear(scratch1);
     if (scratch2 != InvalidGPRReg)
-        m_stubInfo->patch.usedRegisters.clear(scratch2);
+        m_stubInfo->usedRegisters.clear(scratch2);
 
     m_stubInfo->prototypeIsKnownObject = prototypeIsKnownObject;
 
@@ -226,13 +226,13 @@
 {
     m_stubInfo->hasConstantIdentifier = false;
 
-    m_stubInfo->patch.baseGPR = base.payloadGPR();
-    m_stubInfo->patch.u.propertyGPR = property.payloadGPR();
-    m_stubInfo->patch.valueGPR = result.payloadGPR();
+    m_stubInfo->baseGPR = base.payloadGPR();
+    m_stubInfo->regs.propertyGPR = property.payloadGPR();
+    m_stubInfo->valueGPR = result.payloadGPR();
 #if USE(JSVALUE32_64)
-    m_stubInfo->patch.baseTagGPR = base.tagGPR();
-    m_stubInfo->patch.valueTagGPR = result.tagGPR();
-    m_stubInfo->patch.v.propertyTagGPR = property.tagGPR();
+    m_stubInfo->baseTagGPR = base.tagGPR();
+    m_stubInfo->valueTagGPR = result.tagGPR();
+    m_stubInfo->v.propertyTagGPR = property.tagGPR();
 #endif
 }
 

Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (253082 => 253083)


--- trunk/Source/_javascript_Core/jit/Repatch.cpp	2019-12-04 02:41:49 UTC (rev 253082)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp	2019-12-04 03:04:19 UTC (rev 253083)
@@ -204,7 +204,7 @@
 
                     bool generatedCodeInline = InlineAccess::generateArrayLength(stubInfo, jsCast<JSArray*>(baseCell));
                     if (generatedCodeInline) {
-                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateOptimizingGetByFunction(kind));
+                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateOptimizingGetByFunction(kind));
                         stubInfo.initArrayLength();
                         return RetryCacheLater;
                     }
@@ -215,7 +215,7 @@
                 if (stubInfo.cacheType() == CacheType::Unset && InlineAccess::isCacheableStringLength(stubInfo)) {
                     bool generatedCodeInline = InlineAccess::generateStringLength(stubInfo);
                     if (generatedCodeInline) {
-                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateOptimizingGetByFunction(kind));
+                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateOptimizingGetByFunction(kind));
                         stubInfo.initStringLength();
                         return RetryCacheLater;
                     }
@@ -270,7 +270,7 @@
                 if (generatedCodeInline) {
                     LOG_IC((ICEvent::GetBySelfPatch, structure->classInfo(), propertyName, slot.slotBase() == baseValue));
                     structure->startWatchingPropertyForReplacements(vm, slot.cachedOffset());
-                    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateOptimizingGetByFunction(kind));
+                    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateOptimizingGetByFunction(kind));
                     stubInfo.initGetByIdSelf(codeBlock, structure, slot.cachedOffset(), propertyName);
                     return RetryCacheLater;
                 }
@@ -406,7 +406,7 @@
     SuperSamplerScope superSamplerScope(false);
     
     if (tryCacheGetBy(globalObject, codeBlock, baseValue, propertyName, slot, stubInfo, kind) == GiveUpOnCache)
-        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateGetByFunction(kind));
+        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateGetByFunction(kind));
 }
 
 
@@ -502,7 +502,7 @@
 void repatchArrayGetByVal(JSGlobalObject* globalObject, CodeBlock* codeBlock, JSValue base, JSValue index, StructureStubInfo& stubInfo)
 {
     if (tryCacheArrayGetByVal(globalObject, codeBlock, base, index, stubInfo) == GiveUpOnCache)
-        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), operationGetByValGeneric);
+        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationGetByValGeneric);
 }
 
 static V_JITOperation_GSsiJJI appropriateGenericPutByIdFunction(const PutPropertySlot &slot, PutKind putKind)
@@ -576,7 +576,7 @@
                     bool generatedCodeInline = InlineAccess::generateSelfPropertyReplace(stubInfo, structure, slot.cachedOffset());
                     if (generatedCodeInline) {
                         LOG_IC((ICEvent::PutByIdSelfPatch, structure->classInfo(), ident, slot.base() == baseValue));
-                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateOptimizingPutByIdFunction(slot, putKind));
+                        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateOptimizingPutByIdFunction(slot, putKind));
                         stubInfo.initPutByIdReplace(codeBlock, structure, slot.cachedOffset());
                         return RetryCacheLater;
                     }
@@ -712,7 +712,7 @@
     SuperSamplerScope superSamplerScope(false);
     
     if (tryCachePutByID(globalObject, codeBlock, baseValue, structure, propertyName, slot, stubInfo, putKind) == GiveUpOnCache)
-        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateGenericPutByIdFunction(slot, putKind));
+        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateGenericPutByIdFunction(slot, putKind));
 }
 
 static InlineCacheAction tryCacheInByID(
@@ -754,7 +754,7 @@
                 if (generatedCodeInline) {
                     LOG_IC((ICEvent::InByIdSelfPatch, structure->classInfo(), ident, slot.slotBase() == base));
                     structure->startWatchingPropertyForReplacements(vm, slot.cachedOffset());
-                    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), operationInByIdOptimize);
+                    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByIdOptimize);
                     stubInfo.initInByIdSelf(codeBlock, structure, slot.cachedOffset());
                     return RetryCacheLater;
                 }
@@ -824,7 +824,7 @@
     SuperSamplerScope superSamplerScope(false);
 
     if (tryCacheInByID(globalObject, codeBlock, baseObject, propertyName, wasFound, slot, stubInfo) == GiveUpOnCache)
-        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), operationInById);
+        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInById);
 }
 
 static InlineCacheAction tryCacheInstanceOf(
@@ -896,7 +896,7 @@
 {
     SuperSamplerScope superSamplerScope(false);
     if (tryCacheInstanceOf(globalObject, codeBlock, valueValue, prototypeValue, stubInfo, wasFound) == GiveUpOnCache)
-        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), operationInstanceOfGeneric);
+        ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInstanceOfGeneric);
 }
 
 static void linkSlowFor(VM&, CallLinkInfo& callLinkInfo, MacroAssemblerCodeRef<JITStubRoutinePtrTag> codeRef)
@@ -1349,13 +1349,13 @@
 
 void resetGetBy(CodeBlock* codeBlock, StructureStubInfo& stubInfo, GetByKind kind)
 {
-    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), appropriateOptimizingGetByFunction(kind));
-    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation());
+    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, appropriateOptimizingGetByFunction(kind));
+    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation);
 }
 
 void resetPutByID(CodeBlock* codeBlock, StructureStubInfo& stubInfo)
 {
-    V_JITOperation_GSsiJJI unoptimizedFunction = reinterpret_cast<V_JITOperation_GSsiJJI>(readPutICCallTarget(codeBlock, stubInfo.slowPathCallLocation()).executableAddress());
+    V_JITOperation_GSsiJJI unoptimizedFunction = reinterpret_cast<V_JITOperation_GSsiJJI>(readPutICCallTarget(codeBlock, stubInfo.slowPathCallLocation).executableAddress());
     V_JITOperation_GSsiJJI optimizedFunction;
     if (unoptimizedFunction == operationPutByIdStrict || unoptimizedFunction == operationPutByIdStrictOptimize)
         optimizedFunction = operationPutByIdStrictOptimize;
@@ -1368,19 +1368,19 @@
         optimizedFunction = operationPutByIdDirectNonStrictOptimize;
     }
 
-    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), optimizedFunction);
-    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation());
+    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, optimizedFunction);
+    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation);
 }
 
 static void resetPatchableJump(StructureStubInfo& stubInfo)
 {
-    MacroAssembler::repatchJump(stubInfo.patchableJump(), stubInfo.slowPathStartLocation());
+    MacroAssembler::repatchJump(stubInfo.patchableJump(), stubInfo.slowPathStartLocation);
 }
 
 void resetInByID(CodeBlock* codeBlock, StructureStubInfo& stubInfo)
 {
-    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation(), operationInByIdOptimize);
-    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation());
+    ftlThunkAwareRepatchCall(codeBlock, stubInfo.slowPathCallLocation, operationInByIdOptimize);
+    InlineAccess::rewireStubAsJump(stubInfo, stubInfo.slowPathStartLocation);
 }
 
 void resetInstanceOf(StructureStubInfo& stubInfo)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to