Mercurial > hg > graal-compiler
annotate src/share/vm/interpreter/cppInterpreter.cpp @ 3992:d1bdeef3e3e2
7098282: G1: assert(interval >= 0) failed: Sanity check, referencePolicy.cpp: 76
Summary: There is a race between one thread successfully forwarding and copying the klass mirror for the SoftReference class (including the static master clock) and another thread attempting to use the master clock while attempting to discover a soft reference object. Maintain a shadow copy of the soft reference master clock and use the shadow during reference discovery and reference processing.
Reviewed-by: tonyp, brutisso, ysr
author | johnc |
---|---|
date | Wed, 12 Oct 2011 10:25:51 -0700 |
parents | e1162778c1c8 |
children | a3e2f723f2a5 |
rev | line source |
---|---|
0 | 1 /* |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
1972
diff
changeset
|
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
710
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
710
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
710
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "interpreter/bytecodeInterpreter.hpp" | |
27 #include "interpreter/interpreter.hpp" | |
28 #include "interpreter/interpreterGenerator.hpp" | |
29 #include "interpreter/interpreterRuntime.hpp" | |
0 | 30 |
31 #ifdef CC_INTERP | |
32 # define __ _masm-> | |
33 | |
34 void CppInterpreter::initialize() { | |
35 if (_code != NULL) return; | |
36 AbstractInterpreter::initialize(); | |
37 | |
38 // generate interpreter | |
39 { ResourceMark rm; | |
40 TraceTime timer("Interpreter generation", TraceStartupTime); | |
41 int code_size = InterpreterCodeSize; | |
42 NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space | |
43 _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, | |
44 "Interpreter"); | |
45 InterpreterGenerator g(_code); | |
46 if (PrintInterpreter) print(); | |
47 } | |
48 | |
49 | |
50 // Allow c++ interpreter to do one initialization now that switches are set, etc. | |
51 BytecodeInterpreter start_msg(BytecodeInterpreter::initialize); | |
52 if (JvmtiExport::can_post_interpreter_events()) | |
53 BytecodeInterpreter::runWithChecks(&start_msg); | |
54 else | |
55 BytecodeInterpreter::run(&start_msg); | |
56 } | |
57 | |
58 | |
59 address CppInterpreter::_tosca_to_stack [AbstractInterpreter::number_of_result_handlers]; | |
60 address CppInterpreter::_stack_to_stack [AbstractInterpreter::number_of_result_handlers]; | |
61 address CppInterpreter::_stack_to_native_abi [AbstractInterpreter::number_of_result_handlers]; | |
62 | |
63 CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { | |
64 } | |
65 | |
66 static const BasicType types[Interpreter::number_of_result_handlers] = { | |
67 T_BOOLEAN, | |
68 T_CHAR , | |
69 T_BYTE , | |
70 T_SHORT , | |
71 T_INT , | |
72 T_LONG , | |
73 T_VOID , | |
74 T_FLOAT , | |
75 T_DOUBLE , | |
76 T_OBJECT | |
77 }; | |
78 | |
79 void CppInterpreterGenerator::generate_all() { | |
80 AbstractInterpreterGenerator::generate_all(); | |
81 | |
82 { CodeletMark cm(_masm, "result handlers for native calls"); | |
83 // The various result converter stublets. | |
84 int is_generated[Interpreter::number_of_result_handlers]; | |
85 memset(is_generated, 0, sizeof(is_generated)); | |
86 int _tosca_to_stack_is_generated[Interpreter::number_of_result_handlers]; | |
87 int _stack_to_stack_is_generated[Interpreter::number_of_result_handlers]; | |
88 int _stack_to_native_abi_is_generated[Interpreter::number_of_result_handlers]; | |
89 | |
90 memset(_tosca_to_stack_is_generated, 0, sizeof(_tosca_to_stack_is_generated)); | |
91 memset(_stack_to_stack_is_generated, 0, sizeof(_stack_to_stack_is_generated)); | |
92 memset(_stack_to_native_abi_is_generated, 0, sizeof(_stack_to_native_abi_is_generated)); | |
93 for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { | |
94 BasicType type = types[i]; | |
95 if (!is_generated[Interpreter::BasicType_as_index(type)]++) { | |
96 Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); | |
97 } | |
98 if (!_tosca_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { | |
99 Interpreter::_tosca_to_stack[Interpreter::BasicType_as_index(type)] = generate_tosca_to_stack_converter(type); | |
100 } | |
101 if (!_stack_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { | |
102 Interpreter::_stack_to_stack[Interpreter::BasicType_as_index(type)] = generate_stack_to_stack_converter(type); | |
103 } | |
104 if (!_stack_to_native_abi_is_generated[Interpreter::BasicType_as_index(type)]++) { | |
105 Interpreter::_stack_to_native_abi[Interpreter::BasicType_as_index(type)] = generate_stack_to_native_abi_converter(type); | |
106 } | |
107 } | |
108 } | |
109 | |
110 | |
111 #define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) | |
112 | |
113 { CodeletMark cm(_masm, "(kind = frame_manager)"); | |
114 // all non-native method kinds | |
115 method_entry(zerolocals); | |
116 method_entry(zerolocals_synchronized); | |
117 method_entry(empty); | |
118 method_entry(accessor); | |
119 method_entry(abstract); | |
710 | 120 method_entry(method_handle); |
0 | 121 method_entry(java_lang_math_sin ); |
122 method_entry(java_lang_math_cos ); | |
123 method_entry(java_lang_math_tan ); | |
124 method_entry(java_lang_math_abs ); | |
125 method_entry(java_lang_math_sqrt ); | |
126 method_entry(java_lang_math_log ); | |
127 method_entry(java_lang_math_log10 ); | |
3249
e1162778c1c8
7009266: G1: assert(obj->is_oop_or_null(true )) failed: Error
johnc
parents:
1972
diff
changeset
|
128 method_entry(java_lang_ref_reference_get); |
0 | 129 Interpreter::_native_entry_begin = Interpreter::code()->code_end(); |
130 method_entry(native); | |
131 method_entry(native_synchronized); | |
132 Interpreter::_native_entry_end = Interpreter::code()->code_end(); | |
133 } | |
134 | |
135 | |
136 #undef method_entry | |
137 | |
138 } | |
139 | |
140 #endif // CC_INTERP |