Question

4. Answer all of the following: (a) What information is stored in activation records? (b) Which of these information items are only in block-structured pro- gramming languages and why? (c) Name two programming languages where activation records are usu- ally stored on the stack and two where the activation records are usu ally on the heap. Page 2 of 7 Programming Languages Autumn 2012 (d) Describe why, in the latter two programming languages, it is necessary for the activation records to be stored on the heap.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per the HomeworkLib policy on multiple questions, answer to first question is being given here:

Activation Records (AR):

To understand AR, let us first understand the call stack. A call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack". Although maintenance of the call stack is important for the proper functioning of most software, the details are normally hidden and automatic in high-level programming languages. Many computer instruction sets provide special instructions for manipulating stacks.

A call stack is composed of stack frames (also called activation records or activation frames). These are machine dependent and ABI-dependent data structures containing subroutine state information. This data is sometimes referred to as CFI (Call Frame Information).] Each stack frame corresponds to a call to a subroutine which has not yet terminated with a return. For example, if a subroutine named DrawLine is currently running, having been called by a subroutine DrawSquare, the top part of the call stack might be laid out like in the following picture.

Stack Pointer top of stack Locals of DrawLine stack frame for DrawLine subroutine Frame Pointer一一 → Return Address Param eter

Fig: Call stack layout for upward-growing stacks

A diagram like this can be drawn in either direction as long as the placement of the top, and so direction of stack growth, is understood. Furthermore, independently of this, architectures differ as to whether call stacks grow towards higher addresses or towards lower addresses. The logic of the diagram is independent of the addressing choice.

The stack frame at the top of the stack is for the currently executing routine. The stack frame usually includes at least the following items (in push order):

  • the arguments (parameter values) passed to the routine (if any);
  • the return address back to the routine's caller (e.g. in the DrawLine stack frame, an address into DrawSquare's code); and
  • space for the local variables of the routine (if any).
Add a comment
Know the answer?
Add Answer to:
4. Answer all of the following: (a) What information is stored in activation records? (b) Which...
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
  • What information is found in the sender's address? What is the correct format and location of...

    What information is found in the sender's address? What is the correct format and location of the date? What is the purpose of the reference line in a professional letter How would you compose a greeting for a professional letter to John White Where is the closing located and what are typical professional closing 8. What are two ways a reference notation would be keved if Jean Moore were typing a letter for Dr. Sam Mast? 9. Where is the...

  • This is all of the information I have: Now that you have reviewed information about Cover...

    This is all of the information I have: Now that you have reviewed information about Cover 2 Cover, you are ready to begin the first step in the accounting cycle, recording transactions. On this page of the practice set, you are asked to record transactions that occurred during the first week of June into the company's journals and post the appropriate entries to the ledger accounts. The following transactions occurred throughout the first week of June: Week 1 Date Transaction...

  • This is all of the information I have: Now that you have reviewed information about Cover...

    This is all of the information I have: Now that you have reviewed information about Cover 2 Cover, you are ready to begin the first step in the accounting cycle, recording transactions. On this page of the practice set, you are asked to record transactions that occurred during the first week of June into the company's journals and post the appropriate entries to the ledger accounts. The following transactions occurred throughout the first week of June: Week 1 Date Transaction...

  • Use the following figures (A & B) to answer the glacial features provided on the topographic...

    Use the following figures (A & B) to answer the glacial features provided on the topographic maps. ROLLTONE N Ceque Valley Pamov -U-shaped way valgade Present-day 1. Using the map on the following page (labeled 13.9), what is the name given to a feature like conical peak? 2. What type of ridge is found between Improvement Districts 9 and 10 from the Siffleur River Valley to Mount Kentigen? 3. Near the northern edge of the map, what type of valley...

  • ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate)...

    ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) NeedByEvent(Event) CRPrevState(CRID, CRState, StartDate, EndDate) CRAssigned(CRID, EmpID, StartDate, EndDate) Employees(EmpID, FirstName, LastName, JobTitle) ChangeRequest(CRID, CRType, CRTitle, CROriginDate, CRPriority, CRNeedEvent, CRStatus) The CRID is the primary key, it is unique, and it is an positive integer The CRType may be one of two values: "Deficiency" or "Enhancement" CRTitle is a variable length string that may be up to 2048 characters CROriginDate is a date CRPriority is an integer that may assume a value of...

  • Write a c++ program in that file to perform a “Search and Replace All” operation. This...

    Write a c++ program in that file to perform a “Search and Replace All” operation. This operation consists of performing a case-sensitive search for all occurrences of an arbitrary sequence of characters within a file and substituting another arbitrary sequence in place of them. Please note: One of the biggest problems some students have with this exercise occurs simply because they don’t read the command line information in the course document titled “Using the Compiler’s IDE”. Your program: 1. must...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

  • i need help making this program the skeleton of the code is below: //Include the following #include <iostream> #...

    i need help making this program the skeleton of the code is below: //Include the following #include <iostream> #include <string> #include <fstream> //you must include this library if you wish to do file i/o using namespace std; /********************************************************* //Following is the declaration of a order record **********************************************************/ class order_record { public: string cell_number; string item_number; double quantity; double price; int processing_plant; double tax_rate; double order_tax; double net_cost; double total_cost; }; //Prototypes for your functions: input, output, and process will go...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • Read the following case: Answer the questions accordingly: PLEASE MAKE COPY PASTE AVAILABLE EEOC v. Management...

    Read the following case: Answer the questions accordingly: PLEASE MAKE COPY PASTE AVAILABLE EEOC v. Management Hospitality of Racine 666 F.3d 422 (7th Cir. 2012) OPINION BY DISTRICT JUDGE YOUNG: The Equal Employment Opportunity Commission ("EEOC") brought this action on behalf of two serv- ers, Katrina Shisler and Michelle Powell, who were em- ployed at an International House of Pancakes franchise in Racine, Wisconsin (the "Racine IHOP"), alleging that the servers were sexually harassed in violation of Title VII of...

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