changeset 48038:ea5906610227

8191779: LogCompilation throws java.lang.Error: scope underflow Summary: Add the trap into the last call site as the site may not yet be added into scopes. Reviewed-by: kvn, thartmann
author ecaspole
date Thu, 30 Nov 2017 09:59:27 -0500
parents 599f67f3c6d6
children 995ed4b92655
files src/utils/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/utils/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Thu Nov 30 19:46:20 2017 +0530
+++ b/src/utils/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java	Thu Nov 30 09:59:27 2017 -0500
@@ -1025,13 +1025,20 @@
                     return;
                 }
                 try {
+                    UncommonTrap unc = new UncommonTrap(Integer.parseInt(search(atts, "bci")),
+                            search(atts, "reason"),
+                            search(atts, "action"),
+                            bytecodes[current_bytecode]);
                     if (scopes.size() == 0) {
-                        reportInternalError("scope underflow");
+                        // There may be a dangling site not yet in scopes after a late_inline
+                        if (site != null) {
+                            site.add(unc);
+                        } else {
+                            reportInternalError("scope underflow");
+                        }
+                    } else {
+                        scopes.peek().add(unc);
                     }
-                    scopes.peek().add(new UncommonTrap(Integer.parseInt(search(atts, "bci")),
-                                                       search(atts, "reason"),
-                                                       search(atts, "action"),
-                                                       bytecodes[current_bytecode]));
                 } catch (Error e) {
                     e.printStackTrace();
                 }