--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAAg-m6qF47m8fP81GoeeM4YJBaBAC8%2BY_z%3DcmanviBBeQTsD_A%40mail.gmail.com.
Clemens Backes
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAP2LTJ1mRUt%2BR%2BM%3DX3rKFvrGVpTMG9uzdgnoCq99Qj2scyTL_A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAKSzg3RuByF74JjbqPg_Nne055hio_ACNPNbGPSmcOY6Uj79bg%40mail.gmail.com.
Hi everyone,
I've summarized comments, questions, and responses at the top here with the effect of making this a little bit easier to read. My comments, questions, and responses are just below.Clemens:- Currently, there is no kRootRegister in WASM SIMD (or at least x64).- Any access to data through the Isolate heap would require a few indirections since there wouldn't be any way to calculate a consistent offset or displacement for a specific constant.- An alternative to using the heap is to allocate data blocks somewhere that's PC-relative (or within 32bits of RIP). If pages can be allocated in that range and they are not code pages, they're not executable by default. This helps alleviate any security concerns. If closeby is not an option, we can use the code page allocator to allocate pages. However, if we do this, we should ensure that those pages are marked as not executable.- Start putting together a design document and include Zhi and me on it.- How would you use External References with the Heap?Zhi:- Have explored the possibility of using PC-relative/RIP relative addressing in https://docs.google.com/document/d/1uCYwyQYjgNAtaXDNgHusDGCV1m9YGhOWJx2eqzv2rdI/edit- Proposal was specific to shuffles and abandoned when another solution could provide immediate performance benefits without the complexity of the constant pool.- There is still interest in a constant pool and it warrants further investigation.Jakob:- Isolate is good for builtins and or anything fixed and static in scope. This might not be a good use case for two reasons:1) Constants are likely limited in scope to the code using them and are unlikely to get benefit from sharing.2) If it's allocated with an isolate factory, it now requires a handle since the address can move if the GC moves it.- A better alternative would be something like what Clemens is describing (a PC relative solution) since that will follow the same lifecycle as the code using it.- If the implementation can be made to work in such a way that it's PC relative but not in code space, that's even better, since it alleviates security concerns.Clemens:- With respect to External References, we've started using them quite a bit since they have some very nice properties. Regardless of address space, we can make any pointer address available with a movq, not just PC relative, and any other instruction (pandn/pshufb...) with the result as an aligned memory operand. My thought is that if we can find a way to ensure any given block of memory is deallocated after the code executes (or simply when the code itself falls out of scope), we can build a constant pool wherever whenever. In such a case, we could hypothetically have a std::set somewhere in heap space that could be used to deduplicate any/all constants we need and allow for their generation and use during the code generation process. The thought of using the Isolate Heap was appealing if kRootRegister existed and we could always generate a constant displacement -- thus eliminating the extra movq instruction.- Generally speaking, I would love your help and am open to any solution that performs better than constant re-generation with shuffles. If the PC relative solution is viable and efficient, it's certainly worth testing.- How would you like me to list you on the V8 design doc? Do I put you and Zhi as technical leads? I'm not sure what or whom to put in the LGTM column, and then what the next steps are. Do we talk offline and then submit it to v8-dev+design? Or is that where the dialog happens?Zhi:- This design doc and the prototype implementation are super helpful even if only for reference. Thanks.- With respect to the prototype implementation, does it actually build a constant pool or just inline constants before they're used? I'm curious about anything/everything that's happening in this green block: https://chromium-review.googlesource.com/c/v8/v8/+/2149408/2/src/codegen/x64/assembler-x64.cc#431
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAAg-m6qL2dr5kMFn5qqfnfSoidt4LEK2rz0rf83nfw2Rf5crwQ%40mail.gmail.com.
Hi everyone,
I've summarized comments, questions, and responses at the top here with the effect of making this a little bit easier to read. My comments, questions, and responses are just below.Clemens:- Currently, there is no kRootRegister in WASM SIMD (or at least x64).- Any access to data through the Isolate heap would require a few indirections since there wouldn't be any way to calculate a consistent offset or displacement for a specific constant.- An alternative to using the heap is to allocate data blocks somewhere that's PC-relative (or within 32bits of RIP). If pages can be allocated in that range and they are not code pages, they're not executable by default. This helps alleviate any security concerns. If closeby is not an option, we can use the code page allocator to allocate pages. However, if we do this, we should ensure that those pages are marked as not executable.- Start putting together a design document and include Zhi and me on it.- How would you use External References with the Heap?Zhi:- Have explored the possibility of using PC-relative/RIP relative addressing in https://docs.google.com/document/d/1uCYwyQYjgNAtaXDNgHusDGCV1m9YGhOWJx2eqzv2rdI/edit- Proposal was specific to shuffles and abandoned when another solution could provide immediate performance benefits without the complexity of the constant pool.- There is still interest in a constant pool and it warrants further investigation.Jakob:- Isolate is good for builtins and or anything fixed and static in scope. This might not be a good use case for two reasons:1) Constants are likely limited in scope to the code using them and are unlikely to get benefit from sharing.2) If it's allocated with an isolate factory, it now requires a handle since the address can move if the GC moves it.- A better alternative would be something like what Clemens is describing (a PC relative solution) since that will follow the same lifecycle as the code using it.- If the implementation can be made to work in such a way that it's PC relative but not in code space, that's even better, since it alleviates security concerns.Clemens:- With respect to External References, we've started using them quite a bit since they have some very nice properties. Regardless of address space, we can make any pointer address available with a movq, not just PC relative, and any other instruction (pandn/pshufb...) with the result as an aligned memory operand. My thought is that if we can find a way to ensure any given block of memory is deallocated after the code executes (or simply when the code itself falls out of scope), we can build a constant pool wherever whenever. In such a case, we could hypothetically have a std::set somewhere in heap space that could be used to deduplicate any/all constants we need and allow for their generation and use during the code generation process. The thought of using the Isolate Heap was appealing if kRootRegister existed and we could always generate a constant displacement -- thus eliminating the extra movq instruction.- Generally speaking, I would love your help and am open to any solution that performs better than constant re-generation with shuffles. If the PC relative solution is viable and efficient, it's certainly worth testing.- How would you like me to list you on the V8 design doc? Do I put you and Zhi as technical leads? I'm not sure what or whom to put in the LGTM column, and then what the next steps are. Do we talk offline and then submit it to v8-dev+design? Or is that where the dialog happens?
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAAg-m6qL2dr5kMFn5qqfnfSoidt4LEK2rz0rf83nfw2Rf5crwQ%40mail.gmail.com.
Hi everyone,
- If we could allocate pages for data that were never in the pathway of being set as executable that would be awesome. If we can then allocate from said pages each individual aligned constant, it would be really awesome.
On Wed, Mar 17, 2021 at 11:28 PM Dan Weber <dwe...@gmail.com> wrote:Hi everyone,
I would propose to start with the design doc, and we can have "offline" discussions if we find things that require more in-depth discussion. Just put us as reviewers in the LGTM section, we will also help with the completion of the design doc and potentially add more reviewers if necessary. All this can happen before actually sending the doc to v8-dev.Before starting actual work on this it would be nice to learn more about the motivation. Do we have evidence that what we currently do is too slow? Maybe it would be possible to prototype something and measure. I can certainly help with that, if we have a benchmark that we think would benefit. But let's discuss this in the design doc.