124 |
124 |
125 ExceptionBlob* OptoRuntime::_exception_blob; |
125 ExceptionBlob* OptoRuntime::_exception_blob; |
126 |
126 |
127 // This should be called in an assertion at the start of OptoRuntime routines |
127 // This should be called in an assertion at the start of OptoRuntime routines |
128 // which are entered from compiled code (all of them) |
128 // which are entered from compiled code (all of them) |
129 #ifndef PRODUCT |
129 #ifdef ASSERT |
130 static bool check_compiled_frame(JavaThread* thread) { |
130 static bool check_compiled_frame(JavaThread* thread) { |
131 assert(thread->last_frame().is_runtime_frame(), "cannot call runtime directly from compiled code"); |
131 assert(thread->last_frame().is_runtime_frame(), "cannot call runtime directly from compiled code"); |
132 #ifdef ASSERT |
|
133 RegisterMap map(thread, false); |
132 RegisterMap map(thread, false); |
134 frame caller = thread->last_frame().sender(&map); |
133 frame caller = thread->last_frame().sender(&map); |
135 assert(caller.is_compiled_frame(), "not being called from compiled like code"); |
134 assert(caller.is_compiled_frame(), "not being called from compiled like code"); |
136 #endif /* ASSERT */ |
|
137 return true; |
135 return true; |
138 } |
136 } |
139 #endif |
137 #endif // ASSERT |
140 |
138 |
141 |
139 |
142 #define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, save_arg_regs, return_pc) \ |
140 #define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, save_arg_regs, return_pc) \ |
143 var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc) |
141 var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc) |
144 |
142 |