Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8255429: Remove C2-based profiling
Reviewed-by: kvn, neliasso, vlivanov
  • Loading branch information
Igor Veresov committed Oct 28, 2020
1 parent aaf4f69 commit 0425889
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 469 deletions.
2 changes: 0 additions & 2 deletions src/hotspot/share/opto/compile.cpp
Expand Up @@ -929,8 +929,6 @@ void Compile::Init(int aliaslevel) {
set_max_inline_size(MaxInlineSize);
set_freq_inline_size(FreqInlineSize);
set_do_scheduling(OptoScheduling);
set_do_count_invocations(false);
set_do_method_data_update(false);

set_do_vector_loop(false);

Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/opto/compile.hpp
Expand Up @@ -282,8 +282,6 @@ class Compile : public Phase {
bool _do_inlining; // True if we intend to do inlining
bool _do_scheduling; // True if we intend to do scheduling
bool _do_freq_based_layout; // True if we intend to do frequency based block layout
bool _do_count_invocations; // True if we generate code to count invocations
bool _do_method_data_update; // True if we generate code to update MethodData*s
bool _do_vector_loop; // True if allowed to execute loop in parallel iterations
bool _use_cmove; // True if CMove should be used without profitability analysis
bool _age_code; // True if we need to profile code age (decrement the aging counter)
Expand Down Expand Up @@ -571,10 +569,6 @@ class Compile : public Phase {
void set_do_scheduling(bool z) { _do_scheduling = z; }
bool do_freq_based_layout() const{ return _do_freq_based_layout; }
void set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }
bool do_count_invocations() const{ return _do_count_invocations; }
void set_do_count_invocations(bool z){ _do_count_invocations = z; }
bool do_method_data_update() const { return _do_method_data_update; }
void set_do_method_data_update(bool z) { _do_method_data_update = z; }
bool do_vector_loop() const { return _do_vector_loop; }
void set_do_vector_loop(bool z) { _do_vector_loop = z; }
bool use_cmove() const { return _use_cmove; }
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/opto/doCall.cpp
Expand Up @@ -643,10 +643,6 @@ void Parse::do_call() {
receiver = record_profiled_receiver_for_speculation(receiver);
}

// Bump method data counters (We profile *before* the call is made
// because exceptions don't return to the call site.)
profile_call(receiver);

JVMState* new_jvms = cg->generate(jvms);
if (new_jvms == NULL) {
// When inlining attempt fails (e.g., too many arguments),
Expand Down
30 changes: 3 additions & 27 deletions src/hotspot/share/opto/parse.hpp
Expand Up @@ -330,8 +330,6 @@ class Parse : public GraphKit {
bool _wrote_volatile; // Did we write a volatile field?
bool _wrote_stable; // Did we write a @Stable field?
bool _wrote_fields; // Did we write any field?
bool _count_invocations; // update and test invocation counter
bool _method_data_update; // update method data oop
Node* _alloc_with_final; // An allocation node with final field

// Variables which track Java semantics during bytecode parsing:
Expand Down Expand Up @@ -377,8 +375,6 @@ class Parse : public GraphKit {
void set_wrote_stable(bool z) { _wrote_stable = z; }
bool wrote_fields() const { return _wrote_fields; }
void set_wrote_fields(bool z) { _wrote_fields = z; }
bool count_invocations() const { return _count_invocations; }
bool method_data_update() const { return _method_data_update; }
Node* alloc_with_final() const { return _alloc_with_final; }
void set_alloc_with_final(Node* n) {
assert((_alloc_with_final == NULL) || (_alloc_with_final == n), "different init objects?");
Expand Down Expand Up @@ -500,9 +496,6 @@ class Parse : public GraphKit {
// Helper function to uncommon-trap or bailout for non-compilable call-sites
bool can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass *klass);

// Helper function to setup for type-profile based inlining
bool prepare_type_profile_inline(ciInstanceKlass* prof_klass, ciMethod* prof_method);

// Helper functions for type checking bytecodes:
void do_checkcast();
void do_instanceof();
Expand Down Expand Up @@ -555,9 +548,9 @@ class Parse : public GraphKit {
void maybe_add_predicate_after_if(Block* path);
IfNode* jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask, float prob, float cnt);
Node* jump_if_join(Node* iffalse, Node* iftrue);
void jump_if_true_fork(IfNode *ifNode, int dest_bci_if_true, int prof_table_index, bool unc);
void jump_if_false_fork(IfNode *ifNode, int dest_bci_if_false, int prof_table_index, bool unc);
void jump_if_always_fork(int dest_bci_if_true, int prof_table_index, bool unc);
void jump_if_true_fork(IfNode *ifNode, int dest_bci_if_true, bool unc);
void jump_if_false_fork(IfNode *ifNode, int dest_bci_if_false, bool unc);
void jump_if_always_fork(int dest_bci_if_true, bool unc);

friend class SwitchRange;
void do_tableswitch();
Expand All @@ -567,23 +560,6 @@ class Parse : public GraphKit {
void linear_search_switch_ranges(Node* key_val, SwitchRange*& lo, SwitchRange*& hi);

void decrement_age();
// helper functions for methodData style profiling
void test_counter_against_threshold(Node* cnt, int limit);
void increment_and_test_invocation_counter(int limit);
void test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize offset, int limit);
Node* method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize offset, Node* idx = NULL, uint stride = 0);
void increment_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize offset, Node* idx = NULL, uint stride = 0);
void set_md_flag_at(ciMethodData* md, ciProfileData* data, int flag_constant);

void profile_method_entry();
void profile_taken_branch(int target_bci, bool force_update = false);
void profile_not_taken_branch(bool force_update = false);
void profile_call(Node* receiver);
void profile_generic_call();
void profile_receiver_type(Node* receiver);
void profile_ret(int target_bci);
void profile_null_checkcast();
void profile_switch_case(int table_index);

// helper function for call statistics
void count_compiled_calls(bool at_method_entry, bool is_inline) PRODUCT_RETURN;
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/share/opto/parse1.cpp
Expand Up @@ -483,9 +483,6 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses)
// Accumulate total sum of decompilations, also.
C->set_decompile_count(C->decompile_count() + md->decompile_count());

_count_invocations = C->do_count_invocations();
_method_data_update = C->do_method_data_update();

if (log != NULL && method()->has_exception_handlers()) {
log->elem("observe that='has_exception_handlers'");
}
Expand Down Expand Up @@ -1228,10 +1225,6 @@ void Parse::do_method_entry() {
// Feed profiling data for parameters to the type system so it can
// propagate it as speculative types
record_profiled_parameters_for_speculation();

if (depth() == 1) {
increment_and_test_invocation_counter(Tier2CompileThreshold);
}
}

//------------------------------init_blocks------------------------------------
Expand Down

1 comment on commit 0425889

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 0425889 Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.