Changeset 265600 in webkit for trunk/Source/JavaScriptCore/jit/Repatch.cpp
- Timestamp:
- Aug 12, 2020, 9:50:12 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r265000 r265600 592 592 return GiveUpOnCache; 593 593 594 JSCell* baseCell = baseValue.asCell(); 595 596 bool isProxy = false; 597 if (baseCell->type() == PureForwardingProxyType) { 598 baseCell = jsCast<JSProxy*>(baseCell)->target(); 599 baseValue = baseCell; 600 isProxy = true; 601 602 // We currently only cache Replace and JS/Custom Setters on JSProxy. We don't 603 // cache transitions because global objects will never share the same structure 604 // in our current implementation. 605 bool isCacheableProxy = (slot.isCacheablePut() && slot.type() == PutPropertySlot::ExistingProperty) 606 || slot.isCacheableSetter() 607 || slot.isCacheableCustom(); 608 if (!isCacheableProxy) 609 return GiveUpOnCache; 610 } 611 594 612 std::unique_ptr<AccessCase> newCase; 595 JSCell* baseCell = baseValue.asCell();596 613 597 614 if (slot.base() == baseValue && slot.isCacheablePut()) { … … 609 626 if (stubInfo.cacheType() == CacheType::Unset 610 627 && InlineAccess::canGenerateSelfPropertyReplace(stubInfo, slot.cachedOffset()) 611 && !oldStructure->needImpurePropertyWatchpoint()) { 628 && !oldStructure->needImpurePropertyWatchpoint() 629 && !isProxy) { 612 630 613 631 bool generatedCodeInline = InlineAccess::generateSelfPropertyReplace(stubInfo, oldStructure, slot.cachedOffset()); … … 620 638 } 621 639 622 newCase = AccessCase::create(vm, codeBlock, AccessCase::Replace, propertyName, slot.cachedOffset(), oldStructure);640 newCase = ProxyableAccessCase::create(vm, codeBlock, AccessCase::Replace, propertyName, slot.cachedOffset(), oldStructure, ObjectPropertyConditionSet(), isProxy); 623 641 } else { 642 ASSERT(!isProxy); 624 643 ASSERT(slot.type() == PutPropertySlot::NewProperty); 625 644 … … 707 726 newCase = GetterSetterAccessCase::create( 708 727 vm, codeBlock, slot.isCustomAccessor() ? AccessCase::CustomAccessorSetter : AccessCase::CustomValueSetter, oldStructure, propertyName, 709 invalidOffset, conditionSet, WTFMove(prototypeAccessChain), slot.customSetter(), slot.base() != baseValue ? slot.base() : nullptr);728 invalidOffset, conditionSet, WTFMove(prototypeAccessChain), isProxy, slot.customSetter(), slot.base() != baseValue ? slot.base() : nullptr); 710 729 } else { 730 ASSERT(slot.isCacheableSetter()); 711 731 ObjectPropertyConditionSet conditionSet; 712 732 std::unique_ptr<PolyProtoAccessChain> prototypeAccessChain; … … 743 763 744 764 newCase = GetterSetterAccessCase::create( 745 vm, codeBlock, AccessCase::Setter, oldStructure, propertyName, offset, conditionSet, WTFMove(prototypeAccessChain) );765 vm, codeBlock, AccessCase::Setter, oldStructure, propertyName, offset, conditionSet, WTFMove(prototypeAccessChain), isProxy); 746 766 } 747 767 }
Note:
See TracChangeset
for help on using the changeset viewer.