Permalink
Commits on Dec 1, 2014
  1. sync 2014/12/1

    committed Dec 1, 2014
  2. Merge remote-tracking branch 'upstream/master'

    Conflicts:
    	hphp/compiler/compiler.cpp
    	hphp/hack/src/client/clientStart.ml
    	hphp/hack/src/utils/shell.ml
    	hphp/runtime/base/builtin-functions.cpp
    	hphp/runtime/base/builtin-functions.h
    	hphp/runtime/base/exceptions.h
    	hphp/runtime/base/execution-context.cpp
    	hphp/runtime/base/memory-manager-inl.h
    	hphp/runtime/base/memory-manager.cpp
    	hphp/runtime/base/memory-manager.h
    	hphp/runtime/base/object-data.cpp
    	hphp/runtime/base/program-functions.cpp
    	hphp/runtime/base/program-functions.h
    	hphp/runtime/base/request-injection-data.cpp
    	hphp/runtime/base/request-injection-data.h
    	hphp/runtime/base/runtime-option.cpp
    	hphp/runtime/base/runtime-option.h
    	hphp/runtime/base/thread-info.cpp
    	hphp/runtime/ext/ipc/ext_ipc.cpp
    	hphp/runtime/ext/reflection/ext_reflection.cpp
    	hphp/runtime/ext/std/ext_std_classobj.cpp
    	hphp/runtime/ext/std/ext_std_options.cpp
    	hphp/runtime/ext/xdebug/php5_xdebug/xdebug_var.cpp
    	hphp/runtime/ext_zend_compat/php-src/Zend/zend_API.cpp
    	hphp/runtime/server/rpc-request-handler.cpp
    	hphp/runtime/vm/bytecode.cpp
    	hphp/runtime/vm/class.cpp
    	hphp/runtime/vm/class.h
    	hphp/runtime/vm/jit/frame-state.cpp
    	hphp/runtime/vm/jit/hhbc-translator.cpp
    	hphp/runtime/vm/jit/inlining-decider.cpp
    	hphp/runtime/vm/jit/inlining-decider.h
    	hphp/runtime/vm/jit/mc-generator.cpp
    	hphp/runtime/vm/jit/region-selection.h
    	hphp/runtime/vm/jit/region-tracelet.cpp
    	hphp/runtime/vm/jit/translator-runtime.cpp
    	hphp/runtime/vm/jit/translator.cpp
    	hphp/runtime/vm/jit/translator.h
    	hphp/test/slow/array_functions/usort.php.opts
    	hphp/test/slow/collection_classes/822.php.opts
    	hphp/test/slow/compilation/1270.php.opts
    	hphp/test/slow/ext_ipc/message_queue.php
    	hphp/test/slow/lang/reflection.php.hphp_opts
    committed Dec 1, 2014
Commits on Nov 30, 2014
  1. Make options with dashes show correctly on option error.

    Summary: There is a bug in at least Boost 1.54 where options with dashes `-` in them are
    not handled correctly. Basically all but the last substring after the last dash
    is returned.
    
    See: facebook#2864
    
    So our error string when an option had an invalid argument was just plain wrong.
    Since we can't fix boost very easily and are not planning to upgrade yet, we
    workaround it with this fix.
    
    Fixes: #2864
    
    Reviewed By: @paulbiss
    
    Differential Revision: D1681063
    
    Signature: t1:1681063:1416505169:7664cff3c23b8fdfec995c54897eb276d44f92d6
    JoelMarcey committed with hhvm-bot Nov 30, 2014
  2. Remove a warning from msg_receive function

    Summary: Remove a warning from `msg_receive` function for consistency with php:
    https://github.com/php/php-src/blob/a770d29df74515197c76efdf1a64d9794c27b4af/ext/sysvmsg/sysvmsg.c#L377-L379
    Closes facebook#4325
    
    Reviewed By: @fredemmott
    
    Differential Revision: D1700537
    
    Signature: t1:1700537:1417318587:0560094192f76da223b5c379bd9da929f28f1b1e
    rybakit committed with hhvm-bot Nov 30, 2014
  3. Fix for issue when file or directory name is "0"

    Summary: If name of file or directory is `0` - this name shouldn't be removed in `::resolveDotDots` method.
    Solution is to use `strlen` function as callback in `array_filter` - it will works similarly, but keeps values of 0 (zero).
    
    Likely, should be backported into 3.3 LTS branch (I can add another pull request against 3.3 branch if this is OK).
    Closes facebook#4266
    
    Reviewed By: @fredemmott
    
    Differential Revision: D1687469
    
    Signature: t1:1687469:1417307697:14f3413565305ff2289b271c91b188c28bdc688f
    nazar-pc committed with hhvm-bot Nov 30, 2014
