Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompilerToVM.hpp @ 5747:120820e30baa
added basic high-level interpreter support to HotSpot
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Tue, 03 Jul 2012 16:56:40 +0200 |
parents | bcbb918f5ac6 |
children | e522a00b91aa |
comparison
equal
deleted
inserted
replaced
5746:17d2c3b72762 | 5747:120820e30baa |
---|---|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | 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 | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 | 23 |
24 #ifndef SHARE_VM_GRAAL_GRAAL_COMPILER_TO_VM_HPP | |
25 #define SHARE_VM_GRAAL_GRAAL_COMPILER_TO_VM_HPP | |
26 | |
24 #include "prims/jni.h" | 27 #include "prims/jni.h" |
25 | 28 |
26 extern JNINativeMethod CompilerToVM_methods[]; | 29 extern JNINativeMethod CompilerToVM_methods[]; |
27 int CompilerToVM_methods_count(); | 30 int CompilerToVM_methods_count(); |
28 | 31 |
32 methodOop getMethodFromHotSpotMethod(jobject hotspotMethod); | |
29 methodOop getMethodFromHotSpotMethod(oop hotspotMethod); | 33 methodOop getMethodFromHotSpotMethod(oop hotspotMethod); |
34 | |
35 class JavaArgumentUnboxer : public SignatureIterator { | |
36 protected: | |
37 JavaCallArguments* _jca; | |
38 arrayOop _args; | |
39 int _index; | |
40 | |
41 oop next_arg(BasicType expectedType) { | |
42 assert(_index < _args->length(), "out of bounds"); | |
43 oop arg = ((oop*) _args->base(T_OBJECT))[_index++]; | |
44 assert(expectedType == T_OBJECT || java_lang_boxing_object::is_instance(arg, expectedType), "arg type mismatch"); | |
45 return arg; | |
46 } | |
47 | |
48 public: | |
49 JavaArgumentUnboxer(Symbol* signature, JavaCallArguments* jca, arrayOop args, bool is_static) : SignatureIterator(signature) { | |
50 this->_return_type = T_ILLEGAL; | |
51 _jca = jca; | |
52 _index = 0; | |
53 _args = args; | |
54 if (!is_static) { | |
55 _jca->push_oop(next_arg(T_OBJECT)); | |
56 } | |
57 iterate(); | |
58 assert(_index == args->length(), "arg count mismatch with signature"); | |
59 } | |
60 | |
61 inline void do_bool() { if (!is_return_type()) _jca->push_int(next_arg(T_BOOLEAN)->bool_field(java_lang_boxing_object::value_offset_in_bytes(T_BOOLEAN))); } | |
62 inline void do_char() { if (!is_return_type()) _jca->push_int(next_arg(T_CHAR)->char_field(java_lang_boxing_object::value_offset_in_bytes(T_CHAR))); } | |
63 inline void do_short() { if (!is_return_type()) _jca->push_int(next_arg(T_SHORT)->short_field(java_lang_boxing_object::value_offset_in_bytes(T_SHORT))); } | |
64 inline void do_byte() { if (!is_return_type()) _jca->push_int(next_arg(T_BYTE)->byte_field(java_lang_boxing_object::value_offset_in_bytes(T_BYTE))); } | |
65 inline void do_int() { if (!is_return_type()) _jca->push_int(next_arg(T_INT)->int_field(java_lang_boxing_object::value_offset_in_bytes(T_INT))); } | |
66 | |
67 inline void do_long() { if (!is_return_type()) _jca->push_long(next_arg(T_LONG)->long_field(java_lang_boxing_object::value_offset_in_bytes(T_LONG))); } | |
68 inline void do_float() { if (!is_return_type()) _jca->push_float(next_arg(T_FLOAT)->float_field(java_lang_boxing_object::value_offset_in_bytes(T_FLOAT))); } | |
69 inline void do_double() { if (!is_return_type()) _jca->push_double(next_arg(T_DOUBLE)->double_field(java_lang_boxing_object::value_offset_in_bytes(T_DOUBLE))); } | |
70 | |
71 inline void do_object() { _jca->push_oop(next_arg(T_OBJECT)); } | |
72 inline void do_object(int begin, int end) { if (!is_return_type()) _jca->push_oop(next_arg(T_OBJECT)); } | |
73 inline void do_array(int begin, int end) { if (!is_return_type()) _jca->push_oop(next_arg(T_OBJECT)); } | |
74 inline void do_void() { } | |
75 }; | |
30 | 76 |
31 // nothing here - no need to define the jni method implementations in a header file | 77 // nothing here - no need to define the jni method implementations in a header file |
32 | 78 |
33 | 79 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_TO_VM_HPP |