1 /* |
1 /* |
2 * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2017, 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. |
55 // level with a regular invocation entry. |
55 // level with a regular invocation entry. |
56 CompLevel call_event(Method* method, CompLevel cur_level, JavaThread* thread); |
56 CompLevel call_event(Method* method, CompLevel cur_level, JavaThread* thread); |
57 // loop_event checks if a method should be OSR compiled at a different |
57 // loop_event checks if a method should be OSR compiled at a different |
58 // level. |
58 // level. |
59 CompLevel loop_event(Method* method, CompLevel cur_level, JavaThread* thread); |
59 CompLevel loop_event(Method* method, CompLevel cur_level, JavaThread* thread); |
60 void print_counters(const char* prefix, methodHandle mh); |
60 void print_counters(const char* prefix, const methodHandle& mh); |
61 protected: |
61 protected: |
62 int c1_count() const { return _c1_count; } |
62 int c1_count() const { return _c1_count; } |
63 int c2_count() const { return _c2_count; } |
63 int c2_count() const { return _c2_count; } |
64 void set_c1_count(int x) { _c1_count = x; } |
64 void set_c1_count(int x) { _c1_count = x; } |
65 void set_c2_count(int x) { _c2_count = x; } |
65 void set_c2_count(int x) { _c2_count = x; } |
66 |
66 |
67 enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT }; |
67 enum EventType { CALL, LOOP, COMPILE, REMOVE_FROM_QUEUE, UPDATE_IN_QUEUE, REPROFILE, MAKE_NOT_ENTRANT }; |
68 void print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level); |
68 void print_event(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level); |
69 // Print policy-specific information if necessary |
69 // Print policy-specific information if necessary |
70 virtual void print_specific(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { } |
70 virtual void print_specific(EventType type, const methodHandle& mh, const methodHandle& imh, int bci, CompLevel level) { } |
71 // Check if the method can be compiled, change level if necessary |
71 // Check if the method can be compiled, change level if necessary |
72 void compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread); |
72 void compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread); |
73 // Submit a given method for compilation |
73 // Submit a given method for compilation |
74 virtual void submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread); |
74 virtual void submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread); |
75 // Simple methods are as good being compiled with C1 as C2. |
75 // Simple methods are as good being compiled with C1 as C2. |