Could someone help me with this question, I don\'t understandwhats being asked.
ID: 3609084 • Letter: C
Question
Could someone help me with this question, I don't understandwhats being asked. References to non local variables will be faster: a. using a display than using a static chain, in allcases. b. using a display than using a static chain, provided thenon-local variables are more than one static level away. c. using a display than using a static chain, if the displayis in memory. d. using a display in a memory array instead of using adisplay in registers e. only when dynamic scooping is used. Could someone help me with this question, I don't understandwhats being asked. References to non local variables will be faster: a. using a display than using a static chain, in allcases. b. using a display than using a static chain, provided thenon-local variables are more than one static level away. c. using a display than using a static chain, if the displayis in memory. d. using a display in a memory array instead of using adisplay in registers e. only when dynamic scooping is used.Explanation / Answer
Dear..,References to non local variables will befaster: Using a display than using a static chain, if thedisplay is in memory. The maintenance at a subprogram call is faster withstatic chains, unless the called procedure is more than a fewstatic levels away. In that case, extra time is required to followthe static chain of the caller to the activation record instance ofthe declarer of the called subprogram. The maintenance of asubprogram return has fixed cost with both methods, with staticchaining always being slightly faster. The display must be restoredwhen the subprogram terminates. The maintenance at a subprogram call is faster withstatic chains, unless the called procedure is more than a fewstatic levels away. In that case, extra time is required to followthe static chain of the caller to the activation record instance ofthe declarer of the called subprogram. The maintenance of asubprogram return has fixed cost with both methods, with staticchaining always being slightly faster. The display must be restoredwhen the subprogram terminates.