Skip to content
Permalink
Browse files
Pack RegisterAtOffset harder.
<https://webkit.org/b/152501>

Reviewed by Michael Saboff.

Pack the register index and the offset into a single pointer-sized word instead of two.
This reduces memory consumption by 620 kB on mobile theverge.com.

The packing doesn't succeed on MSVC for some reason, so I've left out the static
assertion about class size in those builds.

* jit/RegisterAtOffset.cpp:
* jit/RegisterAtOffset.h:


Canonical link: https://commits.webkit.org/171355@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed Jan 20, 2016
1 parent 9b6aec1 commit b9556031fc6f3460d1c4a1eac3c10be95da717fa
Showing with 21 additions and 1 deletion.
  1. +16 −0 Source/JavaScriptCore/ChangeLog
  2. +4 −0 Source/JavaScriptCore/jit/RegisterAtOffset.cpp
  3. +1 −1 Source/JavaScriptCore/jit/RegisterAtOffset.h
@@ -1,3 +1,19 @@
2016-01-20 Andreas Kling <akling@apple.com>

Pack RegisterAtOffset harder.
<https://webkit.org/b/152501>

Reviewed by Michael Saboff.

Pack the register index and the offset into a single pointer-sized word instead of two.
This reduces memory consumption by 620 kB on mobile theverge.com.

The packing doesn't succeed on MSVC for some reason, so I've left out the static
assertion about class size in those builds.

* jit/RegisterAtOffset.cpp:
* jit/RegisterAtOffset.h:

2016-01-20 Per Arne Vollan <peavo@outlook.com>

[B3][Win64] Compile fix.
@@ -30,6 +30,10 @@

namespace JSC {

#if !COMPILER(MSVC)
static_assert(sizeof(RegisterAtOffset) == sizeof(ptrdiff_t), "RegisterAtOffset should be small.");
#endif

void RegisterAtOffset::dump(PrintStream& out) const
{
out.print(reg(), " at ", offset());
@@ -70,7 +70,7 @@ class RegisterAtOffset {

private:
Reg m_reg;
ptrdiff_t m_offset;
ptrdiff_t m_offset : sizeof(ptrdiff_t) * 8 - sizeof(Reg) * 8;
};

} // namespace JSC

0 comments on commit b955603

Please sign in to comment.