Skip to content

Commit 350878c

Browse files
committed
Reduce String ref/deref churn in JSC by 60% on JetStream2
https://bugs.webkit.org/show_bug.cgi?id=274046 rdar://127946516 Reviewed by Yusuke Suzuki. This patch reduces the number of refs in JSC on JetStream2 by ~60% from 407831951 to 168560273, which seems to be ~.3% speedup on that benchmark. Mostly this is done by introducing a new class `GCOwnedDataScope` this class holds some data owned by a GCed object and ensures that GCed object is retained by the C++ compiler at least as long as the scope. This makes it easy to provide access to GC object owned data safely. The only requirement is that people **DO NOT** do `Data&/* data = gcType->getData()`. However, this is the problem with the current accessors used throughout JSC anyway. Over time we should start migrating more and more JSC accessor member functions to `GCOwnedDataScope`. The main functions updated in this patch are `JSString::value` and `JSString::viewWithUnderlyingString` the latter of which is now JSString::view. These now return a `GCOwnedDataScope<const String&>` and `GCOwnedDataScope<StringView>`, respectively. Additionally, PropertyName now takes a CacheableIdentifier for the various `operationGetBy<Op>` JIT operations instead of converting to a true Identifier (incurring a ref/deref). Also, add some extra logging to our scope checking code. * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/bytecode/Repatch.cpp: (JSC::tryCacheGetBy): (JSC::tryCacheArrayGetByVal): (JSC::tryCachePutBy): (JSC::tryCacheArrayPutByVal): (JSC::tryCacheDeleteBy): (JSC::repatchDeleteBy): (JSC::tryCacheInBy): (JSC::repatchInBy): (JSC::tryCacheHasPrivateBrand): (JSC::tryCacheCheckPrivateBrand): (JSC::tryCacheSetPrivateBrand): (JSC::tryCacheInstanceOf): * Source/JavaScriptCore/dfg/DFGOperations.cpp: (JSC::DFG::JSC_DEFINE_JIT_OPERATION): * Source/JavaScriptCore/ftl/FTLOperations.cpp: (JSC::FTL::JSC_DEFINE_NOEXCEPT_JIT_OPERATION): * Source/JavaScriptCore/heap/GCOwnedDataScope.h: Added. (JSC::GCOwnedDataScope::GCOwnedDataScope): (JSC::GCOwnedDataScope::~GCOwnedDataScope): (JSC::GCOwnedDataScope::operator const T const): (JSC::GCOwnedDataScope::operator T): (JSC::GCOwnedDataScope::requires): (JSC::GCOwnedDataScope::operator[] const): * Source/JavaScriptCore/inspector/InjectedScriptBase.cpp: (Inspector::jsToInspectorValue): * Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::evaluateWithScopeExtension): * Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp: (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension): * Source/JavaScriptCore/interpreter/Interpreter.cpp: (JSC::eval): * Source/JavaScriptCore/jit/ICStats.h: (JSC::ICEvent::ICEvent): * Source/JavaScriptCore/jit/JITArithmetic.cpp: (JSC::JIT::emit_compareImpl): * Source/JavaScriptCore/jit/JITOperations.cpp: (JSC::JSC_DEFINE_JIT_OPERATION): (JSC::setPrivateField): (JSC::definePrivateField): (JSC::getPrivateName): (JSC::deleteById): (JSC::deleteByIdOptimize): * Source/JavaScriptCore/jsc.cpp: (GlobalObject::moduleLoaderImportModule): (printInternal): (JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * Source/JavaScriptCore/runtime/ArrayPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/CachedTypes.cpp: (JSC::CachedJSValue::encode): * Source/JavaScriptCore/runtime/CommonSlowPaths.cpp: (JSC::JSC_DEFINE_COMMON_SLOW_PATH): * Source/JavaScriptCore/runtime/DateConstructor.cpp: (JSC::constructDate): * Source/JavaScriptCore/runtime/ExceptionHelpers.cpp: (JSC::errorDescriptionForValue): * Source/JavaScriptCore/runtime/FunctionConstructor.cpp: (JSC::stringifyFunction): * Source/JavaScriptCore/runtime/HashMapImplInlines.h: (JSC::jsMapHashImpl): * Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/IntlNumberFormatInlines.h: (JSC::toIntlMathematicalValue): * Source/JavaScriptCore/runtime/IntlSegmenter.cpp: (JSC::IntlSegmenter::segment const): * Source/JavaScriptCore/runtime/JSBoundFunction.cpp: (JSC::JSBoundFunction::nameSlow): * Source/JavaScriptCore/runtime/JSCJSValue.cpp: (JSC::JSValue::toWTFStringForConsole const): * Source/JavaScriptCore/runtime/JSCJSValueInlines.h: (JSC::toPreferredPrimitiveType): (JSC::JSValue::equalSlowCaseInline): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h: (JSC::genericTypedArrayViewProtoFuncJoin): * Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSImmutableButterfly.cpp: (JSC::JSImmutableButterfly::createFromString): * Source/JavaScriptCore/runtime/JSModuleLoader.cpp: (JSC::JSModuleLoader::importModule): * Source/JavaScriptCore/runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): (JSC::FastStringifier<CharType>::append): (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): * Source/JavaScriptCore/runtime/JSString.cpp: (JSC::JSString::toNumber const): * Source/JavaScriptCore/runtime/JSString.h: (JSC:: const): (JSC::JSString::getIndex): (JSC::JSRopeString::view const): (JSC::JSString::view const): (JSC::JSString::value const): Deleted. (JSC::JSString::tryGetValue const): Deleted. (JSC::JSRopeString::unsafeView const): Deleted. (JSC::JSRopeString::viewWithUnderlyingString const): Deleted. (JSC::JSString::unsafeView const): Deleted. (JSC::JSString::viewWithUnderlyingString const): Deleted. * Source/JavaScriptCore/runtime/JSStringInlines.h: (JSC::JSString::equalInline const): * Source/JavaScriptCore/runtime/JSStringJoiner.h: (JSC::JSStringJoiner::appendWithoutSideEffects): (JSC::JSStringJoiner::append): * Source/JavaScriptCore/runtime/NumberPrototype.cpp: (JSC::throwVMToThisNumberError): * Source/JavaScriptCore/runtime/Operations.h: (JSC::jsString): (JSC::compareBigIntToOtherPrimitive): (JSC::compareBigInt32ToOtherPrimitive): (JSC::jsLess): (JSC::jsLessEq): * Source/JavaScriptCore/runtime/ParseInt.h: (JSC::toStringView): * Source/JavaScriptCore/runtime/PropertyName.h: (JSC::PropertyName::PropertyName): * Source/JavaScriptCore/runtime/RegExpConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/RegExpMatchesArray.h: (JSC::createRegExpMatchesArray): * Source/JavaScriptCore/runtime/RegExpObject.cpp: (JSC::RegExpObject::matchGlobal): * Source/JavaScriptCore/runtime/RegExpObjectInlines.h: (JSC::RegExpObject::execInline): (JSC::RegExpObject::matchInline): * Source/JavaScriptCore/runtime/RegExpPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/ShadowRealmPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/StringPrototype.cpp: (JSC::replaceUsingRegExpSearch): (JSC::JSC_DEFINE_JIT_OPERATION): (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::replace): (JSC::stringIndexOfImpl): (JSC::toLocaleCase): (JSC::normalize): * Source/JavaScriptCore/runtime/StringPrototypeInlines.h: (JSC::stringReplaceStringString): (JSC::replaceUsingStringSearch): * Source/JavaScriptCore/runtime/SymbolConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalPlainTime.cpp: (JSC::TemporalPlainTime::from): * Source/JavaScriptCore/tools/JSDollarVM.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/WTF/wtf/HashMap.h: * Source/WTF/wtf/text/WTFString.h: * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): * Source/WebCore/bridge/objc/WebScriptObject.mm: (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]): * Source/WebKitLegacy/mac/WebView/WebView.mm: (aeDescFromJSValue): Canonical link: https://commits.webkit.org/278691@main
1 parent ac508ff commit 350878c

62 files changed

Lines changed: 536 additions & 441 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
740740
heap/GCIncomingRefCountedSet.h
741741
heap/GCLogging.h
742742
heap/GCMemoryOperations.h
743+
heap/GCOwnedDataScope.h
743744
heap/GCRequest.h
744745
heap/GCSegmentedArray.h
745746
heap/Handle.h

‎Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@
12121212
53F40E8D1D5901F20099A1B6 /* WasmParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F40E8C1D5901F20099A1B6 /* WasmParser.h */; };
12131213
53F40E931D5A4AB30099A1B6 /* WasmOMGIRGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F40E921D5A4AB30099A1B6 /* WasmOMGIRGenerator.h */; };
12141214
53F6BF6D1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
1215+
53F9DD772BEFD76D004A17B7 /* GCOwnedDataScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F9DD762BEFD76D004A17B7 /* GCOwnedDataScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
12151216
53FA2AE11CF37F3F0022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 53FA2AE01CF37F3F0022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
12161217
53FD04D41D7AB291003287D3 /* WasmCallingConvention.h in Headers */ = {isa = PBXBuildFile; fileRef = 53FD04D21D7AB187003287D3 /* WasmCallingConvention.h */; settings = {ATTRIBUTES = (Private, ); }; };
12171218
554C418829B14CA5003C9F71 /* WebAssemblyGCObjectBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 554C418629B14CA5003C9F71 /* WebAssemblyGCObjectBase.h */; };
@@ -2152,8 +2153,8 @@
21522153
FE7C41961B97FC4B00F4D598 /* PingPongStackOverflowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */; };
21532154
FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE80C1961D775B27008510C0 /* CatchScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
21542155
FE8C0312264A6911001A44AD /* SlowPathFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8C0311264A6910001A44AD /* SlowPathFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
2155-
FE8DE54B23AC1DAD005C9142 /* CacheableIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8DE54A23AC1DAD005C9142 /* CacheableIdentifier.h */; };
2156-
FE8DE54D23AC1E86005C9142 /* CacheableIdentifierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8DE54C23AC1E86005C9142 /* CacheableIdentifierInlines.h */; };
2156+
FE8DE54B23AC1DAD005C9142 /* CacheableIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8DE54A23AC1DAD005C9142 /* CacheableIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
2157+
FE8DE54D23AC1E86005C9142 /* CacheableIdentifierInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8DE54C23AC1E86005C9142 /* CacheableIdentifierInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
21572158
FE912B4F2531193300FABDDF /* AbstractSlotVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = FE912B4E2531193300FABDDF /* AbstractSlotVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
21582159
FE912B5125311AD100FABDDF /* AbstractSlotVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE912B5025311AD100FABDDF /* AbstractSlotVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
21592160
FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99B2481C24B6D300C82159 /* JITNegGenerator.h */; };
@@ -4292,6 +4293,7 @@
42924293
53F40E8E1D5902820099A1B6 /* WasmOMGIRGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmOMGIRGenerator.cpp; sourceTree = "<group>"; };
42934294
53F40E921D5A4AB30099A1B6 /* WasmOMGIRGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmOMGIRGenerator.h; sourceTree = "<group>"; };
42944295
53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InternalFunctionAllocationProfile.h; sourceTree = "<group>"; };
4296+
53F9DD762BEFD76D004A17B7 /* GCOwnedDataScope.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GCOwnedDataScope.h; sourceTree = "<group>"; };
42954297
53FA2AE01CF37F3F0022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LLIntPrototypeLoadAdaptiveStructureWatchpoint.h; sourceTree = "<group>"; };
42964298
53FA2AE21CF380390022711D /* LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp; sourceTree = "<group>"; };
42974299
53FD04D11D7AB187003287D3 /* WasmCallingConvention.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmCallingConvention.cpp; sourceTree = "<group>"; };
@@ -7026,6 +7028,7 @@
70267028
2ADFA26218EF3540004F9FCC /* GCLogging.cpp */,
70277029
2AABCDE618EF294200002096 /* GCLogging.h */,
70287030
5272987B235FC8BA005C982C /* GCMemoryOperations.h */,
7031+
53F9DD762BEFD76D004A17B7 /* GCOwnedDataScope.h */,
70297032
0F97152E1EB28BE900A1645D /* GCRequest.cpp */,
70307033
0F97152F1EB28BE900A1645D /* GCRequest.h */,
70317034
0FA6F38C20CC2C9500A03DCD /* GCSegmentedArray.cpp */,
@@ -10892,6 +10895,7 @@
1089210895
0F2B66AF17B6B54500A7AE3F /* GCIncomingRefCountedSetInlines.h in Headers */,
1089310896
2AABCDE718EF294200002096 /* GCLogging.h in Headers */,
1089410897
522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */,
10898+
53F9DD772BEFD76D004A17B7 /* GCOwnedDataScope.h in Headers */,
1089510899
0F9715311EB28BEE00A1645D /* GCRequest.h in Headers */,
1089610900
A54E8EB018BFFBBB00556D28 /* GCSegmentedArray.h in Headers */,
1089710901
A54E8EB118BFFBBE00556D28 /* GCSegmentedArrayInlines.h in Headers */,

