Arquivos
hhvm/hphp/runtime/base
smith 22058efe41 Allow different RefData and TypedValue layouts
Fixing various bugs all over the VM that make assumptions about RefData
and TypedValue layout.  Here are the assumptions fixed by this diff:

offsetof(RefData, m_tv) == 0.  Both JIT's assumed this in many subtle
ways, by punning RefData* as TypedValue* without adding an offset.
This assumption also causes RefData._count to overlap TypedValue.m_aux,
which constraints TypedValue layout.

offsetof(TypedValue, m_data) == 0.  gen_ext_hhvm.php assumes you
can cast TypedValue* to Value*; the JITs often weren't using
offsetof(TypedValue, m_data) in their addressing calculations.  HHIR
assumed return-by-value TV's have m_data/m_type in rax/rdx, which
can change when TV layout changes.

offsetof(TypedValue, m_type) > 8 is an assumption baked into the
pass-by-value register assignment logic in HHIR's codegen.cpp; if
the type is in the low word, register assignment is swapped.

sizeof(TypedValue::m_type) == 4.  We used dword-sized operations
in both JIT's when accessing m_type.  Now, we use helper functions
that are sensitive to sizeof(DataType)

Configuration:
DEBUG=: (opt)  same layouts as trunk for RefData & TypedValue
DEBUG=1: (dbg) new RefData layout (m_tv doesn't overlap RefData::_count)
PACKED_TV=1, DEBUG=*:  new RefData and TypedValue layout.
2013-04-01 11:51:31 -07:00
..
2013-02-19 06:57:54 -08:00
2013-03-18 16:05:53 -07:00
2013-03-19 14:11:11 -07:00
2013-02-19 06:57:54 -08:00
2013-02-11 02:10:41 -08:00
2013-03-21 16:51:06 -07:00
2013-03-18 16:05:53 -07:00
2013-03-09 12:49:37 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-03-27 16:10:46 -07:00
2013-02-11 02:10:41 -08:00
2013-02-19 06:57:54 -08:00
2013-03-09 12:49:37 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-03-12 14:22:14 -07:00
2013-02-11 02:10:41 -08:00
2013-02-19 06:57:54 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-19 06:57:54 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-02-11 02:10:41 -08:00
2013-03-09 12:49:37 -08:00
2013-02-19 06:57:54 -08:00
2013-03-09 12:49:37 -08:00
2013-02-11 02:10:41 -08:00
2013-04-01 11:51:31 -07:00
2013-04-01 11:51:31 -07:00
2013-02-11 02:10:41 -08:00
2013-03-14 14:27:16 -07:00