-
Notifications
You must be signed in to change notification settings - Fork 8k
Trigger JIT tracing&compilation more often in tests #12250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 26 commits
ef6db9f
4e504e1
2c965c1
ca53391
88cf395
b3a2b3e
a979682
94714eb
f397961
b4ac0e2
8c92c0e
8701969
104f03f
c5af745
c30b9b3
e11a67a
665e09c
f822a56
4aa113f
543b52b
a06eea9
8de7066
1a4d450
96f7b74
84373f0
f837597
4caf2d6
12281a4
dbd4005
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,7 @@ jobs: | |
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=tracing | ||
| - name: Test OpCache | ||
| uses: ./.github/actions/test-linux | ||
| with: | ||
|
|
@@ -116,6 +116,7 @@ jobs: | |
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| - name: Test Function JIT | ||
| # ASAN frequently timeouts. Each test run takes ~90 minutes, we can | ||
| # avoid running into the 6 hour timeout by skipping the function JIT. | ||
|
|
@@ -127,8 +128,7 @@ jobs: | |
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=1205 | ||
| -d opcache.jit=function | ||
| - name: Verify generated files are up to date | ||
| uses: ./.github/actions/verify-generated-files | ||
| - name: Notify Slack | ||
|
|
@@ -198,23 +198,23 @@ jobs: | |
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=tracing | ||
| - name: Test OpCache | ||
| uses: ./.github/actions/test-linux | ||
| with: | ||
| runTestsParameters: >- | ||
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| - name: Test Function JIT | ||
| uses: ./.github/actions/test-linux | ||
| with: | ||
| runTestsParameters: >- | ||
| ${{ matrix.run_tests_parameters }} | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=1205 | ||
| -d opcache.jit=function | ||
| - name: Notify Slack | ||
| if: failure() | ||
| uses: ./.github/actions/notify-slack | ||
|
|
@@ -261,26 +261,23 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.protect_memory=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=tracing | ||
| - name: Test OpCache | ||
| uses: ./.github/actions/test-macos | ||
| with: | ||
| testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache | ||
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.protect_memory=1 | ||
| -d opcache.jit=disable | ||
| - name: Test Function JIT | ||
| uses: ./.github/actions/test-macos | ||
| with: | ||
| testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT | ||
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.protect_memory=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=1205 | ||
| -d opcache.jit=function | ||
| - name: Verify generated files are up to date | ||
| uses: ./.github/actions/verify-generated-files | ||
| - name: Notify Slack | ||
|
|
@@ -324,6 +321,7 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=tracing | ||
| - name: Upload Test Coverage to Codecov.io | ||
| if: always() | ||
| run: bash <(curl -s https://codecov.io/bash) | ||
|
|
@@ -375,9 +373,56 @@ jobs: | |
| echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini | ||
| echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_max_root_traces=1000000 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_max_side_traces=1000000 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_max_exit_counters=1000000 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini | ||
| echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini | ||
| echo memory_limit=-1 >> /etc/php.d/opcache.ini | ||
| php -v | ||
| - name: Test PHPSeclib | ||
|
||
| if: always() | ||
| run: | | ||
| git clone https://github.com/phpseclib/phpseclib --branch=master | ||
| cd phpseclib | ||
| git checkout 259bd9f1e8af11726ed74acf527c2c046549061b | ||
| export ASAN_OPTIONS=exitcode=139 | ||
| export PHPSECLIB_ALLOW_JIT=1 | ||
| php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
| php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? | ||
| git clean -ffdx | ||
| - name: Test Psalm | ||
| if: matrix.branch.ref != 'PHP-8.0' | ||
| run: | | ||
| git clone https://github.com/vimeo/psalm --branch=master | ||
| cd psalm | ||
| git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457 | ||
| export ASAN_OPTIONS=exitcode=139 | ||
| export PSALM_ALLOW_XDEBUG=1 | ||
| php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
| php ./psalm --no-cache || exit $? | ||
| - name: Test PHPStan | ||
| if: matrix.branch.ref != 'PHP-8.0' | ||
| run: | | ||
| git clone https://github.com/phpstan/phpstan-src | ||
| cd phpstan-src | ||
| git checkout 1f608dc6a560f4a5accc854add8e005da0e7ceea | ||
| sed 's/80299/89999/g' -i conf/config.neon | ||
| php /usr/bin/composer install --no-progress --ignore-platform-reqs | ||
| export ASAN_OPTIONS=exitcode=139 | ||
| php bin/phpstan clear-result-cache | ||
| php bin/phpstan || exit $? | ||
| - name: Test AMPHP | ||
| if: matrix.branch.ref != 'PHP-8.0' | ||
| run: | | ||
| sudo apt-get update && sudo apt-get install -y libuv1-dev | ||
| git clone https://github.com/amphp/ext-uv --depth 1 | ||
| cd ext-uv | ||
| phpize && ./configure --enable-debug && make -j$(nproc) && sudo make install | ||
| cd .. | ||
| echo extension=uv >> /etc/php.d/uv.ini | ||
danog marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server" | ||
| X=0 | ||
| for repository in $repositories; do | ||
|
|
@@ -546,20 +591,23 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| --file-cache-prime | ||
| - name: Test File Cache (prime shm, use shm) | ||
| uses: ./.github/actions/test-linux | ||
| with: | ||
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| --file-cache-use | ||
| - name: Test File Cache (prime shm, use file) | ||
| uses: ./.github/actions/test-linux | ||
| with: | ||
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| --file-cache-use | ||
| -d opcache.file_cache_only=1 | ||
| - name: Test File Cache Only (prime) | ||
|
|
@@ -568,6 +616,7 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| --file-cache-prime | ||
| -d opcache.file_cache_only=1 | ||
| - name: Test File Cache Only (use) | ||
|
|
@@ -576,6 +625,7 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| --file-cache-use | ||
| -d opcache.file_cache_only=1 | ||
| - name: Verify generated files are up to date | ||
|
|
@@ -676,6 +726,7 @@ jobs: | |
| --msan | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.jit=disable | ||
| - name: Verify generated files are up to date | ||
| uses: ./.github/actions/verify-generated-files | ||
| - name: Notify Slack | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,7 +129,7 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| ${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }} | ||
| ${{ matrix.asan && '-d opcache.jit=disable' || '-d opcache.jit=tracing' }} | ||
|
||
| ${{ matrix.asan && '--asan -x' || '' }} | ||
| - name: Verify generated files are up to date | ||
| if: ${{ !matrix.asan }} | ||
|
|
@@ -163,8 +163,7 @@ jobs: | |
| runTestsParameters: >- | ||
| -d zend_extension=opcache.so | ||
| -d opcache.enable_cli=1 | ||
| -d opcache.protect_memory=1 | ||
| -d opcache.jit_buffer_size=16M | ||
| -d opcache.jit=tracing | ||
| - name: Verify generated files are up to date | ||
| uses: ./.github/actions/verify-generated-files | ||
| WINDOWS: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --TEST-- | ||
| Bug #11917 (primitives seem to be passed via reference instead of by value under some conditions when JIT is enabled on windows) | ||
danog marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --INI-- | ||
| opcache.enable=1 | ||
| opcache.enable_cli=1 | ||
| opcache.protect_memory=1 | ||
| opcache.jit_buffer_size=64M | ||
| opcache.jit=1255 | ||
| opcache.jit_max_root_traces=1000000 | ||
| opcache.jit_max_side_traces=1000000 | ||
| opcache.jit_max_exit_counters=1000000 | ||
| opcache.jit_hot_loop=1 | ||
| opcache.jit_hot_func=1 | ||
| opcache.jit_hot_return=1 | ||
| opcache.jit_hot_side_exit=1 | ||
| --EXTENSIONS-- | ||
| opcache | ||
| --FILE-- | ||
| <?php | ||
| $a = [2147483647,2147483647,2147483647,3,0,0,32,2147483584,127]; | ||
| echo crc32(json_encode(bitwise_small_split($a))) . "\n"; | ||
| echo crc32(json_encode(bitwise_small_split($a))) . "\n"; | ||
| echo crc32(json_encode(bitwise_small_split($a))) . "\n"; | ||
| echo crc32(json_encode(bitwise_small_split($a))) . "\n"; | ||
|
|
||
| function bitwise_small_split($val) | ||
| { | ||
| $split = 8; | ||
| $vals = []; | ||
|
|
||
| $mask = (1 << $split) - 1; | ||
|
|
||
| $i = $overflow = 0; | ||
| $len = count($val); | ||
| $val[] = 0; | ||
| $remaining = 31; | ||
|
|
||
| while ($i != $len) { | ||
| $digit = $val[$i] & $mask; | ||
|
|
||
| $val[$i] >>= $split; | ||
| if (!$overflow) { | ||
| $remaining -= $split; | ||
| $overflow = $split <= $remaining ? 0 : $split - $remaining; | ||
|
|
||
| if (!$remaining) { | ||
| $i++; | ||
| $remaining = 31; | ||
| $overflow = 0; | ||
| } | ||
| } elseif (++$i != $len) { | ||
| $tempmask = (1 << $overflow) - 1; | ||
| $digit |= ($val[$i] & $tempmask) << $remaining; | ||
| $val[$i] >>= $overflow; | ||
| $remaining = 31 - $overflow; | ||
| $overflow = $split <= $remaining ? 0 : $split - $remaining; | ||
| } | ||
|
|
||
| $vals[] = $digit; | ||
| } | ||
|
|
||
| while ($vals[count($vals) - 1] == 0) { | ||
| unset($vals[count($vals) - 1]); | ||
| } | ||
|
|
||
| return array_reverse($vals); | ||
| } | ||
| ?> | ||
| --EXPECT-- | ||
| 48207660 | ||
| 48207660 | ||
| 48207660 | ||
| 48207660 | ||
Uh oh!
There was an error while loading. Please reload this page.