27 #include "oops/arrayOop.hpp" |
27 #include "oops/arrayOop.hpp" |
28 #include "oops/oop.hpp" |
28 #include "oops/oop.hpp" |
29 #include "shark/llvmHeaders.hpp" |
29 #include "shark/llvmHeaders.hpp" |
30 #include "shark/sharkContext.hpp" |
30 #include "shark/sharkContext.hpp" |
31 #include "utilities/globalDefinitions.hpp" |
31 #include "utilities/globalDefinitions.hpp" |
|
32 #include "memory/allocation.hpp" |
32 |
33 |
33 using namespace llvm; |
34 using namespace llvm; |
34 |
35 |
35 SharkContext::SharkContext(const char* name) |
36 SharkContext::SharkContext(const char* name) |
36 : LLVMContext(), |
37 : LLVMContext(), |
50 |
51 |
51 // Create compound types |
52 // Create compound types |
52 _itableOffsetEntry_type = PointerType::getUnqual( |
53 _itableOffsetEntry_type = PointerType::getUnqual( |
53 ArrayType::get(jbyte_type(), itableOffsetEntry::size() * wordSize)); |
54 ArrayType::get(jbyte_type(), itableOffsetEntry::size() * wordSize)); |
54 |
55 |
|
56 _Metadata_type = PointerType::getUnqual( |
|
57 ArrayType::get(jbyte_type(), sizeof(Metadata))); |
|
58 |
55 _klass_type = PointerType::getUnqual( |
59 _klass_type = PointerType::getUnqual( |
56 ArrayType::get(jbyte_type(), sizeof(Klass))); |
60 ArrayType::get(jbyte_type(), sizeof(Klass))); |
57 |
61 |
58 _jniEnv_type = PointerType::getUnqual( |
62 _jniEnv_type = PointerType::getUnqual( |
59 ArrayType::get(jbyte_type(), sizeof(JNIEnv))); |
63 ArrayType::get(jbyte_type(), sizeof(JNIEnv))); |
60 |
64 |
61 _jniHandleBlock_type = PointerType::getUnqual( |
65 _jniHandleBlock_type = PointerType::getUnqual( |
62 ArrayType::get(jbyte_type(), sizeof(JNIHandleBlock))); |
66 ArrayType::get(jbyte_type(), sizeof(JNIHandleBlock))); |
63 |
67 |
64 _Method*_type = PointerType::getUnqual( |
68 _Method_type = PointerType::getUnqual( |
65 ArrayType::get(jbyte_type(), sizeof(Method))); |
69 ArrayType::get(jbyte_type(), sizeof(Method))); |
66 |
70 |
67 _monitor_type = ArrayType::get( |
71 _monitor_type = ArrayType::get( |
68 jbyte_type(), frame::interpreter_frame_monitor_size() * wordSize); |
72 jbyte_type(), frame::interpreter_frame_monitor_size() * wordSize); |
69 |
73 |
74 ArrayType::get(jbyte_type(), sizeof(JavaThread))); |
78 ArrayType::get(jbyte_type(), sizeof(JavaThread))); |
75 |
79 |
76 _zeroStack_type = PointerType::getUnqual( |
80 _zeroStack_type = PointerType::getUnqual( |
77 ArrayType::get(jbyte_type(), sizeof(ZeroStack))); |
81 ArrayType::get(jbyte_type(), sizeof(ZeroStack))); |
78 |
82 |
79 std::vector<const Type*> params; |
83 std::vector<Type*> params; |
80 params.push_back(Method*_type()); |
84 params.push_back(Method_type()); |
81 params.push_back(intptr_type()); |
85 params.push_back(intptr_type()); |
82 params.push_back(thread_type()); |
86 params.push_back(thread_type()); |
83 _entry_point_type = FunctionType::get(jint_type(), params, false); |
87 _entry_point_type = FunctionType::get(jint_type(), params, false); |
84 |
88 |
85 params.clear(); |
89 params.clear(); |
86 params.push_back(Method*_type()); |
90 params.push_back(Method_type()); |
87 params.push_back(PointerType::getUnqual(jbyte_type())); |
91 params.push_back(PointerType::getUnqual(jbyte_type())); |
88 params.push_back(intptr_type()); |
92 params.push_back(intptr_type()); |
89 params.push_back(thread_type()); |
93 params.push_back(thread_type()); |
90 _osr_entry_point_type = FunctionType::get(jint_type(), params, false); |
94 _osr_entry_point_type = FunctionType::get(jint_type(), params, false); |
91 |
95 |
148 _to_arrayType[i] = NULL; |
152 _to_arrayType[i] = NULL; |
149 } |
153 } |
150 } |
154 } |
151 } |
155 } |
152 |
156 |
153 class SharkFreeQueueItem : public CHeapObj { |
157 class SharkFreeQueueItem : public CHeapObj<mtNone> { |
154 public: |
158 public: |
155 SharkFreeQueueItem(llvm::Function* function, SharkFreeQueueItem *next) |
159 SharkFreeQueueItem(llvm::Function* function, SharkFreeQueueItem *next) |
156 : _function(function), _next(next) {} |
160 : _function(function), _next(next) {} |
157 |
161 |
158 private: |
162 private: |