Permalink
Switch branches/tags
Nothing to show
Commits on Jan 3, 2012
  1. --compiler_warnings;

    d1saster committed Jan 3, 2012
    Unfortunately does the libevent2 version of evhttp.h generate a compiler warning
    which is now avoided by using event2/http.h instead.
Commits on Dec 31, 2011
Commits on Dec 29, 2011
  1. making PCRECache a LRU cache

    d1saster committed Dec 29, 2011
    This patch makes PCRECache a LRU cache and introduces a new runtime option
    Preg.CacheLimit which specifies the maximal number of cache entries per thread.
    
    The latter point fixes a Wordpress issue where the PCRECache was growing indefinitely.
Commits on Dec 12, 2011
  1. Merge remote-tracking branch 'dpaneda/master'

    d1saster committed Dec 12, 2011
    Conflicts:
    	CMake/HPHPFindLibs.cmake
Commits on Dec 11, 2011
  1. fix the hphpi/eval support

    d1saster committed Dec 8, 2011
    The commit which changed 'file_exists' also changed the hphpi/eval
    behavior. This patch fixes this in the way that we only pretend that local
    .php files do not exist for compiled projects without eval support.
Commits on Dec 8, 2011
  1. drop the --as-needed linker flag

    d1saster committed Dec 8, 2011
    First point is that it produces linker errors because the libs are not linked
    in the proper order. Secondly it is not worth fixing this because all functions
    are referenced in some way in a reference table.
  2. Handle .php files differently in file_exists

    d1saster committed Dec 8, 2011
    Consider the following code
    
    	if (file_exists('blub.php'))
    		require_once ('blub.php');
    
    which can fail because of 2 reasons:
    1. blub.php is compiled with all the other files, but is no longer
       present at runtime.
    2. blub.php is not compiled, but does exist in the filesystem.
    
    The patch fixes the first case where file_exists now returns true
    and adds a workaround for the second case where we now pretend that
    the file does not exist.
Commits on Dec 3, 2011
  1. fix undefined references to cli_safe_read, net_field_length, free_roo…

    d1saster committed Dec 3, 2011
    …t for fedora 15
    
    This is not a proper fix, it just disables the localization support.
Commits on Nov 29, 2011
  1. [Fix/apc] typo in profiling

    qigao authored and scottmac committed Oct 31, 2011
    Summary:
    A typo makes it not using normalized keys in profiling deletion,
    resulting in incorrect group stats. Does not affect production
    correctness.
    
    Test Plan: make fast_tests
    
    Reviewers: mwilliams, myang
    
    Reviewed By: myang
    
    CC: ps, mwilliams, myang
    
    Differential Revision: 353265
  2. [APC] Improve apc size profiling

    qigao authored and scottmac committed Oct 28, 2011
    Summary:
    This diff does a few things to improve apc size profiling:
    1. More compact format for script to process the result. I changed it to
    one entry a line and got rid of the global object in json.
    2. Add a profiling to monitor the size of keys with noTTL in a group
    3. Switch to use concurrent_hash_map to protect the group and detail
    profiling
    4. change some field from int64 to int32 to save some memory
    
    Test Plan:
    make fast_tests
    production testing on profiling
    Note that all the code touched in this diff is not on critical path if
    profiling is turned off. This is staging for enabling profiling on h2g
    machines.
    
    Reviewers: myang, mwilliams, ps
    
    Reviewed By: mwilliams
    
    CC: ps, mwilliams
    
    Differential Revision: 352855
  3. [Perf] Reduce o_set overhead

    markw65 authored and scottmac committed Oct 18, 2011
    Summary:
    ObjectData's o_set family of functions all took a bool flag "forInit". The flag
    was used to bypass access checks, and was only used when initializing an
    ObjectData from hphpi, and from o_setArray. This meant that we were always
    passing in, and checking a mostly unused parameter. In addition, Object's o_set
    family didnt have the flag. code-gen didnt differentiate the two cases, and so
    in some cases was passing the class name as the "forInit" flag. Bizarrely, this
    mostly worked, because the class-name would be converted to true, and access
    would be allowed (which is usually the right thing to do in correct programs).
    
    With this diff, ObjectData's o_set family matches the Object o_set family,
    solving the correctness problem, and also reducing the call overhead by dropping
    a parameter.
    
    Test Plan: fast_tests slow_tests
    
    Reviewers: qigao, myang
    
    Reviewed By: myang
    
    CC: ps, mwilliams, myang, qigao
    
    Differential Revision: 346544
  4. [Fix] Misc reference handling buglets exposed by enabling inlining

    markw65 authored and scottmac committed Oct 19, 2011
    Summary:
     - in f($x, $x &= $y), where f takes its first param by reference, we would
       pass a reference to $x after the assignment, rather than before it (this
       happened independent of inlining).
     - in f(g(x)) if g returned by reference, and f did not take its param by
       reference, f could end up with a reference to the result of g anyway, due to
       copy constructor elision (again, independent of inlining)
     - there was a similar problem when a return-by-reference function got inlined.
       The return value could be destroyed before it was used (resulting in a crash in
       one of the added test cases), or it could just end up refering to the wrong
       thing.
     - in $a = &f(), if f returned by value, and got inlined, $a could end up bound
       to the result of f() (rather than bound to a copy of the result of f())
    
    In order to expose the return-by-reference issue, I had to increase the
    inliner's agressiveness. So Ive changed it from a bool, to an int and used it as
    the max "cost" for a function.
    
    To minimize extra temps, I added the return value's refness to the FunctionInfo.
    
    Test Plan: fast_tests, slow_tests and slow_tests with AutoInline=5 (there are
    still some failures, with the latter - will address separately).
    
    Reviewers: qigao, myang
    
    Reviewed By: myang
    
    CC: ps, mwilliams, myang
    
    Differential Revision: 348039
    
    Task ID: 630786
  5. [Fix/hphpd] Only escape the cases needed

    qigao authored and scottmac committed Oct 27, 2011
    Summary:
    This diff makes it hphpd command line tokenizer only escape the cases
    that are needed so that it doesn't do any inappropriate escaping.
    
    Test Plan:
    make fast_tests
    the case in the task
    
    Reviewers: mwilliams
    
    Reviewed By: mwilliams
    
    CC: ps, mwilliams, qigao
    
    Differential Revision: 351968
    
    Task ID: 778864
  6. [Fix] Fix bug in chunked post data

    myang authored and scottmac committed Oct 28, 2011
    Summary:
    The runtime option AlwaysPopulateRawPostData was misused to discard the post
    data rather than only to decide whether to populate $HTTP_RAW_POST_DATA. The
    purpose of discarding post data was an memory optimization on video data
    because the video data is alreay streamed into a temp file so keep the extra
    video data as post data in its entirety isn't needed. However, post data is
    generally needed for non-video data. I fixed that by removing the
    AlwaysPopulateRawPostData check in read_all_post_data.
    
    Test Plan:
    make fast_tests
    <?php
    echo strlen($_POST['foo']);
    Use html form to post data:
    <form action="/temp.php" method="post">
    <input type="hidden" name="foo" value="large data"  /> <input type="submit" />
    </form>
    Before the fix, the returned value is about 4000 due to truncated post data.
    Observed correct value after the fix.
    
    Reviewers: mwilliams, qigao
    
    Reviewed By: mwilliams
    
    CC: hphp-diffs@lists, ps, mwilliams, myang
    
    Differential Revision: 352127
  7. [Fix] Guard AnalysisResult::m_files with a lock

    markw65 authored and scottmac committed Oct 27, 2011
    Summary: For parse-on-demand, we were checking to see if a file had already
    been parsed without aquiring a lock. That could result in a crash if files were
    inserted during the lookup.
    
    Test Plan: Running the command from the task resulted in a crash once in about
    10 tries before the fix. After the fix I ran it 3000 times with no failures.
    
    Reviewers: qigao, myang
    
    Reviewed By: qigao
    
    CC: ps, mwilliams, qigao
    
    Differential Revision: 351734
    
    Task ID: 778331
  8. Mask out xhprof for memory allocation tracking

    ps authored and scottmac committed Oct 22, 2011
    Summary:
    When xhprof is enabled, it will allocate quite a bit of memory
    and this can throw off normal memory allocation statistics.  Mask these
    allocations since it is not relevant for measurements.
    
    Test Plan:
    xhprof_enable() followed by memory_get_allocation() seeing no
    increase in allocation memory.
    
    Reviewers: je
    
    Reviewed By: je
    
    CC: jasont, ps, mwilliams, je
    
    Differential Revision: 349035
  9. [HPHPi] Use ParserBase::IsClosureName to check closure name

    myang authored and scottmac committed Oct 27, 2011
    Summary:
    Two places in HPHPi are changed to use ParserBase::IsClosureName to
    check closure name to avoid ad-hoc code.
    
    Test Plan: make fast_tests
    
    Reviewers: mwilliams, qigao
    
    Reviewed By: mwilliams
    
    CC: hphp-diffs@lists, ps, mwilliams
    
    Differential Revision: 351791
  10. [Fix/hphpd] remove the trailing ';' for '=' command

    qigao authored and scottmac committed Oct 27, 2011
    Summary:
    In a recent change, () were added to wrap the expression for '=', which
    made ';' in the expression a syntax error. We were thinking on a general
    fix but it seems hard to do without calling php parser for the command
    line. This diff fixes one common benign case with traling ';', which used
    to work before the () were added.
    
    Test Plan:
    make fast_tests
    tried with hphpd on command line
    hphpd> =123;
    123
    
    Reviewers: mwilliams, myang
    
    Reviewed By: myang
    
    CC: ps, mwilliams, myang, qigao
    
    Differential Revision: 351726
    
    Task ID: 747161
  11. [Fix] Do not allocate user function id for certain names

    myang authored and scottmac committed Oct 27, 2011
    Summary:
    I made a change not to allocate user function id for names resulted from
    create_function and closures. I also removed the warning message, as long
    as we have a substantial user function names have integer ids, there will
    be some benefit even though some "late comers" will have to go though a
    lookup. The warning message was causing some tests to fail.
    
    Test Plan:
    make fast_tests
    load www sandbox
    run server mode flib test
    
    Reviewers: mwilliams, qigao
    
    Reviewed By: qigao
    
    CC: hphp-diffs@lists, ps, mwilliams, qigao, myang
    
    Differential Revision: 351742
  12. Add new TestTraits to TestCodeRun and fix hphpc accordingly

    ottoni authored and scottmac committed Oct 25, 2011
    Summary:
    I've recently learned a few more nuances about traits.  I added some
    new tests to TestCodeRun, and fixed the following cases:
    
    1. abstract trait methods may be provided by a base class of the class
       using the trait
    
    2. abstract trait methods may be provided by other traits used in the
       same class
    
    3. trait methods and static properties can be accessed via
       trait_name::blah.
    
    Item 3 abore required enabling code generation for trait classes.
    
    Test Plan:
    make fast_tests
    make slow_tests
    built www and checked output CPP code against previous
    
    Reviewers: mwilliams, myang, qigao
    
    Reviewed By: mwilliams
    
    CC: andrewparoski, ps, mwilliams
    
    Differential Revision: 350654
    
    Task ID: 758990
  13. [Fix/hphpd] Fix bugs in server api

    qigao authored and scottmac committed Oct 25, 2011
    Summary:
    This diff fixes the issue of interruping for the second time causing the
    server to abort. It also makes the state machine more clear and guards
    mroe strict so that user retries are unlikely to cause issues and leave
    server in an error state.
    
    Note: there are some generated files change that are not because of this
    diff.
    
    Test Plan:
    make fast_tests
    manually tried more functionalities
    
    Reviewers: myang
    
    Reviewed By: myang
    
    CC: tuomaspelkonen, ps, mwilliams, myang
    
    Differential Revision: 350417
    
    Task ID: 753544
