Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Roadmap #1

Open
9 of 21 tasks
zhuzilin opened this issue Jan 17, 2022 · 2 comments
Open
9 of 21 tasks

Roadmap #1

zhuzilin opened this issue Jan 17, 2022 · 2 comments

Comments

@zhuzilin
Copy link
Owner

zhuzilin commented Jan 17, 2022

recent:

  • pass the typescript compiler test in Octane;
  • make the error messge more intuitive;
  • design a good enough gc;
    • implement a copying gc;
    • implement a mark and sweep gc;
    • implement generational gc.
  • do some optimization on the AST interpreter.
    • remove ParameterMap in arguments object and specialize the function for MakeGetterArgs and MakeSetterArgs;
    • support ascii string to reduce memory consumption;
    • do not allocate number in heap;
    • separate string property and number property;
    • move reference type to stack;
    • let parser take parts in creating runtime values.

functions:

  • pass test262 ch06-ch14
  • support a module system (ES6 / CommonJS);
  • regex;
  • json;
  • URI.

long term

  • design byte code for the interpreter;
  • experiement with different dispatch method and inline caching;
  • JIT support;
@zhuzilin zhuzilin pinned this issue Jan 17, 2022
@zhuzilin
Copy link
Owner Author

I'm trying to implement a stack-based virtual machine inside es.

I would use bytecode of SpiderMonkey: https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Internals/Bytecodes
which is the only stack-based bytecode from a mainstream engine that is "well" documented.

The structure of the stack-based VM could be similar to JVM, as documented in the spec:
https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html

@zhuzilin
Copy link
Owner Author

The main performance bottleneck with the current implementation is that the property visiting is slow (the hashmap visiting costs around 40% of time). To completely solve this, I need to implement both the hidden class and inline caching (which means a good byte code design is also needed), which is too much work......

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

No branches or pull requests

1 participant