Changeset 251951 in webkit
- Timestamp:
- Nov 1, 2019 4:07:34 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r251940 r251951 1 2019-11-01 Saam Barati <sbarati@apple.com> 2 3 Refactor uses of StructureStubInfo 'thisGPR' to a union for thisGPR and prototypeGPR 4 https://bugs.webkit.org/show_bug.cgi?id=203693 5 6 Reviewed by Mark Lam and Yusuke Suzuki. 7 8 I'm going to be adding a third overload for this field when making 9 GetByVal inline caching part of StructureStubInfo. It's nicer for 10 each use case of this field to use it by the proper name. 11 12 * bytecode/AccessCase.cpp: 13 (JSC::AccessCase::generateWithGuard): 14 (JSC::AccessCase::generateImpl): 15 * bytecode/PolymorphicAccess.cpp: 16 (JSC::PolymorphicAccess::regenerate): 17 * bytecode/PolymorphicAccess.h: 18 (JSC::AccessGenerationState::AccessGenerationState): 19 * bytecode/StructureStubInfo.h: 20 * jit/JITInlineCacheGenerator.cpp: 21 (JSC::JITByIdGenerator::JITByIdGenerator): 22 (JSC::JITGetByIdWithThisGenerator::JITGetByIdWithThisGenerator): 23 (JSC::JITInstanceOfGenerator::JITInstanceOfGenerator): 24 1 25 2019-11-01 Alexey Shvayka <shvaikalesh@gmail.com> 2 26 -
trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp
r251425 r251951 466 466 JSValueRegs valueRegs = state.valueRegs; 467 467 GPRReg baseGPR = state.baseGPR; 468 GPRReg thisGPR = state.thisGPR != InvalidGPRReg ? state.thisGPR : baseGPR;469 468 GPRReg scratchGPR = state.scratchGPR; 470 469 … … 604 603 fallThrough.append( 605 604 jit.branchPtr( 606 CCallHelpers::NotEqual, thisGPR,605 CCallHelpers::NotEqual, state.u.prototypeGPR, 607 606 CCallHelpers::TrustedImmPtr(as<InstanceOfAccessCase>().prototype()))); 608 607 break; 609 608 610 609 case InstanceOfGeneric: { 611 // Legend: value = `base instanceof this`. 610 GPRReg prototypeGPR = state.u.prototypeGPR; 611 // Legend: value = `base instanceof prototypeGPR`. 612 612 613 613 GPRReg valueGPR = valueRegs.payloadGPR(); … … 616 616 allocator.lock(baseGPR); 617 617 allocator.lock(valueGPR); 618 allocator.lock( thisGPR);618 allocator.lock(prototypeGPR); 619 619 allocator.lock(scratchGPR); 620 620 … … 622 622 623 623 if (!state.stubInfo->prototypeIsKnownObject) 624 state.failAndIgnore.append(jit.branchIfNotObject( thisGPR));624 state.failAndIgnore.append(jit.branchIfNotObject(prototypeGPR)); 625 625 626 626 ScratchRegisterAllocator::PreservedState preservedState = … … 660 660 jit.move(scratch2GPR, valueGPR); 661 661 662 CCallHelpers::Jump isInstance = jit.branchPtr(CCallHelpers::Equal, valueGPR, thisGPR);662 CCallHelpers::Jump isInstance = jit.branchPtr(CCallHelpers::Equal, valueGPR, prototypeGPR); 663 663 664 664 #if USE(JSVALUE64) … … 717 717 JSValueRegs valueRegs = state.valueRegs; 718 718 GPRReg baseGPR = state.baseGPR; 719 GPRReg thisGPR = state. thisGPR != InvalidGPRReg ? state.thisGPR : baseGPR;719 GPRReg thisGPR = state.u.thisGPR != InvalidGPRReg ? state.u.thisGPR : baseGPR; 720 720 GPRReg scratchGPR = state.scratchGPR; 721 721 -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
r251425 r251951 396 396 397 397 state.baseGPR = stubInfo.baseGPR(); 398 state. thisGPR = stubInfo.patch.thisGPR;398 state.u.thisGPR = stubInfo.patch.u.thisGPR; 399 399 state.valueRegs = stubInfo.valueRegs(); 400 400 … … 402 402 state.allocator = &allocator; 403 403 allocator.lock(state.baseGPR); 404 if (state. thisGPR != InvalidGPRReg)405 allocator.lock(state. thisGPR);404 if (state.u.thisGPR != InvalidGPRReg) 405 allocator.lock(state.u.thisGPR); 406 406 allocator.lock(state.valueRegs); 407 407 #if USE(JSVALUE32_64) -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.h
r250540 r251951 194 194 , m_calculatedCallSiteIndex(false) 195 195 { 196 u.thisGPR = InvalidGPRReg; 196 197 } 197 198 VM& m_vm; … … 206 207 MacroAssembler::JumpList failAndIgnore; 207 208 GPRReg baseGPR { InvalidGPRReg }; 208 GPRReg thisGPR { InvalidGPRReg }; 209 union { 210 GPRReg thisGPR; 211 GPRReg prototypeGPR; 212 } u; 209 213 JSValueRegs valueRegs; 210 214 GPRReg scratchGPR { InvalidGPRReg }; -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h
r251425 r251951 202 202 GPRReg baseGPR; 203 203 GPRReg valueGPR; 204 GPRReg thisGPR; 204 union { 205 GPRReg thisGPR; 206 GPRReg prototypeGPR; 207 } u; 205 208 #if USE(JSVALUE32_64) 206 209 GPRReg valueTagGPR; -
trunk/Source/JavaScriptCore/jit/JITInlineCacheGenerator.cpp
r251425 r251951 75 75 m_stubInfo->patch.baseGPR = base.payloadGPR(); 76 76 m_stubInfo->patch.valueGPR = value.payloadGPR(); 77 m_stubInfo->patch. thisGPR = InvalidGPRReg;77 m_stubInfo->patch.u.thisGPR = InvalidGPRReg; 78 78 #if USE(JSVALUE32_64) 79 79 m_stubInfo->patch.baseTagGPR = base.tagGPR(); … … 123 123 RELEASE_ASSERT(thisRegs.payloadGPR() != thisRegs.tagGPR()); 124 124 125 m_stubInfo->patch. thisGPR = thisRegs.payloadGPR();125 m_stubInfo->patch.u.thisGPR = thisRegs.payloadGPR(); 126 126 #if USE(JSVALUE32_64) 127 127 m_stubInfo->patch.thisTagGPR = thisRegs.tagGPR(); … … 187 187 m_stubInfo->patch.baseGPR = value; 188 188 m_stubInfo->patch.valueGPR = result; 189 m_stubInfo->patch. thisGPR = prototype;189 m_stubInfo->patch.u.prototypeGPR = prototype; 190 190 #if USE(JSVALUE32_64) 191 191 m_stubInfo->patch.baseTagGPR = InvalidGPRReg;
Note: See TracChangeset
for help on using the changeset viewer.