The memory consumption of DFG::BasicBlock can be easily reduced a bit
authorrmorisset@apple.com <rmorisset@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Nov 2017 17:39:55 +0000 (17:39 +0000)
committerrmorisset@apple.com <rmorisset@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Nov 2017 17:39:55 +0000 (17:39 +0000)
commit1d03deabacc62cbadf3f63f4f908a43e01270296
treeb06c83ce9122b6c2272d73ea6cb42b9205487fdd
parentdcaa7d2274d4c4dc374d426ac90b0120dc3c596b
The memory consumption of DFG::BasicBlock can be easily reduced a bit
https://bugs.webkit.org/show_bug.cgi?id=179528

Reviewed by Saam Barati.

A few changes here:
- Reordering some fields of DFG::BasicBlock to reduce padding
- Making the enum fields that are glorified booleans fit into a u8
- Make each Operands object have a single vector that holds all arguments followed by all locals, instead of two vectors.
  This change works because we never increase the number of arguments after allocating an Operands object.
  It lets us avoid one extra capacity field and one extra pointer field per Operands,
  and more importantly one allocation per Operands whenever both vectors would have overflowed their inlined buffer.
  Additionally, if a single vector would have overflowed its inline buffer, while the other would have had some free space,
  we have a chance to avoid an allocation.
- Finally, the three methods argumentForIndex, variableForIndex and indexForOperand were deleted since they were dead code.

* bytecode/Operands.h:
(JSC::Operands::Operands):
(JSC::Operands::numberOfArguments const):
(JSC::Operands::numberOfLocals const):
(JSC::Operands::argument):
(JSC::Operands::argument const):
(JSC::Operands::local):
(JSC::Operands::local const):
(JSC::Operands::ensureLocals):
(JSC::Operands::setLocal):
(JSC::Operands::getLocal):
(JSC::Operands::setArgumentFirstTime):
(JSC::Operands::setLocalFirstTime):
(JSC::Operands::operand):
(JSC::Operands::setOperand):
(JSC::Operands::size const):
(JSC::Operands::at const):
(JSC::Operands::at):
(JSC::Operands::isArgument const):
(JSC::Operands::isVariable const):
(JSC::Operands::virtualRegisterForIndex const):
(JSC::Operands::fill):
(JSC::Operands::operator== const):
(JSC::Operands::argumentForIndex const): Deleted.
(JSC::Operands::variableForIndex const): Deleted.
(JSC::Operands::indexForOperand const): Deleted.
* dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::BasicBlock):
* dfg/DFGBasicBlock.h:
* dfg/DFGBranchDirection.h:
* dfg/DFGStructureClobberState.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/Operands.h
Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
Source/JavaScriptCore/dfg/DFGBasicBlock.h
Source/JavaScriptCore/dfg/DFGBranchDirection.h
Source/JavaScriptCore/dfg/DFGStructureClobberState.h