Gráfico de Commits

27 Commits

Autor SHA1 Mensagem Data
Edwin Smith 7204d561e5 Devirtualize ArrayData part 2
Convert remaining virtual methods to static methods dispatched
by kind.  This makes ArrayData a non-virtual class, so shuffle
fields and adjust static_asserts.
2013-07-22 11:34:09 -07:00
Edwin Smith 49915fe2e6 Devirtualize ArrayData part 1
Moves about half of ArrayData virtual methods to g_array_funcs as
static functions instead of virtual functions.  This is mostly a
mechanical factor, except a handful of methods that are specialized
for Vector instead of generic HphpArray.
2013-07-22 11:34:09 -07:00
Edwin Smith 1e3f2c2864 Remove checkExist option to ArrayData::lval()
It appears to be a leftover optimization that only applied to HPHPC,
which is gone now.
2013-07-19 12:57:27 -07:00
Edwin Smith 353b33928b Make ArrayKind a regular enum
We use ArrayKind as a simple unsigned integer, its an index, we do
range-based comparisons, and in the future we'll likely do bit-ops
for fast sub-kind tests.  Just be honest that this is an old-school enum.
2013-07-19 12:57:26 -07:00
Edwin Smith 608df352de HphpArray Vector specializations
Introduces a new m_kind for vector-shaped HphpArray instances.
A vector has integer indexes in the range [0..size), and no
tombstones.  Internally it does not store the integer keys or
hashtable, although this version still allocates space for it.
2013-07-18 17:28:43 -07:00
Edwin Smith 9b6bf426b9 Move runtime/base/array/* up one level.
Also rename array_inline.h to array_data-inl.h
2013-07-15 17:34:47 -07:00
Edwin Smith 46f2eb82a5 Delete some dead code in NameValueTableWrapper and SharedMap 2013-07-10 11:16:33 -07:00
Edwin Smith 5b512b77b6 Devirtualize nvGetCell()
ArrayData::nvGetCell was only called from one place in vectortranslator.cpp
so hand-inline it there using nvGet(), which is already virtual.
2013-07-08 10:30:57 -07:00
Drew Paroski 9edc07112b Merge ObjectData and Instance together, part 1
When object support was first added to HHVM, a class named "Instance"
was introduced (deriving from ObjectData) to represent instances of user
defined classes. Since then, things have evolved and HPHPc and HPHPi have
been retired, and now there really is no needed to have ObjectData and
Instance be separate classes anymore.

As a first step towards merging ObjectData and Instance together, this diff
puts their definitions in the same .h file and puts their implementations
in the same .cpp file. A few small changes were necessary to fix issues
with cyclical includes: (1) Repo/emitter related parts of class.cpp and
class.h were moved to class-emit.cpp and class-emit.h; (2) the contents of
"vm/core_types.h" was moved to "base/types.h"; and (3) a few functions that
didn't appear to be hot were moved from .h files and the corresponding .cpp
files.
2013-07-06 11:12:29 -07:00
Edwin Smith 29b1fb3cf0 Consolidate more ArrayData methods: getKey, getValue, and nvGetValueRef
getKey wraps nvGetKey
getValue and nvGetValueRef wrap getValueRef
2013-07-06 11:12:29 -07:00
Edwin Smith 047ef325bb Consolodate ArrayData position-based iterator methods
Implement these all in ArrayData, using iter_begin, advance,
rewind, and iter_end virtual methods.  Only SharedMap didn't
override the iter_* methods, so moved ArrayData's implementation
to SharedMap and tailored it a bit.  Fetch SharedMap's size at
construction time to avoid calls to SharedMap::vsize().
Removed HphpArray and NameValueTableWrapper implementations of
these methods.
2013-07-06 11:12:18 -07:00
Edwin Smith 685fe164ae Rewrite get using nvGet()
Profile data shows much heavier use of ArrayData::nvGet(),
nvGetCell(), and exists(), than get().  So rewrite get()
using nvGet().
2013-06-27 13:00:47 -07:00
Jordan DeLong f49b7f2e1c Delete various dead "currentRef"-related functions
endRef() is also almost dead, but not quite yet...
2013-06-15 19:33:46 -07:00
Edwin Smith 274ef6c45b Split ArrayData::append(ArrayOp) into plus() and merge()
We had two distinct functions dispatched by an enum that was
always known somewhere higher up on the callstack.
2013-06-12 11:34:41 -07:00
Edwin Smith 51967b2c12 Remove ArrayData::getIndex virtual methods.
They aren't used anymore, except to implement isVectorData(),
which we can make pure-virtual and implement more efficiently
in each subclass of ArrayData.
2013-06-11 11:47:07 -07:00
Tim Starling 998951619f update copyright date
We did not intend to imply our copyrights last forever

Closes #759
2013-06-03 12:43:56 -07:00
Andrei Alexandrescu 6d365df98f HphpArray compact layout
ArrayData gets on a diet, down to 32 bytes
devirtualized destructor call in HphpArray::release()
aggressively inlined constructors for ArrayData (do away with defaulted arguments)
eliminate a dead memset() for the hashtable in HphpArray(uint size, const TypedValue* values)
2013-05-24 10:10:17 -07:00
aravind 3ebcd53563 Revert "HphpArray" 2013-05-23 21:02:52 -07:00
Andrei Alexandrescu 872d24b761 HphpArray
I've run a bunch of experiments on HphpArray speed and am still yet to have a major breakthrough. However, there are a few clear small winners that I'm submitting with this diff. CPU instructions, CPU loads, and CPU stores are all as green as the Eternal Hunting Grounds. Speed is drowned in noise but I sususpect will be measurable on these changes combined.
2013-05-21 11:17:36 -07:00
Sara Golemon 6ec64e8bf9 make #includes consistent
I was learning from @jdelong and he said that you should use
double quotes for local includes and angle brackets for library
includes. I asked why our code was the way it was, and he said he wanted
to clean it up. I beat him to it :)

Conflicts:

	hphp/runtime/base/server/admin_request_handler.cpp
	hphp/runtime/vm/named_entity.h
2013-05-15 13:05:06 -07:00
Paul Tarjan fef62f03a2 kill VM namespace
Now that HHVM is the default runtime, this namespace doesn't mean anything.
2013-05-15 13:05:05 -07:00
smith cc0ef7c456 Change copy-on-write protocol to always return valid pointers
Streamline the array access methods by always returning an array
pointer instead of a new pointer or null.  Callsites compare
(new != old) to detect escalation, rather than (new != null).
2013-04-15 13:03:16 -07:00
andrewparoski ecdd701952 Clean up ArrayData APIs for mutable iteration
Replaces the awkward getFullPos() and setFullPos() methods with a more
intuitive advanceFullPos() method. This refactoring also reduces the number
of virtual calls made when doing mutable iteration on an array.
2013-04-09 15:33:09 -07:00
aalexandre 505c17f357 replaced null with uninit_null() 2013-03-18 16:05:53 -07:00
aalexandre 26178124a4 Eliminate int32, uint32, int16, uint16, int8, uint8.
This concludes the inttypes replacement.
These replacement have been mostly mechanical
with the use of cxx_replace.
2013-03-09 10:25:16 -08:00
andrewparoski dec99505a6 Refactor iterator logic
This diff refactors some of the VM's logic for iterators (with a focus on
mutable iteration), delivering several improvements:
  1) MIterCtx was renamed to MArrayIter, and the m_key and m_val fields
     were eliminated.
  2) Eliminated the need for MArrayIter to dynamically allocate a
     MutableArrayIter object, and removed other layers of indirection as
     well.
  3) Reduced the size of HPHP::VM::Iter from 64 bytes down to 32 bytes.
  4) Removed the "if (siPastEnd())" check when adding a new element to an
     HphpArray or a ZendArray.
  5) Moved all of the iterator logic into a single .cpp file.

This diff reworks FullPos's to point to current element instead of pointing
to the next element. It also splits up the IterFree instruction into two
instructions (IterFree and MIterFree). These changes allowed various logic
to be simplified and data structures to be reduced in size. There is
definitely more opportunity for refactoring, but I know the JIT helpers for
iteration have been carefully tuned and so I'll leave further refactoring
for future diffs.

Finally, I spent a little time cleaning up the bytecode spec a bit, mostly
with respect to iteration.
2013-02-11 06:36:51 -08:00
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00