mirror of
https://github.com/Nuitka/Nuitka.git
synced 2025-12-14 20:35:49 +01:00
Optimization: Also decide writing traces for parameter variables faster
This commit is contained in:
@@ -175,12 +175,22 @@ class Variable(getMetaClassBase("Variable", require_slots=True)):
|
||||
return self.traces
|
||||
|
||||
def hasEmptyTracesFor(self, owner):
|
||||
"""Do these traces contain any usage."""
|
||||
for trace in self.traces:
|
||||
if trace.owner is owner and trace.isUsingTrace():
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def hasNoWritingTraces(self):
|
||||
"""Do these traces contain any writes."""
|
||||
|
||||
for trace in self.traces:
|
||||
if trace.isWritingTrace():
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def updateUsageState(self):
|
||||
writers = set()
|
||||
users = set()
|
||||
@@ -191,7 +201,7 @@ class Variable(getMetaClassBase("Variable", require_slots=True)):
|
||||
|
||||
if trace.isAssignTrace():
|
||||
writers.add(owner)
|
||||
elif trace.isDeletedTrace() and owner is not self.owner:
|
||||
elif owner is not self.owner and trace.isDeletedTrace():
|
||||
writers.add(owner)
|
||||
|
||||
self.writers = writers
|
||||
|
||||
Reference in New Issue
Block a user