Commits on Nov 28, 2011
  1. [Fix/HPHPi] Increase maximum function id

    myang authored and scottmac committed Oct 25, 2011
    Summary:
    To suppress the warning as the number of functions can exceed the current
    limit: HipHop Warning: Maximum function id reached: 65536.
    
    Test Plan:
    make fast_tests
    run server mode flib test and make sure that no warning as shown above.
    
    Reviewers: qigao, mwilliams
    
    Reviewed By: qigao
    
    CC: hphp-diffs@lists, ps, mwilliams, qigao
    
    Differential Revision: 350451
  2. [Perf/Fix/HPHPi] Use the method table in class eval state for lookup

    myang authored and scottmac committed Oct 19, 2011
    Summary:
    Each class statement AST node has a method table that contains only the
    methods in the class, but not any of the inherited methods. When a class is
    eval'ed, a ClassEvalState is created which contains among other things all
    the methods that the class should have, including all the inherited methods.
    When resolving a static class method call (i.e., finding a class method for
    a given class name), we can take advantage of the inclusive method table in
    the ClassEvalState, rather than redo the search along the class hierarchy
    for methods in parent classes.
    
    Second, I noticed that the m_marker in ClassStatement is always set. From the
    comments it meant to indicate whether the class is top-level and therefore
    should be hoisted upfront. I fixed that and there was one test failing because
    HPHPi starts to raise error as expected.
    
    Test Plan:
    make fast_tests
    flib/unit test
    (1) Error case:
    
    <?php
    $a = bar();
    if ($a) {
      class fOO extends Unknown {}
    } else {
      class Foo extends unknOwn {}
    }
    function bar() { return 123; }
    
    Before: no error reported
    After:
    HipHop Fatal error: Class 'Unknown' does not exist.
    
    (2) micro benchmark
    <?php
    class A0 {
      public static function __callStatic($name, $arguments) {
         return $name;
      }
    }
    class A1 extends A0 {}
    class A2 extends A1 {}
    class A3 extends A2 {}
    class A4 extends A3 {}
    class A5 extends A4 {}
    class A6 extends A5 {}
    class A7 extends A6 {}
    function foo() {
      for ($i = 0; $i < 1000000; $i++) {
        $r = A7::Test();
      }
      return $r;
    }
    var_dump(foo());
    
    Before
    string(4) "Test"
    
    real    0m6.238s
    user    0m6.208s
    sys     0m0.035s
    
    After
    string(4) "Test"
    
    real    0m2.783s
    user    0m2.757s
    sys     0m0.033s
    
    Reviewers: mwilliams, qigao
    
    Reviewed By: qigao
    
    CC: hphp-diffs@lists, ps, mwilliams, qigao
    
    Differential Revision: 349254
  3. [Fix] Fix bug in FileCache::fileSize

    myang authored and scottmac committed Oct 25, 2011
    Summary: When uncompressing the file, we should use buf.clen instead of
    buf.len.
    
    Test Plan:
    make fast_tests
    make slow_tests
    
    Reviewers: qigao, mwilliams, ottoni
    
    Reviewed By: qigao
    
    CC: hphp-diffs@lists, ps, mwilliams, qigao
    
    Differential Revision: 349850
    
    Task ID: 754631
  4. [Fix] Dont pass invalid keys to ArrayData::remove

    markw65 authored and scottmac committed Oct 19, 2011
    Summary: Variant::remove(CVarRef) could end up passing a "null" key to ArrayData::remove if given an invalid key (array or object). In the DEBUG build, this asserted, and in the release build it removed the element with key 0.
    
    The new test case produced incorrect results in the release build, and asserted in the debug build.
    
    Task ID: #768801
    
    Blame Rev:
    
    Reviewers: kma qigao
    
    CC:
    
    Test Plan: fast_tests slow_tests (new test case added).
    
    Revert Plan:
    
    Tags:
    
    Platform Impact (PUBLIC):
    
    Differential Revision: 347370
Commits on Nov 3, 2011
  1. Fix on memcache, strings coming from libmemcache are not guaranteed t…

    dpaneda committed Nov 3, 2011
    …o be null terminated, so we have to copy them