Skip to content
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

Move custom code for Painless "execute" method into external phase #51841

Open
jdconrad opened this issue Feb 4, 2020 · 1 comment
Open

Move custom code for Painless "execute" method into external phase #51841

jdconrad opened this issue Feb 4, 2020 · 1 comment
Assignees
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring Team:Core/Infra Meta label for core/infra team

Comments

@jdconrad
Copy link
Contributor

jdconrad commented Feb 4, 2020

SFunction and FunctionNode contain custom code for generating the "execute" method for Painless contexts. All this code should decorate the ir tree as internal nodes inserted into the ir tree via an external phase. There's no reason for SFunction and FunctionNode to be aware of the "execute" method.

Relates to: #49869

@jdconrad jdconrad added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring labels Feb 4, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@jdconrad jdconrad self-assigned this Feb 4, 2020
jdconrad added a commit that referenced this issue Feb 11, 2020
This change moves almost all of the customized code required to decorate 
the execute method into an external phase. This external phase operates 
only on the ir tree after the user tree has generated the initial ir tree from 
user specified code. The external phase uses ir nodes to create the 
necessary customized code instead of writing asm directly. This is a first 
example of modifying the ir tree to customize it specifically for Elasticsearch 
and leaves the ir nodes in a more generic state.

Another change required for this was to remove the notion of auto-return 
from the ir tree completely. The user tree is now responsible for generating 
appropriate ir tree nodes to support auto-return. This is the first example of 
divergent user and ir trees as the user tree is intended to be higher level 
while the ir tree is supposed to provide lower level translation into asm.

Relates to #49869
Relates to #51841
@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@jimczi jimczi removed the needs:triage Requires assignment of a team area label label Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >refactoring Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

4 participants