[JSC] Optimize PutByVal with for-in
Created attachment 439293 [details] Patch
Comment on attachment 439293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439293&action=review > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1503 > + OpJeqPtr::emit(this, cond, moveLinkTimeConstant(nullptr, LinkTimeConstant::sentinelString), target.bind(this)); No need for this to be a link time constant. It can live on UnlinkedCodeBlock. It’s not related to global object.
Comment on attachment 439293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439293&action=review Thanks >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1503 >> + OpJeqPtr::emit(this, cond, moveLinkTimeConstant(nullptr, LinkTimeConstant::sentinelString), target.bind(this)); > > No need for this to be a link time constant. It can live on UnlinkedCodeBlock. It’s not related to global object. Changed.
Committed r283095 (242153@main): <https://commits.webkit.org/242153@main>
<rdar://problem/83557863>
Re-opened since this is blocked by bug 230815
Comment on attachment 439293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439293&action=review >>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1503 >>> + OpJeqPtr::emit(this, cond, moveLinkTimeConstant(nullptr, LinkTimeConstant::sentinelString), target.bind(this)); >> >> No need for this to be a link time constant. It can live on UnlinkedCodeBlock. It’s not related to global object. > > Changed. Ah, no. This should be link-time-constant. Otherwise, it does not work with bytecode cache. I'll revert the patch and reland the original one.
(In reply to Yusuke Suzuki from comment #7) > Comment on attachment 439293 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=439293&action=review > > >>> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1503 > >>> + OpJeqPtr::emit(this, cond, moveLinkTimeConstant(nullptr, LinkTimeConstant::sentinelString), target.bind(this)); > >> > >> No need for this to be a link time constant. It can live on UnlinkedCodeBlock. It’s not related to global object. > > > > Changed. > > Ah, no. This should be link-time-constant. Otherwise, it does not work with > bytecode cache. I'll revert the patch and reland the original one. I see... That's unfortunate. I guess you could also make it so that we test equivalence to the "sentinel string" when serializing bytecode, and then store it as some kind of marker. But, just making it a link time constant sounds simple enough.
Committed r283098 (242156@main): <https://commits.webkit.org/242156@main>