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

Language compilation optimizations #174

Open
filipeom opened this issue Sep 8, 2024 · 2 comments
Open

Language compilation optimizations #174

filipeom opened this issue Sep 8, 2024 · 2 comments
Labels

Comments

@filipeom
Copy link
Member

filipeom commented Sep 8, 2024

Stuff like:

  function setInternalProperty(___internal_esl_global, object, pname, pvalue) {
    object[pname] := pvalue;
    return [false, null]
  };
  function l_len(___internal_esl_global, lst) {
    __v6290 := extern l_len_external(lst);
    return [false, __v6290]
  };

Could benefit form an @inline annotation to avoid unecessary functions calls

@filipeom filipeom added scope-language Related to the ECMA-SL language design type: feature labels Sep 8, 2024
@filipeom filipeom changed the title Add @inline annotations Language compilation optimizations Sep 16, 2024
@filipeom
Copy link
Member Author

filipeom commented Sep 16, 2024

This pattern also repeats a bunch:

__v4877 := []
symbols := __v4877

Generalized:

__v0 := <Constant value>
code_var := __v0
// Ideally, this would inline to:
code_var := <Constant value>

Seems wasteful having a fresh var to hold a constant

@filipeom
Copy link
Member Author

Each optimization technique should be addressed as a separate issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant