Multi-Method Dispatch Using Multiple Row Displacement Candy Pang, Wade Holst, Yuri Leontiev, and Duane Szafron ECOOP’99 Presented by: Irene Cheng Date:

Slides:



Advertisements
Similar presentations
Optimization of Sequential Networks Step in Synthesis: Problem Flow Table Reduce States Minimum-State Table State Assignment Circuit Transition Table Flip-Flop.
Advertisements

AES Sub-Key Generation By Muhammad Naseem. Rotate Word 09CF4F3C.
Formal Verification of Hardware Support For Advanced Encryption Standard Anna Slobodová Centaur Technology This work was done while at Intel.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Prof. Necula CS 164 Lecture 141 Run-time Environments Lecture 8.
Incremental Algorithms for Dispatching in Dynamically Typed Languages Yoav Zibin Technion—Israel Institute of Technology Joint work with: Yossi (Joseph)
Introduction to Probability
FP (FREQUENT PATTERN)-GROWTH ALGORITHM ERTAN LJAJIĆ, 3392/2013 Elektrotehnički fakultet Univerziteta u Beogradu.
Row 1 Row 6 Row 5 Row 2 Row 7 Row 3 Row 8 Row 4 Row 9 Row 10 Row 11.
Cmput Lecture 8 Department of Computing Science University of Alberta ©Duane Szafron 2000 Revised 1/26/00 The Java Memory Model.
Basic Geometric Ideas 8-1 Vocabulary Words: Point Line Plane
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #9.
CS 536 Spring Run-time organization Lecture 19.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
Traveling Salesman Problems Repetitive Nearest-Neighbor and Cheapest-Link Algorithms Chapter: 6.
Run-time Environment and Program Organization
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #8.
CSE 373, Copyright S. Tanimoto, 2002 Up-trees - 1 Up-Trees Review of the UNION-FIND ADT Straight implementation with Up-Trees Path compression Worst-case.
Recall the distributive property of multiplication over addition... symbolically: a × (b + c) = a × b + a × c and pictorially (rectangular array area model):
Combinations & Permutations. Essentials: Permutations & Combinations (So that’s how we determine the number of possible samples!) Definitions: Permutation;
1 Algorithms CSCI 235, Fall 2012 Lecture 9 Probability.
Finding Lengths of Segments in Chords When two chords intersect in the interior of a circle, each chord is divided into two segments which are called segments.
Overview of Probability Theory In statistical theory, an experiment is any operation that can be replicated infinitely often and gives rise to a set of.
AES (Advanced Encryption Standard) By- Sharmistha Roy M.Tech, CSE 1 st semester NIT, Agartala.
Find Probabilities Using Combinations
Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1.
Phrase-structure grammar A phrase-structure grammar is a quadruple G = (V, T, P, S) where V is a finite set of symbols called nonterminals, T is a set.
Chapter 11 – Counting Methods Intro to Counting Methods Section 11.1: Counting by Systematic Listing.
Cryptography Lecture 17: Advanced Encryption Standard (AES) Piotr Faliszewski.
Objective: Students will use proportional parts of triangles and divide a segment into parts. S. Calahan 2008.
Two-Dimensional Bi-Directional Object Layout Yoav Zibin The Technion—Israel Institute of Technology Joint work with: Yossi Gil.
AES Encryption FIPS 197, November 26, Bit Block Encryption Key Lengths 128, 192, 256 Number of Rounds Key Length Rounds Block.
A horse race has the following horses running. How many different first, second and third place results are possible: Mushroom Pepper Sausage Tomato Onion.
A Valentines Day Problem Source The teachers lab Patterns in Mathematics
Geometry: Plane Figures Chapter. point A point marks a location. A A B B line segment the part of the line between 2 points endpoints.
ECE Prof. John A. Copeland fax Office: GCATT Bldg.
Distributive Property with area models
Lecture 7. Building Forwarding Tables There are several methods Static Method Dynamic Methods Centralized Distributed Distance Vector Link State.
Let’s stay fresh with C. What does this print? void mystery(int * x); main(){ int a = 5; mystery(&a); printf("%d\n",a); } void mystery(int * x){ int y;
MATRICES. Introduction Matrix algebra has several uses in economics as well as other fields of study. One important application of Matrices is that it.
1. Prove that the three angle bisectors of a triangle concur. C AB D F E I § 4.1.
Binary Lesson 4a Hexadecimal and Binary Practice2.
Sequential Pattern Mining
or call for office visit, or call Kathy Cheek,
The Polar Environmental Centre
Oil-soluble yellow pigment extracted from turmeric powder
Run-time organization
Physics 1200 Topic VII Tuning Theory
Combinations COURSE 3 LESSON 11-3
The Advanced Encryption Standard: Rijndael
Combinations & Permutations
Make an Organized List and Simulate a Problem
Arranging and Choosing
Single Source Shortest Paths Bellman-Ford Algorithm
Rotors and Secret-Key Encryption
Running example The 4-houses puzzle:
Data Warehousing Mining & BI
Splash Screen.
Combinations & Permutations
Splash Screen.
A Series of Slides in 5 Parts Movement 2. BFS
Latin Square Designs.
Splash Screen.
If AD = 10, DC =6, and ED = 15, find DB.
10.5 Permutations and Combinations.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 1. DFS
A Series of Slides in 5 Parts Movement 3. IDFS
Presentation transcript:

Multi-Method Dispatch Using Multiple Row Displacement Candy Pang, Wade Holst, Yuri Leontiev, and Duane Szafron ECOOP’99 Presented by: Irene Cheng Date: 7 November 2002 AxA AxB BxA AxC BxB CxA BxC CxB CxC 11 22 33 44

Review of Terminology Review of Row Displacement Dispatch for Single-Receiver Multiple Row Displacement (MRD) Optimizations Performance Results and Conclusion Presentation Topics

Review of Terminology Single-receiver dispatch uses the dynamic type of a receiver object and the method name to determine which method to execute at run-time, e.g. aPerson.id(); Multi-method dispatch uses the dynamic types of the arguments and the method name to determine the method to execute, e.g. shape.intersect( rectangle, circle );

Review of Terminology (cont) What is a call-site ? In single-receiver languages - viewed as a message sent to the receiver object. e.g. In multi-method languages - viewed as the execution of a behavior on a set of arguments. e.g. The run-time determination of the method to invoke at a call-site is called method dispatch. aPerson.id() shape.intersect( rectangle, circle )

Review of Terminology (cont) Dispatch strategy: Cache-based (global or local) Table-based - Pre-determine the method for every possible call-site, and record these methods in a table. When a method is defined, each argument has a specific static type. However, at a call-site, the dynamic type of each argument can either be the static type, or any of its subtypes, e.g. Person ( id 1 ) Student ( id 2 ) Person aPerson; if (…) aPerson = new Person(); else aPerson = new Student(); aPerson.id( ); id 1 id 2

Product-Type Graph (for 2 arguments) AxA AxB BxA AxC BxB CxA BxC CxB CxC 11 22 33 44 The underlying Inheritance Hierarchy, H The 2-arity product-type graph, H 2 ABCABC A product-type graph hierarchy contains all the possible call-sites

Inheritance Conflicts AxC AxD BxC AxE BxD ExC BxE ExD ExE 11 22 General Definition A conflict occurs when a product-type can see 2 different method definitions by looking up different paths in the induced product- type graph. Relaxation Let  = { P 1 … P n } and P < P 1 … P n, the methods in P i and P j do not conflict in P if : i.e. 1 <= i, j, k <= n P i < P j or P j < P i or {  P k  | P k  P i  P k  P j }  2

Review of single-receiver Row displacement Dispatch (RD) Example: E anE = new E(); anE.  (); = 5 D::  A 0  D 3  B 1 C 2 ,  E 4 4

MRD Dispatch Table for method  with 2 arguments AA AB BA AC BB CA AD BC CB DA AE BD CC DB EA BE CD DC EB CE DD EC DE ED EE 11 22 33

AA AB BA AC BB CA AD BC CB DA AE BD CC DB EA BE CD DC EB CE DD EC DE ED EE 11 22 MRD Dispatch Table for method  with 2 arguments

Data Structure per Behavior - Array of pointers to arrays A 0 B 1 C 2 D 3 E 4 ( Level-0 array ) L 0 - indexed by the 1 st argument type ( Level-1 array ) L 1 - indexed by the 2nd argument type and contains method addresses

Compressing the Data Structure for  M - Global Master Array I 0 - Global Index Array B - Global Behavior Array

Compressing the Data Structure for  and  M - Global Master Array I 0 - Global Index Array B - Global Behavior Array Example: Dispatch a call-site  (anE, aD) M [ I 0 [5 + 4 = 9 ] + 3 = 14 ]

MRD is designed for n-dimensional dispatch tables  1 BDB BDE BEB BEE EDB EDE EEB EEE  2 DBD DBE DED DEE EBD EBE EED EEE

Example: dispatch a call-site  (anE, aD, aB) M [I 1 [I 0 [ B [  ] +4] +3] +1] = M [I 1 [I 0 [ 7+4] +3] +1] = M [I 1 [ 5+3] +1] = M[ 15+1] BDDB EE

Optimizations Single I - One Global Index Array, I, to store all L 0 to L k-2 arrays I0I L0L B    M [ I 0 [ I 0 [ B[  ] +4] +3] +1] = M [ I 0 [ I 0 [ 17+4] +3] +1] = M [ I 0 [ 13+3] +1] = M [ 15+1] Example:  (anE, aD, aB) I1I1

Optimizations (cont) Row-matching instead of row-shifting (additional 10-14% ) Row-shifting Row-matching Row-matching cannot be used in single-receiver RD because different rows contain different behavior, and thus different method addresses. Before displacement

Optimizations (cont) Byte vs. Word Storage (MRD-B) M is the most memory consuming data structure (duplicate 4-byte method address) Use method-map per behavior (each method address is stored only once) Only 1 byte (max. 256 methods) is used in M to store the index of the corresponding method in the method-map. Size of M is reduced to 1/4 but extra redirection time at dispatch.

Timing results Noop - dummy function to time the overhead incurred MRD - multiple row displacement MRD-B - MRD using byte instead of word for Master array CNT - Compressed N-Dimensional Tables SRP - Single Receiver Projections LUA - Lookup Automata

Memory Utilization LUA - Lookup Automata MRD - multiple row displacement MRD-B - MRD using byte instead of word for Master array CNT - Compressed N-DimensionalTables SRP - Single Receiver Projections

Conclusion A new multi-method dispatch technique is introduced to compress an n-dimensional table by row displacement. The first time a comparison of multi-method techniques has appeared in the literature. Experimental results shows that when comparing with other table-based multi-method techniques, MRD has the fastest dispatch time and the second smallest per-call-site code size.