Bug 182226

Summary: LargeAllocation should do the same distancing as MarkedBlock
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, jfbastien, keith_miller, mark.lam, msaboff, rmorisset, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 181636    
Attachments:
Description Flags
the patch saam: review+

Filip Pizlo
Reported 2018-01-28 15:52:58 PST
Patch forthcoming.
Attachments
the patch (6.55 KB, patch)
2018-01-28 16:10 PST, Filip Pizlo
saam: review+
Radar WebKit Bug Importer
Comment 1 2018-01-28 15:53:19 PST
Filip Pizlo
Comment 2 2018-01-28 16:10:57 PST
Created attachment 332498 [details] the patch
Saam Barati
Comment 3 2018-01-28 20:58:10 PST
Comment on attachment 332498 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=332498&action=review > Source/JavaScriptCore/heap/LargeAllocation.cpp:41 > + size_t sizeIncludingDistancing = sizeBeforeDistancing + distancing; We don’t have any JIT code that needs to be updated to also do this? Do we not inline large allocations in the JIT?
Filip Pizlo
Comment 4 2018-01-28 21:07:05 PST
(In reply to Saam Barati from comment #3) > Comment on attachment 332498 [details] > the patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=332498&action=review > > > Source/JavaScriptCore/heap/LargeAllocation.cpp:41 > > + size_t sizeIncludingDistancing = sizeBeforeDistancing + distancing; > > We don’t have any JIT code that needs to be updated to also do this? Do we > not inline large allocations in the JIT? Only small allocations are inlined. Large allocations are very complicated to do. Here's a GC thinking trick: the cost of an allocation "hides behind" the cost of initializing every element. Because any not-totally-dumb allocation would be followed by at least an initialization of every element. Large allocations mean allocating at least 8000 bytes. Whether or not you inline a function call has infinitesimal cost compared to the cost of initializing 8000 bytes. Therefore, we don't inline large allocations.
Filip Pizlo
Comment 5 2018-01-28 21:08:47 PST
Saam Barati
Comment 6 2018-01-28 21:49:35 PST
(In reply to Filip Pizlo from comment #4) > (In reply to Saam Barati from comment #3) > > Comment on attachment 332498 [details] > > the patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=332498&action=review > > > > > Source/JavaScriptCore/heap/LargeAllocation.cpp:41 > > > + size_t sizeIncludingDistancing = sizeBeforeDistancing + distancing; > > > > We don’t have any JIT code that needs to be updated to also do this? Do we > > not inline large allocations in the JIT? > > Only small allocations are inlined. Large allocations are very complicated > to do. > > Here's a GC thinking trick: the cost of an allocation "hides behind" the > cost of initializing every element. Because any not-totally-dumb allocation > would be followed by at least an initialization of every element. > > Large allocations mean allocating at least 8000 bytes. > > Whether or not you inline a function call has infinitesimal cost compared to > the cost of initializing 8000 bytes. > > Therefore, we don't inline large allocations. Makes sense.
Note You need to log in before you can comment on or make changes to this bug.