7985 Commits

Autor SHA1 Mensagem Data
Kristaps Kaupe e79df3c25e Allow disabling hardware counters from cmake. 2014-01-22 00:59:13 +02:00
Sean Cannella 204745bfe6 PHP_VERSION_ID should not be greater than all Zend
PHP_VERSION_ID is now 504999 which is > all Zend versions which
makes using it for comparisons of less than 5.5/5.6/etc. impossible.

Closes #1603

Reviewed By: @sgolemon

Differential Revision: D1135461
2014-01-21 11:20:15 -08:00
Guilherme Ottoni c7c45e0f04 Turn on the Region JIT (take 2)
Except for ARM.

Reviewed By: @swtaarrs

Differential Revision: D1119650
2014-01-21 11:20:11 -08:00
Drew Paroski 9793cd6059 Update Set to retain insertion order
Reviewed By: @elgenie

Differential Revision: D1129210
2014-01-20 10:12:32 -08:00
Rachel Kroll b82a14d235 Report thread ID in status pages
Reviewed By: tracelog

Differential Revision: D1134840
2014-01-20 10:09:09 -08:00
Paul Tarjan a13cb40a90 work on FastCGI perf
* parse all the fastcgi headers at once
* uppercase the key instead of using case insensitive. This won't return the original casing, but HTTP is case insensitive anyways, so it shouldn't matter *cross fingers*
* stop generating a vector in the header map and do it at readtime
* use `unordered_map`

Reviewed By: @jdelong

Differential Revision: D1128430
2014-01-20 10:09:06 -08:00
Dario Russi 7590d5e084 APC optimizations for arrays and strings to allow them to be shared "static" style.
Making APC strings and APC array with proper shape uncouted and truly shared in APC, saving on copy and ref count

Reviewed By: @jdelong

Differential Revision: D1114228
2014-01-20 10:09:03 -08:00
Joel Marcey f7ea7e74e1 Refactor the framework test script for better modularity and maintenance
I have wanted to break up run.php into its own files and refactor things a bit. So I am now doing that.

Note that the frameworks directory now contains the PHP for individual frameworks and that framework_downloads will contain the actual github code for the frameworks

During refactoring, I found some interesting new issues:

1. The recent changes to reflection (ext_reflection-classes.php, etc.) have caused my test finder to hiccup for cases where I find the tests with reflection. This may be bad code on my part; but I am not sure. Right now it seems the issues are coming with IsSubclassOf, but this is just a guess. I am trying to come up with a repo case.

2. The percentage of Magento2 has dropped into the upper 80% range. And this is due to some namespace fatals that are occurring. We need to dig into that. Note, that we are using a more recent git hash for Magento2 (instead of the August one as before) and they added more namespace support during that time. We are also seeing a drop in Drupal as well, but not to the same degree.

@ptarjan, this diff does not make the abstract Framework class public yet. That can be done in a subsequent diff :-)

Reviewed By: @ptarjan

Differential Revision: D1133446
2014-01-20 10:08:59 -08:00
Dario Russi 4ecab8ca94 Make $this available (aka not null) after it has been accessed once and subsequent code would have not run
after $this has been used (dereferenced) all subsequent accesses do not need to check for null

Reviewed By: @jdelong

Differential Revision: D1132614
2014-01-20 10:08:56 -08:00
Alex Malyshev 69a83741fc Support more of EG and PG in ext_zend_compat
Not all of the functions return references, so they can't be written to,
only read from.

Reviewed By: @ptarjan

Differential Revision: D1128247
2014-01-20 10:08:49 -08:00
bsimmers 6aa6d171e1 Add some asserts to the jit
These were all added while debugging an xls issue and they seem
generally useful.

Reviewed By: @edwinsmith

Differential Revision: D1132041
2014-01-20 10:08:45 -08:00
Bert Maher 2d6e5ba266 Pop stack before ContEnter
If we pop the stack after ContEnter, it creates a
LdStack/TakeStack that keeps an SSATmp live across a call, which
(rightfully) causes an assertion to fail later.

