To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit c6f2bead authored by qinsoon's avatar qinsoon
Browse files

use simple move for pin/unpin

parent c429e547
...@@ -1643,6 +1643,7 @@ impl<'a> InstructionSelection { ...@@ -1643,6 +1643,7 @@ impl<'a> InstructionSelection {
// FIXME: the semantic of Pin/Unpin is different from spec // FIXME: the semantic of Pin/Unpin is different from spec
// See Issue #33 // See Issue #33
Instruction_::CommonInst_Pin(op) => { Instruction_::CommonInst_Pin(op) => {
use runtime::mm::GC_MOVES_OBJECT;
trace!("instsel on PIN"); trace!("instsel on PIN");
// call pin() in GC // call pin() in GC
...@@ -1653,17 +1654,23 @@ impl<'a> InstructionSelection { ...@@ -1653,17 +1654,23 @@ impl<'a> InstructionSelection {
let tmp_op = self.emit_ireg(op, f_content, f_context, vm); let tmp_op = self.emit_ireg(op, f_content, f_context, vm);
let tmp_res = self.get_result_value(node); let tmp_res = self.get_result_value(node);
self.emit_runtime_entry( if GC_MOVES_OBJECT {
&entrypoints::PIN_OBJECT, self.emit_runtime_entry(
vec![tmp_op.clone()], &entrypoints::PIN_OBJECT,
Some(vec![tmp_res]), vec![tmp_op.clone()],
Some(node), Some(vec![tmp_res]),
f_content, Some(node),
f_context, f_content,
vm f_context,
); vm
);
} else {
// FIXME: this is problematic, as we are not keeping the object alive
self.backend.emit_mov_r_r(&tmp_res, &tmp_op);
}
} }
Instruction_::CommonInst_Unpin(op) => { Instruction_::CommonInst_Unpin(op) => {
use runtime::mm::GC_MOVES_OBJECT;
trace!("instsel on UNPIN"); trace!("instsel on UNPIN");
// call unpin() in GC // call unpin() in GC
...@@ -1673,15 +1680,17 @@ impl<'a> InstructionSelection { ...@@ -1673,15 +1680,17 @@ impl<'a> InstructionSelection {
assert!(self.match_ireg(op)); assert!(self.match_ireg(op));
let tmp_op = self.emit_ireg(op, f_content, f_context, vm); let tmp_op = self.emit_ireg(op, f_content, f_context, vm);
self.emit_runtime_entry( if GC_MOVES_OBJECT {
&entrypoints::UNPIN_OBJECT, self.emit_runtime_entry(
vec![tmp_op.clone()], &entrypoints::UNPIN_OBJECT,
None, vec![tmp_op.clone()],
Some(node), None,
f_content, Some(node),
f_context, f_content,
vm f_context,
); vm
);
}
} }
Instruction_::CommonInst_GetAddr(op) => { Instruction_::CommonInst_GetAddr(op) => {
trace!("instsel on GETADDR"); trace!("instsel on GETADDR");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment