hotspot/src/share/vm/opto/parseHelper.cpp
changeset 17000 11bf92e571a2
parent 14621 fd9265ab0f67
child 17383 3665c0901a0d
equal deleted inserted replaced
16665:482e60f4f893 17000:11bf92e571a2
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   335 //----------------------increment_and_test_invocation_counter-------------------
   335 //----------------------increment_and_test_invocation_counter-------------------
   336 void Parse::increment_and_test_invocation_counter(int limit) {
   336 void Parse::increment_and_test_invocation_counter(int limit) {
   337   if (!count_invocations()) return;
   337   if (!count_invocations()) return;
   338 
   338 
   339   // Get the Method* node.
   339   // Get the Method* node.
   340   const TypePtr* adr_type = TypeMetadataPtr::make(method());
   340   ciMethod* m = method();
   341   Node *method_node = makecon(adr_type);
   341   address counters_adr = m->ensure_method_counters();
   342 
   342 
   343   // Load the interpreter_invocation_counter from the Method*.
   343   Node* ctrl = control();
   344   int offset = Method::interpreter_invocation_counter_offset_in_bytes();
   344   const TypePtr* adr_type = TypeRawPtr::make(counters_adr);
   345   Node* adr_node = basic_plus_adr(method_node, method_node, offset);
   345   Node *counters_node = makecon(adr_type);
   346   Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type);
   346   Node* adr_iic_node = basic_plus_adr(counters_node, counters_node,
       
   347     MethodCounters::interpreter_invocation_counter_offset_in_bytes());
       
   348   Node* cnt = make_load(ctrl, adr_iic_node, TypeInt::INT, T_INT, adr_type);
   347 
   349 
   348   test_counter_against_threshold(cnt, limit);
   350   test_counter_against_threshold(cnt, limit);
   349 
   351 
   350   // Add one to the counter and store
   352   // Add one to the counter and store
   351   Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1)));
   353   Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1)));
   352   store_to_memory( NULL, adr_node, incr, T_INT, adr_type );
   354   store_to_memory( ctrl, adr_iic_node, incr, T_INT, adr_type );
   353 }
   355 }
   354 
   356 
   355 //----------------------------method_data_addressing---------------------------
   357 //----------------------------method_data_addressing---------------------------
   356 Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) {
   358 Node* Parse::method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, Node* idx, uint stride) {
   357   // Get offset within MethodData* of the data array
   359   // Get offset within MethodData* of the data array