Question

In Java Discuss how Activation Records (stack frames in Java) work including how they help to...

In Java

  1. Discuss how Activation Records (stack frames in Java) work including how they help to pass parameters, return variables and save the state of the calling method.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Control stack or runtime stack is used to keep track of the live procedure activations i.e the procedures whose execution have not been completed. A procedure name is pushed on to the stack when it is called (activation begins) and it is popped when it returns (activation ends). Information needed by a single execution of a procedure is managed using an activation record or frame. When a procedure is called, an activation record is pushed into the stack and as soon as the control returns to the caller function the activation record is popped.

A general activation record consist of the following things:

  • Local variables: hold the data that is local to the execution of the procedure.
  • Temporary values: stores the values that arise in the evaluation of an expression.
  • Machine status: holds the information about status of machine just before the function call.
  • Access link (optional): refers to non-local data held in other activation records.
  • Control link (optional): points to activation record of caller.
  • Return value: used by the called procedure to return a value to calling procedure
  • Actual parameters
Add a comment
Know the answer?
Add Answer to:
In Java Discuss how Activation Records (stack frames in Java) work including how they help to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT