Skip to content

Implement Changes Requested in PR Review #8

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

Merged
merged 5 commits into from
May 1, 2020
Merged

Implement Changes Requested in PR Review #8

merged 5 commits into from
May 1, 2020

Conversation

kooldev
Copy link

@kooldev kooldev commented Apr 28, 2020

Implements changes requested in php#5394.

@kooldev kooldev changed the title Fix Userland Attribute Validation Implement Changes Requested in PR Review Apr 30, 2020
@beberlei beberlei merged commit e870452 into beberlei:attributes_v2_rfc May 1, 2020
@beberlei
Copy link
Owner

beberlei commented May 1, 2020

@kooldev thank you! I saw Nikitas comments yesterday and you seem to have been much faster :-)

@kooldev
Copy link
Author

kooldev commented May 1, 2020

@beberlei I was pretty fast but should have marked the PR as [WIP] or something... It passes all tests and has no memory leaks but it is missing support for file-based caching in opcache. I was not able to finish that yet. I also did not address all the issues on the list. Support for printing attributes AST is easy to do, I had this in my first annotations PR and will port the code and submit another PR to your PHP repo. As far as opcache is concerned I need to work this out in a separate PR that will likely require some help. I will create these today / tomorrow.

I did not address the topics that Nikita identified to be RFC-related. We need to clarify them and adjust the code in an appropriate way.

@kooldev kooldev deleted the FixAttributeValidation branch May 1, 2020 08:48
beberlei pushed a commit that referenced this pull request Jun 19, 2021
The following opcodes would be generated:

  ...
  BB1:
  0003 JMP BB3

  BB2:
  0004 INIT_FCALL 1 96 string("chr")
  0005 #10.T3 [long] = SR #3.CV0($int) [long] #7.CV2($i) ...
  0006 #11.T4 [long] RANGE[0..127] = BW_AND #10.T3 [long] ...
  0007 #12.T3 [long] RANGE[128..255] = BW_OR #11.T4 [long] ...
  0008 SEND_VAL #12.T3 [long] RANGE[128..255] 1
  0009 #13.V3 [ref, rc1, rcn, any] = DO_ICALL
  0010 ASSIGN_OP (CONCAT) #6.CV1($out) [rc1, rcn, string]
  0011 ADD #7.CV2($i)... int(7) #7.CV2($i) ... -> #15.CV2($i) ...

  BB3:
  0012 #8.T4 [long] = SR #3.CV0($int) #7.CV2($i) [long, double]
  0013 #9.T3 [bool] RANGE[0..1] = IS_SMALLER int(128) #8.T4
  0014 JMPNZ #9.T3 [bool] RANGE[0..1] BB2
  ...

Main changes are:
1. SR opcode covers new path in function zend_jit_long_math_helper().
2. BW_AND and BW_OR opcodes are supported. See macro LONG_OP.
3. Function zend_jit_concat_helper() is added to support ASSIGN_OP
opcode. Speficically, CONCAT and FAST_CONCAT is supported for statements
"$out .= ...".
4. New path is covered in function zend_jit_cmp_long_long() by
IS_SMALLER opcode.
5. New path is covered in macros ZVAL_PTR_DTOR and ZVAL_DTOR_FUNC when
leaving.
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.

2 participants