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

frozen constant objects should live in the data segment #11

Open
toshok opened this issue Dec 31, 2013 · 0 comments
Open

frozen constant objects should live in the data segment #11

toshok opened this issue Dec 31, 2013 · 0 comments

Comments

@toshok
Copy link
Owner

toshok commented Dec 31, 2013

similar to #10.

pirouette does the following to map objective-c enums:

var enum = Object.create(null);
Object.defineProperty (enum, "foo", 5);
...
Object.freeze(enum);

esprima does the same with its syntax object, which is a set of constant strings.

If we can statically determine that an object is constructed and populated with constants - and then frozen, we can move the construction/population out of code entirely, and put it in the data segment of the executable instead.

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