//--------------------------test_for_osr_md_counter_at------------------------- void Parse::test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize counter_offset, int limit) { Node* adr_node = method_data_addressing(md, data, counter_offset); const TypePtr* adr_type = _gvn.type(adr_node)->is_ptr(); Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); test_counter_against_threshold(cnt, limit); }
//----------------------increment_and_test_invocation_counter------------------- void Parse::increment_and_test_invocation_counter(int limit) { if (!count_invocations()) return; // Get the Method* node. const TypePtr* adr_type = TypeMetadataPtr::make(method()); Node *method_node = makecon(adr_type); // Load the interpreter_invocation_counter from the Method*. int offset = Method::interpreter_invocation_counter_offset_in_bytes(); Node* adr_node = basic_plus_adr(method_node, method_node, offset); Node* cnt = make_load(NULL, adr_node, TypeInt::INT, T_INT, adr_type); test_counter_against_threshold(cnt, limit); // Add one to the counter and store Node* incr = _gvn.transform(new (C) AddINode(cnt, _gvn.intcon(1))); store_to_memory( NULL, adr_node, incr, T_INT, adr_type ); }
//----------------------increment_and_test_invocation_counter------------------- void Parse::increment_and_test_invocation_counter(int limit) { if (!count_invocations()) return; // Get the Method* node. ciMethod* m = method(); MethodCounters* counters_adr = m->ensure_method_counters(); if (counters_adr == NULL) { C->record_failure("method counters allocation failed"); return; } Node* ctrl = control(); const TypePtr* adr_type = TypeRawPtr::make((address) counters_adr); Node *counters_node = makecon(adr_type); Node* adr_iic_node = basic_plus_adr(counters_node, counters_node, MethodCounters::interpreter_invocation_counter_offset_in_bytes()); Node* cnt = make_load(ctrl, adr_iic_node, TypeInt::INT, T_INT, adr_type, MemNode::unordered); test_counter_against_threshold(cnt, limit); // Add one to the counter and store Node* incr = _gvn.transform(new AddINode(cnt, _gvn.intcon(1))); store_to_memory(ctrl, adr_iic_node, incr, T_INT, adr_type, MemNode::unordered); }