Gráfico de Commits

1247 Commits

Autor SHA1 Mensagem Data
Mike Magruder 4048565e87 Ensure flow control commands don't remove internal breakpoints set by real breakpoints
A real breakpoint makes entries in the breakpoint filter for all offsets at the given line. Various flow control commands will also use the breakpoint filter to add and remove temporary "internal breakpoints" required during the flow operation. Ensure that we never remove a breakpoint filter entry if there was already one there due to a breakpoint (or really  any other reason).
2013-07-22 11:34:05 -07:00
Mike Magruder 3231abf20a Add option to extend the time we'll wait before dropping into the dummy sandbox on debugger signals
When the proxy's signal polling thread gets a signal from the debugger client, it would normally wait one second for another thread to recognize and consume the signal. This is pretty reasonable, but with a debug build on a heavily loaded system it's very rarely possible for one second to not be long enough. Added a runtime option to extend this, and set it to 3s for the existing debugger server tests.
2013-07-22 11:34:04 -07:00
Sara Golemon 65a6125580 Match PHP's numeric type conversion rules for math functions
Null/Bool/Object get converted to numeric values.
Touches abs(), floor(), ceil(), and round().
2013-07-19 12:57:30 -07:00
Sara Golemon 825cb52060 Fix parse_url()
Bug#54180 - Fragments containing '?'
Do not throw a notice on bad URLs
Add 'port' to return value after 'host', not at end of array
2013-07-19 12:57:29 -07:00
Paul Tarjan 38330353f6 warning on bad chdir
matches zend
2013-07-19 12:57:29 -07:00
Daniel Sloof cadddcd0d3 enable ServiceData on OSX
- re-enable servicedata on OSX now that jemalloc is fixed

Closes #865
2013-07-19 12:57:29 -07:00
Paul Bissonnette 1227cda52e Fixing bug with IterBreak assembler
Was failing to push iterator ID along with type in assembler.
2013-07-19 12:57:28 -07:00
Sean Cannella f319a3c029 gcc 4.7.1 unused-variable warnings
- fix unused variable warnings from OSS
2013-07-19 12:57:28 -07:00
mwilliams 76aed9f150 Empty loops need to check surprise flags
We didnt count a brach to itself as a backward branch.
Also, there seemed to be a signed vs unsigned issue with IterBreak.
2013-07-19 12:57:28 -07:00
Edwin Smith 1e3f2c2864 Remove checkExist option to ArrayData::lval()
It appears to be a leftover optimization that only applied to HPHPC,
which is gone now.
2013-07-19 12:57:27 -07:00
Guilherme Ottoni f107113ed3 Remove handling for const Bools that are neither 0 nor 1
It looks like whatever was introducing these has been fixed.
2013-07-19 12:57:27 -07:00
Bert Maher abca91e0fa Exit early during checkInvariants rather than do the O(N) loop.
This loop is useful for debugging arrays but is too slow for
general use, so we'll just "return true" before it and leave it in
place for offline use.
2013-07-19 12:57:27 -07:00
Edwin Smith 353b33928b Make ArrayKind a regular enum
We use ArrayKind as a simple unsigned integer, its an index, we do
range-based comparisons, and in the future we'll likely do bit-ops
for fast sub-kind tests.  Just be honest that this is an old-school enum.
2013-07-19 12:57:26 -07:00
Daniel Sloof c494c3a145 Don't use "echo -n" in /bin/sh scripts on MacOSX
The shell builtin implementation of echo on MacOSX
doesn't respect the -n flag.  This is the only usage of it
in our stack so far and we can avoid it by hiding the generated
token from the linter in a different way.
2013-07-18 17:28:44 -07:00
danslo 079dc468ca Comments are not SimpleXML element children
- Comments should not be counted as node children

Closes #863
2013-07-18 17:28:44 -07:00
Edwin Smith 608df352de HphpArray Vector specializations
Introduces a new m_kind for vector-shaped HphpArray instances.
A vector has integer indexes in the range [0..size), and no
tombstones.  Internally it does not store the integer keys or
hashtable, although this version still allocates space for it.
2013-07-18 17:28:43 -07:00
Paul Tarjan 0335e335b7 build setAccessible
This implementation feels a bit haphazard with all the forces in the `o_*`. Is this stuff all changing dario?
2013-07-18 17:28:42 -07:00
Mirek Klimos 90b7170582 Remove Continuation from local 0
No emitted bytecode relies on Continuation being stored in local 0
anymore. Stop using local 0 for this purpose and compute offset
to the Continuation at JIT time. 16 bytes of memory freed.

