MCPcopy Index your code
hub / github.com/nodejs/node / Add

Method Add

deps/v8/tools/profiling/ll_prof.py:273–291  ·  view source on GitHub ↗
(self, code, max_pages=-1)

Source from the content-addressed store, hash-verified

271 self.max_address = -1
272
273 def Add(self, code, max_pages=-1):
274 page_id = CodePage.PageId(code.start_address)
275 limit_id = CodePage.PageId(code.end_address + CodePage.SIZE - 1)
276 pages = 0
277 while page_id < limit_id:
278 if max_pages >= 0 and pages > max_pages:
279 print("Warning: page limit (%d) reached for %s [%s]" % (
280 max_pages, code.name, code.origin), file=sys.stderr)
281 break
282 if page_id in self.pages:
283 page = self.pages[page_id]
284 else:
285 page = CodePage(CodePage.PageAddressFromId(page_id))
286 self.pages[page_id] = page
287 page.Add(code)
288 page_id += 1
289 pages += 1
290 self.min_address = min(self.min_address, code.start_address)
291 self.max_address = max(self.max_address, code.end_address)
292
293 def Remove(self, code):
294 page_id = CodePage.PageId(code.start_address)

Callers 3

ReadUpToGCMethod · 0.45
LoadMethod · 0.45
_LoadKernelSymbolsMethod · 0.45

Calls 7

AddMethod · 0.95
CodePageClass · 0.85
minFunction · 0.85
PageIdMethod · 0.80
PageAddressFromIdMethod · 0.80
printFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected