Skip to content

[ImgBot] Optimize images #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[ImgBot] Optimize images #1

wants to merge 1 commit into from

Conversation

imgbot[bot]
Copy link

@imgbot imgbot bot commented Jan 23, 2021

Beep boop. Your images are optimized!

Your image file size has been reduced!

Details
File Before After Percent reduction
/ext/standard/tests/image/200x100.gif 1.01kb 0.21kb 79.15%
/ext/gd/tests/bug64641.png 1.37kb 0.48kb 65.17%
/ext/standard/tests/image/bug71848.jpg 0.68kb 0.28kb 59.23%
/ext/standard/tests/image/200x100.png 0.67kb 0.27kb 59.00%
/ext/standard/tests/image/200x100.jpg 0.97kb 0.41kb 57.62%
/ext/standard/tests/image/bug13213.jpg 0.58kb 0.28kb 52.18%
/ext/gd/tests/bug73614.png 2.59kb 1.36kb 47.44%
/ext/gd/tests/imagepolygon_aa.png 1.86kb 0.98kb 47.24%
/ext/exif/tests/bug68799.jpg 0.72kb 0.38kb 47.07%
/sapi/fuzzer/corpus/exif/bug68799.jpg 0.72kb 0.38kb 47.07%
/sapi/fuzzer/corpus/exif/test1.jpg 0.51kb 0.28kb 45.51%
/ext/exif/tests/test1.jpg 0.51kb 0.28kb 45.51%
/ext/standard/tests/image/test1pix.jpg 0.51kb 0.28kb 45.51%
/ext/gd/tests/bug73272.png 0.72kb 0.41kb 42.91%
/ext/gd/tests/imageellipse_basic.png 1.44kb 0.83kb 42.33%
/ext/gd/tests/libgd00100.png 2.05kb 1.19kb 42.13%
/ext/gd/tests/bug77943.png 2.14kb 1.29kb 39.74%
/sapi/fuzzer/corpus/exif/test5.jpg 0.59kb 0.36kb 39.47%
/ext/exif/tests/test5.jpg 0.59kb 0.36kb 39.47%
/ext/gd/tests/logo_noise.png 24.59kb 15.72kb 36.07%
/ext/gd/tests/bug50194.png 2.76kb 1.82kb 33.96%
/ext/gd/tests/imagecreatefromtga.png 2.50kb 1.77kb 29.19%
/ext/gd/tests/imageopenpolygon.png 1.29kb 0.92kb 29.06%
/ext/exif/tests/bug68547.jpg 0.70kb 0.50kb 27.91%
/ext/exif/tests/test4.jpg 0.70kb 0.50kb 27.91%
/sapi/fuzzer/corpus/exif/test4.jpg 0.70kb 0.50kb 27.91%
/ext/gd/tests/bug43828.png 0.64kb 0.47kb 26.98%
/ext/exif/tests/bug74428/bug74428.jpg 1.86kb 1.36kb 26.92%
/ext/gd/tests/bug72604.png 0.68kb 0.50kb 26.71%
/sapi/fuzzer/corpus/exif/test3.jpg 1.21kb 0.93kb 23.23%
/ext/exif/tests/test3.jpg 1.21kb 0.93kb 23.23%
/ext/exif/tests/test2私はガラスを食べられます.jpg 1.21kb 0.93kb 23.23%
/sapi/fuzzer/corpus/exif/test2.jpg 1.21kb 0.93kb 23.23%
/sapi/fuzzer/corpus/exif/test22.jpg 1.21kb 0.93kb 23.23%
/ext/exif/tests/test2.jpg 1.21kb 0.93kb 23.23%
/sapi/fuzzer/corpus/exif/test6.jpg 1.21kb 0.93kb 23.23%
/ext/gd/tests/imagesetthickness_basic.png 0.37kb 0.29kb 20.42%
/ext/gd/tests/imagefilltoborder_basic.png 0.52kb 0.41kb 20.00%
/ext/fileinfo/tests/resources/test.gif 0.04kb 0.03kb 18.60%
/ext/standard/tests/image/bug72278.jpg 11.89kb 10.17kb 14.49%
/ext/standard/tests/image/testAPP.jpg 11.89kb 10.17kb 14.47%
/ext/exif/tests/bug64739.jpg 4.70kb 4.02kb 14.40%
/ext/gd/tests/imagecolorallocatealpha_basic.png 0.55kb 0.47kb 14.34%
/ext/gd/tests/test.png 2.65kb 2.30kb 13.06%
/ext/gd/tests/imageconvolution_basic.png 0.96kb 0.87kb 9.30%
/ext/gd/tests/bug43475.png 4.59kb 4.37kb 4.64%
/ext/exif/tests/exif_encoding_crash.jpg 7.42kb 7.08kb 4.61%
/sapi/fuzzer/corpus/exif/exif_encoding_crash.jpg 7.42kb 7.08kb 4.61%
/ext/fileinfo/tests/68731.gif 1.10kb 1.08kb 1.86%
/ext/gd/tests/bug43121.gif 0.34kb 0.33kb 1.73%
/ext/exif/tests/redhat-bug1362571.jpg 16.24kb 16.00kb 1.47%
/ext/exif/tests/bug72735/panasonic.jpg 16.24kb 16.00kb 1.47%
/ext/exif/tests/bug50845.jpg 784.77kb 776.34kb 1.07%
/ext/exif/tests/bug77184/DJI_0245_tiny.jpg 25.39kb 25.16kb 0.93%
/ext/exif/tests/bug72819/bug72819.jpg 32.00kb 31.72kb 0.87%
/ext/gd/tests/bug66005.png 0.42kb 0.42kb 0.47%
/ext/exif/tests/bug73115/bug73115.jpg 12.08kb 12.02kb 0.44%
/ext/exif/tests/bug72735/nokia.jpg 13.39kb 13.34kb 0.39%
/ext/exif/tests/bug62523_2.jpg 15.24kb 15.19kb 0.35%
/ext/exif/tests/bug62523_1.jpg 17.96kb 17.91kb 0.29%
/ext/exif/tests/bug50660/bug50660-1.jpg 24.07kb 24.02kb 0.22%
/ext/fileinfo/tests/bug67516.gif 12.06kb 12.03kb 0.20%
/ext/exif/tests/bug50660/bug50660-2.jpg 26.17kb 26.12kb 0.20%
/ext/exif/tests/sony.jpg 35.02kb 34.97kb 0.15%
/ext/pgsql/tests/php.gif 3.78kb 3.78kb 0.08%
/ext/gd/tests/bug67325.jpg 13.29kb 13.29kb 0.03%
/ext/exif/tests/bug72735/samsung.jpg 28.39kb 28.39kb 0.01%
Total : 1,196.05kb 1,156.24kb 3.33%

Black Lives Matter | 💰 donate | 🎓 learn | ✍🏾 sign

📝 docs | :octocat: repo | 🙋🏾 issues | 🏅 swag | 🏪 marketplace

*Total -- 1,196.05kb -> 1,156.24kb (3.33%)

/ext/standard/tests/image/200x100.gif -- 1.01kb -> 0.21kb (79.15%)
/ext/gd/tests/bug64641.png -- 1.37kb -> 0.48kb (65.17%)
/ext/standard/tests/image/bug71848.jpg -- 0.68kb -> 0.28kb (59.23%)
/ext/standard/tests/image/200x100.png -- 0.67kb -> 0.27kb (59%)
/ext/standard/tests/image/200x100.jpg -- 0.97kb -> 0.41kb (57.62%)
/ext/standard/tests/image/bug13213.jpg -- 0.58kb -> 0.28kb (52.18%)
/ext/gd/tests/bug73614.png -- 2.59kb -> 1.36kb (47.44%)
/ext/gd/tests/imagepolygon_aa.png -- 1.86kb -> 0.98kb (47.24%)
/ext/exif/tests/bug68799.jpg -- 0.72kb -> 0.38kb (47.07%)
/sapi/fuzzer/corpus/exif/bug68799.jpg -- 0.72kb -> 0.38kb (47.07%)
/sapi/fuzzer/corpus/exif/test1.jpg -- 0.51kb -> 0.28kb (45.51%)
/ext/exif/tests/test1.jpg -- 0.51kb -> 0.28kb (45.51%)
/ext/standard/tests/image/test1pix.jpg -- 0.51kb -> 0.28kb (45.51%)
/ext/gd/tests/bug73272.png -- 0.72kb -> 0.41kb (42.91%)
/ext/gd/tests/imageellipse_basic.png -- 1.44kb -> 0.83kb (42.33%)
/ext/gd/tests/libgd00100.png -- 2.05kb -> 1.19kb (42.13%)
/ext/gd/tests/bug77943.png -- 2.14kb -> 1.29kb (39.74%)
/sapi/fuzzer/corpus/exif/test5.jpg -- 0.59kb -> 0.36kb (39.47%)
/ext/exif/tests/test5.jpg -- 0.59kb -> 0.36kb (39.47%)
/ext/gd/tests/logo_noise.png -- 24.59kb -> 15.72kb (36.07%)
/ext/gd/tests/bug50194.png -- 2.76kb -> 1.82kb (33.96%)
/ext/gd/tests/imagecreatefromtga.png -- 2.50kb -> 1.77kb (29.19%)
/ext/gd/tests/imageopenpolygon.png -- 1.29kb -> 0.92kb (29.06%)
/ext/exif/tests/bug68547.jpg -- 0.70kb -> 0.50kb (27.91%)
/ext/exif/tests/test4.jpg -- 0.70kb -> 0.50kb (27.91%)
/sapi/fuzzer/corpus/exif/test4.jpg -- 0.70kb -> 0.50kb (27.91%)
/ext/gd/tests/bug43828.png -- 0.64kb -> 0.47kb (26.98%)
/ext/exif/tests/bug74428/bug74428.jpg -- 1.86kb -> 1.36kb (26.92%)
/ext/gd/tests/bug72604.png -- 0.68kb -> 0.50kb (26.71%)
/sapi/fuzzer/corpus/exif/test3.jpg -- 1.21kb -> 0.93kb (23.23%)
/ext/exif/tests/test3.jpg -- 1.21kb -> 0.93kb (23.23%)
/ext/exif/tests/test2私はガラスを食べられます.jpg -- 1.21kb -> 0.93kb (23.23%)
/sapi/fuzzer/corpus/exif/test2.jpg -- 1.21kb -> 0.93kb (23.23%)
/sapi/fuzzer/corpus/exif/test22.jpg -- 1.21kb -> 0.93kb (23.23%)
/ext/exif/tests/test2.jpg -- 1.21kb -> 0.93kb (23.23%)
/sapi/fuzzer/corpus/exif/test6.jpg -- 1.21kb -> 0.93kb (23.23%)
/ext/gd/tests/imagesetthickness_basic.png -- 0.37kb -> 0.29kb (20.42%)
/ext/gd/tests/imagefilltoborder_basic.png -- 0.52kb -> 0.41kb (20%)
/ext/fileinfo/tests/resources/test.gif -- 0.04kb -> 0.03kb (18.6%)
/ext/standard/tests/image/bug72278.jpg -- 11.89kb -> 10.17kb (14.49%)
/ext/standard/tests/image/testAPP.jpg -- 11.89kb -> 10.17kb (14.47%)
/ext/exif/tests/bug64739.jpg -- 4.70kb -> 4.02kb (14.4%)
/ext/gd/tests/imagecolorallocatealpha_basic.png -- 0.55kb -> 0.47kb (14.34%)
/ext/gd/tests/test.png -- 2.65kb -> 2.30kb (13.06%)
/ext/gd/tests/imageconvolution_basic.png -- 0.96kb -> 0.87kb (9.3%)
/ext/gd/tests/bug43475.png -- 4.59kb -> 4.37kb (4.64%)
/ext/exif/tests/exif_encoding_crash.jpg -- 7.42kb -> 7.08kb (4.61%)
/sapi/fuzzer/corpus/exif/exif_encoding_crash.jpg -- 7.42kb -> 7.08kb (4.61%)
/ext/fileinfo/tests/68731.gif -- 1.10kb -> 1.08kb (1.86%)
/ext/gd/tests/bug43121.gif -- 0.34kb -> 0.33kb (1.73%)
/ext/exif/tests/redhat-bug1362571.jpg -- 16.24kb -> 16.00kb (1.47%)
/ext/exif/tests/bug72735/panasonic.jpg -- 16.24kb -> 16.00kb (1.47%)
/ext/exif/tests/bug50845.jpg -- 784.77kb -> 776.34kb (1.07%)
/ext/exif/tests/bug77184/DJI_0245_tiny.jpg -- 25.39kb -> 25.16kb (0.93%)
/ext/exif/tests/bug72819/bug72819.jpg -- 32.00kb -> 31.72kb (0.87%)
/ext/gd/tests/bug66005.png -- 0.42kb -> 0.42kb (0.47%)
/ext/exif/tests/bug73115/bug73115.jpg -- 12.08kb -> 12.02kb (0.44%)
/ext/exif/tests/bug72735/nokia.jpg -- 13.39kb -> 13.34kb (0.39%)
/ext/exif/tests/bug62523_2.jpg -- 15.24kb -> 15.19kb (0.35%)
/ext/exif/tests/bug62523_1.jpg -- 17.96kb -> 17.91kb (0.29%)
/ext/exif/tests/bug50660/bug50660-1.jpg -- 24.07kb -> 24.02kb (0.22%)
/ext/fileinfo/tests/bug67516.gif -- 12.06kb -> 12.03kb (0.2%)
/ext/exif/tests/bug50660/bug50660-2.jpg -- 26.17kb -> 26.12kb (0.2%)
/ext/exif/tests/sony.jpg -- 35.02kb -> 34.97kb (0.15%)
/ext/pgsql/tests/php.gif -- 3.78kb -> 3.78kb (0.08%)
/ext/gd/tests/bug67325.jpg -- 13.29kb -> 13.29kb (0.03%)
/ext/exif/tests/bug72735/samsung.jpg -- 28.39kb -> 28.39kb (0.01%)

