Changeset 89058 in webkit
- Timestamp:
- Jun 16, 2011 12:30:57 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r89037 r89058 1 2011-06-15 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Reduce memory usage of resolve_global 6 https://bugs.webkit.org/show_bug.cgi?id=62765 7 8 If we have a large number of resolve_globals in a single 9 block start planting plain resolve instructions instead 10 whenever we aren't in a loop. This allows us to reduce 11 the code size for extremely large functions without 12 losing the performance benefits of op_resolve_global. 13 14 * bytecode/CodeBlock.h: 15 (JSC::CodeBlock::globalResolveInfoCount): 16 * bytecompiler/BytecodeGenerator.cpp: 17 (JSC::BytecodeGenerator::shouldAvoidResolveGlobal): 18 (JSC::BytecodeGenerator::emitResolve): 19 (JSC::BytecodeGenerator::emitResolveWithBase): 20 * bytecompiler/BytecodeGenerator.h: 21 1 22 2011-06-16 Qi Zhang <qi.2.zhang@nokia.com> 2 23 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r88873 r89058 373 373 MethodCallLinkInfo& methodCallLinkInfo(int index) { return m_methodCallLinkInfos[index]; } 374 374 #endif 375 unsigned globalResolveInfoCount() const 376 { 377 #if ENABLE(JIT) 378 if (m_globalData->canUseJIT()) 379 return m_globalResolveInfos.size(); 380 #endif 381 return 0; 382 } 375 383 376 384 // Exception handling support -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r88873 r89058 1202 1202 } 1203 1203 1204 static const unsigned maxGlobalResolves = 128; 1205 1206 bool BytecodeGenerator::shouldAvoidResolveGlobal() 1207 { 1208 return m_codeBlock->globalResolveInfoCount() > maxGlobalResolves && !m_labelScopes.size(); 1209 } 1210 1204 1211 RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const Identifier& property) 1205 1212 { … … 1215 1222 return dst; 1216 1223 } 1217 1224 if (shouldAvoidResolveGlobal()) { 1225 globalObject = 0; 1226 requiresDynamicChecks = true; 1227 } 1228 1218 1229 if (globalObject) { 1219 1230 bool forceGlobalResolve = false; … … 1364 1375 return baseDst; 1365 1376 } 1366 1377 if (shouldAvoidResolveGlobal()) { 1378 emitOpcode(op_resolve); 1379 instructions().append(propDst->index()); 1380 instructions().append(addConstant(property)); 1381 return baseDst; 1382 } 1367 1383 #if ENABLE(JIT) 1368 1384 m_codeBlock->addGlobalResolveInfo(instructions().size()); -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r88873 r89058 460 460 461 461 void preserveLastVar(); 462 bool shouldAvoidResolveGlobal(); 462 463 463 464 RegisterID& registerFor(int index)
Note: See TracChangeset
for help on using the changeset viewer.