This isn't a problem if we have refcount opts or dce on, since those
passes will remove the TakeStack, but it would still be good to have
our IR correct in the absence of optimization.

Reviewed By: @swtaarrs

Differential Revision: D1134125
2014-01-20 10:08:42 -08:00
bsimmers c96f6e7c49 Make sure we don't throw without catch blocks
Some optimizations rely on being able to insert code on all exit
edges, so anything that can throw much have a catch block. This diff adds a
runtime check for that and fixes all cases I hit in local and prod testing.

Reviewed By: @edwinsmith

Differential Revision: D1132380
2014-01-20 10:08:39 -08:00
bsimmers e18f7406b0 Remove IRTrace from the jit
Exit traces are gone so this was fairly straightforward.

Reviewed By: @edwinsmith

Differential Revision: D1129611
2014-01-20 10:08:35 -08:00
bsimmers d7dba127d3 Purge exit traces from the jit
This diff eliminates all exit traces from the jit, turning them into
regular old Unlikely blocks in the main trace. IRTrace is still around and we
have one per IRUnit; I'm planning on eliminating it in a separate
diff. IRTrace's BlockList is gone, so now we just store a pointer to the entry
Block and walk the cfg from there.

Reviewed By: @edwinsmith

Differential Revision: D1128179
2014-01-20 10:08:31 -08:00
Sean Cannella 88d6079dc3 Fix server stats reporting
Fix server stats reporting

Reviewed By: @dariorussi

Differential Revision: D1133875
2014-01-20 10:08:28 -08:00
Fred Emmott 973c5847f2 Make SQLite3::version static
Depended on by codeigniter

Reviewed By: @ptarjan

Differential Revision: D1130812
2014-01-20 10:08:24 -08:00
Dario Russi e1d79f54d5 Update ir specification
IR opcodes added during lockdown had missing specifications

Reviewed By: @swtaarrs

Differential Revision: D1134268
2014-01-20 10:08:21 -08:00
bsimmers 58ddd23cec Disable flaky zend test
Reviewed By: @edwinsmith

Differential Revision: D1133886
2014-01-20 10:08:17 -08:00
Dario Russi cfaf436001 NewCol should push specific object types
NewCol and ColAddNewElemC should infer the proper collection type

Reviewed By: @jdelong

Differential Revision: D1129076
2014-01-20 10:08:13 -08:00
Eugene Letuchy ee4a6f7b35 misc: set error handler slightly differently in typehint_number test
... perhaps it will work better in repo mode if the test-installed error
handler always throws an exception, instead of relying on the return
value.

Reviewed By: @jdelong

Differential Revision: D1133463
2014-01-20 10:08:10 -08:00
Edwin Smith 47bc94d3a4 Enable xls by default
Flips the switch, and fixes computeLiveRegs() to account
for Shuffle destinations.

Reviewed By: @swtaarrs

Differential Revision: D1114596
2014-01-20 10:08:06 -08:00
Bert Maher daef8573ec Use getNativeFunctionName in Disasm
Get rid of duplicated code for demangling function names

Reviewed By: @swtaarrs

Differential Revision: D1132428
2014-01-20 10:08:02 -08:00
Evert Pot e93f235669 Added support for CURLOPT_POSTREDIR
Added support for CURLOPT_POSTREDIR

Closes #1477
Closes #1583

Reviewed By: @JoelMarcey

Differential Revision: D1131605

Pulled By: @scannell
2014-01-20 10:07:58 -08:00
Scott Renfro 9d74c2ce93 Change fb_utf8_substr() semantics to return '' on error
Already made the corresponding change in flib.  This
is more consistent with mb_substr() and more consistent with
a typed world -- fb_utf8_substr()'s return value will pass
typehints for strings, for example.

Reviewed By: @alokmenghrajani

Differential Revision: D493517
2014-01-17 14:46:18 -08:00
Jordan DeLong adaaaff943 Add .norepo to a test
I had this in the wrong diff, so broke trunk pushing a stack.

