Closed Bug 779233 Opened 7 years ago Closed 7 years ago
move filename to Script
Since scripts in a compilation unit usually share the same filename, we could save a word on JSScript by putting the filename on ScriptSource. I say "usually" because the //@line directive can change the filename. I don't know how important it is for scripts to be able to pretend they're from different files. Will the whole thing be superseded by source maps? Maybe we could just take the first //@line?
The semantics of //@line are unclear, and the implementation is really hacky, working just well enough for the particular uses we have in Firefox. I think it currently only works if you change the filename once in a file, but I'm not certain.
Bill, I remember you telling me you wanted to kill the script filename table stuff. Are you okay to review, too? Most of patch is just making JSScript::filename into a method.
Attachment #724161 - Flags: review?(wmccloskey)
With the previous patch, script filenames no longer live in a separate hashtable. Is it okay if I just count them as part of the script source now? I never noticed that they ever amounted to much.
Attachment #724162 - Flags: review?(n.nethercote)
Attachment #724162 - Flags: review?(n.nethercote) → review+
> Most of patch is just making JSScript::filename into a method. It makes life easier for reviewers if you split out the big mechanical change into a separate patch.
Comment on attachment 724161 [details] [diff] [review] move filename to ScriptSource Thanks!
Attachment #724161 - Flags: review?(wmccloskey) → review+
Assignee: general → benjamin
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.