我正在准备编译器考试,我在过去的论文中发现了以下两个我不知道如何回答的问题:
1. Array bounds checking requires code to check each array subscript to ensure it
falls within the array's declared range. How could induction variable analysis be
used to avoid repeated bounds checks in "for" loops.
2. Give a short example in Java in which one array address calculation is loop-
invariant and another array address is an induction variable.
我知道不变量和归纳变量的含义,但我真的不知道在解释这两种解决方案方面对我的期望是什么。
如果有人帮助我解释,我将不胜感激。
谢谢!