Reviewed By: @elgenie

Differential Revision: D1133199
2014-01-17 14:46:18 -08:00
Eugene Letuchy 8b247bafd1 'num' typehint
It's quite advantageous to be able to support int|float as a
 typehint without introducing support for full-blown unions. To make
 that equivalence happen, a bit of runtime support is necessary

Reviewed By: @jdelong

Differential Revision: D1128502
2014-01-17 14:46:00 -08:00
Owen Yamauchi 4fe752d8e5 Implement DecRef{Stack,Loc,Mem} in ARM mode
DecRefStack is the #2 punt. This involved a surprising amount of code.
Decreffing is hard, apparently.

Reviewed By: @edwinsmith

Differential Revision: D1131799
2014-01-17 01:43:53 -08:00
Jordan DeLong 4f56be3f8f Give up on private property inference on CreateCl opcodes
For now.  As is it can infer incorrect property types since
it isn't set up to look at the closure bodies.

Reviewed By: @dariorussi

Differential Revision: D1132987
2014-01-17 01:43:49 -08:00
Jordan DeLong eb8f8f3825 Fix several issues with type assert opcodes
Type assertions were allocating new DynLocations every time
we encountered them, which breaks getOutputUsage (it uses DynLocation
pointer equality to track the flow of values).  When encountering
assertions, it also wasn't doing the optimization that we have in
applyInputMetaData to eliminate earlier predictions on the same
location.  Finally, this diff finishes the support for optional object
types (fixes inlining and object property accesses in these
situations).

Reviewed By: @swtaarrs

Differential Revision: D1128602
2014-01-17 01:43:45 -08:00
Jordan DeLong 040e87ba69 Make type hint errors disallow recovery if repo was compiled with HardTypeHints
Fix a long-standing issue that could segfault the VM in
RepoAuthoritative mode (not in practice in www, since our error
handler always throws in this case).  To do this, adds a Repo global
metadata blob that we can use to communicate whatever global
compilation information we want to the runtime (I've wished we had
this for a few things in the past).

Reviewed By: @edwinsmith

Differential Revision: D1125218
2014-01-17 01:43:42 -08:00
Jordan DeLong 4be2cfd7d6 A few code review items I accidentally missed
Reviewed By: @edwinsmith

Differential Revision: D1126655
2014-01-17 01:43:38 -08:00
Jordan DeLong 8a8d6fe852 Returning from a function reads locals
Looking at the JIT's output with HHBBC on, I noticed guards
in tracelets that only do RetC weren't going away.  This is because I
forgot to tell the interpreter that return opcodes read locals, so the
assert opcodes weren't being added.

Reviewed By: @swtaarrs

Differential Revision: D1125188
2014-01-17 01:43:34 -08:00
Jordan DeLong f68a1d9c12 AssertObj opcode support for possibly-null types
I think for us to get anything from private property
inference, we have to be able to assert these types and rely on
tracelet guards to remove the nulls.

Reviewed By: @dariorussi

Differential Revision: D1125172
2014-01-17 01:43:30 -08:00
Jordan DeLong 78072ded36 Do better on bc::Clone of ?Obj<=Foo and ?Obj=Foo
A really small thing we needed to have the recently added
is_opt() and unopt() things to do.  Before it would just push TObj.
Now we can push the type with the possible null removed (since we'd
fatal if it was null).

Reviewed By: @dariorussi

Differential Revision: D1125107
2014-01-17 01:43:26 -08:00
Jordan DeLong 510881234a Infer that the Catch opcode always pushes a subclass of Exception
You can't throw non-Exception derived classes.  Also, catch
can't throw.

Reviewed By: @dariorussi

Differential Revision: D1125105
2014-01-17 01:43:23 -08:00
Jordan DeLong 19bd90df5e Use HNI return types in hhbbc's return type inference
We could do better for object types, but probably not worth
the effort yet until there's more conversion.

Reviewed By: @edwinsmith

