RESOLVED FIXED 214403
[JSC] Use unvalidatedGet instead of get to access UnlinkedCodeBlock from CodeBlock destructor
https://bugs.webkit.org/show_bug.cgi?id=214403
Summary [JSC] Use unvalidatedGet instead of get to access UnlinkedCodeBlock from Code...
Yusuke Suzuki
Reported 2020-07-16 03:48:14 PDT
[JSC] Touch UnlinkedCodeBlock from CodeBlock destructor by using unvalidatedGet
Attachments
Patch (5.59 KB, patch)
2020-07-16 03:50 PDT, Yusuke Suzuki
no flags
Patch (5.63 KB, patch)
2020-07-16 12:39 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2020-07-16 03:50:41 PDT
Yusuke Suzuki
Comment 2 2020-07-16 03:50:43 PDT
Mark Lam
Comment 3 2020-07-16 10:18:54 PDT
Comment on attachment 404433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=404433&action=review r=me if EWS bots are green. The mac-wk1 bot was red but I told it to re-run the test. If the failure is real, please fix before landing. Thanks. > Source/JavaScriptCore/ChangeLog:3 > + [JSC] Touch UnlinkedCodeBlock from CodeBlock destructor by using unvalidatedGet I suggest renaming this title to "Use unvalidatedGet instead of get to access UnlinkedCodeBlock from CodeBlock destructor". The current title reads to me like an imperative to add some code to access the UnlinkedCodeBlock, whereas what you meant is that when we access it, we need to use unvalidatedGet. > Source/JavaScriptCore/bytecode/CodeBlock.cpp:820 > + // We use unvalidatedGet because validation rejects get() access when we are destroying cells. I suggest rephrasing as "because get() has a validation assertion that rejects access". Mentioning the "assertion" here also sets the context for the next point. > Source/JavaScriptCore/bytecode/CodeBlock.cpp:821 > + // This is right assertion since destruction order of cells is not defined, so member cells would get destroyed already. I suggest rephrasing as "This assertion is correct since destruction order of cells is not guaranteed, and member cells could already be destroyed." > JSTests/stress/codeblock-destructor-access-unlinkedcodeblock.js:2 > +//@ runDefault("--returnEarlyFromInfiniteLoopsForFuzzing=1") > +//@ slow! Please skip for memoryLimited. I'm using memoryLimited here as a proxy for slow machines here. The armv7 and mips bots are showing that this tests times out there. I'm guessing this might also be the case for other embedded / memory limited devices.
Yusuke Suzuki
Comment 4 2020-07-16 12:35:22 PDT
Comment on attachment 404433 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=404433&action=review >> Source/JavaScriptCore/ChangeLog:3 >> + [JSC] Touch UnlinkedCodeBlock from CodeBlock destructor by using unvalidatedGet > > I suggest renaming this title to "Use unvalidatedGet instead of get to access UnlinkedCodeBlock from CodeBlock destructor". The current title reads to me like an imperative to add some code to access the UnlinkedCodeBlock, whereas what you meant is that when we access it, we need to use unvalidatedGet. Changed. >> Source/JavaScriptCore/bytecode/CodeBlock.cpp:820 >> + // We use unvalidatedGet because validation rejects get() access when we are destroying cells. > > I suggest rephrasing as "because get() has a validation assertion that rejects access". Mentioning the "assertion" here also sets the context for the next point. Changed. >> Source/JavaScriptCore/bytecode/CodeBlock.cpp:821 >> + // This is right assertion since destruction order of cells is not defined, so member cells would get destroyed already. > > I suggest rephrasing as "This assertion is correct since destruction order of cells is not guaranteed, and member cells could already be destroyed." Changed. >> JSTests/stress/codeblock-destructor-access-unlinkedcodeblock.js:2 >> +//@ slow! > > Please skip for memoryLimited. I'm using memoryLimited here as a proxy for slow machines here. The armv7 and mips bots are showing that this tests times out there. I'm guessing this might also be the case for other embedded / memory limited devices. OK, added.
Yusuke Suzuki
Comment 5 2020-07-16 12:39:54 PDT
Yusuke Suzuki
Comment 6 2020-07-16 12:42:18 PDT
Note You need to log in before you can comment on or make changes to this bug.