src/share/vm/opto/parseHelper.cpp

changeset 4936
aeaca88565e6
parent 4313
beebba0acc11
child 5110
6f3fd5150b67
     1.1 --- a/src/share/vm/opto/parseHelper.cpp	Thu Apr 04 21:15:43 2013 -0700
     1.2 +++ b/src/share/vm/opto/parseHelper.cpp	Tue Apr 09 17:17:41 2013 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1998, 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 @@ -337,19 +337,21 @@
    1.11    if (!count_invocations()) return;
    1.12  
    1.13    // Get the Method* node.
    1.14 -  const TypePtr* adr_type = TypeMetadataPtr::make(method());
    1.15 -  Node *method_node = makecon(adr_type);
    1.16 +  ciMethod* m = method();
    1.17 +  address counters_adr = m->ensure_method_counters();
    1.18  
    1.19 -  // Load the interpreter_invocation_counter from the Method*.
    1.20 -  int offset = Method::interpreter_invocation_counter_offset_in_bytes();
    1.21 -  Node* adr_node = basic_plus_adr(method_node, method_node, offset);
    1.22 -  Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type);
    1.23 +  Node* ctrl = control();
    1.24 +  const TypePtr* adr_type = TypeRawPtr::make(counters_adr);
    1.25 +  Node *counters_node = makecon(adr_type);
    1.26 +  Node* adr_iic_node = basic_plus_adr(counters_node, counters_node,
    1.27 +    MethodCounters::interpreter_invocation_counter_offset_in_bytes());
    1.28 +  Node* cnt = make_load(ctrl, adr_iic_node, TypeInt::INT, T_INT, adr_type);
    1.29  
    1.30    test_counter_against_threshold(cnt, limit);
    1.31  
    1.32    // Add one to the counter and store
    1.33    Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1)));
    1.34 -  store_to_memory( NULL, adr_node, incr, T_INT, adr_type );
    1.35 +  store_to_memory( ctrl, adr_iic_node, incr, T_INT, adr_type );
    1.36  }
    1.37  
    1.38  //----------------------------method_data_addressing---------------------------

mercurial