Skip to content

Commit

Permalink
Revert "C2: Clean up include statements to speed up compilation when …
Browse files Browse the repository at this point in the history
…touching type.hpp"

This reverts commit d95a8c6.
  • Loading branch information
chhagedorn committed Dec 9, 2024
1 parent d95a8c6 commit 5d67959
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/hotspot/cpu/x86/c2_intelJccErratum_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "asm/macroAssembler.hpp"
#include "c2_intelJccErratum_x86.hpp"
#include "opto/cfgnode.hpp"
#include "opto/compile.hpp"
#include "opto/machnode.hpp"
#include "opto/node.hpp"
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/share/c1/c1_Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "code/debugInfoRec.hpp"
#include "compiler/compilationFailureInfo.hpp"
#include "compiler/compilationMemoryStatistic.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "compiler/compilerDirectives.hpp"
#include "compiler/compileLog.hpp"
#include "compiler/compileTask.hpp"
Expand Down Expand Up @@ -657,12 +656,6 @@ void Compilation::bailout(const char* msg) {
}
}

bool Compilation::is_optimistic() {
return CompilerConfig::is_c1_only_no_jvmci() && !is_profiling() &&
(RangeCheckElimination || UseLoopInvariantCodeMotion) &&
method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
}

ciKlass* Compilation::cha_exact_type(ciType* type) {
if (type != nullptr && type->is_loaded() && type->is_instance_klass()) {
ciInstanceKlass* ik = type->as_instance_klass();
Expand Down
9 changes: 8 additions & 1 deletion src/hotspot/share/c1/c1_Compilation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#include "ci/ciMethodData.hpp"
#include "code/exceptionHandlerTable.hpp"
#include "compiler/compiler_globals.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "compiler/compilerDirectives.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/deoptimization.hpp"

class CompilationFailureInfo;
Expand Down Expand Up @@ -262,7 +265,11 @@ class Compilation: public StackObj {

// will compilation make optimistic assumptions that might lead to
// deoptimization and that the runtime will account for?
bool is_optimistic();
bool is_optimistic() {
return CompilerConfig::is_c1_only_no_jvmci() && !is_profiling() &&
(RangeCheckElimination || UseLoopInvariantCodeMotion) &&
method()->method_data()->trap_count(Deoptimization::Reason_none) == 0;
}

ciKlass* cha_exact_type(ciType* type);

Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_Defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#ifndef SHARE_C1_C1_DEFS_HPP
#define SHARE_C1_C1_DEFS_HPP

#include "asm/register.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

// set frame size and return address offset to these values in blobs
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_FrameMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
#ifndef SHARE_C1_C1_FRAMEMAP_HPP
#define SHARE_C1_C1_FRAMEMAP_HPP

#include "asm/macroAssembler.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_LIR.hpp"
#include "code/vmreg.hpp"
#include "memory/allocation.hpp"
#include "runtime/frame.hpp"
#include "runtime/synchronizer.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
#include "interpreter/bytecode.hpp"
#include "jfr/jfrEvents.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_JFR
#include "jfr/jfr.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_IR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include "c1/c1_Instruction.hpp"
#include "ci/ciExceptionHandler.hpp"
#include "ci/ciMethod.hpp"
#include "ci/ciStreams.hpp"
#include "memory/allocation.hpp"

// An XHandler is a C1 internal description for an exception handler
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/c1/c1_LIRAssembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_ValueStack.hpp"
#include "ci/ciInstance.hpp"
#include "compiler/compilerDefinitions.inline.hpp"
#include "compiler/oopMap.hpp"
#include "runtime/os.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_LIRGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#include "c1/c1_Decorators.hpp"
#include "c1/c1_Instruction.hpp"
#include "c1/c1_LIR.hpp"
#include "ci/ciMethodData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "jfr/support/jfrIntrinsics.hpp"
#include "utilities/macros.hpp"
#include "utilities/sizes.hpp"

Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_Optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
*/

#include "precompiled.hpp"
#include "c1/c1_Canonicalizer.hpp"
#include "c1/c1_Optimizer.hpp"
#include "c1/c1_ValueMap.hpp"
#include "c1/c1_ValueSet.hpp"
#include "c1/c1_ValueStack.hpp"
#include "memory/resourceArea.hpp"
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/c1/c1_RangeCheckElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
#include "c1/c1_ValueStack.hpp"
#include "c1/c1_RangeCheckElimination.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_Canonicalizer.hpp"
#include "c1/c1_ValueMap.hpp"
#include "ci/ciMethodData.hpp"
#include "runtime/deoptimization.hpp"
#ifdef ASSERT
#include "utilities/bitMap.inline.hpp"
#endif

// Macros for the Trace and the Assertion flag
#ifdef ASSERT
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "asm/codeBuffer.hpp"
#include "c1/c1_CodeStubs.hpp"
#include "c1/c1_Defs.hpp"
#include "c1/c1_FrameMap.hpp"
#include "c1/c1_LIRAssembler.hpp"
#include "c1/c1_MacroAssembler.hpp"
#include "c1/c1_Runtime1.hpp"
Expand All @@ -34,6 +35,7 @@
#include "classfile/vmSymbols.hpp"
#include "code/codeBlob.hpp"
#include "code/compiledIC.hpp"
#include "code/pcDesc.hpp"
#include "code/scopeDesc.hpp"
#include "code/vtableStubs.hpp"
#include "compiler/compilationPolicy.hpp"
Expand All @@ -46,10 +48,12 @@
#include "interpreter/interpreter.hpp"
#include "jfr/support/jfrIntrinsics.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/access.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/oop.inline.hpp"
Expand All @@ -63,6 +67,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/stackWatermarkSet.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/vframe.inline.hpp"
#include "runtime/vframeArray.hpp"
#include "runtime/vm_version.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/c1/c1_Runtime1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "code/stubs.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/allStatic.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/stubDeclarations.hpp"

class StubAssembler;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_ValueMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
*/

#include "precompiled.hpp"
#include "c1/c1_Canonicalizer.hpp"
#include "c1/c1_IR.hpp"
#include "c1/c1_ValueMap.hpp"
#include "c1/c1_ValueSet.hpp"
#include "c1/c1_ValueStack.hpp"
#include "utilities/bitMap.inline.hpp"

#ifndef PRODUCT

Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_ValueSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#define SHARE_C1_C1_VALUESET_HPP

#include "c1/c1_Instruction.hpp"
#include "memory/allocation.hpp"
#include "utilities/bitMap.hpp"
#include "utilities/bitMap.inline.hpp"

// A ValueSet is a simple abstraction on top of a BitMap representing
// a set of Instructions. Currently it assumes that the number of
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/c1/c1_ValueType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define SHARE_C1_C1_VALUETYPE_HPP

#include "c1/c1_Compilation.hpp"
#include "ci/ciConstant.hpp"
#include "ci/ciMethodData.hpp"

// type hierarchy
class ValueType;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/ci/ciTypeFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
#include "runtime/deoptimization.hpp"
#include "utilities/growableArray.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/vmIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include "compiler/compilerDirectives.hpp"
#include "jvm_constants.h"
#include "jvm_io.h"
#include "opto/c2_globals.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/tribool.hpp"
#include "utilities/xmlstream.hpp"

// These are flag-matching functions:
inline bool match_F_R(jshort flags) {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/compiledIC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "code/nativeInst.hpp"
#include "interpreter/linkResolver.hpp"
#include "runtime/safepointVerifiers.hpp"
#include "opto/c2_MacroAssembler.hpp"

//-----------------------------------------------------------------------------
// The CompiledIC represents a compiled inline cache.
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/code/vtableStubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#include "runtime/sharedRuntime.hpp"
#include "utilities/align.hpp"
#include "utilities/powerOfTwo.hpp"
#ifdef COMPILER2
#include "opto/matcher.hpp"
#endif

// -----------------------------------------------------------------------------------------
// Implementation of VtableStub
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/compiler/compilerDefinitions.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include "opto/c2compiler.hpp"
#endif
#include "compiler/compilerDefinitions.hpp"

#include "compiler/compiler_globals.hpp"
#include "compiler/compilerDefinitions.hpp"
#include "runtime/arguments.hpp"

inline bool CompilerConfig::is_interpreter_only() {
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/compiler/compilerDirectives.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#define SHARE_COMPILER_COMPILERDIRECTIVES_HPP

#include "classfile/vmIntrinsics.hpp"
#include "ci/ciMetadata.hpp"
#include "ci/ciMethod.hpp"
#include "compiler/compiler_globals.hpp"
#include "compiler/methodMatcher.hpp"
#include "opto/phasetype.hpp"
#include "utilities/bitMap.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/compiler/oopMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "code/vmreg.hpp"
#include "memory/allocation.hpp"
#include "memory/iterator.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/growableArray.hpp"

Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/interpreter/interpreterRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
#include "utilities/checkedCast.hpp"
#include "utilities/copy.hpp"
#include "utilities/events.hpp"

#ifdef COMPILER2
#include "opto/runtime.hpp"
#endif

// Helper class to access current interpreter state
class LastFrameAccessor : public StackObj {
Expand Down
8 changes: 1 addition & 7 deletions src/hotspot/share/opto/c2compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
#define SHARE_OPTO_C2COMPILER_HPP

#include "compiler/abstractCompiler.hpp"
// #include "opto/output.hpp"

// Define the initial sizes for allocation of the resizable code buffer
enum {
initial_const_capacity = 4 * 1024
};

#include "opto/output.hpp"

class C2Compiler : public AbstractCompiler {
private:
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/opto/compile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,11 @@ class Compile : public Phase {
Node_Notes* default_node_notes() const { return _default_node_notes; }
void set_default_node_notes(Node_Notes* n) { _default_node_notes = n; }

Node_Notes* node_notes_at(int idx);

Node_Notes* node_notes_at(int idx) {
return locate_node_notes(_node_note_array, idx, false);
}
inline bool set_node_notes_at(int idx, Node_Notes* value);

// Copy notes from source to dest, if they exist.
// Overwrite dest only if source provides something.
// Return true if information was moved.
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/opto/library_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "opto/runtime.hpp"
#include "opto/rootnode.hpp"
#include "opto/subnode.hpp"
#include "opto/vectornode.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "prims/unsafe.hpp"
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/opto/mathexactnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
#ifndef SHARE_OPTO_MATHEXACTNODE_HPP
#define SHARE_OPTO_MATHEXACTNODE_HPP

#include "opto/multnode.hpp"
#include "opto/node.hpp"
#include "opto/addnode.hpp"
#include "opto/subnode.hpp"
#include "opto/type.hpp"

class PhaseGVN;

Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/opto/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2000,10 +2000,6 @@ Compile::locate_node_notes(GrowableArray<Node_Notes*>* arr,
return arr->at(block_idx) + (idx & (_node_notes_block_size-1));
}

inline Node_Notes* Compile::node_notes_at(int idx) {
return locate_node_notes(_node_note_array, idx, false);
}

inline bool
Compile::set_node_notes_at(int idx, Node_Notes* value) {
if (value == nullptr || value->is_clear())
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/opto/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/debugInfo.hpp"
#include "code/debugInfoRec.hpp"
Expand All @@ -33,6 +34,7 @@
#include "compiler/oopMap.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/c2/barrierSetC2.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/allocation.hpp"
#include "opto/ad.hpp"
#include "opto/block.hpp"
Expand All @@ -46,7 +48,10 @@
#include "opto/optoreg.hpp"
#include "opto/output.hpp"
#include "opto/regalloc.hpp"
#include "opto/runtime.hpp"
#include "opto/subnode.hpp"
#include "opto/type.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/macros.hpp"
#include "utilities/powerOfTwo.hpp"
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/opto/output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class PhaseCFG;
#define DEBUG_ARG(x)
#endif

// Define the initial sizes for allocation of the resizable code buffer
enum {
initial_const_capacity = 4 * 1024
};

class BufferSizingData {
public:
int _stub;
Expand Down
Loading

0 comments on commit 5d67959

Please sign in to comment.