Unit 1f - Dynamic Control Flow

Polymorphism

 

Polymorphism Dispatch

Dynamic Jumps in C

Static vs Dynamic Call

Implementing Polymorphism in C


 
 

 

Polymorphic Dispatch in Assembly

a->class->ping(a);

pc <- m[r[1] + 4]

 

Double Indirect Jump

Implementing Method Calls

 

Linked List: Follow All Elements

 

Problems with print_list

Generalized Version

 

Function Pointer in Dr Racket

Implementing Map in C

 

Implementing Foldl in C

 

Switch Statement

 

Switch: The Human Perspective

Switch: The Compiler Perspective

Switch Using GOTO

 

Problems with Switch Jump Table

Switch Statement Implementation

Switch Example: Original Code

 

Switch Example: Using GOTO

 

Switch Example: Assembly, Part 1

 

Double Indirect Jump: Extended