Signed-off-by: ImgBotApp <[email protected]>
pull bot pushed a commit that referenced this pull request Apr 27, 2021
When encountering the following SSA graph:

    BB1:
    #2.T1 [string] = COALESCE #1.CV0($str) [null, string] BB2

    BB2:
    #5.T1 [string] = QM_ASSIGN string("")

    BB3:
    #7.X1 [string] = Phi(#2.X1 [string], #5.X1 [string])
    FREE #7.T1 [string]

We would currently determine that #7, #5 are dead, and eliminate
the FREE and QM_ASSIGN. However, we cannot eliminate #2, as
COALESCE is also responsible for control flow.

Fix this my marking all non-CV phis as live to start with. This
can be relaxed to check the kind of the source instruction, but
I couldn't immediately come up with a case where it would be
useful.
pull bot pushed a commit that referenced this pull request Jul 3, 2021
1. For statement "$a->change($a = array("a" => range(1, 5)));", the
following opcodes will be generated:

  0002 ASSIGN CV0($a) V1
  0003 INIT_METHOD_CALL 1 CV0($a) string("change")
  0004 INIT_NS_FCALL_BY_NAME 2 string("A\range")
  0005 SEND_VAL_EX int(1) 1
  0006 SEND_VAL_EX int(5) 2
  0007 V1 = DO_FCALL_BY_NAME

