- 
    Bug 
- 
    Resolution: Fixed
- 
     P3 P3
- 
    9
- 
    None
- 
        b136
- 
        generic
- 
        generic
                    While the test runs fine in its entirety in both configurations, a subsection of it that I whittled down to reproduce another bug does not.
Consider the script (attached as 'nosuch.js')
function invokeMegamorphic() {
var o = {};
var s = String.fromCharCode(97);
o[s] = 1;
try {
print(Debug.map(o));
o._();
} catch (e) {
print(e);
}
}
Object.prototype.__noSuchProperty__ = function() {
print("no such property", Array.prototype.slice.call(arguments));
};
invokeMegamorphic();
Object.prototype.__noSuchMethod__ = function() {
print("no such method", Array.prototype.slice.call(arguments));
};
invokeMegamorphic();
Running it in the default 9 configuration (with -Dnashorn.debug enabled) produces this output:
0x3972a855 = {
['a'@0x62e7f11d (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
0x101952da = {
['a'@0x6babf3bf (writable enumerable configurable) Accessor type=i slot=0]
}
no such method _
... but turning off ot for the same build (running with --optimistic-types=false -Dnashorn.debug) produces
0x424e1977 = {
['a'@0x10d68fcd (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
0x424e1977 = {
['a'@0x10d68fcd (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
The default configuration in 9 is optimistic types enabled. Not that with ot false, we get the same no such property printout twice, instead of the second one being a nosuchmethod. As far as I can tell, the latter is the correct behavior.
            
Consider the script (attached as 'nosuch.js')
function invokeMegamorphic() {
var o = {};
var s = String.fromCharCode(97);
o[s] = 1;
try {
print(Debug.map(o));
o._();
} catch (e) {
print(e);
}
}
Object.prototype.__noSuchProperty__ = function() {
print("no such property", Array.prototype.slice.call(arguments));
};
invokeMegamorphic();
Object.prototype.__noSuchMethod__ = function() {
print("no such method", Array.prototype.slice.call(arguments));
};
invokeMegamorphic();
Running it in the default 9 configuration (with -Dnashorn.debug enabled) produces this output:
0x3972a855 = {
['a'@0x62e7f11d (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
0x101952da = {
['a'@0x6babf3bf (writable enumerable configurable) Accessor type=i slot=0]
}
no such method _
... but turning off ot for the same build (running with --optimistic-types=false -Dnashorn.debug) produces
0x424e1977 = {
['a'@0x10d68fcd (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
0x424e1977 = {
['a'@0x10d68fcd (writable enumerable configurable) Accessor type=i slot=0]
}
no such property _
TypeError: Cannot call undefined
The default configuration in 9 is optimistic types enabled. Not that with ot false, we get the same no such property printout twice, instead of the second one being a nosuchmethod. As far as I can tell, the latter is the correct behavior.
- relates to
- 
                    JDK-8026016 too many relinks dominate avatar.js http benchmark -           
- Resolved
 
-