RESOLVED FIXED 176345
[DFG] PutByVal with Array::Generic is too generic
https://bugs.webkit.org/show_bug.cgi?id=176345
Summary [DFG] PutByVal with Array::Generic is too generic
Attachments
Patch (29.88 KB, patch)
2017-09-08 05:33 PDT, Yusuke Suzuki
fpizlo: review+
Yusuke Suzuki
Comment 1 2017-09-08 04:43:25 PDT
We should have some fixup to remove runtime branches. For example, PutByVal(CellUse, StringUse, UntypedUse).
Yusuke Suzuki
Comment 2 2017-09-08 05:33:46 PDT
Saam Barati
Comment 3 2017-09-08 11:20:35 PDT
Comment on attachment 320257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320257&action=review > Source/JavaScriptCore/dfg/DFGOperations.cpp:151 > + RELEASE_ASSERT(base->isObject()); what guarantees this? Inside Fixup, you speculate Cell, not object? If it's guaranteed, why don't you speculate object?
Yusuke Suzuki
Comment 4 2017-09-08 11:23:35 PDT
Comment on attachment 320257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320257&action=review >> Source/JavaScriptCore/dfg/DFGOperations.cpp:151 >> + RELEASE_ASSERT(base->isObject()); > > what guarantees this? Inside Fixup, you speculate Cell, not object? If it's guaranteed, why don't you speculate object? This is originally guaranteed in operationPutByVal generic functions too. This is because we emit `op_put_by_val` with direct flag only for objects.
Filip Pizlo
Comment 5 2017-09-08 11:26:02 PDT
Comment on attachment 320257 [details] Patch Cool! I think that we can make the Generic case even better by implementing it as an inline cache. Then we can have baseline, DFG, and FTL share that inline cache. And we could use it for better array access profiling.
Yusuke Suzuki
Comment 6 2017-09-08 11:55:18 PDT
(In reply to Filip Pizlo from comment #5) > Comment on attachment 320257 [details] > Patch > > Cool! > > I think that we can make the Generic case even better by implementing it as > an inline cache. Then we can have baseline, DFG, and FTL share that inline > cache. And we could use it for better array access profiling. It sounds nice. We already have IC for GetByVal if it sees only one String/Symbol Identifier. But adding this type of IC (String/Symbol specialization) could further improve performance in baseline, DFG, and FTL.
Yusuke Suzuki
Comment 7 2017-09-08 11:58:40 PDT
Saam Barati
Comment 8 2017-09-08 12:42:30 PDT
Comment on attachment 320257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320257&action=review >>> Source/JavaScriptCore/dfg/DFGOperations.cpp:151 >>> + RELEASE_ASSERT(base->isObject()); >> >> what guarantees this? Inside Fixup, you speculate Cell, not object? If it's guaranteed, why don't you speculate object? > > This is originally guaranteed in operationPutByVal generic functions too. This is because we emit `op_put_by_val` with direct flag only for objects. Right, but your patch looks like it’s calling this from non-direct case. Am I missing something?
Yusuke Suzuki
Comment 9 2017-09-08 21:53:34 PDT
Comment on attachment 320257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320257&action=review >>>> Source/JavaScriptCore/dfg/DFGOperations.cpp:151 >>>> + RELEASE_ASSERT(base->isObject()); >>> >>> what guarantees this? Inside Fixup, you speculate Cell, not object? If it's guaranteed, why don't you speculate object? >> >> This is originally guaranteed in operationPutByVal generic functions too. This is because we emit `op_put_by_val` with direct flag only for objects. > > Right, but your patch looks like it’s calling this from non-direct case. Am I missing something? This "direct" template param is true only when it's used for PutByValDirect.
Saam Barati
Comment 10 2017-09-08 22:40:58 PDT
Comment on attachment 320257 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320257&action=review >>>>> Source/JavaScriptCore/dfg/DFGOperations.cpp:151 >>>>> + RELEASE_ASSERT(base->isObject()); >>>> >>>> what guarantees this? Inside Fixup, you speculate Cell, not object? If it's guaranteed, why don't you speculate object? >>> >>> This is originally guaranteed in operationPutByVal generic functions too. This is because we emit `op_put_by_val` with direct flag only for objects. >> >> Right, but your patch looks like it’s calling this from non-direct case. Am I missing something? > > This "direct" template param is true only when it's used for PutByValDirect. Sorry I was completely misreading the code. This LGTM
Radar WebKit Bug Importer
Comment 11 2017-09-27 12:37:30 PDT
Note You need to log in before you can comment on or make changes to this bug.