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

Modify IDL order if all JS engines benefit #77

Open
arai-a opened this issue May 20, 2019 · 0 comments
Open

Modify IDL order if all JS engines benefit #77

arai-a opened this issue May 20, 2019 · 0 comments

Comments

@arai-a
Copy link

arai-a commented May 20, 2019

This is not immediate issue, but for tracking

Background:

  • BinAST file encodes interface fields in IDL's order
  • Given we encode scope information, at the point of reading each node, it's ready to compile the code to bytecode or machine code
  • Currently IDL uses the syntax order for each field
  • There are some differences between syntax order and execution order
  • Some optimizations might be possible if some other fields are encoded in different order (this mostly depends on implementation)

From early experiment, I found some cases:

  • for (init; cond; update) body
    • execution order is: init, cond, body, update
  • switch (discriminant) { case C1: body1; case C2: body2; ... }
    • jump operation can be optimized if case values are all known before reading bodies
      there may be other cases.

on SpiderMonkey, we're going to compile BinAST file directly to bytecode, and if the IDL order matches to bytecode order, the compilation can become simpler.
to be clear, I'm trying to avoid modifying the IDL order just for SpiderMonkey's benefit, so we need to figure out other engine's situation as well.

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

No branches or pull requests

1 participant