author | sgehwolf |
Wed, 07 Dec 2016 13:37:37 +0100 | |
changeset 42872 | fde06567a6fb |
parent 35479 | 62c12ca7a45e |
permissions | -rw-r--r-- |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
1 |
/* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
4 |
* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
8 |
* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
14 |
* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
18 |
* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
21 |
* questions. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
22 |
* |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
23 |
*/ |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
24 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
26 |
#include "interpreter/bytecodeInterpreter.hpp" |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
27 |
#include "interpreter/cppInterpreterGenerator.hpp" |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
28 |
#include "interpreter/interpreter.hpp" |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
29 |
#include "interpreter/interpreterRuntime.hpp" |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
30 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
31 |
#ifdef CC_INTERP |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
32 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
33 |
CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
34 |
generate_all(); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
35 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
36 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
37 |
void CppInterpreterGenerator::generate_all() { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
38 |
{ CodeletMark cm(_masm, "slow signature handler"); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
39 |
AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler(); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
40 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
41 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
42 |
#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
43 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
44 |
{ CodeletMark cm(_masm, "(kind = frame_manager)"); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
45 |
// all non-native method kinds |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
46 |
method_entry(zerolocals); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
47 |
method_entry(zerolocals_synchronized); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
48 |
method_entry(empty); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
49 |
method_entry(accessor); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
50 |
method_entry(abstract); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
51 |
method_entry(java_lang_math_sin ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
52 |
method_entry(java_lang_math_cos ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
53 |
method_entry(java_lang_math_tan ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
54 |
method_entry(java_lang_math_abs ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
55 |
method_entry(java_lang_math_sqrt ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
56 |
method_entry(java_lang_math_log ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
57 |
method_entry(java_lang_math_log10 ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
58 |
method_entry(java_lang_math_pow ); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
59 |
method_entry(java_lang_math_exp ); |
42872
fde06567a6fb
8170767: Zero fastdebug build triggers assertion
sgehwolf
parents:
35479
diff
changeset
|
60 |
method_entry(java_lang_math_fmaD ); |
fde06567a6fb
8170767: Zero fastdebug build triggers assertion
sgehwolf
parents:
35479
diff
changeset
|
61 |
method_entry(java_lang_math_fmaF ); |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
62 |
method_entry(java_lang_ref_reference_get); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
63 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
64 |
AbstractInterpreter::initialize_method_handle_entries(); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
65 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
66 |
Interpreter::_native_entry_begin = Interpreter::code()->code_end(); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
67 |
method_entry(native); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
68 |
method_entry(native_synchronized); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
69 |
Interpreter::_native_entry_end = Interpreter::code()->code_end(); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
70 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
71 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
72 |
#undef method_entry |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
73 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
74 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
75 |
// Generate method entries |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
76 |
address CppInterpreterGenerator::generate_method_entry( |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
77 |
AbstractInterpreter::MethodKind kind) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
78 |
// determine code generation flags |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
79 |
bool native = false; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
80 |
bool synchronized = false; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
81 |
address entry_point = NULL; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
82 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
83 |
switch (kind) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
84 |
case Interpreter::zerolocals : break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
85 |
case Interpreter::zerolocals_synchronized: synchronized = true; break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
86 |
case Interpreter::native : native = true; break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
87 |
case Interpreter::native_synchronized : native = true; synchronized = true; break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
88 |
case Interpreter::empty : entry_point = generate_empty_entry(); break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
89 |
case Interpreter::accessor : entry_point = generate_accessor_entry(); break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
90 |
case Interpreter::abstract : entry_point = generate_abstract_entry(); break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
91 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
92 |
case Interpreter::java_lang_math_sin : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
93 |
case Interpreter::java_lang_math_cos : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
94 |
case Interpreter::java_lang_math_tan : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
95 |
case Interpreter::java_lang_math_abs : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
96 |
case Interpreter::java_lang_math_log : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
97 |
case Interpreter::java_lang_math_log10 : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
98 |
case Interpreter::java_lang_math_sqrt : // fall thru |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
99 |
case Interpreter::java_lang_math_pow : // fall thru |
42872
fde06567a6fb
8170767: Zero fastdebug build triggers assertion
sgehwolf
parents:
35479
diff
changeset
|
100 |
case Interpreter::java_lang_math_exp : // fall thru |
fde06567a6fb
8170767: Zero fastdebug build triggers assertion
sgehwolf
parents:
35479
diff
changeset
|
101 |
case Interpreter::java_lang_math_fmaD : // fall thru |
fde06567a6fb
8170767: Zero fastdebug build triggers assertion
sgehwolf
parents:
35479
diff
changeset
|
102 |
case Interpreter::java_lang_math_fmaF : entry_point = generate_math_entry(kind); break; |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
103 |
case Interpreter::java_lang_ref_reference_get |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
104 |
: entry_point = generate_Reference_get_entry(); break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
105 |
default: |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
106 |
fatal("unexpected method kind: %d", kind); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
107 |
break; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
108 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
109 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
110 |
if (entry_point) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
111 |
return entry_point; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
112 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
113 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
114 |
// We expect the normal and native entry points to be generated first so we can reuse them. |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
115 |
if (native) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
116 |
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
117 |
if (entry_point == NULL) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
118 |
entry_point = generate_native_entry(synchronized); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
119 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
120 |
} else { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
121 |
entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
122 |
if (entry_point == NULL) { |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
123 |
entry_point = generate_normal_entry(synchronized); |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
124 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
125 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
126 |
|
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
127 |
return entry_point; |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
128 |
} |
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
diff
changeset
|
129 |
#endif // CC_INTERP |