src/share/vm/ci/ciMethod.cpp

changeset 4936
aeaca88565e6
parent 4866
16885e702c88
child 5110
6f3fd5150b67
     1.1 --- a/src/share/vm/ci/ciMethod.cpp	Thu Apr 04 21:15:43 2013 -0700
     1.2 +++ b/src/share/vm/ci/ciMethod.cpp	Tue Apr 09 17:17:41 2013 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -905,6 +905,20 @@
    1.11  }
    1.12  
    1.13  // ------------------------------------------------------------------
    1.14 +// ciMethod::ensure_method_counters
    1.15 +//
    1.16 +address ciMethod::ensure_method_counters() {
    1.17 +  check_is_loaded();
    1.18 +  VM_ENTRY_MARK;
    1.19 +  methodHandle mh(THREAD, get_Method());
    1.20 +  MethodCounters *counter = mh->method_counters();
    1.21 +  if (counter == NULL) {
    1.22 +    counter = Method::build_method_counters(mh(), CHECK_AND_CLEAR_NULL);
    1.23 +  }
    1.24 +  return (address)counter;
    1.25 +}
    1.26 +
    1.27 +// ------------------------------------------------------------------
    1.28  // ciMethod::should_exclude
    1.29  //
    1.30  // Should this method be excluded from compilation?
    1.31 @@ -1191,13 +1205,14 @@
    1.32    ASSERT_IN_VM;
    1.33    ResourceMark rm;
    1.34    Method* method = get_Method();
    1.35 +  MethodCounters* mcs = method->method_counters();
    1.36    Klass*  holder = method->method_holder();
    1.37    st->print_cr("ciMethod %s %s %s %d %d %d %d %d",
    1.38                 holder->name()->as_quoted_ascii(),
    1.39                 method->name()->as_quoted_ascii(),
    1.40                 method->signature()->as_quoted_ascii(),
    1.41 -               method->invocation_counter()->raw_counter(),
    1.42 -               method->backedge_counter()->raw_counter(),
    1.43 +               mcs == NULL ? 0 : mcs->invocation_counter()->raw_counter(),
    1.44 +               mcs == NULL ? 0 : mcs->backedge_counter()->raw_counter(),
    1.45                 interpreter_invocation_count(),
    1.46                 interpreter_throwout_count(),
    1.47                 _instructions_size);

mercurial