->LoadTrue()
.StoreAccumulatorInRegister(done)
using `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
->LoadTrue()
.StoreAccumulatorInRegister(done)
using `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Ok, let's take this fix for now and look into why 3323 isn't working separately.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
->LoadTrue()
.StoreAccumulatorInRegister(done)
Leszek Swirskiusing `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Ok, let's take this fix for now and look into why 3323 isn't working separately.
I figured it out -- it's because of the way the register optimizer works, it expects that `ForOfNext` will _unconditionally_ write into the `done` register, and therefore that the previous store of `True` into the `done` register is not observable.
You can take advantage of this by actually unconditionally writing `True` into `done` at the start of `ForOfNext`, before doing all the callbacks, and then you can move the `LoadTrue().Store(done)` into the `else` branch here.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
->LoadTrue()
.StoreAccumulatorInRegister(done)
Leszek Swirskiusing `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Leszek SwirskiOk, let's take this fix for now and look into why 3323 isn't working separately.
I figured it out -- it's because of the way the register optimizer works, it expects that `ForOfNext` will _unconditionally_ write into the `done` register, and therefore that the previous store of `True` into the `done` register is not observable.
You can take advantage of this by actually unconditionally writing `True` into `done` at the start of `ForOfNext`, before doing all the callbacks, and then you can move the `LoadTrue().Store(done)` into the `else` branch here.
That's interesting. I did not know about the register optimizer.
I applied your suggestion but it didn't work. I have uploaded my code so you can see what I have done. I tried loading `True` in bytecode-array-builder.cc and bytecode-graph-builder.cc and none of them worked. I kept both in this CL so you can check them.
(I also tried loading `True` in var_done (TVARIABLE) in `ForOfNextHelper` in code-stub-assembler.cc but that did not look correct to me. We don't have access to the registers there so I did not upload that part in this CL.)
Let me know if I am missing something here, thanks.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
->LoadTrue()
.StoreAccumulatorInRegister(done)
Leszek Swirskiusing `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Leszek SwirskiOk, let's take this fix for now and look into why 3323 isn't working separately.
Rezvan Mahdavi HezavehI figured it out -- it's because of the way the register optimizer works, it expects that `ForOfNext` will _unconditionally_ write into the `done` register, and therefore that the previous store of `True` into the `done` register is not observable.
You can take advantage of this by actually unconditionally writing `True` into `done` at the start of `ForOfNext`, before doing all the callbacks, and then you can move the `LoadTrue().Store(done)` into the `else` branch here.
That's interesting. I did not know about the register optimizer.
I applied your suggestion but it didn't work. I have uploaded my code so you can see what I have done. I tried loading `True` in bytecode-array-builder.cc and bytecode-graph-builder.cc and none of them worked. I kept both in this CL so you can check them.
(I also tried loading `True` in var_done (TVARIABLE) in `ForOfNextHelper` in code-stub-assembler.cc but that did not look correct to me. We don't have access to the registers there so I did not upload that part in this CL.)Let me know if I am missing something here, thanks.
What I meant was in the ForOfNext bytecode handler itself, before it calls the ForOfNextHelper. OTOH, this might be tricky with lazy deopts...
Another option you have is to add ForOfNext to the list of bytecodes in the register optimizer which flush the optimizer state. Since you're at the top of a loop, this won't have a huge impact, since loops already flush the registers.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
->LoadTrue()
.StoreAccumulatorInRegister(done)
Leszek Swirskiusing `--trace_ignition`, I realized that `done` set to `false` in the second iteration of the loop at this point. The code in line 3323 should set it to `true` at the start of each iteration but it does not. Loading `true` here fixes the bug but I still am not sure why this happens.
Leszek SwirskiOk, let's take this fix for now and look into why 3323 isn't working separately.
Rezvan Mahdavi HezavehI figured it out -- it's because of the way the register optimizer works, it expects that `ForOfNext` will _unconditionally_ write into the `done` register, and therefore that the previous store of `True` into the `done` register is not observable.
You can take advantage of this by actually unconditionally writing `True` into `done` at the start of `ForOfNext`, before doing all the callbacks, and then you can move the `LoadTrue().Store(done)` into the `else` branch here.
Leszek SwirskiThat's interesting. I did not know about the register optimizer.
I applied your suggestion but it didn't work. I have uploaded my code so you can see what I have done. I tried loading `True` in bytecode-array-builder.cc and bytecode-graph-builder.cc and none of them worked. I kept both in this CL so you can check them.
(I also tried loading `True` in var_done (TVARIABLE) in `ForOfNextHelper` in code-stub-assembler.cc but that did not look correct to me. We don't have access to the registers there so I did not upload that part in this CL.)Let me know if I am missing something here, thanks.
What I meant was in the ForOfNext bytecode handler itself, before it calls the ForOfNextHelper. OTOH, this might be tricky with lazy deopts...
Another option you have is to add ForOfNext to the list of bytecodes in the register optimizer which flush the optimizer state. Since you're at the top of a loop, this won't have a huge impact, since loops already flush the registers.
Okay, I applied your suggestion and add the ForOfNext to the list of bytecodes that needs flushing the optimizer state. Thanks for the suggestion.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for the review. PTAL, thanks
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |