Gráfico de Commits

23 Commits

Autor SHA1 Mensagem Data
mwilliams db130c83e1 Identify direct children of yield expressions
We want to be able to recognize them without knowing their
context.
2013-07-18 17:28:38 -07:00
mwilliams 52b914a4c9 Fix type assertions for array-like interfaces
Without this we could infer that an array was an object,
skip the guards, and then die horribly.
2013-07-06 11:12:14 -07:00
Jordan DeLong 6b891c8331 Support checking option type typehints at runtime.
Adds support for checking ?Foo type hints in VerifyParamType.
The parameter must have type Foo or null.  Failing to pass the hint is
reported as a warning instead of a recoverable error for now for
migration reasons---we'll want to convert it to be the same as normal
type hints later.
2013-06-25 13:19:08 -07:00
Owen Yamauchi d7c2eac643 Get rid of variable break/continue
This is gone as of Zend 5.4: as far as I can tell, anything other than a
positive integer literal is a parse error (including constants, "1 + 1",
etc.) Let's get rid of it. The mere fact that this construct ever
existed in any programming language is deeply horrifying.

This lets us get rid of all the goofy code that subtracts 1 from the top
value on the stack, does IterFree if needed, and jumps to the next
level. Now, we can hardcode the necessary IterFrees and do a single
jump, right where the break/continue actually is.

The error message for using a non-integer expression is less helpful
than Zend's (Zend says "non-constant operand not supported"; ours is
"unexpected T_VARIABLE" or whatever). It wouldn't be that hard to do in
our parser, if we think that's helpful. I don't think it matters,
though.
2013-06-12 17:10:34 -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
Owen Yamauchi fee428f6fb Some compatibility changes for more recent versions of boost
- boost::shared_ptr now has "explicit operator bool", which means we
  can't "return <a shared ptr>" from a function with return type bool.

- Our use of shared_ptr<T[]> in debugger_client.h was screwed.
  Unfortunately it's not straightforward to make it a unique_ptr as per
  our discussion; there are other objects that call setLiveLists, and
  it's not clear to me that this is a total transfer of ownership. I'm
  just fixing the immediate problem using shared_array. (Also made the
  typedef less confusing, hopefully.)

- Our specialization of graph_traits<G> for ControlFlowGraph didn't
  define the null_vertex member function. This didn't matter in older
  versions of boost because they didn't use it internally, but now they
  do (the call to depth_first_search in control_flow.cpp was failing to
  compile).
2013-05-30 17:39:22 -07:00
Drew Paroski 4d923bf679 Fix foreach with superglobals
HHVM was segfaulting on "foreach ($x as $_FILES) {}" during bytecode
emission. This diff fixes the issue.

Github issue 734: https://github.com/facebook/hiphop-php/issues/734
2013-05-20 13:52:33 -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
Owen Yamauchi a57ae0488a Generate the parser at build time, part one
Update a number of things to make optionally generating the parser at
build time possible.  @sgolemon will add the OSS pieces of this in a
separate commit.
2013-04-30 09:57:57 -07:00
mwilliams 0a70a77f42 Fix an issue with exit/include/etc
Various unary operators have arbitrary effects. Dont assume we
know anything about locals when we see one.

Fix an expect for differences in line numbers.

Prevent a use of an undefined constant from being optimized away.
2013-04-22 14:43:51 -07:00
Jordan DeLong 24cb23f21b More fixing lint: various conversion constructors in compiler/
Left one implicit, but it's arguable.  Inspected manually.
2013-04-22 14:43:49 -07:00
mwilliams b5f81ab942 Constant propagation was too aggressive
it assumed that $a = 5; echo $a; would echo 5, which isn't
true if $a is the last reference to an object whose destructor
can get hold of $a.
2013-04-17 10:12:47 -07:00
jdelong abc9170968 Fix typedefs/shapes for whole program optimization
Needed a few cases for KindOfTypedefStatement,
EnableExperimentalHipHopSyntax, and passing it through to the scanner.
2013-04-17 09:51:40 -07:00
jan 7b7343b56a Introduce YieldExpression
Unhack the parser and introduce YieldExpression that emits the
equivalent set of opcodes that were emitted by bunch of
expressions/statements generated by parser before.

YieldExpression expects evaluation stack to contain just the value
being yielded, so {,List}AssignmentExpression need to evaluate RHS
first. The previous code had the same behavior.

This will let us consolidate continuation-related opcodes and make
them less tied with continuation objects.
2013-03-22 13:01:05 -07:00
jan f9765d1c58 Fix local propagation of generator parameters
Alias manager does not know that generator parameters are populated and
assumes they are uninit. The current code works because control flow
algorithm gives up while trying to deal with the continuation switch
statement full of gotos.

This diff fixes it by setting isGeneratorParameter flag in symbols
representing parameters of enclosing generator wrapper and use variables
of enclosing closure.
2013-03-21 19:33:53 -07:00
jan c2b38ad2b1 {,List}AssignmentExpression: add support for RHS first evaluation order
Add a flag to {,List}AssignmentExpression that changes evaluation order
to RHS before LHS.

This will be used by YieldExpression.
2013-03-21 16:13:06 -07:00
mwilliams cbf041b01b Remove Option::OutputHHBC and Option::SystemGen 2013-03-21 15:17:33 -07:00
jan 2ebb2a93a1 Eliminate {get,set}NthKid() usage with known specific kid
{get,set}NthKid() should be only used to walk thru all the kids and not to get/set a known specific kid. Replace its use by direct helper method.

All remaining callers of {get,set}NthKid() were audited and there are no instances left accessing specific kid.
2013-03-19 14:11:17 -07:00
mwilliams 4514a79c60 Remove ReqSrc and ReqMod
They can no longer be generated. Also remove all the associated
code from the emitter.
2013-03-13 09:53:58 -07:00
mwilliams 10f9f6b239 const bool hhvm is dead 2013-03-09 12:49:37 -08: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
aalexandre b3b41e08bb Replaced NULL with nullptr 2013-02-19 06:57:54 -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