Commits on Nov 29, 2014
  1. Improve the property accessing API of Class.

    Summary: Affects Class methods getDeclPropIndex(), findSProp(), getSProp(), and
    zGetSProp(). They were taking two boolean arguments by reference and setting
    them: visible and accessible.
    
    visible is unneeded. It was set iff the property existed, but that could be
    checked against the return values of those functions (either "value == nullptr"
    or "slotIdx == kInvalidInd").
    
    That left returning a some representation of the property (either a Slot,
    TypedValue*, or RefData*) and the accessible flag, which I turned into a struct
    templated on the property.
    
    Reviewed By: @jdelong
    
    Differential Revision: D1708784
    
    Signature: t1:1708784:1417282914:1782c28704245b9b2a50520936dcabc155e13a77
    alexmalyshev committed with hhvm-bot Nov 29, 2014
  2. Lazy-init freelist headers

    Summary: It's a clear regression to initialize a free header every time we
    push onto the freelist (a few alu operations plus an additional store),
    so do it lazily before parsing the heap.
    
    This effectively moves the cost from the mutator to the allocator,
    and the amortized cost depends on how often we parse the heap instead
    of how often we free objects.
    
    Reviewed By: @jdelong
    
    Differential Revision: D1709018
    
    Signature: t1:1709018:1417204521:321b84f8a86d857481d5487a0b22acff08dac47b
    ^^cmake phase never completed
    edwinsmith committed with hhvm-bot Nov 25, 2014
  3. Fix predicted local type invariant failure (test/slow/ext_collator/18…

    …10.php)
    
    Summary: It looks like this test is failing in trunk?  This fixes it, and is
    definitely a bug fix (because we might only have Gen for the local now even if
    we had a LdLoc that knew more earlier, so taking this prediction could lead to
    an invariant violation of exactly this sort).  I didn't think through all the
    details of why exactly it failed though.
    
    Reviewed By: @markw65
    
    Differential Revision: D1708111
    
    Signature: t1:1708111:1417210961:f0d864b7a9cd844d83f21411e050079150f3255b
    jdelong committed with hhvm-bot Nov 27, 2014
  4. Revert "Move all inlining work to translateRegion()"

    Summary: This reverts commit 7a17649306b003c961a86e9e33b5bb92e979192e.
    
    Perflab says it broke lots of things.
    
    Reviewed By: @jdelong
    
    Differential Revision: D1709049
    
    Signature: t1:1709049:1417208800:3f72a2a4d47968d7db9ae906c71ab28c54929041
    markw65 committed with hhvm-bot Nov 28, 2014
Commits on Nov 28, 2014
  1. Fix a frame state tracing bug I introduced

    Summary: If you turn tracing up too high now you get folly::format exceptions.
    
    Reviewed By: @bertmaher, @alexmalyshev
    
    Differential Revision: D1708102
    
    Signature: t1:1708102:1417061596:3674837cec575ff003de9845fe73f02139d5d58e
    jdelong committed with hhvm-bot Nov 27, 2014
