Islands : Aliasing Protection In ObjectOriented Languages - PowerPoint PPT Presentation

About This Presentation
Title:

Islands : Aliasing Protection In ObjectOriented Languages

Description:

at least one of the access paths has a prefix consisting of temporary variables or parameters ... nill. 15. Unique Access Mode ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 20
Provided by: admi1176
Category:

less

Transcript and Presenter's Notes

Title: Islands : Aliasing Protection In ObjectOriented Languages


1
Islands Aliasing Protection In Object-Oriented
Languages
  • By John Hogg
  • OOPSLA 91

Aharon Abadi
2
Islands
  • The main contribution of the paper.
  • Provide alias protection.
  • Alias definition
  • aliased object two pointer access paths

3
Aliases problem
  • Aliased objects allow changing the state
    through
  • different access paths

Perform operation x x 1
Harmless aliasing y is unaffected
Perform operation x .increment
Harm aliasing y is affected
4
Aliasing Types
  • Dynamic Aliasing
  • at least one of the access paths has a prefix
    consisting of temporary variables or parameters
  • Class A xB
  • void f() B yx

5
Aliasing Types
  • Static Aliasing
  • an object is aliased statically if two
    different access paths are both composed entirely
    of chains of instance variables.
  • Class A C x
  • Class B C y

6
Static Aliasing Problems
  • Dynamic alias
  • has no effect beyond the
  • scope in which it occurs
  • Static alias
  • problems scope arbitrarily
  • point of the execution
  • The paths length may be
  • arbitrarily long
  • function f may be affected by
  • function g even though they
  • share no variables
  • Islands only prevents static aliasing

. g(x) . .
f(y) . .
7
Island Motivation
  • In practice aliasing tends to be local
  • Programmers understand aliases complexity
  • Islands permit aliasing only on small groups of
    object
  • Each group called island

8
Island Definition
  • Island
  • the transitive closure of a set of objects
    accessible from a bridge object
  • Bridge
  • the unique access point to a set of instances
    that make up an island

9
Island Requirements
  • It must be possible to pass a structure
  • into an island with a guarantee that no other
    references to it are held

10
Island Requirements
  • It must be possible to retrieve structure
  • from an island with a guarantee that no other
    references to it are held

11
Island Requirements
  • Ability invoking external functions and
    procedures.

A
B
C
D
Dynamic aliasing
12
Island Benefits and Disadvantages
  • Benefits
  • Static references cannot cross Island boundary
  • Dynamic references that cross Island boundary
    are visible and controlled by the bridge
  • An island provides a true encapsulation of its
    components.
  • Disadvantages
  • Dynamic aliasing prevents information hiding is
    not supported (not in the paper)
  • Need to construct a proof about intra-island
    behavior.

13
Island Implementation Language Extension
  • One new operation destructive read
  • Two more access modes unique and free which
    mutually exclusive to read

14
Destructive Read
  • Atomic operation that returns the value of a
    variable and sets the variable to nil.
  • Only an instance variable may be destructively
    read.

15
Unique Access Mode
  • Indicates that the object has only one static
    reference in the entire system.
  • Rules
  • A unique variable may only be assigned the result
    of a free expression.
  • A unique expression may not be assigned to
    anything.
  • A unique expression may only be exported as
    unique.
  • If a method receiver is unique, then every
    parameter and the result must be read or unique
    or free.

A
A
Unique object B
Unique object B
C
C
16
Free Access Mode
  • Indicates that no other static references to the
    variable exist anywhere in the system.
  • Definition
  • A free expression is
  • destructive read of a unique instance variable
  • destructive read of a free variable
  • result of new
  • result of free valued function
  • Rules
  • A free variable may only be accessed via a
    destructive
  • read.

17
Additional Rules
  • Bridge class - in every method every parameter
  • and function result is
    read, unique or free
  • A read expression may not be the right side of an
    assignment.
  • A unique expression may not be assigned to
    anything
  • Free is not harmful
  • Disadvantage internal object can be exported as
    read, no
  • information hiding.

18
Bridge Example
  • class name DictionaryBuffer
  • instance variable names head
  • tail
  • initialize size read do end
  • insertKey newKeyfree , value newValuefree do
    end
  • read Find searchKeyread read do end

19
Conclusion
  • Islands allow a set of objects to be nicely
    encapsulated.
  • Bridge may used as true black box.
  • Future work extension to multiple threads
Write a Comment
User Comments (0)
About PowerShow.com