提交 e0adff21 编写于 作者: R roland

8211232: GraphKit::make_runtime_call() sometimes attaches wrong memory state to call

Reviewed-by: kvn

--HG--
extra : rebase_source : 51bb75f94058cf96cda1ea902645358e4c3a41fe
上级 f5ced692
...@@ -1787,12 +1787,13 @@ Node* GraphKit::set_results_for_java_call(CallJavaNode* call, bool separate_io_p ...@@ -1787,12 +1787,13 @@ Node* GraphKit::set_results_for_java_call(CallJavaNode* call, bool separate_io_p
// A better answer would be to separate out card marks from other memory. // A better answer would be to separate out card marks from other memory.
// For now, return the input memory state, so that it can be reused // For now, return the input memory state, so that it can be reused
// after the call, if this call has restricted memory effects. // after the call, if this call has restricted memory effects.
Node* GraphKit::set_predefined_input_for_runtime_call(SafePointNode* call) { Node* GraphKit::set_predefined_input_for_runtime_call(SafePointNode* call, Node* narrow_mem) {
// Set fixed predefined input arguments // Set fixed predefined input arguments
Node* memory = reset_memory(); Node* memory = reset_memory();
Node* m = narrow_mem == NULL ? memory : narrow_mem;
call->init_req( TypeFunc::Control, control() ); call->init_req( TypeFunc::Control, control() );
call->init_req( TypeFunc::I_O, top() ); // does no i/o call->init_req( TypeFunc::I_O, top() ); // does no i/o
call->init_req( TypeFunc::Memory, memory ); // may gc ptrs call->init_req( TypeFunc::Memory, m ); // may gc ptrs
call->init_req( TypeFunc::FramePtr, frameptr() ); call->init_req( TypeFunc::FramePtr, frameptr() );
call->init_req( TypeFunc::ReturnAdr, top() ); call->init_req( TypeFunc::ReturnAdr, top() );
return memory; return memory;
...@@ -2382,9 +2383,7 @@ Node* GraphKit::make_runtime_call(int flags, ...@@ -2382,9 +2383,7 @@ Node* GraphKit::make_runtime_call(int flags,
} else { } else {
assert(!wide_out, "narrow in => narrow out"); assert(!wide_out, "narrow in => narrow out");
Node* narrow_mem = memory(adr_type); Node* narrow_mem = memory(adr_type);
prev_mem = reset_memory(); prev_mem = set_predefined_input_for_runtime_call(call, narrow_mem);
map()->set_memory(narrow_mem);
set_predefined_input_for_runtime_call(call);
} }
// Hook each parm in order. Stop looking at the first NULL. // Hook each parm in order. Stop looking at the first NULL.
......
...@@ -700,7 +700,7 @@ class GraphKit : public Phase { ...@@ -700,7 +700,7 @@ class GraphKit : public Phase {
void set_predefined_output_for_runtime_call(Node* call, void set_predefined_output_for_runtime_call(Node* call,
Node* keep_mem, Node* keep_mem,
const TypePtr* hook_mem); const TypePtr* hook_mem);
Node* set_predefined_input_for_runtime_call(SafePointNode* call); Node* set_predefined_input_for_runtime_call(SafePointNode* call, Node* narrow_mem = NULL);
// Replace the call with the current state of the kit. Requires // Replace the call with the current state of the kit. Requires
// that the call was generated with separate io_projs so that // that the call was generated with separate io_projs so that
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册