3 ms·
> the Chrome code generator is using %rbx The memory base is actually loaded from the instance pointer, and neither of these are pinned to specific registers.
by titzer 7y ago
> the Chrome code generator is using %rbx
The memory base is actually loaded from the instance pointer, and neither of these are pinned to specific registers. They're both allocatable by the register allocator.
> %fs or %gs segment override instead
This is tricky to do for all platforms that V8 supports. I'm not sure it's free; it's still at the very least another prefix.
- devit 7y ago> This is tricky to do for all platforms that V8 supports It can be done only where supported. Ivy Bridge and later have instructions to set them in user space (WRFSBASE/WRGSBASE), and although it needs the OS to enable it, I would expect it can be done on all significant x86-64 OSes. > I'm not sure it's free; it's still at the very least another prefix. There are benchmarks that show TLS is as fast as global variable, so it's probably free (aside from the impact on the I-cache due to increased code size, but using a general purpose register is probably much worse due to additional instructions and extra SIB bytes).