RESOLVED FIXED 202324
OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
https://bugs.webkit.org/show_bug.cgi?id=202324
Summary OSR exit shouldn't bother updating get_by_id array profiles that have changed...
Keith Miller
Reported 2019-09-27 11:10:32 PDT
OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
Attachments
Patch (3.94 KB, patch)
2019-09-27 11:11 PDT, Keith Miller
no flags
Patch for landing (4.08 KB, patch)
2019-09-27 11:44 PDT, Keith Miller
no flags
Keith Miller
Comment 1 2019-09-27 11:11:50 PDT
Keith Miller
Comment 2 2019-09-27 11:11:52 PDT
Yusuke Suzuki
Comment 3 2019-09-27 11:33:29 PDT
Comment on attachment 379744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379744&action=review r=me > Source/JavaScriptCore/dfg/DFGOSRExit.cpp:523 > + bool doProfile = instruction->opcodeID() != op_get_by_id || instruction->as<OpGetById>().metadata(profiledCodeBlock).m_modeMetadata.mode == GetByIdMode::ArrayLength; You can use `!instruction->is<OpGetById>()`. > Source/JavaScriptCore/dfg/DFGOSRExit.cpp:1176 > + if (instruction->opcodeID() == op_get_by_id) { Ditto. You can use `instruction->is<OpGetById>()`.
Keith Miller
Comment 4 2019-09-27 11:34:16 PDT
Comment on attachment 379744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379744&action=review >> Source/JavaScriptCore/dfg/DFGOSRExit.cpp:523 >> + bool doProfile = instruction->opcodeID() != op_get_by_id || instruction->as<OpGetById>().metadata(profiledCodeBlock).m_modeMetadata.mode == GetByIdMode::ArrayLength; > > You can use `!instruction->is<OpGetById>()`. Nice! Fixed, thanks! >> Source/JavaScriptCore/dfg/DFGOSRExit.cpp:1176 >> + if (instruction->opcodeID() == op_get_by_id) { > > Ditto. You can use `instruction->is<OpGetById>()`. ditto.
Mark Lam
Comment 5 2019-09-27 11:34:48 PDT
Comment on attachment 379744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379744&action=review > Source/JavaScriptCore/dfg/DFGOSRExit.cpp:1174 > if (ArrayProfile* arrayProfile = jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex())) { > + const Instruction* instruction = jit.baselineCodeBlockFor(codeOrigin)->instructions().at(codeOrigin.bytecodeIndex()).ptr(); Can you just compute jit.baselineCodeBlockFor(codeOrigin) once and pre-cache it?
Keith Miller
Comment 6 2019-09-27 11:42:09 PDT
Comment on attachment 379744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379744&action=review >> Source/JavaScriptCore/dfg/DFGOSRExit.cpp:1174 >> + const Instruction* instruction = jit.baselineCodeBlockFor(codeOrigin)->instructions().at(codeOrigin.bytecodeIndex()).ptr(); > > Can you just compute jit.baselineCodeBlockFor(codeOrigin) once and pre-cache it? Sure, done.
Keith Miller
Comment 7 2019-09-27 11:44:43 PDT
Created attachment 379749 [details] Patch for landing
WebKit Commit Bot
Comment 8 2019-09-27 12:30:14 PDT
Comment on attachment 379749 [details] Patch for landing Clearing flags on attachment: 379749 Committed r250440: <https://trac.webkit.org/changeset/250440>
WebKit Commit Bot
Comment 9 2019-09-27 12:30:16 PDT
All reviewed patches have been landed. Closing bug.
Saam Barati
Comment 10 2019-10-01 17:33:30 PDT
You missed the FTL
Keith Miller
Comment 11 2019-10-02 14:02:35 PDT
(In reply to Saam Barati from comment #10) > You missed the FTL Whoops, will fix.
Keith Miller
Comment 12 2019-10-02 14:10:23 PDT
Note You need to log in before you can comment on or make changes to this bug.