Changeset 96563 in webkit
- Timestamp:
- Oct 3, 2011 6:16:46 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r96562 r96563 1 2011-10-03 Gavin Barraclough <barraclough@apple.com> 2 3 On X86, switch bucketCount into a register, timeoutCheck into memory 4 https://bugs.webkit.org/show_bug.cgi?id=69299 5 6 Reviewed by Geoff Garen. 7 8 We don't have sufficient registers to keep both in registers, and DFG JIT will trample esi; 9 it doesn't matter if the bucketCount gets stomped on (in fact it may add to randomness!), 10 but it if the timeoutCheck gets trashed we may make calls out to the timout_check stub 11 function too frequently (regressing performance). This patch has no perf impact on sunspider. 12 13 * JavaScriptCore.xcodeproj/project.pbxproj: 14 * assembler/MacroAssemblerX86.h: 15 (JSC::MacroAssemblerX86::branchAdd32): 16 (JSC::MacroAssemblerX86::branchSub32): 17 - Added branchSub32 with AbsoluteAddress. 18 * jit/JIT.cpp: 19 (JSC::JIT::emitTimeoutCheck): 20 - Keep timeout count in memory on X86. 21 * jit/JITInlineMethods.h: 22 (JSC::JIT::emitValueProfilingSite): 23 - remove X86 specific code, switch bucket count back into a register. 24 * jit/JITStubs.cpp: 25 - Stop initializing esi (it is no longer the timeoutCheck!) 26 * jit/JSInterfaceJIT.h: 27 - change definition of esi to be the bucketCountRegister. 28 * runtime/JSGlobalData.cpp: 29 (JSC::JSGlobalData::JSGlobalData): 30 * runtime/JSGlobalData.h: 31 - Add timeoutCount as a property to global data (the counter should be per-thread). 32 1 33 2011-10-03 Filip Pizlo <fpizlo@apple.com> 2 34 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r96527 r96563 1053 1053 860161E10F3A83C100F84710 /* MacroAssemblerX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86_64.h; sourceTree = "<group>"; }; 1054 1054 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = "<group>"; }; 1055 8604F4F2143A6C4400B295F5 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; }; 1055 1056 8626BECE11928E3900782FAB /* StringStatics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringStatics.cpp; path = text/StringStatics.cpp; sourceTree = "<group>"; }; 1056 1057 8627E5EA11F1281900A313B5 /* PageAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageAllocation.h; sourceTree = "<group>"; }; … … 1550 1551 isa = PBXGroup; 1551 1552 children = ( 1553 8604F4F2143A6C4400B295F5 /* ChangeLog */, 1552 1554 651122E5140469BA002B101D /* testRegExp.cpp */, 1553 1555 A718F8211178EB4B002465A7 /* create_regex_tables */, -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86.h
r95902 r96563 45 45 using MacroAssemblerX86Common::and32; 46 46 using MacroAssemblerX86Common::branchAdd32; 47 using MacroAssemblerX86Common::branchSub32; 47 48 using MacroAssemblerX86Common::sub32; 48 49 using MacroAssemblerX86Common::or32; … … 123 124 } 124 125 125 Jump branchAdd32(ResultCondition cond, TrustedImm32 src, AbsoluteAddress dest) 126 { 127 m_assembler.addl_im(src.m_value, dest.m_ptr); 126 Jump branchAdd32(ResultCondition cond, TrustedImm32 imm, AbsoluteAddress dest) 127 { 128 m_assembler.addl_im(imm.m_value, dest.m_ptr); 129 return Jump(m_assembler.jCC(x86Condition(cond))); 130 } 131 132 Jump branchSub32(ResultCondition cond, TrustedImm32 imm, AbsoluteAddress dest) 133 { 134 m_assembler.subl_im(imm.m_value, dest.m_ptr); 128 135 return Jump(m_assembler.jCC(x86Condition(cond))); 129 136 } -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r96463 r96563 109 109 #endif 110 110 111 #if USE(JSVALUE32_64) 111 #if CPU(X86) 112 void JIT::emitTimeoutCheck() 113 { 114 Jump skipTimeout = branchSub32(NonZero, TrustedImm32(1), AbsoluteAddress(&m_globalData->m_timeoutCount)); 115 JITStubCall stubCall(this, cti_timeout_check); 116 stubCall.addArgument(regT1, regT0); // save last result registers. 117 stubCall.call(regT0); 118 store32(regT0, &m_globalData->m_timeoutCount); 119 stubCall.getArgument(0, regT1, regT0); // reload last result registers. 120 skipTimeout.link(this); 121 } 122 #elif USE(JSVALUE32_64) 112 123 void JIT::emitTimeoutCheck() 113 124 { … … 723 734 } 724 735 725 #if CPU(X86) && ENABLE(VALUE_PROFILER)726 int bucketCounter = 0;727 #endif728 729 736 } // namespace JSC 730 737 -
trunk/Source/JavaScriptCore/jit/JITInlineMethods.h
r95901 r96563 447 447 } 448 448 449 #if CPU(X86) && ENABLE(VALUE_PROFILER)450 extern int bucketCounter;451 #endif452 453 449 #if ENABLE(VALUE_PROFILER) 454 450 inline void JIT::emitValueProfilingSite(ValueProfilingSiteKind siteKind) … … 470 466 ASSERT(valueProfile); 471 467 472 #if CPU(X86)473 if (m_randomGenerator.getUint32() & 1)474 add32(Imm32(1), AbsoluteAddress(&bucketCounter));475 else476 add32(Imm32(3), AbsoluteAddress(&bucketCounter));477 and32(Imm32(ValueProfile::bucketIndexMask), AbsoluteAddress(&bucketCounter));478 load32(&bucketCounter, scratch);479 lshift32(TrustedImm32(3), scratch);480 addPtr(ImmPtr(valueProfile->m_buckets), scratch);481 storePtr(value, scratch);482 #else483 468 if (m_randomGenerator.getUint32() & 1) 484 469 add32(Imm32(1), bucketCounterRegister); … … 488 473 move(ImmPtr(valueProfile->m_buckets), scratch); 489 474 storePtr(value, BaseIndex(scratch, bucketCounterRegister, TimesEight)); 490 #endif491 475 } 492 476 #endif -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r96527 r96563 132 132 "pushl %ebx" "\n" 133 133 "subl $0x3c, %esp" "\n" 134 "movl $512, %esi" "\n"135 134 "movl 0x58(%esp), %edi" "\n" 136 135 "call *0x50(%esp)" "\n" … … 262 261 push ebx; 263 262 sub esp, 0x3c; 264 mov esi, 512;265 263 mov ecx, esp; 266 264 mov edi, [esp + 0x58]; -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r95901 r96563 81 81 static const RegisterID firstArgumentRegister = X86Registers::ecx; 82 82 83 static const RegisterID timeoutCheckRegister = X86Registers::esi;83 static const RegisterID bucketCounterRegister = X86Registers::esi; 84 84 static const RegisterID callFrameRegister = X86Registers::edi; 85 85 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r96465 r96563 200 200 , exclusiveThread(0) 201 201 #endif 202 #if CPU(X86) && ENABLE(JIT) 203 , m_timeoutCount(512) 204 #endif 202 205 #if ENABLE(GC_VALIDATION) 203 206 , m_isInitializingObject(false) -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r96465 r96563 306 306 #endif 307 307 308 #if CPU(X86) && ENABLE(JIT) 309 unsigned m_timeoutCount; 310 #endif 311 308 312 private: 309 313 JSGlobalData(GlobalDataType, ThreadStackType, HeapSize);
Note: See TracChangeset
for help on using the changeset viewer.