comparison src/share/vm/graal/graalVMExits.hpp @ 2890:c23d45daff9b

Renamed cpp/hpp file directory.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 08 Jun 2011 13:40:25 +0200
parents src/share/vm/c1x/graalVMExits.hpp@2fb867285938
children d577d07cedec
comparison
equal deleted inserted replaced
2889:2fb867285938 2890:c23d45daff9b
1 /*
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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 #include "memory/allocation.hpp"
25 #include "oops/oop.hpp"
26 #include "runtime/handles.hpp"
27 #include "runtime/thread.hpp"
28 #include "classfile/javaClasses.hpp"
29 #include "runtime/jniHandles.hpp"
30 #include "runtime/javaCalls.hpp"
31
32 class VMExits : public AllStatic {
33
34 private:
35 static jobject _compilerPermObject;
36 static jobject _vmExitsPermObject;
37 static jobject _vmExitsPermKlass;
38
39 static KlassHandle vmExitsKlass();
40 static Handle instance();
41
42 public:
43 static void initializeCompiler();
44
45 static Handle compilerInstance();
46
47 // public static boolean HotSpotOptions.setOption(String option);
48 static jboolean setOption(Handle option);
49
50 // public static void HotSpotOptions.setDefaultOptions();
51 static void setDefaultOptions();
52
53 // public abstract void compileMethod(long vmId, String name, int entry_bci);
54 static void compileMethod(jlong vmId, Handle name, int entry_bci);
55
56 // public abstract RiMethod createRiMethodResolved(long vmId, String name);
57 static oop createRiMethodResolved(jlong vmId, Handle name, TRAPS);
58
59 // public abstract RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
60 static oop createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS);
61
62 // public abstract RiField createRiField(RiType holder, String name, RiType type, int flags, int offset);
63 static oop createRiField(Handle holder, Handle name, Handle type, int index, int flags, TRAPS);
64
65 // public abstract RiType createRiType(long vmId, String name);
66 static oop createRiType(jlong vmId, Handle name, TRAPS);
67
68 // public abstract RiType createRiTypeUnresolved(String name);
69 static oop createRiTypeUnresolved(Handle name, TRAPS);
70
71 // public abstract RiConstantPool createRiConstantPool(long vmId);
72 static oop createRiConstantPool(jlong vmId, TRAPS);
73
74 // public abstract RiType createRiTypePrimitive(int basicType);
75 static oop createRiTypePrimitive(int basicType, TRAPS);
76
77 // public abstract RiSignature createRiSignature(String signature);
78 static oop createRiSignature(Handle name, TRAPS);
79
80 // public abstract CiConstant createCiConstant(CiKind kind, long value);
81 static oop createCiConstant(Handle kind, jlong value, TRAPS);
82
83 // public abstract CiConstant createCiConstantFloat(float value);
84 static oop createCiConstantFloat(jfloat value, TRAPS);
85
86 // public abstract CiConstant createCiConstantDouble(double value);
87 static oop createCiConstantDouble(jdouble value, TRAPS);
88
89 // public abstract CiConstant createCiConstantObject(long vmId);
90 static oop createCiConstantObject(Handle object, TRAPS);
91 };
92
93 inline void check_pending_exception(const char* message, bool dump_core = false) {
94 Thread* THREAD = Thread::current();
95 if (THREAD->has_pending_exception()) {
96 Handle exception = PENDING_EXCEPTION;
97 CLEAR_PENDING_EXCEPTION;
98 tty->print_cr("%s", message);
99 java_lang_Throwable::print(exception, tty);
100 tty->cr();
101 java_lang_Throwable::print_stack_trace(exception(), tty);
102 vm_abort(dump_core);
103 }
104 }
105
106 inline void check_not_null(void* value, const char* message, bool dump_core = false) {
107 if (value == NULL) {
108 tty->print_cr("%s", message);
109 vm_abort(dump_core);
110 }
111 }