Jumps Flashcards

(7 cards)

1
Q

jumps

A

fundamental form of control for most languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

types of jump

A
  • goto - rarely used
  • call/return - goto that can remember
  • exceptions - non local jumps
  • concurrency - goto with stacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

call

A
  1. save current program point and state
  2. transfer to new program point
  3. pick up state or extend current
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

return

A

transfer to saved program point and restore saved state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

exception handler

A

save program point and state for later use and execute body of handler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

exception raise

A

find matching handler and transfer to saved program point and state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

C exceptions

A

libc procedures setjmp and longjump can be used as a primitive form of exception handling

state (stack frame and registers) represented my struct jmpbuf

setjmp inits jmpbuf
longjump reads a jmpbuf and restores state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly