27 #include "prims/jni.h" |
27 #include "prims/jni.h" |
28 #include "runtime/javaCalls.hpp" |
28 #include "runtime/javaCalls.hpp" |
29 #include "jvmci/jvmciJavaClasses.hpp" |
29 #include "jvmci/jvmciJavaClasses.hpp" |
30 |
30 |
31 class CompilerToVM { |
31 class CompilerToVM { |
32 public: |
32 public: |
33 /** |
33 class Data { |
34 * Tag bits used by lookupKlassInPool to distinguish the types in Java. |
34 friend class JVMCIVMStructs; |
35 */ |
35 |
36 enum Tags { |
36 private: |
37 KLASS_TAG = 0x0, |
37 static int InstanceKlass_vtable_start_offset; |
38 SYMBOL_TAG = 0x1 |
38 static int InstanceKlass_vtable_length_offset; |
|
39 |
|
40 static int Method_extra_stack_entries; |
|
41 |
|
42 static address SharedRuntime_ic_miss_stub; |
|
43 static address SharedRuntime_handle_wrong_method_stub; |
|
44 static address SharedRuntime_deopt_blob_unpack; |
|
45 static address SharedRuntime_deopt_blob_uncommon_trap; |
|
46 |
|
47 static size_t ThreadLocalAllocBuffer_alignment_reserve; |
|
48 |
|
49 static CollectedHeap* Universe_collectedHeap; |
|
50 static int Universe_base_vtable_size; |
|
51 static address Universe_narrow_oop_base; |
|
52 static int Universe_narrow_oop_shift; |
|
53 static address Universe_narrow_klass_base; |
|
54 static int Universe_narrow_klass_shift; |
|
55 static uintptr_t Universe_verify_oop_mask; |
|
56 static uintptr_t Universe_verify_oop_bits; |
|
57 static void* Universe_non_oop_bits; |
|
58 |
|
59 static bool _supports_inline_contig_alloc; |
|
60 static HeapWord** _heap_end_addr; |
|
61 static HeapWord** _heap_top_addr; |
|
62 |
|
63 static jbyte* cardtable_start_address; |
|
64 static int cardtable_shift; |
|
65 |
|
66 public: |
|
67 static void initialize(); |
39 }; |
68 }; |
40 |
69 |
41 // FIXME This is only temporary until the GC code is changed. |
70 public: |
42 static bool _supports_inline_contig_alloc; |
|
43 static HeapWord** _heap_end_addr; |
|
44 static HeapWord** _heap_top_addr; |
|
45 |
|
46 static intptr_t tag_pointer(Klass* klass) { |
|
47 return ((intptr_t) klass) | KLASS_TAG; |
|
48 } |
|
49 |
|
50 static intptr_t tag_pointer(Symbol* symbol) { |
|
51 return ((intptr_t) symbol) | SYMBOL_TAG; |
|
52 } |
|
53 |
|
54 static JNINativeMethod methods[]; |
71 static JNINativeMethod methods[]; |
55 static int methods_count(); |
72 static int methods_count(); |
56 |
73 |
57 static inline Method* asMethod(jobject jvmci_method) { |
74 static inline Method* asMethod(jobject jvmci_method) { |
58 return (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(jvmci_method); |
75 return (Method*) (address) HotSpotResolvedJavaMethodImpl::metaspaceMethod(jvmci_method); |