Commit b5990ffd authored by Kevin Modzelewski's avatar Kevin Modzelewski

Some rewriter annotations

parent 99f5f5c6
...@@ -1821,7 +1821,7 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box ...@@ -1821,7 +1821,7 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box
if (rewrite_args) { if (rewrite_args) {
r_im_self = r_im_class; r_im_self = r_im_class;
r_im_func = r_descr->getAttr(offsetof(BoxedClassmethod, cm_callable)); r_im_func = r_descr->getAttr(offsetof(BoxedClassmethod, cm_callable))->setType(RefType::BORROWED);
r_im_func->addGuardNotEq(0); r_im_func->addGuardNotEq(0);
} }
} else if (descr->cls == instancemethod_cls) { } else if (descr->cls == instancemethod_cls) {
...@@ -1871,7 +1871,8 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box ...@@ -1871,7 +1871,8 @@ Box* nondataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, Box
} }
if (rewrite_args) { if (rewrite_args) {
RewriterVar* r_sm_callable = r_descr->getAttr(offsetof(BoxedStaticmethod, sm_callable)); RewriterVar* r_sm_callable
= r_descr->getAttr(offsetof(BoxedStaticmethod, sm_callable))->setType(RefType::BORROWED);
r_sm_callable->addGuardNotEq(0); r_sm_callable->addGuardNotEq(0);
rewrite_args->setReturn(r_sm_callable, ReturnConvention::HAS_RETURN); rewrite_args->setReturn(r_sm_callable, ReturnConvention::HAS_RETURN);
} }
......
# expected: reffail
# run_args: -n # run_args: -n
# statcheck: noninit_count('slowpath_classmethod_get') <= 10 # statcheck: noninit_count('slowpath_classmethod_get') <= 10
# statcheck: noninit_count('slowpath_staticmethod_get') <= 10 # statcheck: noninit_count('slowpath_staticmethod_get') <= 10
......
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