Skip to content

Commit

Permalink
[JSC] Remove DFGDesiredObjectProperties
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267134
rdar://120443399

Reviewed by Mark Lam.

When we limit the structure only one, there is no way to change the property without firing
property replacement watchpoint while keeping object's structure as specified. So removing DFGDesiredObjectProperties.

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/dfg/DFGDesiredObjectProperties.cpp: Removed.
* Source/JavaScriptCore/dfg/DFGDesiredObjectProperties.h: Removed.
* Source/JavaScriptCore/dfg/DFGGraph.cpp:
(JSC::DFG::Graph::tryGetConstantProperty):
* Source/JavaScriptCore/dfg/DFGPlan.cpp:
(JSC::DFG::Plan::cancel):
(JSC::DFG::Plan::isStillValidOnMainThread):
* Source/JavaScriptCore/dfg/DFGPlan.h:

Originally-landed-as: 272448.8@safari-7618-branch (a8b53bc). rdar://121473608
Canonical link: https://commits.webkit.org/273487@main
  • Loading branch information
Constellation authored and robert-jenner committed Jan 25, 2024
1 parent 6471469 commit 66f60de
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1970,8 +1970,6 @@
E33F50811B8429A400413856 /* JSInternalPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E33F507F1B8429A400413856 /* JSInternalPromise.h */; settings = {ATTRIBUTES = (Private, ); }; };
E3400EC122A1CC7B009DED54 /* FunctionExecutableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E3400EC022A1CC78009DED54 /* FunctionExecutableInlines.h */; };
E3443E3128E9711700C0020C /* ArrayPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E3443E3028E9711700C0020C /* ArrayPrototypeInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
E34565A72B4753D800ED9B78 /* DFGDesiredObjectProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E34565A42B4753D700ED9B78 /* DFGDesiredObjectProperties.cpp */; };
E34565A82B4753D800ED9B78 /* DFGDesiredObjectProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = E34565A52B4753D800ED9B78 /* DFGDesiredObjectProperties.h */; };
E348876228F516C600527E5E /* ObjectPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E348876128F516C600527E5E /* ObjectPrototypeInlines.h */; };
E349A7812491F161001BA336 /* DFGCodeOriginPool.h in Headers */ = {isa = PBXBuildFile; fileRef = E349A7802491F15A001BA336 /* DFGCodeOriginPool.h */; settings = {ATTRIBUTES = (Private, ); }; };
E34D4FAA2984F25B00CE5F9F /* WasmCallsiteCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = E34D4FA92984F25A00CE5F9F /* WasmCallsiteCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -5624,8 +5622,6 @@
E33F50881B844A1A00413856 /* InternalPromiseConstructor.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InternalPromiseConstructor.js; sourceTree = "<group>"; };
E3400EC022A1CC78009DED54 /* FunctionExecutableInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionExecutableInlines.h; sourceTree = "<group>"; };
E3443E3028E9711700C0020C /* ArrayPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayPrototypeInlines.h; sourceTree = "<group>"; };
E34565A42B4753D700ED9B78 /* DFGDesiredObjectProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredObjectProperties.cpp; path = dfg/DFGDesiredObjectProperties.cpp; sourceTree = "<group>"; };
E34565A52B4753D800ED9B78 /* DFGDesiredObjectProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredObjectProperties.h; path = dfg/DFGDesiredObjectProperties.h; sourceTree = "<group>"; };
E348876128F516C600527E5E /* ObjectPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectPrototypeInlines.h; sourceTree = "<group>"; };
E349A77F2491F159001BA336 /* DFGCodeOriginPool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DFGCodeOriginPool.cpp; path = dfg/DFGCodeOriginPool.cpp; sourceTree = "<group>"; };
E349A7802491F15A001BA336 /* DFGCodeOriginPool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGCodeOriginPool.h; path = dfg/DFGCodeOriginPool.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9034,8 +9030,6 @@
E3BFA5CD21E853A1009C0EBA /* DFGDesiredGlobalProperty.h */,
0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */,
0F8F2B98172F04FD007DBDA5 /* DFGDesiredIdentifiers.h */,
E34565A42B4753D700ED9B78 /* DFGDesiredObjectProperties.cpp */,
E34565A52B4753D800ED9B78 /* DFGDesiredObjectProperties.h */,
C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */,
C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */,
0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */,
Expand Down Expand Up @@ -10630,7 +10624,6 @@
0F2FC77316E12F740038D976 /* DFGDCEPhase.h in Headers */,
E3BFA5D021E853A1009C0EBA /* DFGDesiredGlobalProperty.h in Headers */,
0F8F2B9A172F0501007DBDA5 /* DFGDesiredIdentifiers.h in Headers */,
E34565A82B4753D800ED9B78 /* DFGDesiredObjectProperties.h in Headers */,
C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */,
0FE8534C1723CDA500B618F5 /* DFGDesiredWatchpoints.h in Headers */,
C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */,
Expand Down Expand Up @@ -13155,7 +13148,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E34565A72B4753D800ED9B78 /* DFGDesiredObjectProperties.cpp in Sources */,
52CD0F682242F71C004A18A5 /* testdfg.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
1 change: 0 additions & 1 deletion Source/JavaScriptCore/Sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ dfg/DFGCriticalEdgeBreakingPhase.cpp
dfg/DFGDCEPhase.cpp
dfg/DFGDesiredGlobalProperties.cpp
dfg/DFGDesiredIdentifiers.cpp
dfg/DFGDesiredObjectProperties.cpp
dfg/DFGDesiredTransitions.cpp
dfg/DFGDesiredWatchpoints.cpp
dfg/DFGDesiredWeakReferences.cpp
Expand Down
71 changes: 0 additions & 71 deletions Source/JavaScriptCore/dfg/DFGDesiredObjectProperties.cpp

This file was deleted.

55 changes: 0 additions & 55 deletions Source/JavaScriptCore/dfg/DFGDesiredObjectProperties.h

This file was deleted.

9 changes: 2 additions & 7 deletions Source/JavaScriptCore/dfg/DFGGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,8 +1354,8 @@ JSValue Graph::tryGetConstantProperty(
if (!result)
return JSValue();

// If all structures are watched, we don't need to check them in the main thread because they already registered watchpoints
// for transitions. If the object gets transition while compiling, then it invalidates the code.
// If all structures are watched, we don't need to consider whether object transitions and changes the value.
// If the object gets transition while compiling, then it invalidates the code.
bool allAreWatched = true;
for (unsigned i = structureSet.size(); i--;) {
RegisteredStructure structure = structureSet[i];
Expand All @@ -1373,11 +1373,6 @@ JSValue Graph::tryGetConstantProperty(
if (structureSet.size() != 1)
return JSValue();

m_plan.weakReferences().addLazily(object);
m_plan.weakReferences().addLazily(result);
if (!m_plan.objectProperties().addLazily(object, offset, result, set.onlyStructure()))
return JSValue();

return result;
}

Expand Down
7 changes: 1 addition & 6 deletions Source/JavaScriptCore/dfg/DFGPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ void Plan::cancel()
m_identifiers = DesiredIdentifiers();
m_weakReferences = DesiredWeakReferences();
m_transitions = DesiredTransitions();
m_objectProperties = DesiredObjectProperties();
m_callback = nullptr;
}

Expand Down Expand Up @@ -543,11 +542,7 @@ void Plan::reallyAdd(CommonData* commonData)

bool Plan::isStillValidOnMainThread()
{
if (!m_watchpoints.areStillValidOnMainThread(*m_vm, m_identifiers))
return false;
if (!m_objectProperties.areStillValidOnMainThread(*m_vm))
return false;
return true;
return m_watchpoints.areStillValidOnMainThread(*m_vm, m_identifiers);
}

CompilationResult Plan::finalize()
Expand Down
3 changes: 0 additions & 3 deletions Source/JavaScriptCore/dfg/DFGPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "CompilationResult.h"
#include "DFGDesiredGlobalProperties.h"
#include "DFGDesiredIdentifiers.h"
#include "DFGDesiredObjectProperties.h"
#include "DFGDesiredTransitions.h"
#include "DFGDesiredWatchpoints.h"
#include "DFGDesiredWeakReferences.h"
Expand Down Expand Up @@ -93,7 +92,6 @@ class Plan final : public JITPlan {
DesiredIdentifiers& identifiers() { return m_identifiers; }
DesiredWeakReferences& weakReferences() { return m_weakReferences; }
DesiredTransitions& transitions() { return m_transitions; }
DesiredObjectProperties& objectProperties() { return m_objectProperties; }
RecordedStatuses& recordedStatuses() { return m_recordedStatuses; }

bool willTryToTierUp() const { return m_willTryToTierUp; }
Expand Down Expand Up @@ -134,7 +132,6 @@ class Plan final : public JITPlan {
DesiredIdentifiers m_identifiers;
DesiredWeakReferences m_weakReferences;
DesiredTransitions m_transitions;
DesiredObjectProperties m_objectProperties;
RecordedStatuses m_recordedStatuses;

HashMap<BytecodeIndex, FixedVector<BytecodeIndex>> m_tierUpInLoopHierarchy;
Expand Down

0 comments on commit 66f60de

Please sign in to comment.