comparison src/share/vm/ci/ciMethodData.cpp @ 1783:d5d065957597

6953144: Tiered compilation Summary: Infrastructure for tiered compilation support (interpreter + c1 + c2) for 32 and 64 bit. Simple tiered policy implementation. Reviewed-by: kvn, never, phh, twisti
author iveresov
date Fri, 03 Sep 2010 17:51:07 -0700
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1782:f353275af40e 1783:d5d065957597
1 /* 1 /*
2 * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2010, 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.
35 Copy::zero_to_words((HeapWord*) &_orig, sizeof(_orig) / sizeof(HeapWord)); 35 Copy::zero_to_words((HeapWord*) &_orig, sizeof(_orig) / sizeof(HeapWord));
36 _data = NULL; 36 _data = NULL;
37 _data_size = 0; 37 _data_size = 0;
38 _extra_data_size = 0; 38 _extra_data_size = 0;
39 _current_mileage = 0; 39 _current_mileage = 0;
40 _invocation_counter = 0;
41 _backedge_counter = 0;
40 _state = empty_state; 42 _state = empty_state;
41 _saw_free_extra_data = false; 43 _saw_free_extra_data = false;
42 // Set an initial hint. Don't use set_hint_di() because 44 // Set an initial hint. Don't use set_hint_di() because
43 // first_di() may be out of bounds if data_size is 0. 45 // first_di() may be out of bounds if data_size is 0.
44 _hint_di = first_di(); 46 _hint_di = first_di();
54 Copy::zero_to_words((HeapWord*) &_orig, sizeof(_orig) / sizeof(HeapWord)); 56 Copy::zero_to_words((HeapWord*) &_orig, sizeof(_orig) / sizeof(HeapWord));
55 _data = NULL; 57 _data = NULL;
56 _data_size = 0; 58 _data_size = 0;
57 _extra_data_size = 0; 59 _extra_data_size = 0;
58 _current_mileage = 0; 60 _current_mileage = 0;
61 _invocation_counter = 0;
62 _backedge_counter = 0;
59 _state = empty_state; 63 _state = empty_state;
60 _saw_free_extra_data = false; 64 _saw_free_extra_data = false;
61 // Set an initial hint. Don't use set_hint_di() because 65 // Set an initial hint. Don't use set_hint_di() because
62 // first_di() may be out of bounds if data_size is 0. 66 // first_di() may be out of bounds if data_size is 0.
63 _hint_di = first_di(); 67 _hint_di = first_di();
97 ci_data = next_data(ci_data); 101 ci_data = next_data(ci_data);
98 data = mdo->next_data(data); 102 data = mdo->next_data(data);
99 } 103 }
100 // Note: Extra data are all BitData, and do not need translation. 104 // Note: Extra data are all BitData, and do not need translation.
101 _current_mileage = methodDataOopDesc::mileage_of(mdo->method()); 105 _current_mileage = methodDataOopDesc::mileage_of(mdo->method());
106 _invocation_counter = mdo->invocation_count();
107 _backedge_counter = mdo->backedge_count();
102 _state = mdo->is_mature()? mature_state: immature_state; 108 _state = mdo->is_mature()? mature_state: immature_state;
103 109
104 _eflags = mdo->eflags(); 110 _eflags = mdo->eflags();
105 _arg_local = mdo->arg_local(); 111 _arg_local = mdo->arg_local();
106 _arg_stack = mdo->arg_stack(); 112 _arg_stack = mdo->arg_stack();
251 mdo->set_arg_modified(i, arg_modified(i)); 257 mdo->set_arg_modified(i, arg_modified(i));
252 } 258 }
253 } 259 }
254 } 260 }
255 261
262 void ciMethodData::set_compilation_stats(short loops, short blocks) {
263 VM_ENTRY_MARK;
264 methodDataOop mdo = get_methodDataOop();
265 if (mdo != NULL) {
266 mdo->set_num_loops(loops);
267 mdo->set_num_blocks(blocks);
268 }
269 }
270
271 void ciMethodData::set_would_profile(bool p) {
272 VM_ENTRY_MARK;
273 methodDataOop mdo = get_methodDataOop();
274 if (mdo != NULL) {
275 mdo->set_would_profile(p);
276 }
277 }
278
256 bool ciMethodData::has_escape_info() { 279 bool ciMethodData::has_escape_info() {
257 return eflag_set(methodDataOopDesc::estimated); 280 return eflag_set(methodDataOopDesc::estimated);
258 } 281 }
259 282
260 void ciMethodData::set_eflag(methodDataOopDesc::EscapeFlag f) { 283 void ciMethodData::set_eflag(methodDataOopDesc::EscapeFlag f) {