7985 Commits

Autor SHA1 Mensagem Data
Paul Tarjan c4499f273d parallel makes 2014-01-28 19:50:23 -08:00
Erik b538a34e89 Support for UNIX sockets
Add a new config param, Server.FileSocket. When
Server.FileSocket
is set it will be used inplace of a network socket for the primary
server. This uses a new parameter to ServerOptions, m_useFileSocket,
to toggle between treating the address as a socket path or a network
address.

To initialize a socket connection thrift expects the socket file to not
exist. To support this the 'something nice' retry in startServer will
unlink an existing socket only if fuser claims it is unused.
Server.EvilShutdown enables unlinking the socket regardless of current
users.

Closes #1594

Reviewed By: @ptarjan

Differential Revision: D1135876

Pulled By: @sgolemon
2014-01-28 15:38:35 -08:00
Sean Cannella c3b11e0c55 Switch Map and Set to use tracked smart allocators
Switches Map and Set to use tracked allocators. Vector uses
smart_realloc which will require a bit more work.

Reviewed By: @edwinsmith

Differential Revision: D1146939
2014-01-28 15:38:31 -08:00
Paul Tarjan 62c0212045 stop killing the socket until all data is sent
For small responses this was ok, since sending the data didn't take much time. For large requests, they would get truncated without this.

I checked for leaks by printing in the FastCGIConnection constructor and destructor and making sure they match up.

Closes #1631

Reviewed By: @simpkins

Differential Revision: D1147016
2014-01-28 15:38:28 -08:00
Daniel Sloof b4845ed26d SimpleXML rewrite
Update SimpleXML to be compliant with Zend and fix a bunch of
tests.

Closes #1387
Closes #1530

Reviewed By: @ptarjan

Differential Revision: D1135882

