Topic: stack machine

topics > computer science > computer hardware > Group: machine model

computer architecture
evaluation in an environment
intermediate representation of code
local declaration of data
register allocation
threaded code


A stack engine uses last-in-first-out stacks for variable storage and parameter passing. Stacks work well with expression languages and embedded evaluation. Since block structures are embedded, stacks are usually used for re-entrant allocation of local variables. Stacks are necessary for recursive definition. In Forth they are used as a universal procedure interface in which procedures take their arguments from the stack and return result values for the stack. Reverse Polish notation is directly implementable on stack machines. Process stacks are used for local storage in interrupt handlers and parallel processes. Stacks are a fixed size and require stack overflow detection. Stack underflow protection may be useful.

Advantages -- Stacks can be hardware implemented. They provide efficient storage for embedded contexts. Stacks can be easily swapped between contexts. (cbb 5/80)

Subtopic: stack principle up

Quote: the stack principle grew out of checking well-formed, propositional formula using Plankalkul [»baueFL_2002]

Subtopic: stack for procedure interface up

Quote: Tech Assembly System had functions with parameters passed on a stack [»perlAJ2_1959]
QuoteRef: moorCH6_1974 ;;498 All interfaces by stack (polish notation), gives flexibility at low cost.
Quote: Fortran is based on fixed code and data blocks while Algol is based on an activation record stack
Quote: Smalltalk sent messages by pushing pointers for receiver and argument objects on the stack; replaced by pointer to returned object [»krasG8_1981]

Subtopic: stack for temporaries up

QuoteRef: sameK2_1960 ;;442 incoming info which can not be evaluated is put on a lifo stack [works because of embedding context] for "bracketed structures"
Quote: Mesa uses an operand stack for implicitly defined operands [»johnRK3_1982]

Subtopic: garbage collection up

Quote: contaminated garbage collection dynamically identifies each object with a stack frame; 4-24% faster than Java collector [»cannDJ6_2000]

Subtopic: stack as register; caching up

Quote: caching the top of stack removes register allocation but worsens context switching [»ditzDR3_1982, OK]

Subtopic: stack not necessary up

Quote: instead of a stack machine, use load/store architectures without condition codes

Related Topics up

Topic: computer architecture (46 items)
Topic: context (8 items)
Topic: evaluation in an environment (35 items)
Topic: intermediate representation of code (31 items)
Topic: local declaration of data (11 items)
Topic: register allocation (28 items)
Topic: stacks (6 items)
Topic: threaded code
(18 items)

Updated barberCB 2/05
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.