Mercurial > hg > graal-compiler
annotate src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp @ 21814:5f07d936a14e
8058982: Better verification of an exceptional invokespecial
Summary: Throw VerifyError for illegal accesses
Reviewed-by: acorn, ahgross, coleenp
author | hseigel |
---|---|
date | Mon, 20 Oct 2014 15:14:56 -0400 |
parents | abe03600372a |
children | 327e7269f90d |
rev | line source |
---|---|
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
1 /* |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
3 * Copyright 2012, 2013 SAP AG. All rights reserved. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
5 * |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
6 * This code is free software; you can redistribute it and/or modify it |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
7 * under the terms of the GNU General Public License version 2 only, as |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
8 * published by the Free Software Foundation. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
9 * |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
10 * This code is distributed in the hope that it will be useful, but WITHOUT |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
13 * version 2 for more details (a copy is included in the LICENSE file that |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
14 * accompanied this code). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
15 * |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License version |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
17 * 2 along with this work; if not, write to the Free Software Foundation, |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
19 * |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
22 * questions. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
23 * |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
24 */ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
25 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
26 // This file defines a set of macros which are used by the c++-interpreter |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
27 // for updating a method's methodData object. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
28 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
29 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
30 #ifndef SHARE_VM_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
31 #define SHARE_VM_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
32 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
33 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
34 // Global settings ///////////////////////////////////////////////////////////// |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
35 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
36 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
37 // Enables profiling support. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
38 #if defined(COMPILER2) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
39 #define CC_INTERP_PROFILE |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
40 #endif |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
41 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
42 // Enables assertions for profiling code (also works in product-builds). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
43 // #define CC_INTERP_PROFILE_WITH_ASSERTIONS |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
44 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
45 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
46 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
47 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
48 // Empty dummy implementations if profiling code is switched off. ////////////// |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
49 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
50 #ifndef CC_INTERP_PROFILE |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
51 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
52 #define SET_MDX(mdx) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
53 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
54 #define BI_PROFILE_GET_OR_CREATE_METHOD_DATA(exception_handler) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
55 if (ProfileInterpreter) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
56 ShouldNotReachHere(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
57 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
58 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
59 #define BI_PROFILE_ALIGN_TO_CURRENT_BCI() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
60 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
61 #define BI_PROFILE_UPDATE_JUMP() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
62 #define BI_PROFILE_UPDATE_BRANCH(is_taken) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
63 #define BI_PROFILE_UPDATE_RET(bci) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
64 #define BI_PROFILE_SUBTYPECHECK_FAILED(receiver) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
65 #define BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
66 #define BI_PROFILE_UPDATE_INSTANCEOF(null_seen, receiver) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
67 #define BI_PROFILE_UPDATE_CALL() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
68 #define BI_PROFILE_UPDATE_FINALCALL() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
69 #define BI_PROFILE_UPDATE_VIRTUALCALL(receiver) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
70 #define BI_PROFILE_UPDATE_SWITCH(switch_index) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
71 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
72 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
73 #else |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
74 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
75 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
76 // Non-dummy implementations /////////////////////////////////////////////////// |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
77 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
78 // Accessors for the current method data pointer 'mdx'. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
79 #define MDX() (istate->mdx()) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
80 #define SET_MDX(mdx) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
81 if (TraceProfileInterpreter) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
82 /* Let it look like TraceBytecodes' format. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
83 tty->print_cr("[%d] %4d " \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
84 "mdx " PTR_FORMAT "(%d)" \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
85 " " \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
86 " \t-> " PTR_FORMAT "(%d)", \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
87 (int) THREAD->osthread()->thread_id(), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
88 BCI(), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
89 MDX(), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
90 (MDX() == NULL \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
91 ? 0 \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
92 : istate->method()->method_data()->dp_to_di((address)MDX())), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
93 mdx, \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
94 istate->method()->method_data()->dp_to_di((address)mdx) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
95 ); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
96 }; \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
97 istate->set_mdx(mdx); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
98 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
99 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
100 // Dumps the profiling method data for the current method. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
101 #ifdef PRODUCT |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
102 #define BI_PROFILE_PRINT_METHOD_DATA() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
103 #else // PRODUCT |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
104 #define BI_PROFILE_PRINT_METHOD_DATA() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
105 { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
106 ttyLocker ttyl; \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
107 MethodData *md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
108 tty->cr(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
109 tty->print("method data at mdx " PTR_FORMAT "(0) for", \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
110 md->data_layout_at(md->bci_to_di(0))); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
111 istate->method()->print_short_name(tty); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
112 tty->cr(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
113 if (md != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
114 md->print_data_on(tty); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
115 address mdx = (address) MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
116 if (mdx != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
117 tty->print_cr("current mdx " PTR_FORMAT "(%d)", \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
118 mdx, \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
119 istate->method()->method_data()->dp_to_di(mdx)); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
120 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
121 } else { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
122 tty->print_cr("no method data"); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
123 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
124 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
125 #endif // PRODUCT |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
126 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
127 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
128 // Gets or creates the profiling method data and initializes mdx. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
129 #define BI_PROFILE_GET_OR_CREATE_METHOD_DATA(exception_handler) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
130 if (ProfileInterpreter && MDX() == NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
131 /* Mdx is not yet initialized for this activation. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
132 MethodData *md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
133 if (md == NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
134 MethodCounters* mcs; \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
135 GET_METHOD_COUNTERS(mcs); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
136 /* The profiling method data doesn't exist for this method, */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
137 /* create it if the counters have overflowed. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
138 if (mcs->invocation_counter() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
139 ->reached_ProfileLimit(mcs->backedge_counter())) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
140 /* Must use CALL_VM, because an async exception may be pending. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
141 CALL_VM((InterpreterRuntime::profile_method(THREAD)), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
142 exception_handler); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
143 md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
144 if (md != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
145 if (TraceProfileInterpreter) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
146 BI_PROFILE_PRINT_METHOD_DATA(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
147 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
148 Method *m = istate->method(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
149 int bci = m->bci_from(pc); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
150 jint di = md->bci_to_di(bci); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
151 SET_MDX(md->data_layout_at(di)); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
152 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
153 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
154 } else { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
155 /* The profiling method data exists, align the method data pointer */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
156 /* mdx to the current bytecode index. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
157 if (TraceProfileInterpreter) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
158 BI_PROFILE_PRINT_METHOD_DATA(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
159 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
160 SET_MDX(md->data_layout_at(md->bci_to_di(BCI()))); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
161 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
162 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
163 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
164 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
165 // Asserts that the current method data pointer mdx corresponds |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
166 // to the current bytecode. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
167 #if defined(CC_INTERP_PROFILE_WITH_ASSERTIONS) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
168 #define BI_PROFILE_CHECK_MDX() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
169 { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
170 MethodData *md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
171 address mdx = (address) MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
172 address mdx2 = (address) md->data_layout_at(md->bci_to_di(BCI())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
173 guarantee(md != NULL, "1"); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
174 guarantee(mdx != NULL, "2"); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
175 guarantee(mdx2 != NULL, "3"); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
176 if (mdx != mdx2) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
177 BI_PROFILE_PRINT_METHOD_DATA(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
178 fatal3("invalid mdx at bci %d:" \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
179 " was " PTR_FORMAT \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
180 " but expected " PTR_FORMAT, \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
181 BCI(), \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
182 mdx, \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
183 mdx2); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
184 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
185 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
186 #else |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
187 #define BI_PROFILE_CHECK_MDX() |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
188 #endif |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
189 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
190 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
191 // Aligns the method data pointer mdx to the current bytecode index. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
192 #define BI_PROFILE_ALIGN_TO_CURRENT_BCI() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
193 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
194 MethodData *md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
195 SET_MDX(md->data_layout_at(md->bci_to_di(BCI()))); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
196 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
197 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
198 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
199 // Updates profiling data for a jump. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
200 #define BI_PROFILE_UPDATE_JUMP() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
201 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
202 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
203 JumpData::increment_taken_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
204 /* Remember last branch taken count. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
205 mdo_last_branch_taken_count = JumpData::taken_count(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
206 SET_MDX(JumpData::advance_taken(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
207 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
208 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
209 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
210 // Updates profiling data for a taken/not taken branch. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
211 #define BI_PROFILE_UPDATE_BRANCH(is_taken) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
212 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
213 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
214 if (is_taken) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
215 BranchData::increment_taken_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
216 /* Remember last branch taken count. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
217 mdo_last_branch_taken_count = BranchData::taken_count(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
218 SET_MDX(BranchData::advance_taken(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
219 } else { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
220 BranchData::increment_not_taken_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
221 SET_MDX(BranchData::advance_not_taken(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
222 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
223 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
224 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
225 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
226 // Updates profiling data for a ret with given bci. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
227 #define BI_PROFILE_UPDATE_RET(bci) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
228 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
229 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
230 MethodData *md = istate->method()->method_data(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
231 /* FIXME: there is more to do here than increment and advance(mdx)! */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
232 CounterData::increment_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
233 SET_MDX(RetData::advance(md, bci)); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
234 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
235 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
236 // Decrement counter at checkcast if the subtype check fails (as template |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
237 // interpreter does!). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
238 #define BI_PROFILE_SUBTYPECHECK_FAILED(receiver) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
239 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
240 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
241 ReceiverTypeData::increment_receiver_count_no_overflow(MDX(), receiver); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
242 ReceiverTypeData::decrement_count(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
243 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
244 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
245 // Updates profiling data for a checkcast (was a null seen? which receiver?). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
246 #define BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
247 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
248 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
249 if (null_seen) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
250 ReceiverTypeData::set_null_seen(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
251 } else { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
252 /* Template interpreter doesn't increment count. */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
253 /* ReceiverTypeData::increment_count_no_overflow(MDX()); */ \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
254 ReceiverTypeData::increment_receiver_count_no_overflow(MDX(), receiver); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
255 } \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
256 SET_MDX(ReceiverTypeData::advance(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
257 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
258 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
259 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
260 // Updates profiling data for an instanceof (was a null seen? which receiver?). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
261 #define BI_PROFILE_UPDATE_INSTANCEOF(null_seen, receiver) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
262 BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
263 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
264 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
265 // Updates profiling data for a call. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
266 #define BI_PROFILE_UPDATE_CALL() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
267 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
268 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
269 CounterData::increment_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
270 SET_MDX(CounterData::advance(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
271 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
272 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
273 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
274 // Updates profiling data for a final call. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
275 #define BI_PROFILE_UPDATE_FINALCALL() \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
276 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
277 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
278 VirtualCallData::increment_count_no_overflow(MDX()); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
279 SET_MDX(VirtualCallData::advance(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
280 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
281 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
282 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
283 // Updates profiling data for a virtual call with given receiver Klass. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
284 #define BI_PROFILE_UPDATE_VIRTUALCALL(receiver) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
285 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
286 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
287 VirtualCallData::increment_receiver_count_no_overflow(MDX(), receiver); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
288 SET_MDX(VirtualCallData::advance(MDX())); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
289 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
290 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
291 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
292 // Updates profiling data for a switch (tabelswitch or lookupswitch) with |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
293 // given taken index (-1 means default case was taken). |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
294 #define BI_PROFILE_UPDATE_SWITCH(switch_index) \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
295 if (ProfileInterpreter && MDX() != NULL) { \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
296 BI_PROFILE_CHECK_MDX(); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
297 MultiBranchData::increment_count_no_overflow(MDX(), switch_index); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
298 SET_MDX(MultiBranchData::advance(MDX(), switch_index)); \ |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
299 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
300 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
301 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
302 // The end ///////////////////////////////////////////////////////////////////// |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
303 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
304 #endif // CC_INTERP_PROFILE |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
305 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
306 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
307 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
diff
changeset
|
308 #endif // SHARE_VM_INTERPRETER_BYTECODECINTERPRETERPROFILING_HPP |