src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
changeset 57537 ecc6e394475f
parent 54328 37648a9c4a6a
child 58299 6df94ce3ab2f
equal deleted inserted replaced
57536:67cce1b84a9a 57537:ecc6e394475f
   134             }
   134             }
   135 
   135 
   136             // Get all current JavaMethod instances in the context.
   136             // Get all current JavaMethod instances in the context.
   137             List<String> inlineContext = getInlineContext(graph);
   137             List<String> inlineContext = getInlineContext(graph);
   138 
   138 
   139             if (inlineContext != previousInlineContext) {
   139             if (!inlineContext.equals(previousInlineContext)) {
   140                 Map<Object, Object> properties = new HashMap<>();
   140                 Map<Object, Object> properties = new HashMap<>();
   141                 properties.put("graph", graph.toString());
   141                 properties.put("graph", graph.toString());
   142                 addCompilationId(properties, graph);
   142                 addCompilationId(properties, graph);
   143                 if (inlineContext.equals(previousInlineContext)) {
   143                 // Check for method scopes that must be closed since the previous dump.
   144                     /*
   144                 for (int i = 0; i < previousInlineContext.size(); ++i) {
   145                      * two different graphs have the same inline context, so make sure they appear
   145                     if (i >= inlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
   146                      * in different folders by closing and reopening the top scope.
   146                         for (int inlineDepth = previousInlineContext.size() - 1; inlineDepth >= i; --inlineDepth) {
   147                      */
   147                             closeScope(debug, inlineDepth);
   148                     int inlineDepth = previousInlineContext.size() - 1;
       
   149                     closeScope(debug, inlineDepth);
       
   150                     openScope(debug, inlineContext.get(inlineDepth), inlineDepth, properties);
       
   151                 } else {
       
   152                     // Check for method scopes that must be closed since the previous dump.
       
   153                     for (int i = 0; i < previousInlineContext.size(); ++i) {
       
   154                         if (i >= inlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
       
   155                             for (int inlineDepth = previousInlineContext.size() - 1; inlineDepth >= i; --inlineDepth) {
       
   156                                 closeScope(debug, inlineDepth);
       
   157                             }
       
   158                             break;
       
   159                         }
   148                         }
       
   149                         break;
   160                     }
   150                     }
   161                     // Check for method scopes that must be opened since the previous dump.
   151                 }
   162                     for (int i = 0; i < inlineContext.size(); ++i) {
   152                 // Check for method scopes that must be opened since the previous dump.
   163                         if (i >= previousInlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
   153                 for (int i = 0; i < inlineContext.size(); ++i) {
   164                             for (int inlineDepth = i; inlineDepth < inlineContext.size(); ++inlineDepth) {
   154                     if (i >= previousInlineContext.size() || !inlineContext.get(i).equals(previousInlineContext.get(i))) {
   165                                 openScope(debug, inlineContext.get(inlineDepth), inlineDepth, inlineDepth == inlineContext.size() - 1 ? properties : null);
   155                         for (int inlineDepth = i; inlineDepth < inlineContext.size(); ++inlineDepth) {
   166                             }
   156                             openScope(debug, inlineContext.get(inlineDepth), inlineDepth, inlineDepth == inlineContext.size() - 1 ? properties : null);
   167                             break;
       
   168                         }
   157                         }
       
   158                         break;
   169                     }
   159                     }
   170                 }
   160                 }
   171             }
   161             }
   172 
   162 
   173             // Save inline context for next dump.
   163             // Save inline context for next dump.