Differential Revision: D1125101
2014-01-17 01:43:19 -08:00
nareshv 0acddafb3e Test runner improvements
- Added -i option to include only certain tests to be executed.
- Print the norepo reason next to skipped message for tests with .norepo
  file

Closes #1582

Reviewed By: @ptarjan

Differential Revision: D1131390

Pulled By: @scannell
2014-01-17 01:43:15 -08:00
Dmitry Panin 1445bce38d Fixed key collision in get_html_translation_table
in expression String::FromChar(i + em.basechar)
we casted "i + em.basechar" to char and therefore we got some
collisions of keys in translation table.
This diff uses more appropriate String::FromCStr as keys

Reviewed By: @ptarjan

Differential Revision: D1125958
2014-01-17 01:42:33 -08:00
Fred Emmott 0309f90d0f duplicate cell in rare loadCns path
- gets decrefed in frame_free_locals_helper_inl
- matches the behavior in the other non-error paths
- bsimmers is going to look at LookupCns - Uncounted is probably incorrect

Reviewed By: @swtaarrs

Differential Revision: D1130546
2014-01-17 01:42:28 -08:00
Owen Yamauchi 1c24482fa1 Delete unused exit edge support from DecRef instructions
These instructions never actually have an exit edge. Their flags in ir.h
indicate as much, as well as all of the places where they're gen()'ed.
All that code in code-gen was just cluttering up the place.

Reviewed By: @jdelong

Differential Revision: D1129774
2014-01-17 01:42:24 -08:00
Owen Yamauchi 5c6896ccd1 Implement LdFuncCached in ARM mode
This is the #3 punting opcode. The top two are Call and DecRefStack;
Call is in the works but proving to be rather nontrivial, and
DecRefStack is also going to be slightly tricky. This one, on the other
hand, is super simple.

Reviewed By: @edwinsmith

Differential Revision: D1129534
2014-01-17 01:40:54 -08:00
Joel Marcey 41f7f531fe Move the rest of the config to YAML
We started moving core config to YAML. Seems to work well. Let's move the rest over.

Reviewed By: @ptarjan

Differential Revision: D1130844
2014-01-17 01:40:54 -08:00
Guilherme Blanco fcba0889ad phpversion($extension) support
Implemented support for extension version check in phpversion()
following Zend compatibility. Updated all extensions on HHVM to match
versions on PECL and php-src master branch.

Closes #1506

Reviewed By: @JoelMarcey

Differential Revision: D1117334

Pulled By: @scannell
2014-01-17 01:40:54 -08:00
Fred Emmott e9b618ffe3 Reflection: use PreClass for method ordering and profiling info, Class for rest
Neither has sufficient data by itself

Reviewed By: @ptarjan

Differential Revision: D1129761
2014-01-17 01:40:54 -08:00
Paul Tarjan 3adf3d2994 fix test/run spew
Reviewed By: @swtaarrs

Differential Revision: D1129148
2014-01-17 01:40:54 -08:00
bsimmers 09c77a558f Change getNativeFunctionName to return a std::string
This is never used in perf-sensitive code and using std::string is
much cleaner and safer.

Reviewed By: @bertmaher

Differential Revision: D1126781
2014-01-17 01:40:53 -08:00
Bert Maher 8876047b0d Admin command for TC section addresses
It's nice to be able to ask the VM where the various TC
sections are.

Reviewed By: @ottoni

Differential Revision: D1128800
2014-01-17 01:40:53 -08:00
Guilherme Ottoni 8d55dfe117 Stop profiling translations at unconditional jumps
We should let the region selector decide whether or not to merge
profiling translations connected by an unconditional jump into a
longer trace.  So don't eagerly trace through unconditional jumps in
profiling mode.

Reviewed By: @edwinsmith

Differential Revision: D1128517
2014-01-17 01:40:53 -08:00
Alex Malyshev e2df82dc85 gd_info() had a misspelled string
Need "JPEG Support", not "JPG Support" to match Zend.

Reviewed By: @JoelMarcey

Differential Revision: D1128945
2014-01-17 01:40:53 -08:00