1 Islands : Aliasing Protection In Object-Oriented Languages By : John Hogg OOPSLA 91 Aharon Abadi.

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

Techniques for proving programs with pointers A. Tikhomirov.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
Programming Languages and Paradigms
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
1 Classes and Data Abstraction Chapter What a Class ! ! Specification and implementation Private and public elements Declaring classes data and.
Chapter 9 Subprograms Specification: name, signature, actions Signature: number and types of input arguments, number and types of output results –Book.
Abstract Data Types Data abstraction, or abstract data types, is a programming methodology where one defines not only the data structure to be used, but.
Lecture 3 Feb 4 summary of last week’s topics and review questions (handout) Today’s goals: Chapter 1 overview (sections 1.4 to 1.6) c++ classes constructors,
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Unified Modeling Language (UML)
Chapter 9: Subprogram Control
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
Lesson 6 Functions Also called Methods CS 1 Lesson 6 -- John Cole1.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
C++ fundamentals.
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
Classes Mark Hennessy Dept. Computer Science NUI Maynooth C++ Workshop 18 th – 22 nd Spetember 2006.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
CS212: Object Oriented Analysis and Design Lecture 6: Friends, Constructor and destructors.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
The Procedure Abstraction, Part V: Support for OOLs Comp 412 Copyright 2010, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled in.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Visibility, Accessibility, and Information Hiding.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
COMPILERS Symbol Tables hussein suleman uct csc3003s 2007.
Basic Semantics Associating meaning with language entities.
Java Software Solutions Lewis and Loftus Chapter 4 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Objects and Classes -- Introduction.
Programming Languages and Paradigms Imperative Programming.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
COMP3190: Principle of Programming Languages
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 6 Functions.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Principles of programming languages 10: Object oriented languages Isao Sasano Department of Information Science and Engineering.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
Lecture 4 – Function (Part 1) FTMK, UTeM – Sem /2014.
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
Copyright © 2012 Pearson Education, Inc. Chapter 10 Advanced Topics.
Chapter 6 Functions. 6-2 Topics 6.1 Modular Programming 6.2 Defining and Calling Functions 6.3 Function Prototypes 6.4 Sending Data into a Function 6.5.
Procedure Definitions and Semantics Procedures support control abstraction in programming languages. In most programming languages, a procedure is defined.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
ISBN Chapter 12 Support for Object-Oriented Programming.
Memory Management.
CS 326 Programming Languages, Concepts and Implementation
Chapter 3: Using Methods, Classes, and Objects
Chapter 4: Writing Classes
Corresponds with Chapter 7
Classes and Data Abstraction
Testing with OO OO has several key concepts:
Binding Times Binding is an association between two things Examples:
Lecture 10 Concepts of Programming Languages
SPL – PS3 C++ Classes.
Presentation transcript:

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 Aliased Object

3 Aliases problem x y 3 Perform operation x = x+ 1 x y 3 4 Harmless aliasing: y is unaffected x y z 3 Harm aliasing: y is affected Perform operation x.increment x y z 4 Aliased objects allow changing the state through different access paths

4 Aliasing Types Dynamic Aliasing: at least one of the access paths has a prefix consisting of temporary variables or parameters Class A{ x:B; void f(){ B & y=x; } } Within f object pointed by x is dynamic aliased y stack A object B object x

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; } A object C object B object x 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 x y z 3 heap x y z 5 heap Problem. 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 G1 G2 G3 G4

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 bridge Static references Are disallowed

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 Insert an object with no external references

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

11 Ability invoking external functions and procedures. Island Requirements D B A C 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. y = x yx object yx nill

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

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: newKey%free, value: newValue%free do … end %read Find: searchKey%read :%read do … end DictionaryBuffer

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