At this point all locals of Continuation construction wrapper share the
same indices with their respective locals of Continuation body, which
should allow further optimizations.
2013-07-18 17:28:42 -07:00
Mirek Klimos f11bab46b7 Eliminate Continuation in local 0: JIT
The the code is being translated, we statically know offset of
Continuaton from its ActRec. Use this knowledge to emit data fetches
relative to ActRec rather than relative to Continuation loaded from
local 0.
2013-07-18 17:28:42 -07:00
huzhiguang 506329b7ce error_log add message_type=3 function
add f_error_log message_type=3 function
hhvm defult error_log message_type 0,so it can't support user-defind error_log mode(message_type=3)

Closes #831

Github: https://github.com/facebook/hiphop-php/pull/831
2013-07-18 17:28:41 -07:00
bsimmers 4665b068d4 Initial tracelet region selector
This diff renames the Tracelet -> RegionDesc conversion mode to
"legacy" (since it's going away eventually) and changes "tracelet" to use the
new region selection mode. It attempts to select a region that will be the same
length as what Translator::analyze would come up with, using HhbcTranslator for
all of the type flow logic. It generates longer tracelets in some cases due to
more precise type information. Once this new mode is no longer a perf
regression it can become the new default, replacing all the code in
Translator::analyze and the "legacy" region mode. This version doesn't support
inlining or tracking of known Func*s; those will come in later diffs.
2013-07-18 17:28:41 -07:00
Paul Tarjan c9b0ebd674 change get_resource_type() to match zend
in composer.phar they test `get_resource_type` and make sure it matches this string. This just seemed like a bug.
2013-07-18 17:28:40 -07:00
Mike Magruder 601ca57f53 Cleanup debugger client shutdown
The exit path for the debugger client has always been a little odd. We'd call a shutdown function which would destroy the client, then later call a stop function which would first make a new client, then stop it, then that one would get destroyed later. Made it so we stop and destroy just one client.
2013-07-18 17:28:40 -07:00
Herman Venter ee2cd8d32e Do not evaluate breakpoint conditions during stepping.
Flow control commands should not evaluate the conditions of conditional breakpoints when enabling and disabling breakpoints during stepping. Also, all breakpoints, rather than just the first matching breakpoint should be enabled/disabled.
2013-07-18 17:28:39 -07:00
Jordan DeLong 29dbaf3ae9 Remove assert on maxStackCells > 0
One of these was left over.
2013-07-18 17:28:39 -07:00
Mike Magruder 76fd23c2cb Remove rare flakieness from protocol tests
There was a race in the debugger protocol tests which send bad commands to the proxy and expect it to disconnect. If the proxy thread was fast enough it would mark the client as stopped, and we'd skip trying to get a new message after sending the bad command. This means missing one line of output in very rare cases. I've put in a wait to ensure that the client settles in the stopped state before continuing, to remove the race.
2013-07-18 17:28:39 -07:00
Paul Bissonnette 0a111314bd Adding shift left and right to codegen
shift left and right in codegen
2013-07-18 17:28:37 -07:00
Kyle Delong a8e3321fbd HPHP/XHP: 'mixed' type in attribute declarations
We'd like to start using ##mixed## instead of ##var## for attribute types to be consistent with Hack. As a followup to this (once released), we would codemod all ##var## to ##mixed##.
2013-07-18 17:28:37 -07:00
Mike Magruder f3d5a8abb1 Allow ctrl-c during eval
A client couldn't break execution during eval. There used to be a lot of barriers to making that right, but I fixed most of them with a previous diff on unifying client-side event loops. Now the only barrier was that a server-side thread processing an interrupt was blocking the signal polling thread by holding a mutex while processing the interrupt. Changed to set a flag to disable polling when starting to process the interrupt (and unsetting it when done), while still synchronizing with the signal polling thread to ensure only one thread is sending the client messages at a time. Added logic to re-enable polling while executing PHP for eval, print, etc. Plumbed the proxy thru to the point where we check the clause on conditional breakpoints, too, since that's the third (and final) place we do this.
2013-07-18 17:28:36 -07:00
Herman Venter b03f72d185 Only one break point can be set per file when running against a server
When the client sends a list of breakpoints over to the server, the logic that applies the breakpoints as soon as a file is loaded is broken. It stops looking at breakpoints as soon as it finds the first one. It should carry on and look at all of them.
2013-07-18 17:28:36 -07:00
Edwin Smith 721f89b890 Flatten directories under runtime/base
This moves runtime/base/*/* to runtime/base, and fixes paths.
2013-07-18 17:28:35 -07:00
bsimmers a9e58686ab Pull Translator's translate* methods into a separate class
This diff creates IRTranslator, which creates and uses an
HhbcTranslator to implement the translate* methods. It can be used
independently of Translator or TranslatorX64 (it isn't yet but my next
region compiler diff uses it). I also moved a bunch of methods out of
inappropriate classes and changed the type guard/assert methods in
HhbcTranslator to use RegionDesc::Location instead of Transl::Location
and fixes a local tracking issue in translateRegion.
2013-07-18 17:28:34 -07:00
Jordan DeLong 43d8497245 Translate BitNot on doubles 2013-07-18 17:28:34 -07:00
Benjamin Strahs 8ce9231f1b Fix DOMDocument UTF-16 parsing
We should be using xmlCreateMemoryParserCtxt for in-memory XML documents because it correctly handles UTF-16 encoded strings.
2013-07-18 17:28:33 -07:00
Owen Yamauchi 4cea6506e6 Get rid of NameValueTableWrapper, part 2 of 3
Part 2: getting rid of NVTW for initializing nonscalar static
properties. This is slightly messier than the equivalent for nonstatic
properties.
2013-07-18 17:28:33 -07:00
Sara Golemon 5c93a5fe40 Prevent buffer overrun during iopBitOr on string args
"foo" | "f" is meant to yield a string of length
max(strlen("foo"), strlen("f")) by bitwise ORing each byte
of one string against the corresponding byte of the other.

When the strings are of differing lengths, however, we get unknown
garbage data from past the end of the buffer.  This data is
often '\0', however under memory pressure we can get any
value and the behavior becomes undefined.
2013-07-18 17:28:22 -07:00
Keith Adams bbcf1a2db3 Make Asm::code private.
Having everybody and their uncle reading and writing fields out
of a.code and stubs.code was making assembler work hard. This replaces most
reads with accessors, and all writes with structured friends of
X64SAssembler.
2013-07-15 18:13:31 -07:00
Edwin Smith c4e406b62f Move runtime/base/server to runtime/server
This is an incremental step towards moving it all the way
to hphp/server.  This flattens base but doesn't untangle
the server files from lib_hphp_runtime
2013-07-15 18:13:25 -07:00
Keith Adams d3673cad74 Make it possible to wait for gdb on crash.
Often I happen not to be running under a debugger when a
crash occurs. In my debugging workflow, I'd prefer our crash handler to
preserve the broken state and spin waiting for gdb to attach rather than
dump core, attempt its own little sad stacktraces, etc. Driven via a
default-false config flag.
2013-07-15 17:35:33 -07:00
Mike Magruder f3e19a5dfa Fix machine force attach
I broke the operation of CmdMachine when we attach with the force flag with https://phabricator.fb.com/D851880. I consolidated some error handling logic around broken connections, etc., and in particular pulled throwing of an exception into forceQuit(). I failed to realize there was a single call site of forceQuit() that did not in fact throw an exception afterwards… the logic underneath of force attach. Switching the forceQuit() call there to stop() replaces the logic that was there previously, and restores the behavior.
2013-07-15 17:35:32 -07:00
aravind b5f608b942 always_assert when we run out of TC space
Makes debugging easier.
2013-07-15 17:35:32 -07:00
Herman Venter 10f93d4828 Do not report start, end and psp breakpoints as unbound when connected to a sandbox.
break start/end/psp currently always report themselves as unbound. If the client is connected to a sanbox, these should instead be treated as bound. Also, break clear all currently removes breakpoints without running their destructors in the right order, which causes the break point counter to not reset to 1.
2013-07-15 17:35:31 -07:00
Mike Magruder f051e2fe04 Don't go back to the interpreter after the end of pseudo main when debugging
Fix a long-standing bug where if you step off of the end of pseudo main we'd segfault in the interpreter loop. To get this we have to have a breakpoint in the final TC in pseudo main, and have that called from another TC, then Step or Next off the end. We'd end up with a PC of zero after the ret, which makes sense, but the logic after interpreting a block of code to stay in the interpreter when debugging was blind to this case.
2013-07-15 17:34:47 -07:00
Edwin Smith 9b6bf426b9 Move runtime/base/array/* up one level.
Also rename array_inline.h to array_data-inl.h
2013-07-15 17:34:47 -07:00
Sean Cannella 7d07873817 OSX warnings
- fix OSS warnings
2013-07-15 17:34:42 -07:00
Edwin Smith 746862246f Fix typos from "Remove do/while(0) trick in iopFCallBuiltin macros"
s/-1/-i/
Add missing \
2013-07-15 15:46:28 -07:00
Jordan DeLong a28b21c191 Remove do/while(0) trick in iopFCallBuiltin macros
It doesn't really make sense in this context.  Also pushed
the if statement down into the CASE macro for now and fixed some
indentation.
2013-07-15 15:46:28 -07:00
Jordan DeLong 0c489492dc Remove array_iter_foo functions from Variant and VRefParam @override-unit-failures
Pretty much just moves them to their only callers in
ext_array.
2013-07-15 15:46:27 -07:00
Jordan DeLong 8e3ee5a87f Use stringToNumeric in tv_comparisons
I like this api slightly better than passing in multiple
output refs, but when I added I didn't change these so I could see
perflabs separately.
2013-07-15 15:46:27 -07:00
Jordan DeLong 1c764cabf0 Remove redundant function in Array
get() and getArrayData() do the same thing.
2013-07-15 15:46:27 -07:00