Closed
Bug 257423
Opened 21 years ago
Closed 21 years ago
Optimizer regression: this.name += expression generates wrong code.
Categories
(Rhino Graveyard :: Compiler, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.6R1
People
(Reporter: igor, Assigned: igor)
Details
Attachments
(1 file)
Consider the following example:
function F()
{
this.name = "A";
this.name += "B";
}
new F();
With Rhino from CVS it produces with optimization mode 0 or greater:
| Assignee | ||
Comment 1•21 years ago
|
||
E4X support added ScriptRuntime.getObjectProp which was equivalent to
OptRuntime.thisGet but I forgot to update the code generation to call the new
method.
| Assignee | ||
Comment 2•21 years ago
|
||
I cimmitted the fix
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.5R6
| Assignee | ||
Comment 3•21 years ago
|
||
(In reply to comment #0)
> Consider the following example:
>
> function F()
> {
> this.name = "A";
> this.name += "B";
> }
>
> new F();
>
> With Rhino from CVS it produces with optimization mode 0 or greater:
It was cut, not paste for the bug output when copied the error output:
Exception in thread "main" java.lang.NoSuchMethodError:
org.mozilla.javascript.optimizer.OptRuntime.thisGet(Lorg/mozilla/javascript/Scriptable;Ljava/lang/String;Lorg/mozilla/javascript/Scriptable;)Ljava/lang/Object;
at org.mozilla.javascript.gen.c1._c1(/home/igor/s/x.js:4)
at org.mozilla.javascript.gen.c1.call(/home/igor/s/x.js)
at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:306)
at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2156)
at org.mozilla.javascript.gen.c1._c0(/home/igor/s/x.js:7)
at org.mozilla.javascript.gen.c1.call(/home/igor/s/x.js)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2864)
at org.mozilla.javascript.gen.c1.call(/home/igor/s/x.js)
at org.mozilla.javascript.gen.c1.exec(/home/igor/s/x.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1179)
at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:389)
at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:376)
at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:313)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:305)
at org.mozilla.javascript.tools.shell.Main$1.run(Main.java:119)
at org.mozilla.javascript.Context.call(Context.java:498)
at org.mozilla.javascript.Context.call(Context.java:413)
at org.mozilla.javascript.tools.shell.Main.withContext(Main.java:155)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:96)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:77)
Now the test works and prints nothing as expected
You need to log in
before you can comment on or make changes to this bug.
Description
•