author | rprotacio |
Wed, 17 Feb 2016 14:03:18 -0500 | |
changeset 36178 | 9739f8c767da |
parent 35479 | 62c12ca7a45e |
child 37161 | e881f320966e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
35214
diff
changeset
|
2 |
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2534
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2534
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2534
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "interpreter/bytecodeInterpreter.hpp" |
|
35214 | 27 |
#include "interpreter/cppInterpreterGenerator.hpp" |
7397 | 28 |
#include "interpreter/interpreter.hpp" |
29 |
#include "interpreter/interpreterRuntime.hpp" |
|
36178
9739f8c767da
8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
35479
diff
changeset
|
30 |
#include "runtime/logTimer.hpp" |
1 | 31 |
|
32 |
#ifdef CC_INTERP |
|
35214 | 33 |
|
34 |
#ifdef ZERO |
|
35 |
# include "entry_zero.hpp" |
|
36 |
#else |
|
37 |
#error "Only Zero CppInterpreter is supported" |
|
38 |
#endif |
|
1 | 39 |
|
40 |
void CppInterpreter::initialize() { |
|
41 |
if (_code != NULL) return; |
|
42 |
AbstractInterpreter::initialize(); |
|
43 |
||
44 |
// generate interpreter |
|
45 |
{ ResourceMark rm; |
|
36178
9739f8c767da
8148630: Convert TraceStartupTime to Unified Logging
rprotacio
parents:
35479
diff
changeset
|
46 |
TraceStartupTime timer("Interpreter generation"); |
1 | 47 |
int code_size = InterpreterCodeSize; |
48 |
NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space |
|
49 |
_code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, |
|
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
35214
diff
changeset
|
50 |
"Interpreter"); |
35214 | 51 |
CppInterpreterGenerator g(_code); |
1 | 52 |
if (PrintInterpreter) print(); |
53 |
} |
|
54 |
||
55 |
// Allow c++ interpreter to do one initialization now that switches are set, etc. |
|
56 |
BytecodeInterpreter start_msg(BytecodeInterpreter::initialize); |
|
57 |
if (JvmtiExport::can_post_interpreter_events()) |
|
58 |
BytecodeInterpreter::runWithChecks(&start_msg); |
|
59 |
else |
|
60 |
BytecodeInterpreter::run(&start_msg); |
|
61 |
} |
|
62 |
||
63 |
||
35214 | 64 |
void CppInterpreter::invoke_method(Method* method, address entry_point, TRAPS) { |
65 |
((ZeroEntry *) entry_point)->invoke(method, THREAD); |
|
66 |
} |
|
67 |
||
68 |
void CppInterpreter::invoke_osr(Method* method, |
|
69 |
address entry_point, |
|
70 |
address osr_buf, |
|
71 |
TRAPS) { |
|
72 |
((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD); |
|
73 |
} |
|
74 |
||
1 | 75 |
|
76 |
||
35214 | 77 |
InterpreterCodelet* CppInterpreter::codelet_containing(address pc) { |
78 |
// FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied. |
|
79 |
return (InterpreterCodelet*)_code->stub_containing(pc); |
|
1 | 80 |
} |
81 |
||
82 |
#endif // CC_INTERP |