MCPcopy Create free account
hub / github.com/nodejs/node / branch_update

Method branch_update

tools/inspector_protocol/jinja2/idtracking.py:104–128  ·  view source on GitHub ↗
(self, branch_symbols)

Source from the content-addressed store, hash-verified

102 self._define_ref(name, load=(VAR_LOAD_RESOLVE, name))
103
104 def branch_update(self, branch_symbols):
105 stores = {}
106 for branch in branch_symbols:
107 for target in branch.stores:
108 if target in self.stores:
109 continue
110 stores[target] = stores.get(target, 0) + 1
111
112 for sym in branch_symbols:
113 self.refs.update(sym.refs)
114 self.loads.update(sym.loads)
115 self.stores.update(sym.stores)
116
117 for name, branch_count in iteritems(stores):
118 if branch_count == len(branch_symbols):
119 continue
120 target = self.find_ref(name)
121 assert target is not None, 'should not happen'
122
123 if self.parent is not None:
124 outer_target = self.parent.find_ref(name)
125 if outer_target is not None:
126 self.loads[target] = (VAR_LOAD_ALIAS, outer_target)
127 continue
128 self.loads[target] = (VAR_LOAD_RESOLVE, name)
129
130 def dump_stores(self):
131 rv = {}

Callers 1

visit_IfMethod · 0.45

Calls 3

find_refMethod · 0.95
getMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected