8152065: TraceBytecodes breaks the interpreter expression stack

Move trace_bytecode to InterpreterRuntime and make trace_bytecode an IRT_LEAF so that safepoints are not allowed.

Reviewed-by: jiangli, dholmes, dcubed
This commit is contained in:
Coleen Phillimore 2016-03-18 15:14:22 -04:00
parent 6e0466f618
commit 1954276b28
11 changed files with 33 additions and 73 deletions

View file

@ -173,9 +173,6 @@ IRT_END
IRT_ENTRY(void, InterpreterRuntime::anewarray(JavaThread* thread, ConstantPool* pool, int index, jint size))
// Note: no oopHandle for pool & klass needed since they are not used
// anymore after new_objArray() and no GC can happen before.
// (This may have to change if this code changes!)
Klass* klass = pool->klass_at(index, CHECK);
objArrayOop obj = oopFactory::new_objArray(klass, size, CHECK);
thread->set_vm_result(obj);
@ -1414,3 +1411,17 @@ IRT_ENTRY(void, InterpreterRuntime::member_name_arg_or_null(JavaThread* thread,
}
IRT_END
#endif // INCLUDE_JVMTI
#ifndef PRODUCT
// This must be a IRT_LEAF function because the interpreter must save registers on x86 to
// call this, which changes rsp and makes the interpreter's expression stack not walkable.
// The generated code still uses call_VM because that will set up the frame pointer for
// bcp and method.
IRT_LEAF(intptr_t, InterpreterRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
const frame f = thread->last_frame();
assert(f.is_interpreted_frame(), "must be an interpreted frame");
methodHandle mh(thread, f.interpreter_frame_method());
BytecodeTracer::trace(mh, f.interpreter_frame_bcp(), tos, tos2);
return preserve_this_value;
IRT_END
#endif // !PRODUCT