Changeset 286635 in webkit
- Timestamp:
- Dec 7, 2021, 5:43:22 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/BytecodeList.rb (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (2 diffs)
-
bytecode/GetByStatus.cpp (modified) (1 diff)
-
llint/LLIntSlowPaths.cpp (modified) (1 diff)
-
llint/LowLevelInterpreter.asm (modified) (1 diff)
-
llint/LowLevelInterpreter32_64.asm (modified) (1 diff)
-
llint/LowLevelInterpreter64.asm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r286597 r286635 1 2021-12-07 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Add LLInt IC for try_get_by_id of own cacheable value 4 https://bugs.webkit.org/show_bug.cgi?id=233830 5 6 Reviewed by Yusuke Suzuki. 7 8 This patch adds an LLInt IC for the "own cacheable value" path of try_get_by_id; 9 this is the simplest case and basically the same as get_by_id_direct. 10 11 Performance is neutral with JIT enabled as well as on current uses of try_get_by_id in JSC 12 (e.g. hasObservableSideEffectsForRegexpSplit), but microbenchmarks of try_get_by_id itself see a 2x speedup: 13 14 Before After 15 16 try-get-by-id-polymorphic 123.8361+-0.4562 ^ 61.7586+-0.3770 ^ definitely 2.0052x faster 17 try-get-by-id-basic 124.4437+-0.6091 ^ 61.0340+-0.1924 ^ definitely 2.0389x faster 18 19 <geometric> 124.1207+-0.3130 ^ 61.3865+-0.2019 ^ definitely 2.0220x faster 20 21 22 * bytecode/BytecodeList.rb: 23 * bytecode/CodeBlock.cpp: 24 * bytecode/GetByStatus.cpp: 25 * llint/LLIntSlowPaths.cpp: 26 * llint/LowLevelInterpreter.asm: 27 * llint/LowLevelInterpreter32_64.asm: 28 * llint/LowLevelInterpreter64.asm: 29 1 30 2021-12-07 Commit Queue <commit-queue@webkit.org> 2 31 -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.rb
r285795 r286635 524 524 metadata: { 525 525 profile: ValueProfile, 526 structureID: StructureID, 527 offset: unsigned, 526 528 } 527 529 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r286345 r286635 1387 1387 }); 1388 1388 1389 m_metadata->forEach<OpTryGetById>([&] (auto& metadata) { 1390 StructureID oldStructureID = metadata.m_structureID; 1391 if (!oldStructureID || vm.heap.isMarked(oldStructureID.decode())) 1392 return; 1393 dataLogLnIf(Options::verboseOSR(), "Clearing try_get_by_id LLInt property access."); 1394 metadata.m_structureID = StructureID(); 1395 metadata.m_offset = 0; 1396 }); 1397 1389 1398 m_metadata->forEach<OpGetByIdDirect>([&] (auto& metadata) { 1390 1399 StructureID oldStructureID = metadata.m_structureID; 1391 1400 if (!oldStructureID || vm.heap.isMarked(oldStructureID.decode())) 1392 1401 return; 1393 dataLogLnIf(Options::verboseOSR(), "Clearing LLInt property access.");1402 dataLogLnIf(Options::verboseOSR(), "Clearing get_by_id_direct LLInt property access."); 1394 1403 metadata.m_structureID = StructureID(); 1395 1404 metadata.m_offset = 0; … … 1462 1471 return; 1463 1472 1464 dataLogLnIf(Options::verboseOSR(), "Clearing LLInt set_private_brand transition.");1473 dataLogLnIf(Options::verboseOSR(), "Clearing LLInt check_private_brand transition."); 1465 1474 metadata.m_structureID = StructureID(); 1466 1475 metadata.m_brand.clear(); -
trunk/Source/JavaScriptCore/bytecode/GetByStatus.cpp
r286345 r286635 71 71 break; 72 72 } 73 74 case op_try_get_by_id: 75 structureID = instruction->as<OpTryGetById>().metadata(profiledBlock).m_structureID; 76 identifier = &(profiledBlock->identifier(instruction->as<OpTryGetById>().m_property)); 77 break; 73 78 case op_get_by_id_direct: 74 79 structureID = instruction->as<OpGetByIdDirect>().metadata(profiledBlock).m_structureID; 75 80 identifier = &(profiledBlock->identifier(instruction->as<OpGetByIdDirect>().m_property)); 76 81 break; 77 case op_try_get_by_id: {78 // FIXME: We should not just bail if we see a try_get_by_id.79 // https://bugs.webkit.org/show_bug.cgi?id=15803980 return GetByStatus(NoInformation, false);81 }82 82 83 83 case op_get_by_val: -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r286345 r286635 665 665 JSValue result = slot.getPureResult(); 666 666 667 if (!LLINT_ALWAYS_ACCESS_SLOW && slot.isCacheable() && !slot.isUnset()) { 668 ASSERT(!slot.isTaintedByOpaqueObject()); 669 ASSERT(baseValue.isCell()); 670 671 auto& metadata = bytecode.metadata(codeBlock); 672 { 673 StructureID oldStructureID = metadata.m_structureID; 674 if (oldStructureID) { 675 Structure* a = oldStructureID.decode(); 676 Structure* b = baseValue.asCell()->structure(vm); 677 678 if (Structure::shouldConvertToPolyProto(a, b)) { 679 ASSERT(a->rareData()->sharedPolyProtoWatchpoint().get() == b->rareData()->sharedPolyProtoWatchpoint().get()); 680 a->rareData()->sharedPolyProtoWatchpoint()->invalidate(vm, StringFireDetail("Detected poly proto opportunity.")); 681 } 682 } 683 } 684 685 JSCell* baseCell = baseValue.asCell(); 686 Structure* structure = baseCell->structure(vm); 687 if (slot.isValue() && slot.slotBase() == baseValue) { 688 // Start out by clearing out the old cache. 689 metadata.m_structureID = StructureID(); 690 metadata.m_offset = 0; 691 692 if (structure->propertyAccessesAreCacheable() && !structure->needImpurePropertyWatchpoint()) { 693 { 694 ConcurrentJSLocker locker(codeBlock->m_lock); 695 metadata.m_structureID = structure->id(); 696 metadata.m_offset = slot.cachedOffset(); 697 } 698 vm.writeBarrier(codeBlock); 699 } 700 } 701 } 702 667 703 LLINT_RETURN_PROFILED(result); 668 704 } -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r286345 r286635 2181 2181 llintSlowPathOp(super_sampler_end) 2182 2182 llintSlowPathOp(throw) 2183 llintSlowPathOp(try_get_by_id)2184 2183 llintSlowPathOp(get_by_id_with_this) 2185 2184 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r285795 r286635 1422 1422 # execution counter hits zero. 1423 1423 1424 llintOpWithMetadata(op_try_get_by_id, OpTryGetById, macro (size, get, dispatch, metadata, return) 1425 metadata(t5, t0) 1426 get(m_base, t0) 1427 loadi OpTryGetById::Metadata::m_structureID[t5], t1 1428 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opTryGetByIdSlow) 1429 loadi OpTryGetById::Metadata::m_offset[t5], t2 1430 bineq JSCell::m_structureID[t3], t1, .opTryGetByIdSlow 1431 loadPropertyAtVariableOffset(t2, t3, t0, t1) 1432 valueProfile(OpTryGetById, m_profile, t5, t0, t1) 1433 return(t0, t1) 1434 1435 .opTryGetByIdSlow: 1436 callSlowPath(_llint_slow_path_try_get_by_id) 1437 dispatch() 1438 end) 1439 1424 1440 llintOpWithMetadata(op_get_by_id_direct, OpGetByIdDirect, macro (size, get, dispatch, metadata, return) 1425 1441 metadata(t5, t0) -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r286372 r286635 1533 1533 end 1534 1534 1535 1536 llintOpWithMetadata(op_try_get_by_id, OpTryGetById, macro (size, get, dispatch, metadata, return) 1537 metadata(t2, t0) 1538 get(m_base, t0) 1539 loadConstantOrVariableCell(size, t0, t3, .opTryGetByIdSlow) 1540 loadi JSCell::m_structureID[t3], t1 1541 loadi OpTryGetById::Metadata::m_structureID[t2], t0 1542 bineq t0, t1, .opTryGetByIdSlow 1543 loadi OpTryGetById::Metadata::m_offset[t2], t1 1544 loadPropertyAtVariableOffset(t1, t3, t0) 1545 valueProfile(OpTryGetById, m_profile, t2, t0) 1546 return(t0) 1547 1548 .opTryGetByIdSlow: 1549 callSlowPath(_llint_slow_path_try_get_by_id) 1550 dispatch() 1551 end) 1535 1552 1536 1553 llintOpWithMetadata(op_get_by_id_direct, OpGetByIdDirect, macro (size, get, dispatch, metadata, return)
Note:
See TracChangeset
for help on using the changeset viewer.