The updates in function zend_jit_init_fcall(), zend_jit_send_val() and
zend_jit_do_fcall() are made to support INIT_NS_FCALL_BY_NAME,
SEND_VAL_EX and DO_FCALL_BY_NAME respectively.

2. For method $change(), opcode RECV is used to obtain the argument:

  0000 #1.CV0($config) [rc1, rcn, array of [any, ref]] = RECV 1

Accordingly the updates in functions zend_jit_recv() and
zend_jit_verify_arg_type() are made.

3. For statement "array_keys($config["a"])", the following opcodes will
be generated:

  0001 INIT_NS_FCALL_BY_NAME 1 string("A\array_keys")
  0002 CHECK_FUNC_ARG 1
  0003 #3.V1 [ref, rc1, rcn, any] = FETCH_DIM_FUNC_ARG #1.CV0($config)
     ... -> #2.CV0($config) [rc1, rcn, ...
  0004 SEND_FUNC_ARG #3.V1 [ref, rc1, rcn, any] 1
  0005 #4.V1 [ref, rc1, rcn, any] = DO_FCALL_BY_NAME

CHECK_FUNC_ARG and SEND_FUNC_ARG are not supported before. See the
updates in functions zend_jit_check_func_arg() and zend_jit_send_var().

Besides, a new path is covered in macro OBJ_RELEASE when leaving.
pull bot pushed a commit that referenced this pull request Jul 3, 2021
The opcodes for function $foo are:

  0001 INIT_FCALL 1 96 string("var_dump")
  0002 #2.T1 [null, long] = FETCH_DIM_R array(...) #1.CV0($n) [...]
  0003 SEND_VAL #2.T1 [null, long] 1
  0004 DO_ICALL
  0005 RETURN null