‎Source/JavaScriptCore/bytecode/Repatch.cpp‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static InlineCacheAction tryCacheGetBy(JSGlobalObject* globalObject, CodeBlock*
378378
&& !loadTargetFromProxy) {
379379
bool generatedCodeInline = InlineAccess::generateSelfPropertyAccess(codeBlock, stubInfo, structure, slot.cachedOffset());
380380
if (generatedCodeInline) {
381-
LOG_IC((ICEvent::GetBySelfPatch, structure->classInfoForCells(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
381+
LOG_IC((vm, ICEvent::GetBySelfPatch, structure->classInfoForCells(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
382382
structure->startWatchingPropertyForReplacements(vm, slot.cachedOffset());
383383
repatchSlowPathCall(codeBlock, stubInfo, appropriateGetByOptimizeFunction(kind));
384384
stubInfo.initGetByIdSelf(locker, codeBlock, structure, slot.cachedOffset());
@@ -513,12 +513,12 @@ static InlineCacheAction tryCacheGetBy(JSGlobalObject* globalObject, CodeBlock*
513513
}
514514
}
515515

516-
LOG_IC((ICEvent::GetByAddAccessCase, baseValue.classInfoOrNull(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
516+
LOG_IC((vm, ICEvent::GetByAddAccessCase, baseValue.classInfoOrNull(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
517517

518518
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), propertyName, WTFMove(newCase));
519519

520520
if (result.generatedSomeCode())
521-
LOG_IC((ICEvent::GetByReplaceWithJump, baseValue.classInfoOrNull(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
521+
LOG_IC((vm, ICEvent::GetByReplaceWithJump, baseValue.classInfoOrNull(), Identifier::fromUid(vm, propertyName.uid()), slot.slotBase() == baseValue));
522522
}
523523

524524
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -685,7 +685,7 @@ static InlineCacheAction tryCacheArrayGetByVal(JSGlobalObject* globalObject, Cod
685685
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), nullptr, newCase.releaseNonNull());
686686

687687
if (result.generatedSomeCode())
688-
LOG_IC((ICEvent::GetByReplaceWithJump, baseValue.classInfoOrNull(), Identifier()));
688+
LOG_IC((vm, ICEvent::GetByReplaceWithJump, baseValue.classInfoOrNull(), Identifier()));
689689
}
690690

691691
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -858,7 +858,7 @@ static InlineCacheAction tryCachePutBy(JSGlobalObject* globalObject, CodeBlock*
858858

859859
bool generatedCodeInline = InlineAccess::generateSelfPropertyReplace(codeBlock, stubInfo, oldStructure, slot.cachedOffset());
860860
if (generatedCodeInline) {
861-
LOG_IC((ICEvent::PutBySelfPatch, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
861+
LOG_IC((vm, ICEvent::PutBySelfPatch, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
862862
repatchSlowPathCall(codeBlock, stubInfo, appropriatePutByOptimizeFunction(putByKind));
863863
stubInfo.initPutByIdReplace(locker, codeBlock, oldStructure, slot.cachedOffset());
864864
return RetryCacheLater;
@@ -1014,12 +1014,12 @@ static InlineCacheAction tryCachePutBy(JSGlobalObject* globalObject, CodeBlock*
10141014
newCase = ProxyObjectAccessCase::create(vm, codeBlock, AccessCase::ProxyObjectStore, propertyName);
10151015
}
10161016

1017-
LOG_IC((ICEvent::PutByAddAccessCase, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
1017+
LOG_IC((vm, ICEvent::PutByAddAccessCase, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
10181018

10191019
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, slot.isStrictMode() ? ECMAMode::strict() : ECMAMode::sloppy(), propertyName, WTFMove(newCase));
10201020

10211021
if (result.generatedSomeCode())
1022-
LOG_IC((ICEvent::PutByReplaceWithJump, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
1022+
LOG_IC((vm, ICEvent::PutByReplaceWithJump, oldStructure->classInfoForCells(), ident, slot.base() == baseValue));
10231023
}
10241024

10251025
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1145,7 +1145,7 @@ static InlineCacheAction tryCacheArrayPutByVal(JSGlobalObject* globalObject, Cod
11451145
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ecmaModeFor(putByKind), nullptr, AccessCase::create(vm, codeBlock, accessType, nullptr));
11461146

11471147
if (result.generatedSomeCode())
1148-
LOG_IC((ICEvent::PutByReplaceWithJump, baseValue.classInfoOrNull(), Identifier()));
1148+
LOG_IC((vm, ICEvent::PutByReplaceWithJump, baseValue.classInfoOrNull(), Identifier()));
11491149
}
11501150

11511151
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1218,7 +1218,7 @@ static InlineCacheAction tryCacheDeleteBy(JSGlobalObject* globalObject, CodeBloc
12181218
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ecmaMode, propertyName, WTFMove(newCase));
12191219

12201220
if (result.generatedSomeCode())
1221-
LOG_IC((ICEvent::DelByReplaceWithJump, oldStructure->classInfoForCells(), Identifier::fromUid(vm, propertyName.uid())));
1221+
LOG_IC((vm, ICEvent::DelByReplaceWithJump, oldStructure->classInfoForCells(), Identifier::fromUid(vm, propertyName.uid())));
12221222
}
12231223

12241224
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1231,7 +1231,7 @@ void repatchDeleteBy(JSGlobalObject* globalObject, CodeBlock* codeBlock, DeleteP
12311231
SuperSamplerScope superSamplerScope(false);
12321232

12331233
if (tryCacheDeleteBy(globalObject, codeBlock, slot, baseValue, oldStructure, propertyName, stubInfo, kind, ecmaMode) == GiveUpOnCache) {
1234-
LOG_IC((ICEvent::DelByReplaceWithGeneric, baseValue.classInfoOrNull(), Identifier::fromUid(globalObject->vm(), propertyName.uid())));
1234+
LOG_IC((globalObject->vm(), ICEvent::DelByReplaceWithGeneric, baseValue.classInfoOrNull(), Identifier::fromUid(globalObject->vm(), propertyName.uid())));
12351235
switch (kind) {
12361236
case DelByKind::ByIdStrict:
12371237
repatchSlowPathCall(codeBlock, stubInfo, operationDeleteByIdStrictGaveUp);
@@ -1322,7 +1322,7 @@ static InlineCacheAction tryCacheInBy(
13221322
&& !structure->needImpurePropertyWatchpoint()) {
13231323
bool generatedCodeInline = InlineAccess::generateSelfInAccess(codeBlock, stubInfo, structure);
13241324
if (generatedCodeInline) {
1325-
LOG_IC((ICEvent::InBySelfPatch, structure->classInfoForCells(), ident, slot.slotBase() == base));
1325+
LOG_IC((vm, ICEvent::InBySelfPatch, structure->classInfoForCells(), ident, slot.slotBase() == base));
13261326
structure->startWatchingPropertyForReplacements(vm, slot.cachedOffset());
13271327
repatchSlowPathCall(codeBlock, stubInfo, operationInByIdOptimize);
13281328
stubInfo.initInByIdSelf(locker, codeBlock, structure, slot.cachedOffset());
@@ -1372,15 +1372,15 @@ static InlineCacheAction tryCacheInBy(
13721372
}
13731373
}
13741374

1375-
LOG_IC((ICEvent::InAddAccessCase, structure->classInfoForCells(), ident, slot.slotBase() == base));
1375+
LOG_IC((vm, ICEvent::InAddAccessCase, structure->classInfoForCells(), ident, slot.slotBase() == base));
13761376

13771377
if (!newCase)
13781378
newCase = AccessCase::create(vm, codeBlock, wasFound ? AccessCase::InHit : AccessCase::InMiss, propertyName, wasFound ? slot.cachedOffset() : invalidOffset, structure, conditionSet, WTFMove(prototypeAccessChain));
13791379

13801380
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), propertyName, WTFMove(newCase));
13811381

13821382
if (result.generatedSomeCode())
1383-
LOG_IC((ICEvent::InReplaceWithJump, structure->classInfoForCells(), ident, slot.slotBase() == base));
1383+
LOG_IC((vm, ICEvent::InReplaceWithJump, structure->classInfoForCells(), ident, slot.slotBase() == base));
13841384
}
13851385

13861386
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1411,7 +1411,7 @@ void repatchInBy(JSGlobalObject* globalObject, CodeBlock* codeBlock, JSObject* b
14111411
break;
14121412
}
14131413
case GiveUpOnCache:
1414-
LOG_IC((ICEvent::InReplaceWithGeneric, baseObject->classInfo(), Identifier::fromUid(globalObject->vm(), propertyName.uid())));
1414+
LOG_IC((globalObject->vm(), ICEvent::InReplaceWithGeneric, baseObject->classInfo(), Identifier::fromUid(globalObject->vm(), propertyName.uid())));
14151415
repatchSlowPathCall(codeBlock, stubInfo, appropriateInByGaveUpFunction(kind));
14161416
break;
14171417
case RetryCacheLater:
@@ -1438,14 +1438,14 @@ static InlineCacheAction tryCacheHasPrivateBrand(JSGlobalObject* globalObject, C
14381438
return action;
14391439

14401440
bool isBaseProperty = true;
1441-
LOG_IC((ICEvent::InAddAccessCase, structure->classInfoForCells(), ident, isBaseProperty));
1441+
LOG_IC((vm, ICEvent::InAddAccessCase, structure->classInfoForCells(), ident, isBaseProperty));
14421442

14431443
Ref<AccessCase> newCase = AccessCase::create(vm, codeBlock, wasFound ? AccessCase::InHit : AccessCase::InMiss, brandID, invalidOffset, structure, { }, { });
14441444

14451445
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), brandID, WTFMove(newCase));
14461446

14471447
if (result.generatedSomeCode())
1448-
LOG_IC((ICEvent::InReplaceWithJump, structure->classInfoForCells(), ident, isBaseProperty));
1448+
LOG_IC((vm, ICEvent::InReplaceWithJump, structure->classInfoForCells(), ident, isBaseProperty));
14491449
}
14501450

14511451
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1481,14 +1481,14 @@ static InlineCacheAction tryCacheCheckPrivateBrand(
14811481
return action;
14821482

14831483
bool isBaseProperty = true;
1484-
LOG_IC((ICEvent::CheckPrivateBrandAddAccessCase, structure->classInfoForCells(), ident, isBaseProperty));
1484+
LOG_IC((vm, ICEvent::CheckPrivateBrandAddAccessCase, structure->classInfoForCells(), ident, isBaseProperty));
14851485

14861486
Ref<AccessCase> newCase = AccessCase::createCheckPrivateBrand(vm, codeBlock, brandID, structure);
14871487

14881488
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), brandID, WTFMove(newCase));
14891489

14901490
if (result.generatedSomeCode())
1491-
LOG_IC((ICEvent::CheckPrivateBrandReplaceWithJump, structure->classInfoForCells(), ident, isBaseProperty));
1491+
LOG_IC((vm, ICEvent::CheckPrivateBrandReplaceWithJump, structure->classInfoForCells(), ident, isBaseProperty));
14921492
}
14931493

14941494
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1536,14 +1536,14 @@ static InlineCacheAction tryCacheSetPrivateBrand(
15361536
ASSERT(newStructure->isObject());
15371537

15381538
bool isBaseProperty = true;
1539-
LOG_IC((ICEvent::SetPrivateBrandAddAccessCase, oldStructure->classInfoForCells(), ident, isBaseProperty));
1539+
LOG_IC((vm, ICEvent::SetPrivateBrandAddAccessCase, oldStructure->classInfoForCells(), ident, isBaseProperty));
15401540

15411541
Ref<AccessCase> newCase = AccessCase::createSetPrivateBrand(vm, codeBlock, brandID, oldStructure, newStructure);
15421542

15431543
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), brandID, WTFMove(newCase));
15441544

15451545
if (result.generatedSomeCode())
1546-
LOG_IC((ICEvent::SetPrivateBrandReplaceWithJump, oldStructure->classInfoForCells(), ident, isBaseProperty));
1546+
LOG_IC((vm, ICEvent::SetPrivateBrandReplaceWithJump, oldStructure->classInfoForCells(), ident, isBaseProperty));
15471547
}
15481548

15491549
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);
@@ -1602,12 +1602,12 @@ static InlineCacheAction tryCacheInstanceOf(
16021602
if (!newCase)
16031603
newCase = AccessCase::create(vm, codeBlock, AccessCase::InstanceOfGeneric, nullptr);
16041604

1605-
LOG_IC((ICEvent::InstanceOfAddAccessCase, structure->classInfoForCells(), Identifier()));
1605+
LOG_IC((vm, ICEvent::InstanceOfAddAccessCase, structure->classInfoForCells(), Identifier()));
16061606

16071607
result = stubInfo.addAccessCase(locker, globalObject, codeBlock, ECMAMode::strict(), nullptr, WTFMove(newCase));
16081608

16091609
if (result.generatedSomeCode())
1610-
LOG_IC((ICEvent::InstanceOfReplaceWithJump, structure->classInfoForCells(), Identifier()));
1610+
LOG_IC((vm, ICEvent::InstanceOfReplaceWithJump, structure->classInfoForCells(), Identifier()));
16111611
}
16121612

16131613
fireWatchpointsAndClearStubIfNeeded(vm, stubInfo, codeBlock, result);

0 commit comments

Comments
 (0)