Allow early initialization of classes if they don't have any [sp]init methods
commitbf52b61852bbb09042af3056b90841a9193aeaae
authorBert Maher <bertrand@fb.com>
Wed, 5 Jun 2013 20:46:13 +0000 (5 13:46 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 6 Jun 2013 19:00:04 +0000 (6 12:00 -0700)
tree46ba0e6acc6b683d9684d3187727a7a328617c3f
parentbcc0192c131448a0d428e26523e9b831708c4c9c
Allow early initialization of classes if they don't have any [sp]init methods

We were being too conservative in determining whether to use
the static property cache when accessing a property from outside the
class.  In fact we'd never use it in that case, because we required
that the class not need initialization (and any class with static
properties needs initialization!).

We can relax this restriction to just enforce that the class not
define sinit or pinit methods -- scalar properties are fine.
hphp/runtime/vm/class.cpp
hphp/runtime/vm/class.h
hphp/runtime/vm/jit/simplifier.cpp