Opcode FETCH_DIM_R is not touched before, and the updates in function
zend_jit_fetch_dim_read() are made to support it.
As different types of arguments are used for $foo, several cases in
function zend_jit_fetch_dimension_address_inner() are covered as well.

Besides, opcode DO_ICALL can reach one site of cold code in function
zend_jit_do_fcall().
pull bot pushed a commit that referenced this pull request Jul 3, 2021
Opcodes for $Test::method are:

  BB0:
  0000 #0.T0 [rcn, any] = FETCH_OBJ_R THIS string("prop")
  0001 #1.T0 [bool] RANGE[0..1] = JMPZ_EX #0.T0 [rcn, any] BB3

  BB1:
  0002 #2.T1 [rcn, any] = FETCH_OBJ_R THIS string("prop")
  0003 INIT_METHOD_CALL 0 #2.T1 [rcn, any] string("method2")
  0004 #3.V1 [ref, rc1, rcn, any] = DO_FCALL
  ...

New path is covered in functions zend_jit_fetch_obj() and
zend_jit_zval_copy_deref() for FETCH_OBJ_R THIS opcode.

New path is covered in function zend_jit_init_method_call() for opcode
INIT_METHOD_CALL.

Major chagnes lie in function zend_jit_bool_jmpznz() to support opcode
JMPZ_EX.

Note that macro ZVAL_DTOR_FUNC is updated to remove the hard-coded use
of REG0.
pull bot pushed a commit that referenced this pull request Jul 3, 2021
Opcodes for $test are:

  BB0:
  0000 #1.CV0($char_code) [rc1, rcn, any] = RECV 1

  BB1:
  0001 #2.T1 [rc1, ...] = BW_AND #1.CV0($char_code) ...
  0002 #3.T2 [bool] RANGE[0..1] = BOOL_NOT #2.T1 [rc1, ...]
  0003 #4.T1 [bool] RANGE[0..1] = IS_EQUAL #1.CV0($char_code) ...
  0004 JMPZ #4.T1 [bool] RANGE[0..1] BB3
  ...

New path is covered in function zend_jit_long_math_helper() for opcode
BW_AND.

New path is covered in function zend_jit_bool_jmpznz() for opcode
BOOL_NOT.

Major changes lie in functions zend_jit_cmp(), zend_jit_cmp_slow() and
zend_jit_check_exception_undef_result() to support opocdes IS_EQUAL and
JMPZ.
pull bot pushed a commit that referenced this pull request Jul 3, 2021
* JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported.
See [2]. For example, `add x0, x1, php#4096` would be encoded by DynASM
into `add x0, x1, #1, lsl #12` directly.

In this patch, a helper is added to check whether an immediate value is
in the two allowed ranges: (1) 0 to 4095, and (2) LSL #12 on all the
values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] LuaJIT/LuaJIT#718
[2]
https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

* Deprecatd CMP_IMM/ADD_SUB_IMM and add test cases

Macros CMP_IMM and ADD_SUB_IMM are deprecated and instead we use
this helper to guard the immediate encoding.

Add two 64-bit only test cases, since 64-bit integers are used
and tested inside.

Change-Id: I0b42d4617b40372e2f4ce5b6ad31a4ddb7d89e49
pull bot pushed a commit that referenced this pull request Feb 4, 2022
pull bot pushed a commit that referenced this pull request Feb 4, 2022
pull bot pushed a commit that referenced this pull request Feb 4, 2022
* PHP-8.0:
  Tracing JIT: Fixed incorrect assumtion about temporary variable types clobbered by *_ROPE instructions
  Revert "Fix bug GH-1 (mysqli_sql_exception->sqlstate is inaccessible)"
  Fix bug GH-1 (mysqli_sql_exception->sqlstate is inaccessible)
pull bot pushed a commit that referenced this pull request Feb 4, 2022
* PHP-8.1:
  Tracing JIT: Fixed incorrect assumtion about temporary variable types clobbered by *_ROPE instructions
  Revert "Fix bug GH-1 (mysqli_sql_exception->sqlstate is inaccessible)"
  Fix bug GH-1 (mysqli_sql_exception->sqlstate is inaccessible)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant