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

Add the try_find_const_fast instruction #3311

Closed
wants to merge 2 commits into from
Closed

Conversation

jemc
Copy link
Member

@jemc jemc commented Feb 8, 2015

Add the try_find_const_fast instruction,
which returns undefined instead of raising NameError when the constant is not found.

This can be helpful for other languages on the Rubinius VM, trying to implement different constant lookup semantics, but still want to benefit from the ConstantCaches.

which returns undefined instead of raising NameError when the constant is not found.
BasicBlock* use_cache = new_block("use_cache");
BasicBlock* use_call = new_block("use_call");

cont = new_block("continue");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace here shouldn't be needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was copied verbatim from the find_const_fast visit above.

@jemc
Copy link
Member Author

jemc commented Feb 9, 2015

I guess this will fail on Travis until https://github.com/rubinius/rubinius-compiler/pull/3 is added and released.

@jemc
Copy link
Member Author

jemc commented Apr 18, 2015

I've decided to take a different approach with constant lookup using Rubinius.global_serial, so this is not needed for me with Myco anymore, although I think that doing this for Titanius is a good long term goal. Returning undefined instead of raising an exception for missing constants is an easier-to-use operation. Something similar for instance variables would be nice too. Returning undefined instead of nil for missing instance variables is easier to use as well.

I'm closing for now, but we can discuss this more as Titanius begins to take shape.

@jemc jemc closed this Apr 18, 2015
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

Successfully merging this pull request may close these issues.

None yet

2 participants