-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not take ExprCompilerValue by value in as_compiled
Summary: Change: ``` fn as_compiled(self) -> ExprCompiledValue { ... } ``` to ``` fn as_compiled(&self) -> ExprCompiledValue { ... } ``` We need to preserve original `ExprCompiledValue` after compilation to do the compilation again on freeze. Unfortunately, this diff results in many string duplications at compile time. For example, in "get local" expression we need string to use it in error message. Now we clone the string. This can be addressed for example by * placing all strings into frozen heap (less memory safe) * placing string in `Arc` (almost as expensive as string copy) * creating some string table per module and store indices to strings (too complicated) It string copy is the issue, perhaps the best thing to do is to stop allocating strings at parse time: we already have spans for the strings, so we can store strings as spans through the pipeline. Reviewed By: ndmitchell Differential Revision: D31034896 fbshipit-source-id: 8ea4776f3f8493cc6bd72ef27be8e3f564491dde
- Loading branch information
1 parent
b4fdc0d
commit 4f68414
Showing
6 changed files
with
133 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.