today s topics
play

Todays Topics Project 1 questions Less than a week left, should be - PowerPoint PPT Presentation

Todays Topics Project 1 questions Less than a week left, should be in Phase III But its really about logging the hours Test, test, test Runtime systems introduction Goal Bridging concepts Domain analysis


  1. Today’s Topics • Project 1 questions � Less than a week left, should be in Phase III � But it’s really about logging the hours � Test, test, test • Runtime systems introduction � Goal � Bridging concepts � Domain analysis

  2. Today’s Topics • Project 1 questions � Less than a week left, should be in Phase III � But it’s really about logging the hours � Test, test, test • Runtime systems introduction � Goal � Bridging concepts � Domain analysis Live Presentation Live Presentation • http://www.cse.ucsd.edu/classes/wi05/cse131b/ • http://www.cse.ucsd.edu/classes/wi05/cse131b/ • “Live Presentations” • “Live Presentations” • “IA-and-runtime-intro” • “IA-and-runtime-intro” • Password “cse131b” • Password “cse131b”

  3. Runtime Systems – A Look Ahead VAR x, y: INTEGER; BEGIN x := x + y; END.

  4. Runtime Systems – A Look Ahead .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 !#PROLOGUE# 0 ; allocate stack frame (locals) sethi %hi(LF14),%g1 add %g1,%lo(LF14),%g1 save %sp,%g1,%sp !#PROLOGUE# 1 ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x add %o1,%o0,%o1 ; add st %o1,[%g7+0] ; x <- ret ; return from function restore ; free stack frame space (locals) LF14 = -64 ; total size of main's stack frame

  5. Runtime Systems – A Look Ahead .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x add %o1,%o0,%o1 ; add st %o1,[%g7+0] ; x <- ret ; return from function restore ; free stack frame space (locals) LF14 = -64 ; total size of main's stack frame

  6. Runtime Systems – A Look Ahead .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x Different paradigms Different paradigms add %o1,%o0,%o1 ; add • Names vs. addrs/regs • Names vs. addrs/regs st %o1,[%g7+0] ; x <- • calls vs. gotos • calls vs. gotos ret ; return from function • typed vs. untyped • typed vs. untyped restore ; free stack frame space (locals) • infinite user types vs. few • infinite user types vs. few LF14 = -64 ; total size of main's stack frame simple types simple types

  7. Runtime Systems – Base + Offset .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x Different paradigms Different paradigms add %o1,%o0,%o1 ; add • Names vs. addrs/regs • Names vs. addrs/regs st %o1,[%g7+0] ; x <- • calls vs. gotos • calls vs. gotos ret ; return from function • typed vs. untyped • typed vs. untyped restore ; free stack frame space (locals) • infinite user types vs. few • infinite user types vs. few LF14 = -64 ; total size of main's stack frame simple types simple types

  8. Runtime Systems – Oberon Int � Sparc Int .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x Different paradigms Different paradigms add %o1,%o0,%o1 ; add • Names vs. addrs/regs • Names vs. addrs/regs st %o1,[%g7+0] ; x <- • calls vs. gotos • calls vs. gotos ret ; return from function • typed vs. untyped • typed vs. untyped restore ; free stack frame space (locals) • infinite user types vs. few • infinite user types vs. few LF14 = -64 ; total size of main's stack frame simple types simple types

  9. Runtime Systems – Calling with Stack .seg "data" VAR x, y: INTEGER; globals: BEGIN .common _x,0x4,"data" x := x + y; .common _y,0x4,"data" .seg "text" END. _main: set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x Different paradigms Different paradigms add %o1,%o0,%o1 ; add • Names vs. addrs/regs • Names vs. addrs/regs st %o1,[%g7+0] ; x <- • calls vs. gotos • calls vs. gotos ret ; return from function • typed vs. untyped • typed vs. untyped restore ; free stack frame space (locals) • infinite user types vs. few • infinite user types vs. few LF14 = -64 ; total size of main's stack frame simple types simple types

  10. Runtime Systems – Bridging Concepts .seg "data" Bridging principles VAR x, y: INTEGER; Bridging principles globals: • map in general to arithmetic • map in general to arithmetic BEGIN .common _x,0x4,"data" • scope � base pointer • scope � base pointer x := x + y; .common _y,0x4,"data" • decl order � storage order • decl order � storage order .seg "text" END. • stack for nested calls/memory _main: • stack for nested calls/memory set globals, %g7 Huge step to take Huge step to take !#PROLOGUE# 0 ; allocate stack frame (locals) • Oberon names to addrs • Oberon names to addrs sethi %hi(LF14),%g1 • Load variables into regs • Load variables into regs add %g1,%lo(LF14),%g1 • Call a function save %sp,%g1,%sp • Call a function • Return to place of call !#PROLOGUE# 1 • Return to place of call ld [%g7+4],%o0 ; y ld [%g7+0],%o1 ; x Different paradigms Different paradigms add %o1,%o0,%o1 ; add • Names vs. addrs/regs • Names vs. addrs/regs st %o1,[%g7+0] ; x <- • calls vs. gotos • calls vs. gotos ret ; return from function • typed vs. untyped • typed vs. untyped restore ; free stack frame space (locals) • infinite user types vs. few • infinite user types vs. few LF14 = -64 ; total size of main's stack frame simple types simple types

  11. Structure of Oberon (Domain Analysis) Question Answers (Java, Oberon) . Procedure calls recursive? Procedure decls nest? Parameter-passing modes? Procedure parameters? Procedures returned as results? Dynamically created storage? Dynamic storage deallocated by programmer?

Recommend


More recommend