Gráfico de Commits

20 Commits

Autor SHA1 Mensagem Data
Edwin Smith 4fd3b597f6 Manually inline HphpArray::addValWithRef to the one place they're used used.
They're only called from one place, and manually inlining them allows
a little bit of code sharing; maybe more over time.

Reviewed By: @jdelong

Differential Revision: D970506
2013-09-16 11:43:43 -07:00
Edwin Smith ce9cf05c02 Rename NewTuple to NewPackedArray and MakeTuple to MakePacked
This un-overloads "tuple", which also refers to one of the new
container classes.

Reviewed By: @jdelong

Differential Revision: D970494
2013-09-16 11:43:42 -07:00
Edwin Smith afd5fb03bf Separate findForDelete from findForInsert
They're used differently enough that this will aid streamlining each
one separately.  Also, this way, key-type-specific logic in erase()
can be done earlier without extra branches.

Reviewed By: @jdelong

Differential Revision: D970271
2013-09-16 11:43:42 -07:00
Jordan DeLong 38fd595342 Allocate HphpArrays in a flat mode instead of using m_inline_data
Gets HphpArrays into a flat mode using MM().objMalloc()
instead of SmartAllocator.  Various optimizations were needed to the
Make functions to get this to work out ok.  Growth still creates a
non-flat HphpArray (leaving a PromotedPayload behind so we know how
big the original allocation was).

Reviewed By: @edwinsmith

Differential Revision: D969431
2013-09-16 11:43:40 -07:00
Jordan DeLong 7cfa297dab Move static string map to its own module
Reviewed By: @edwinsmith

Differential Revision: D970170
2013-09-16 11:43:39 -07:00
Edwin Smith 4eb05b745f HphpArray cleanup
Various cleanups that I factored out of other work.
Eliminate ElmInd; it's usefulness is pretty low since we rely on
int32_t for the hashtable storage and ssize_t for locals and
and parameters that pass around array positions.

Renamed a few things for brevity & clarity.
Moved some inline functions to hphp-array-defs.h.
More use of auto, replace Elm* with auto& in several places.
Eliminate a bunch of unnecessary ssize_t() casts.
s/ElmIndEmpty/invalid_index in several places.

Reviewed By: bertrand

Differential Revision: D968744
2013-09-13 12:35:48 -07:00
Edwin Smith c542106129 Skip vector-ish probe in HphpArray::find(int64_t)
This was a nice hack since lots of arrays are packed, however now that
enough are actually kPackedKind, this test doesn't appear to pay for
itself (not called as often as before, and nearly always false).

Reviewed By: @jdelong

Differential Revision: D963530
2013-09-11 11:39:51 -07:00
Jordan DeLong 198112895e Reorder HphpArray members some; make ctor/dtor private
Get the data representation all at the end, and keep all
privates non-data members at the end too.  Private ctors (eventually
should be removed and replaced by the Make functions) so we can change
its allocation behavior.  The public members are still in a mostly
random order for now, and I left the bulk of the non-static private
member functions alone.

Reviewed By: @edwinsmith

Differential Revision: D960965
2013-09-10 13:22:10 -07:00
Sean Cannella 19da83f2aa fix inlining warnings
Noticed these warnings when building on OSX.

Reviewed By: @jdelong

Differential Revision: D958997
2013-09-09 10:28:10 -07:00
Jordan DeLong 1e4a4ac458 Move HphpArray::ElmKey to local use site
Helped me know what it was for.

Differential Revision: D952706
2013-09-04 00:41:32 -07:00
Edwin Smith 13ae081fa3 Add DequeuePacked and PrependPacked
We only handle a few easy cases for these, but since these
operations renumber and compact elements on Mixed arrays,
there's no point in escalating from packed to mixed; we might
as well do memmove and leave the existing 0..N numbering.

Differential Revision: D945517
2013-09-03 08:02:35 -07:00
Edwin Smith 15dc5b0221 Use "Packed" as the term for vector-like arrays.
The term Vector is getting too overloaded in our codebase.  Rename
vector-like array kinds to "packed" instead.

Differential Revision: D935245
2013-08-26 09:21:40 -07:00
Edwin Smith 47d8ee5298 Remove Array::addLval() methods, use lvalAt() instead.
The AddLval methods were fairly cold, so reimplement them in
terms of lval(), but preserve the assert that ensures the keys
being added do not already exist.  This reduces the number
of kind-specific methods we need to implement.

Added Array::setWithRef(key,value) to capture a common use
case for lvalAt().  Later this can implemented more efficiently
as a virtual method in ArrayData subclasses.

Differential Revision: D937227
2013-08-26 09:21:38 -07:00
Edwin Smith 666fa474ff Optimize string same() and hitStringKey()
Most strings used as keys are either small or not shared, where the
data pointers cannot be equal.  Of the rest (shared), most could have
been small.

This diff copies small SharedVariant strings, so they don't refer
back to the SharedVariant, and don't need to be enlisted.  Then,
this changes hitStringKey() to not check data pointers, making it
equivalent to StringData::same().  Lastly, hand-write the comparison
loop in StringData::same() so we compare words at a time, and the
loop can be inlined.

Differential Revision: D937233
2013-08-22 12:40:19 -07:00
Edwin Smith 288d4993e2 Remove allocElmFast; its only called in one place.
It used to have two callsites before the vector code landed.

Differential Revision: D932789
2013-08-21 09:33:13 -07:00
Edwin Smith 2f927eb29a Get rid of optional arguments in HphpArray helpers.
This just obscures what's going on and is making refactoring
more difficult.

Differential Revision: D927215
2013-08-15 15:19:34 -07:00
Bert Maher b7034ab930 Allow guarding tracelets on ArrayKind
Enable guarding tracelets on ArrayKind when we can generate
better code for a specific kind.

Added specialized helpers for CGetM, FPassM, and IssetM of
vector-shaped arrays.  This eliminates an indirect call and allows the
entire array-access call stack to be inlined into the helper

Differential Revision: D873631
2013-08-12 11:32:58 -07:00
Edwin Smith 860d410367 Streamline NewTuple and NewArray helpers
Rearrange the code so when we allocate an array from JIT code,
we call one helper where most of the code is inline.

Differential Revision: D917956
2013-08-08 09:11:24 -07:00
Edwin Smith 783301a6f8 Rewrite findBody and findForInsertBody as functions taking lambdas.
The way we use these macros is exactly what lambdas are for, so
give it a try.

Differential Revision: D916121
2013-08-07 09:55:22 -07:00
Edwin Smith de4259e8ae Rename rest of files in runtime/base
Differential Revision: D913884
2013-08-06 09:23:21 -07:00