author | redestad |
Thu, 29 Mar 2018 10:38:29 +0200 | |
changeset 49641 | 2ad3212a7dd9 |
parent 49449 | ef5d5d343e2a |
child 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
12095 | 1 |
/* |
47659 | 2 |
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. |
12095 | 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 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#ifndef SHARE_VM_PRIMS_WHITEBOX_HPP |
|
26 |
#define SHARE_VM_PRIMS_WHITEBOX_HPP |
|
27 |
||
47659 | 28 |
#include "jni.h" |
12262
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
29 |
|
27917
c5937f7b4e8b
8064669: compiler/whitebox/AllocationCodeBlobTest.java crashes / asserts
iignatyev
parents:
27642
diff
changeset
|
30 |
#include "utilities/exceptions.hpp" |
12262
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
31 |
#include "memory/allocation.hpp" |
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
32 |
#include "oops/oopsHierarchy.hpp" |
26844 | 33 |
#include "oops/symbol.hpp" |
49449
ef5d5d343e2a
8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents:
47659
diff
changeset
|
34 |
|
ef5d5d343e2a
8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents:
47659
diff
changeset
|
35 |
#define WB_METHOD_DECLARE(result_type) extern "C" result_type JNICALL |
12262
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
36 |
|
41084
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
37 |
// Unconditionally clear pedantic pending JNI checks |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
38 |
class ClearPendingJniExcCheck : public StackObj { |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
39 |
private: |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
40 |
JavaThread* _thread; |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
41 |
public: |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
42 |
ClearPendingJniExcCheck(JNIEnv* env) : _thread(JavaThread::thread_from_jni_environment(env)) {} |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
43 |
~ClearPendingJniExcCheck() { |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
44 |
_thread->clear_pending_jni_exception_check(); |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
45 |
} |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
46 |
}; |
fc5db29fa08e
8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents:
38024
diff
changeset
|
47 |
|
27642
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
48 |
class CodeBlob; |
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
49 |
class CodeHeap; |
27917
c5937f7b4e8b
8064669: compiler/whitebox/AllocationCodeBlobTest.java crashes / asserts
iignatyev
parents:
27642
diff
changeset
|
50 |
class JavaThread; |
27642
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
51 |
|
12095 | 52 |
class WhiteBox : public AllStatic { |
53 |
private: |
|
54 |
static bool _used; |
|
55 |
public: |
|
27642
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
56 |
static volatile bool compilation_locked; |
12095 | 57 |
static bool used() { return _used; } |
58 |
static void set_used() { _used = true; } |
|
12262
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
59 |
static int offset_for_field(const char* field_name, oop object, |
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
60 |
Symbol* signature_symbol); |
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
61 |
static const char* lookup_jstring(const char* field_name, oop object); |
fb3b9fede660
7148488: Whitebox tests for the Diagnostic Framework Parser
nloodin
parents:
12095
diff
changeset
|
62 |
static bool lookup_bool(const char* field_name, oop object); |
27642
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
63 |
static int get_blob_type(const CodeBlob* code); |
8c9eff693145
8059624: Test task: WhiteBox API for testing segmented codecache feature
iignatyev
parents:
26844
diff
changeset
|
64 |
static CodeHeap* get_code_heap(int blob_type); |
28042
40ce95bcdc78
8065134: Need WhiteBox::allocateCodeBlob(long, int) method to be implemented
iignatyev
parents:
27917
diff
changeset
|
65 |
static CodeBlob* allocate_code_blob(int size, int blob_type); |
25492
d27050bdfb04
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
25491
diff
changeset
|
66 |
static int array_bytes_to_length(size_t bytes); |
26844 | 67 |
static void register_methods(JNIEnv* env, jclass wbclass, JavaThread* thread, |
68 |
JNINativeMethod* method_array, int method_count); |
|
69 |
static void register_extended(JNIEnv* env, jclass wbclass, JavaThread* thread); |
|
38024
84095353e30f
8153514: Whitebox API should allow compilation of <clinit>
thartmann
parents:
30205
diff
changeset
|
70 |
static bool compile_method(Method* method, int comp_level, int bci, Thread* THREAD); |
12095 | 71 |
}; |
72 |
||
73 |
#endif // SHARE_VM_PRIMS_WHITEBOX_HPP |