Pulled By: @scannell
2014-01-28 15:38:21 -08:00
rbelenov fe7a4fcff9 Support for Intel VTune Amplifier XE
Intel VTune Amplifier XE
(http://software.intel.com/en-us/intel-vtune-amplifier-xe), the
performance analysis tool, supports mapping of performance data from IP
addresses to function names and source file/lines for custom JIT
engines; the engine should provide mapping from generated code to source
using JIT API (http://software.intel.com/en-us/node/458070). This patch
add the reporting to hhvm, allowing to profile PHP code execution and
see both generated assembly and PHP source for hotspots.

The reporting is controlled via Eval.JitUseVtuneAPI runtime option, so
the default behaviour is not affected. If the option is set and hhvm is
profiled by VTune, the information on compiled code is reported via JIT
API and stored in data file which is used during postprocessing and data
visualization.

The patch includes some files from VTune; the are distrubuted under BSD
license.

Closes #1254

Reviewed By: @ottoni

Differential Revision: D1133559

Pulled By: @scannell
2014-01-28 15:38:17 -08:00
bsimmers fd6d3c4dd2 Disable flaky zend test
Reviewed By: @edwinsmith

Differential Revision: D1147082
2014-01-28 15:38:11 -08:00
Owen Yamauchi d004ca9c6b Implement codegen for Call
After LdLoc went down, this is the next top punt. This forced me to get
the bind-call machinery working, and a bunch of other stuff -- it kind
of snowballed on me. Redispatching from prologues and handling stack
overflow also had to work. We were also forgetting to rewind the
globalData frontier if translation failed, and this change combined with
that to actually blow out globalData in a couple of tests.

Small bonus: deleting a bunch of "JIT::" that used to be "Transl::".

Reviewed By: @edwinsmith

Differential Revision: D1134414
2014-01-28 15:38:07 -08:00
Edwin Smith 35ca2405fc Remove dead function: emitContVarEnvHelperCall().
It was never called.

Reviewed By: @ottoni

Differential Revision: D1146574
2014-01-28 15:38:00 -08:00
Stuart Loxton 8f05139460 Fix Zend strrpos compatibility
Fixes Zend strrpos compatibility and adds test.

Closes #1564
Closes #1632

Reviewed By: @bertmaher

Differential Revision: D1142139

Pulled By: @scannell
2014-01-28 15:37:53 -08:00
Camillus Gerard Cai 9b2b28d678 Define missing IMAGETYPE_ constants
Defined IMAGETYPE_UNKNOWN and IMAGETYPE_COUNT

Closes #1634
Closes #1638

Reviewed By: @ptarjan

Differential Revision: D1144855

Pulled By: @scannell
2014-01-28 15:37:49 -08:00
Paul Saab fc26e82dc2 Prevent garbage on DNS_TXT records
Bug #64458 fixed an off by one error when decoding TXT records
that resulted with garbage at the end of the string returned.

Reviewed By: @scannell

Differential Revision: D1146140
2014-01-28 15:37:46 -08:00
Fred Emmott e38a481061 Fix scoping for evaling default ReflectionParameter values
Closes #1449
Closes #1652

Reviewed By: @ptarjan

Differential Revision: D1141045
2014-01-28 15:37:42 -08:00
Fred Emmott 379a930d49 Fix spl_autoload_unregister($unused_but_valid_handler)
If a valid handler is passed in, but wasn't registered, we'd just remove the last one:

- find_if() would return ::end()
- erase() treats that to mean erase the last one

Behavior in the new test was:
- correctly remove 'b'
- incorrectly remove 'a' when asked to remove 'b' again
- segfault when asked to remove 'b' a third time

Reviewed By: @ptarjan

Differential Revision: D1145531
2014-01-28 15:37:39 -08:00
Fred Emmott f2f8c75444 Fix memory management for xinclude nodes
Previously: ==580== ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x604400212103

We were recursively freeing the node, including the attribute nodes - however, libxml2 doesn't malloc them separately - all we needed to do was unlink and free the root.

This fixes a fatal in PHPUnit's test suite.

Reviewed By: @ptarjan

Differential Revision: D1144722
2014-01-28 15:37:35 -08:00
Fred Emmott c68c15b39f Fix incorrect ownerDocument after DOMDocument::createElement
Closes #1551

Fixed while investigating an ASAN failure when running PHPUnit's suite.

Reviewed By: @ptarjan

Differential Revision: D1144627
2014-01-28 15:37:32 -08:00
Sara Golemon d776975c82 Revert "Build ext_zend_compat extensions by default"
This reverts commit 8bf8e13796.

Not behaving as it's supposed to.  Revert until I can figure that out.
2014-01-28 11:11:46 -08:00
Sara Golemon 8bf8e13796 Build ext_zend_compat extensions by default 2014-01-28 09:17:56 -08:00
Jim Radford c052283289 Implement stream_context_{get,set}_default
Implement stream_context_{get,set}_default

Closes #1642

Reviewed By: @ptarjan

Differential Revision: D1145658

Pulled By: @scannell
2014-01-28 09:17:56 -08:00
Sean Cannella a9c43f1b82 Convert ext/zlib to HNI
Convert ext/zlib to HNI

Closes #1635

Reviewed By: @ptarjan

Differential Revision: D1143714
2014-01-28 09:17:55 -08:00
Jim Radford 7d4b75583e LdapLink::sweep shouldn't free smart allocated objects
LdapLink::sweep, avoid freeing smart allocated objects

Closes #1644

Reviewed By: @ptarjan

Differential Revision: D1144565

Pulled By: @scannell
2014-01-28 09:17:55 -08:00
Jim Radford 05c1c762f4 UrlFile::sweep shouldn't free smart allocated objs
UrlFile::sweep shouldn't free smart allocated objs

Closes #1643

Reviewed By: @jdelong

Differential Revision: D1144563

Pulled By: @scannell
2014-01-28 09:17:54 -08:00
Drew Paroski 09d121c851 Update array_shift to support collections
This diff updates the implementation of array_shift to support mutable
collections. A very simple scheme was used to make Vector and Set support
adding elements to the front similar to what HphpArray currently does. I
leave improving the data structures' perf when adding elements to the front
to a subsequent diff.

Reviewed By: @elgenie

Differential Revision: D1140008
2014-01-28 09:17:54 -08:00
Eugene Letuchy 1f3095e8cc make phinq tests slightly more reviewable
... attempting to use diff on expect files containing
 non-printing characters doesn't seem like a good idea, and having
 .expect that are treated as binary makes them hard to review.

Reviewed By: @hermanventer

Differential Revision: D1144149

(flaky www test)
2014-01-28 09:17:54 -08:00
Paul Tarjan b69b36096d support SCRIPT_FILENAME
Some fastcgi documentation doesn't tell you to pass all the params, only a handful. Even the official docs say this http://wiki.nginx.org/HttpFastcgiModule I think we should support the mode where we don't know the document root, jsut the absolute filename. I've already had to help 2 people in github with this issue so I think it is prevelant

Reviewed By: @scannell

Differential Revision: D1125309
2014-01-28 09:17:53 -08:00
Edwin Smith a55228796d Fix XLS spill slot alignment for SIMD registers
If XLS spills a SIMD register, we need the spill slot to
be 16-byte aligned. Also the checkShuffle() assertions weren't
quite right when spilling/loading SIMD registers.

Reviewed By: @jdelong

Differential Revision: D1144168
2014-01-28 09:17:53 -08:00
Owen Yamauchi 9070858a18 Implement codegen for SpillFrame, CallBuiltin, CheckType
SpillFrame is the next top punt after Call. This diff is preparation to
get the Call diff to pass all the tests. Also:

- I removed some code that I said I was going to remove in my last diff
  but forgot. :/

- There was a bug in emitStore, where I was failing to zero-extend bool
  srcs. This caused some interesting test failures once CallBuiltin was
  implemented, because if you call a builtin that returns bool from C++,
  you'll get garbage in the higher-order bytes.

- I had to increase the max number of arguments you can pass to a host
  call.

- Finally, I moved the reserved-stack-space constants out of the X64
  namespace and strengthened some of the asserts around the simulator's
  stack pointer (I ran into this while working).

Reviewed By: @edwinsmith

Differential Revision: D1139057
2014-01-28 09:17:52 -08:00
Paul Tarjan f7d82dfa0b document --php
Closes #1610

Reviewed By: @jdelong

Differential Revision: D1145021
2014-01-28 09:17:52 -08:00
Edwin Smith 9582398cb9 Remove legacy linear scan register allocator
Also rename linear-scan.h to reg-alloc.h, it still contains
a few leftover definitions and it's a useful place to put
declarations that don't depend on the implementation.

Reviewed By: @swtaarrs

Differential Revision: D1135081
2014-01-28 09:17:52 -08:00
Drew Paroski 3fe57c93db Update array_unshift to support Vector and Set
This diff updates the implementation of array_unshift to support Vector
and Set for the first parameter. A very simple scheme was used to make
Vector and Set support adding elements to the front similar to what
HphpArray currently does. I leave improving the data structures' perf
when adding elements to the front to a subsequent diff.

Along the way, I fixed the behavior of array_unshift() to match PHP 5.5
in the case where the first parameter is not an array, Vector, or Set.

Reviewed By: @elgenie

Differential Revision: D1139932
2014-01-28 09:17:51 -08:00
Jordan DeLong a8956cf943 Fix a bug with properties initialized to __DIR__ or __FILE__
Reported on freenode by nelt.  The deepInitHelper code
assumes the result of any deep-initialized property is reference
counted.  Since we recently changed opcodes that push static strings
to push KindOfStaticString, this means in the interpreter we'd hit an
assertion here.  (The JIT was unaffected, and neither case does
anything wrong in an opt build.)

Reviewed By: @paroski

Differential Revision: D1144110
2014-01-28 09:17:51 -08:00
Paul Tarjan f30fc478c3 try these again
I want to see what contbuild has to say about them

Reviewed By: @scannell

Differential Revision: D1116576
2014-01-28 09:17:50 -08:00
aravind a2df4d2e35 Revert "[hh] autoload: don't swallow fatals when autoloading"
This reverts commit 78e4c601db4c0b6ce55b44ae201fedaf47b65501.

Reviewed By: @elgenie

Differential Revision: D1144365
2014-01-28 09:17:50 -08:00
Eugene Letuchy f58e20caf3 array_slice(): support for collections, remove dead code
A straight-forward delegation to ArrayIter does the job.
 After analysis of the uses of slicing code, it seems that slicing can
 be confined to just the ext_array function, since the other uses for
 func_get_args have been subsumed by special purpose bytecodes. Thus,
 this diff also removes Array::slice, ArrayUtil::Slice, func_get_arg,
 and func_get_args.

Reviewed By: @jdelong

Differential Revision: D1142189
2014-01-28 09:17:50 -08:00
Eugene Letuchy 7613e239a6 collections: get rid of CollectionType::StableMap
... since StableMap is an alias for Map (as of {D1116834}),
 there can be no collections of this type.

Reviewed By: @jdelong

Differential Revision: D1119658
2014-01-28 09:17:49 -08:00
Eugene Letuchy ecc2f9b686 collections: unify StableMap and Map as HH\Map
* Turns ##c_StableMap## into a typedef for ##c_Map##
* ## StableMap ## and ## Map ## are both parse-time aliases for ## HH\Map ## (auto-imported under HipHopSyntax)
* Incorporates anietoro's {D1105491}.

Note: this cannot be committed until we're sure about the equality
semantics that make the most sense for the Map/StableMap hybrid (see {D1116829})

Reviewed By: @paroski

Differential Revision: D1116834
2014-01-28 09:17:49 -08:00
Eugene Letuchy 1903ce4d06 make f_array_rand faster when only one key is to be returned
Same big-O complexity, but smaller constant factors ... iterate
 ~1/2 as many elements, generate 1 instead of n random numbers.

Reviewed By: @jdelong

Differential Revision: D1142089
2014-01-28 09:17:48 -08:00
Eugene Letuchy b90ad1e32d collections: support in array_flip() builtin
A straight-forward iteration does the job.

Reviewed By: @jdelong

Differential Revision: D1142068
2014-01-28 09:17:48 -08:00
Bert Maher 2fbfba627e Avoid assertion failure while trying to print an empty block
Doing block->next() on an empty block causes an assertion
failure.  While that should never happen in normal operation, it's
kind of annoying when you're in gdb and want to print a block without
checking first whether it's empty.

Reviewed By: @ottoni

Differential Revision: D1143080
2014-01-28 09:17:48 -08:00
Eugene Letuchy 11e808ef24 collections: support in array_reverse() builtin
Rather than building a way of iterating every collection in
 reverse, `array_reverse` is accomplished by reversing the result of
 converting the collection to an array.

Reviewed By: @paroski

Differential Revision: D1142062
2014-01-28 09:17:47 -08:00
Paul Tarjan b873e69600 remove assert for ::class and make it fatal instead
If you do `parent::class` in a pseudomain you end up in this case. Zend gives this message in that case

Reviewed By: @elgenie

Differential Revision: D1140116
2014-01-28 09:17:47 -08:00
bsimmers 20f3e66d92 Disable/trim flaky tests
- Disable sleep_await.php and curlUpload.php for being flaky
- Remove potentially flaky parts from ext_network.php

Reviewed By: @bertmaher

Differential Revision: D1143085
2014-01-28 09:17:46 -08:00
Owen Yamauchi 3ef0ec891d Convert a few CALL_OPCODEs for ARM
These were all causing me trouble with my upcoming diffs -- punting on
these was causing some tests to time out due to punting so much.

Reviewed By: @edwinsmith

Differential Revision: D1142730
2014-01-28 09:17:46 -08:00
Owen Yamauchi a5261ea56c Fix a sandcastle crash due to PGO mode
I'm only 95% convinced that this is the cause of a sandcastle crash.
We're not calling transCounterAddr with sequential translation ids
anymore (apparently) so it's possible that we need to allocate more than
one chunk of new counters.

I ran a sandcastle with this fix applied and it didn't crash, but the
crash wasn't 100% before, so you never know.

Reviewed By: @ottoni

Differential Revision: D1142512
2014-01-28 09:17:46 -08:00
Simon Welsh beb5d544a5 Convert standard/url to HNI
Convert standard/url to HNI

Closes #1604

Reviewed By: @ptarjan

Differential Revision: D1135473

Pulled By: @scannell
2014-01-28 09:17:45 -08:00
Eugene Letuchy c724f89d7b autoloading: change currently-loading array to be indexed by classNames
Mainly interested in the perflab here, as looping over all the values
 is certainly less efficient O(autoload-depth) as opposed to O(1).

 Also, gets rid of the last use of Array::valueExists

Reviewed By: @scannell

Differential Revision: D1137619
2014-01-28 09:17:45 -08:00
Fred Emmott 417328fefb Implement ini_get_all()
Used by PHPUnit, as triggered by Mockery

Reviewed By: @ptarjan

Differential Revision: D1136971
2014-01-28 09:17:44 -08:00
Fred Emmott 02694e94e4 Move magic ini settings out of IniSettings
Pre-req on implementing ini_get_all() sanely.

Reviewed By: @ptarjan

Differential Revision: D1134579
2014-01-28 09:17:44 -08:00
Alan Frindell edcdac373b Wait for the PProfServer before main exits
Looking into shutdown crashes I found this one with jemalloc junk enabled.

Reviewed By: @scannell

Differential Revision: D1139409
2014-01-28 09:17:44 -08:00
Edwin Smith 4404f655c5 Reduce default MaxRegs setting to avoid wraparound.
Fix wraparound bug in XLS that was reducing available registers.

Reviewed By: @bertmaher

Differential Revision: D1142120
2014-01-28 09:17:43 -08:00