已关闭
Speading up field traversing by adding flag to klass #7991
chikunov-danila创建于 2025年10月22日关闭于 2月14日
2025年10月22日 添加了label:enhancement
openharmony_ci
2025年10月22日 评论:
2025年10月22日 评论:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@weng-changcheng](https://gitcode.com/weng-changcheng) [@godmiaozi](https://gitcode.com/godmiaozi) [@liyiming13](https://gitcode.com/liyiming13) [@lijin1039](https://gitcode.com/lijin1039) [@Prof](https://gitcode.com/Prof) [@dingding5](https://gitcode.com/dingding5) [@v-cherkashin](https://gitcode.com/v-cherkashin) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


2025年10月22日 添加了label:waiting_for_assign
2025年10月22日 修改了issue 的描述
2025年10月22日 修改了issue 的描述
2025年10月22日 关联了pull request:Speading up field traversing by klass flag
2025年12月25日 关联了pull request:Speading up field traversing by klass flag
openharmony_dcp
2月14日 评论:
2月14日 评论:
开发自提单,长时间未处理,经领域审视,issue先关闭


2月14日 issue状态由 待办的 改变为 已完成
2月14日 关闭了 issue
感谢提出新需求。
新需求提供了什么功能?
Traversing fields goes as follows: we take klass of object, from klass takes its fields, trverse it in while, and then takes base klass in cycle.
For some klasses there could be no reference fields. And we can speed up traversing by adding special flag to object, that will allow us to get if object and its ancestors dont have reference fields.
Example
class REF{ // Has no references public i: int = 0; } class A{ public i1: int = 0; } // Has no references class B extends A{ public i2: int = 0; } // No ref class C extends B{ public i3: int = 0; } // No ref class D extends C{ // Has references public i5: int = 0; public ref:REF = new REF(); } class E extends D{ public i5: int = 0; } // parent has reference class LAST extends E{} // Ancestor has reference let l = new LAST(); GC.startGC(GC.Cause.FULL); // It is OK to traverse up to D class and dont go futher该需求带来的价值、应用场景?