Bug 277381

Summary: [JSC] B3 Values shouldn't recompute their adjacency list offset when children are accessed
Product: WebKit Reporter: David Degazio <d_degazio>
Component: JavaScriptCoreAssignee: David Degazio <d_degazio>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

David Degazio
Reported 2024-07-30 15:11:57 PDT
B3 Values are currently laid out as a base Value class (which can be a derived class like a MemoryValue or AtomicValue) followed in memory by an adjacency list, of up to two Value* children or a Vector<Value*, 3> child vector for varargs nodes. The offset of this adjacency list is the size of the derived class of the current instance, but since we implement this behavior in Value, we don't know this size and currently have to switch on opcode (!) to figure out how big our Value is. Since this offset will never change for the lifetime of a Value, and it is likely pretty small, we should just store it as a field on Value to avoid unnecessary switching.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-07-30 15:12:14 PDT
David Degazio
Comment 2 2024-07-30 15:30:40 PDT
EWS
Comment 3 2024-07-31 11:42:48 PDT
Committed 281663@main (6bca30fcc772): <https://commits.webkit.org/281663@main> Reviewed commits have been landed. Closing PR #31505 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.