RFR: JDK-8280274: Guard printing code of Compile::print_method in PRODUCT [v2]

Tobias Holenstein duke at openjdk.java.net
Fri Jan 21 13:51:19 UTC 2022


> In `Compile::print_method(CompilerPhaseType cpt, Node* n, int level)` the code 
> ``` 
> ResourceMark rm; 
> stringStream ss; 
> ss.print_raw(CompilerPhaseTypeHelper::to_string(cpt)); 
> if (n != NULL) { 
>   ss.print(": %d %s ", n->_idx, NodeClassNames[n->Opcode()]); 
> } else { 
>   ss.print_raw(": NULL"); 
> } 
> ``` 
> should to be guarded by a `#ifndef PRODUCT` since the usage of the string is also guarded in `Compile::print_method_impl`
> 
> Tested on Tier1-3

Tobias Holenstein has updated the pull request incrementally with two additional commits since the last revision:

 - minor code style update
   
   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
 - minor code style update
   
   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7158/files
  - new: https://git.openjdk.java.net/jdk/pull/7158/files/dce24e2a..b8fd8111

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7158&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7158&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7158.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7158/head:pull/7158

PR: https://git.openjdk.java.net/jdk/pull/7158


More information about the hotspot-compiler-dev mailing list