RFR: 8325651: C2 SuperWord: refactor the dependency graph [v3]

Emanuel Peter epeter at openjdk.org
Fri Mar 8 06:18:00 UTC 2024


On Thu, 7 Mar 2024 14:15:21 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   missing string Extra -> Memory change
>
> src/hotspot/share/opto/vectorization.hpp line 456:
> 
>> 454: class VLoopDependencyGraph : public StackObj {
>> 455: private:
>> 456:   class DependencyNode;
> 
> I'm not sure if we should declare classes in the middle of another class. Should we move the forward declaration to the top of the file as done in other places as well?

I see this pattern in other places in the codebase:


class ciTypeFlow : public ArenaObj {
private:
  ciEnv*    _env;
  ciMethod* _method;
  int       _osr_bci;

  bool      _has_irreducible_entry;

  const char* _failure_reason;

public:
  class StateVector;
  class Loop;
  class Block;


I think it makes sense to declare "internal" (private) classes at the beginning of the class.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17812#discussion_r1517208777


More information about the hotspot-compiler-dev mailing list