src/cpu/x86/vm/cppInterpreter_x86.cpp

changeset 4936
aeaca88565e6
parent 4873
e961c11b85fe
child 5225
603ca7e51354
     1.1 --- a/src/cpu/x86/vm/cppInterpreter_x86.cpp	Thu Apr 04 21:15:43 2013 -0700
     1.2 +++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp	Tue Apr 09 17:17:41 2013 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2007, 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 @@ -570,20 +570,28 @@
    1.11  // rcx: invocation counter
    1.12  //
    1.13  void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) {
    1.14 -
    1.15 -  const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
    1.16 -  const Address backedge_counter  (rbx, Method::backedge_counter_offset() + InvocationCounter::counter_offset());
    1.17 -
    1.18 -  if (ProfileInterpreter) { // %%% Merge this into MethodData*
    1.19 -    __ incrementl(Address(rbx,Method::interpreter_invocation_counter_offset()));
    1.20 +  Label done;
    1.21 +  const Address invocation_counter(rax,
    1.22 +                MethodCounters::invocation_counter_offset() +
    1.23 +                InvocationCounter::counter_offset());
    1.24 +  const Address backedge_counter  (rax,
    1.25 +                MethodCounter::backedge_counter_offset() +
    1.26 +                InvocationCounter::counter_offset());
    1.27 +
    1.28 +  __ get_method_counters(rbx, rax, done);
    1.29 +
    1.30 +  if (ProfileInterpreter) {
    1.31 +    __ incrementl(Address(rax,
    1.32 +            MethodCounters::interpreter_invocation_counter_offset()));
    1.33    }
    1.34    // Update standard invocation counters
    1.35 +  __ movl(rcx, invocation_counter);
    1.36 +  __ increment(rcx, InvocationCounter::count_increment);
    1.37 +  __ movl(invocation_counter, rcx);             // save invocation count
    1.38 +
    1.39    __ movl(rax, backedge_counter);               // load backedge counter
    1.40 -
    1.41 -  __ increment(rcx, InvocationCounter::count_increment);
    1.42    __ andl(rax, InvocationCounter::count_mask_value);  // mask out the status bits
    1.43  
    1.44 -  __ movl(invocation_counter, rcx);             // save invocation count
    1.45    __ addl(rcx, rax);                            // add both counters
    1.46  
    1.47    // profile_method is non-null only for interpreted method so
    1.48 @@ -593,7 +601,7 @@
    1.49    __ cmp32(rcx,
    1.50             ExternalAddress((address)&InvocationCounter::InterpreterInvocationLimit));
    1.51    __ jcc(Assembler::aboveEqual, *overflow);
    1.52 -
    1.53 +  __ bind(done);
    1.54  }
    1.55  
    1.56  void InterpreterGenerator::generate_counter_overflow(Label* do_continue) {
    1.57 @@ -977,7 +985,6 @@
    1.58    address entry_point = __ pc();
    1.59  
    1.60    const Address constMethod       (rbx, Method::const_offset());
    1.61 -  const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
    1.62    const Address access_flags      (rbx, Method::access_flags_offset());
    1.63    const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset());
    1.64  
    1.65 @@ -1029,8 +1036,6 @@
    1.66    }
    1.67  #endif
    1.68  
    1.69 -  if (inc_counter) __ movl(rcx, invocation_counter);  // (pre-)fetch invocation count
    1.70 -
    1.71    const Register unlock_thread = LP64_ONLY(r15_thread) NOT_LP64(rax);
    1.72    NOT_LP64(__ movptr(unlock_thread, STATE(_thread));) // get thread
    1.73    // Since at this point in the method invocation the exception handler

mercurial