Commits on Nov 27, 2014
  1. Quote the path passed to hh_server

    Summary: When hh_client spawns a server, quote the path so that paths with spaces in the
    name are correctly handled.
    
    Fixes #4310
    
    Closes facebook#4321
    
    Reviewed By: @​svcscm
    
    Differential Revision: D1701186
    
    Pulled By: @int3
    simonwelsh committed with hhvm-bot Nov 26, 2014
  2. Add a CPU timer to RequestInjectionData

    Summary: We'd like to be able to kill a runaway CPU-eating request before it
    hits the full wall-time timeout.  Requests generally use a lot less CPU than
    wall time, so we should be able to be more aggressive with it.
    
    Reviewed By: @markw65
    
    Differential Revision: D1702049
    bertmaher committed with hhvm-bot Nov 18, 2014
  3. remove icd extension

    committed Nov 27, 2014
  4. sync hhvm code 2014-11-27

    committed Nov 27, 2014
Commits on Nov 26, 2014
  1. Break up macros.h

    Summary: Moved parts of macros.h to object-data.h, resource-data.h,
    type-string.h, and a new classname-is.h that just has the guts
    of the CLASSNAME_IS macro, which is still shared between concrete
    objects and resources.
    
    Reviewed By: @alexmalyshev
    
    Differential Revision: D1706380
    
    Signature: t1:1706380:1417030686:28ddcb5a815e5fbb79295ed8fb02e37508d3c8e9
    edwinsmith committed with hhvm-bot Nov 26, 2014
  2. Restarting should just start the server if one isn't already running.

    Summary: I think this behavior is more convenient. It would have made testing
    the saved state behavior easier, for one. Also, things like `service` on Linux
    operate the same way.
    
    Reviewed By: @elgenie
    
    Differential Revision: D1704053
    
    Signature: t1:1704053:1416995526:7d02ea3d138445566fb38dc9aab3c73a15b809de
    int3 committed with hhvm-bot Nov 26, 2014
  3. Codemod "const Ref&" to "const Ref"

    Summary: Not much of a codemod since there's only 2 code sites to change...
    
    Reviewed By: @edwinsmith
    
    Differential Revision: D1702707
    
    Signature: t1:1702707:1416937381:a4de3760f52219a82ca47a1f7cae4e0a85aab08b
    alexmalyshev committed with hhvm-bot Nov 26, 2014
  4. Fix bundled PCRE build

    Summary: Do not pass the "REQUIRED" argument when finding PCRE, since we now have
    a bundled PCRE which we can use in the absence of a system library. The
    only effect of REQUIRED was to make FIND_PACKAGE_HANDLE_STANDARD_ARGS()
    fail with an error.
    Closes facebook#4342
    
    Reviewed By: @fredemmott
    
    Differential Revision: D1706218
    
    Signature: t1:1706218:1417023737:6d291bcddb6dd21273e12263614e4a59524b3d09
    tstarling committed with hhvm-bot Nov 26, 2014
  5. Remove marker from FrameState

    Summary: It seemed weird to duplicate spOff and curFunc with the marker, and
    then I was a little worried that it isn't handle the same way for merging.  It
    turns out it wasn't broken, just not necessary: ir-builder is just storing its
    next-to-gen-marker there for presumably historical reasons.
    
    This also changes splitEdge to use the marker from the source jump instead of
    the destination, which seems to make more sense to me, but I think we could
    choose either.
    
    Reviewed By: @alexmalyshev
    
    Differential Revision: D1699852
    
    Signature: t1:1699852:1416889935:4735fb88a4ec8ed3f24a4d5937275e3fa7d2319b
    jdelong committed with hhvm-bot Nov 22, 2014
  6. Remove HhbcTranslator::replace

    Summary: Probably dates to when EvalStack was a member of HhbcTranslator.
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1699851
    
    Signature: t1:1699851:1416854158:f9374084856b9ea46433145241f91ced04479c25
    jdelong committed with hhvm-bot Nov 22, 2014
  7. Remove LocalStateHook& from startBlock

    Summary: Refcount opts doesn't support loops (or user-level dags), and is the
    only user, so we can remove this code.
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1699850
    jdelong committed with hhvm-bot Nov 22, 2014
  8. Fix frameSpansCall bugs, remove 'clearing' code and add m_status asserts

    Summary: There was no merging at all of the frameSpansCall state, and the way
    we handled it at a loop header or with an unprocessed pred was incorrect (it
    left it dangling as whatever it used to be).  Rename it to make it clearer that
    it's may-information, and refactor the various clear/reset state functions so
    they don't exist anymore.  Expanded m_status with some assertions: it's pretty
    clear with the status assertions that this class is still doing 3 unrelated
    things (finding a fixed point, dag-only-legacy-reoptimize-or-analyze-stuff, and
    the building mode), so it should be split up further.
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1699849
    
    Signature: t1:1699849:1416856507:403366c23fa1471eaa1ded1486725ed93b83ad15
    jdelong committed with hhvm-bot Nov 22, 2014
  9. Remove runtime/test/refcount-opts.cpp

    Summary: It's the only user of FrameStateMgr's second constructor, which I want
    to remove, and you can't pass a dummy marker to the normal constructor instead
    as we end up hitting hasFunc assertions (which looks like it's explicitly
    testing that it's not a dummy).  I could make it work (or leave the
    constructor), but I think this test's days are numbered anyway, since we're
    going to need to change how the refcount-opts pass works pretty fundamentally
    for it to support arbitrary control flow.  So unless someone really likes it
    can I delete it?
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1699848
    
    Signature: t1:1699848:1416854866:70d6f636671ac0dd6c46773702e296b2d7003bc9
    jdelong committed with hhvm-bot Nov 22, 2014
  10. Move LocalStateHook driving out of FrameStateMgr

    Summary: This lets refcount opts talk to it directly.  But it still requires a
    FrameStateMgr& for now to be able to call MInstrEffects::get (which wants to
    read the old type of a local on the other side of a pointer, and is assuming
    FrameStateMgr knows what that type is, although it only kinda does (not really
    sound after gen time)).  Also gets rid of forEachFrame (unused) and makes the
    forEachLocal callback match how it's used.
    
    walkAllInlinedLocals also only has a single callsite now, which needs it
    because of the skipFrame stuff.  (You can't null the locals out more than once
    or refcount opts thinks it's consuming things too many times.)
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1699847
    jdelong committed with hhvm-bot Nov 22, 2014
  11. Turn off most of insertPhis

    Summary: It's using incorrect values from predecessor blocks because it doesn't
    distinguish between states on the taken or next edge.  Also this isn't the
    place we want to do this long term (LCM pass or something should do it
    instead).  We can't turn off the stacks yet, though.
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1698939
    jdelong committed with hhvm-bot Nov 22, 2014
  12. Don't attempt to autoload ints from is_a()

    Summary: Fixes facebook/hhvm#4337
    
    Reviewed By: @paulbiss, @elgenie
    
    Differential Revision: D1701715
    
    Signature: t1:1701715:1416874204:20c909c2e95a108273c9e2a67f0849f01f72f653
    fredemmott committed with hhvm-bot Nov 24, 2014
  13. Move all inlining work to translateRegion()

    Summary: Rather than inlining from the tracelet selector (or, more generally,
    making the inlining decision in any particular region selector), let's
    instead move the entire process into the translation path.  This gives
    us inlining support for all regions, and is just generally nicer:
    
    - We can, and have, turned off inlining for profiling translations.  The
      hottrace selector will still support inlining, since it does its own
      decision-making on the stitched-together region, but profiling
      translations are back to being single-block.
    
    - Part of the inlining decision involves inspecting the callee's region,
      and inspecting a fully-formed region seems cleaner than looking
      through a region-that-has-been-formed-up-until-the-FCall-hopefully.
    
    First-order inlining for hottrace regions may also allows us to inline
    more calls in cases where we have more information.
    
    The most prominent change to note is that inlined callees' blocks are no
    longer included in the caller's region; instead, we just skip emitting
    the FCall in HhbcTranslator and emit the callee region instead.
    
    Because we no longer see the in-callee uses of types for profiling
    tracelets, we duplicate the inlining decision-making during profiling
    translations, and if a callee is inlinable, we constrain the types of
    all of its arguments, to avoid losing out on an inlining opportunity.
    
    Reviewed By: @swtaarrs
    
    Differential Revision: D1428014
    mxw committed with hhvm-bot Aug 26, 2014
  14. Check !typeMightRelax in simplifyConvObjToBool()

    Reviewed By: @alexmalyshev
    
    Differential Revision: D1635364
    mxw committed with hhvm-bot Oct 23, 2014
  15. Allow negative TransIDs in certain contexts

    Summary: For the new inlining stuff, we need to be able to convert negative
    BlockIds into nontrivial ProfSrcKeys, so that we can correctly track the
    set of instructions that need interpreting, but without changing the
    behavior of anything else.
    
    We're already using JIT::BlockIds and TransIDs in a very transparent
    manner, so let's just give them the same types and logical ranges.
    
    Reviewed By: @ottoni
    
    Differential Revision: D1444737
    mxw committed with hhvm-bot Jul 18, 2014
  16. use IMPLEMENT_RESOURCE_ALLOCATION for resources

    Summary: It's confusing to use IMPLEMENT_OBJECT_ALLOCATION for resources,
    and we might want to change how object/resources are swept
    independently.
    
    Reviewed By: @markw65
    
    Differential Revision: D1703478
    
    Signature: t1:1703478:1416964853:82feff283db1c7eaf3b5af7e4a76478074c98a51
    edwinsmith committed with hhvm-bot Nov 25, 2014
  17. Don't use sbbl in cgIsScalarType

    Summary: I replaced it with an instruction sequence that shouldn't be
    meaningfully slower (or faster) but is much simpler to implement in the llvm
    backend.
    
    Reviewed By: @jasone
    
    Differential Revision: D1702277
    swtaarrs committed with hhvm-bot Nov 25, 2014
  18. Raise psllq and psrlq to absdbl, support in llvm

    Summary: We were only using these two instructions to clear the sign bit of a
    double to take its absolute value. Use the llvm intrinsic in the llvm backend.
    
    Reviewed By: @jasone
    
    Differential Revision: D1702068
    swtaarrs committed with hhvm-bot Nov 25, 2014
  19. Handle push/pop instructions in llvm backend

    Summary: pushl was unused so it's been deleted. Of the others, only pushm was
    used inside a normal tracelet, and only by LdRetAddr. I've replaced it with a
    higher level instruction that's lowered to the corresponding pushm for x64
    codegen. I also replaced ret with the higher-level retctrl, also lowered back
    to ret for x64 codegen. This allows us to generate the same llir we were
    before, but with one fewer awkward hack.
    
    Reviewed By: @jasone
    
    Differential Revision: D1699263
    swtaarrs committed with hhvm-bot Nov 22, 2014
  20. Implement svcreq in llvm backend

    Summary: Fairly easy, with a bit of a hack to work around the fact that we
    still use ret to invoke service requests.
    
    Reviewed By: @jasone
    
    Differential Revision: D1699108
    swtaarrs committed with hhvm-bot Nov 22, 2014
  21. Fix race condition with sigalrm.

    Summary: Took way too long to debug this... the issue was that if an
    exception (like Server_initializing) got thrown before the alarm went
    off, the alarm would not get unset. So at some point the signal handler
    gets called and raises Server_busy.
    
    Reviewed By: @jwatzman
    
    Differential Revision: D1702848
    
    Signature: t1:1702848:1416962236:1fc138cb08b254da69fb44912ac8149872929a5e
    int3 committed with hhvm-bot Nov 26, 2014