United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6910605 C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used
JDK-6910605 : C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used

Details
Type:
Bug
Submit Date:
2009-12-15
Status:
Resolved
Updated Date:
2012-11-21
Project Name:
JDK
Resolved Date:
2010-03-02
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs16,7
Fixed Versions:
hs17 (b10)

Related Reports
Backport:
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
NullPointerException/ClassCaseException is thrown when C2/DeoptimizeALot is used.
 http://sqeweb.sfbay/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2009-12-13/Comp_Baseline/vm/linux-amd64/server/comp/linux-amd64_server_comp_nsk.coverage.testlist/analysis.html
 http://sqeweb.sfbay/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2009-12-13/Comp_Baseline/vm/linux-amd64/server/comp/linux-amd64_server_comp_nsk.coverage.testlist/analysis.html

Affected tests:
nsk/coverage/runtime/runtime003
nsk/coverage/runtime/runtime004
nsk/coverage/runtime/runtime005
nsk/coverage/runtime/runtime006
nsk/coverage/runtime/runtime007

                                    

Comments
EVALUATION

Regression after 6603492: multianewarray should generate same code as anewarray for 1-d arrays.

After deoptimization interpreter will continue execution after _multianewarray
even if compiled code did not allocate all needed arrays.
                                     
2010-02-06
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/f516d5d7a019
                                     
2010-02-09
PUBLIC COMMENTS

Problem:
Regression after 6603492: "multianewarray should generate same code
as anewarray for 1-d arrays".
After deoptimization interpreter will continue execution after 
_multianewarray even if compiled code did not allocate all needed arrays.

Solution:
Set the reexecute bit for runtime calls _new_array_Java so the interpreter
will reexecute the _multianewarray bytecode if deoptimization happens.
Do it unconditionally even for one dimension multianewarray.
Aso I replaced "expand_count == 1" check with "ndimensions == 1"
otherwise with MultiArrayExpandLimit=0 we hit ShouldNotReachHere()
in case of one dimension multianewarray because the method
expand_multianewarray() will not be called.
And I removed annoying "reexecute=false" from PcDesc output. 

Added regression test copied from nsk/coverage/runtime/runtime007
                                     
2010-02-09



Hardware and Software, Engineered to Work Together