Closed
Bug 784620
Opened 13 years ago
Closed 13 years ago
Support compiling JS in self-hosting mode in the shell
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: till, Assigned: till)
References
Details
(Whiteboard: [js:t])
Attachments
(1 file, 1 obsolete file)
3.39 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
This would enable testing self-hosted code without recompiling the shell.
Updated•13 years ago
|
Whiteboard: [js:t]
Assignee | ||
Comment 1•13 years ago
|
||
So it occurred to me that making it possible to load an external JS file during runtime and to set that file using an environment variable is more useful than adding a special compile mode to the shell.
This patch adds the environment variable "MOZ_SELFHOSTEDJS" and changes the makefile and embedjs.py script very slightly to make creating the required JS file easier.
Usage:
1. modify any JS file that's compiled into selfhosted.js
2. invoke the shell or the browser with "MOZ_SELFHOSTEDJS=./selfhosted.js ./js" (for the shell, in the obj dir) or "MOZ_SELFHOSTEDJS=[path to js obj dir].selfhosted.js ./run-mozilla.sh ./firefox" (for the browser, in the dist/bin dir)
![]() |
||
Comment 2•13 years ago
|
||
Comment on attachment 663833 [details] [diff] [review]
v1
Punting to Terrence.
Attachment #663833 -
Flags: review?(luke) → review?(terrence)
Comment 3•13 years ago
|
||
Comment on attachment 663833 [details] [diff] [review]
v1
Review of attachment 663833 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #663833 -
Flags: review?(terrence) → review+
Assignee | ||
Comment 4•13 years ago
|
||
rebased, pushed to try here:
http://tbpl.mozilla.org/?tree=Try&rev=b0e52a4a5627
Attachment #670367 -
Flags: review+
Assignee | ||
Comment 5•13 years ago
|
||
Comment on attachment 663833 [details] [diff] [review]
v1
hrmpf
Attachment #663833 -
Attachment is obsolete: true
Assignee | ||
Comment 6•13 years ago
|
||
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 8•13 years ago
|
||
Comment on attachment 670367 [details] [diff] [review]
v2
Review of attachment 670367 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jscntxt.cpp
@@ +272,5 @@
> + char *filename = getenv("MOZ_SELFHOSTEDJS");
> + if (filename) {
> + RootedScript script(cx, Compile(cx, shg, options, filename));
> + if (script)
> + ok = Execute(cx, script, *shg.get(), &rv);
So if script is null, we will return some uninitialized value?
Assignee | ||
Comment 9•13 years ago
|
||
(In reply to :Ms2ger from comment #8)
> So if script is null, we will return some uninitialized value?
Thanks for noticing. Luckily, Ehsan fixed that in bug 801344.
Depends on: 801344
You need to log in
before you can comment on or make changes to this bug.
Description
•