32
Method Manipulation in an Object-Oriented Processor

Method Manipulation in an Object-Oriented Processor

  • Upload
    eithne

  • View
    53

  • Download
    0

Embed Size (px)

DESCRIPTION

Method Manipulation in an Object-Oriented Processor. OO Process Requirements with Instruction Analysis of Java Programs. “An Object Oriented Processor should provide a fast and secure method-manipulation procedure.” - PowerPoint PPT Presentation

Citation preview

Page 1: Method Manipulation in an Object-Oriented Processor

Method Manipulation in an Object-Oriented Processor

Page 2: Method Manipulation in an Object-Oriented Processor

• “An Object Oriented Processor should provide a fast and secure method-manipulation procedure.”

• “Data Structures should be defined in an object-oriented processor for the storage of context information and local variables”

• “OOP coding style, requires lots of method invocation and revocation”, so optimize

OO Process Requirements with Instruction Analysis of Java Programs

Page 3: Method Manipulation in an Object-Oriented Processor

Software approaches to OOP introduce inefficiency & insecurity

• Translation from OOP objects to hardware instructions and Data takes time

• Method invocations require locating the method code, access control checking, and passing control etc.

• Security brought by OOP is lost by the translation because the hardware does not manipulate objects directly

Page 4: Method Manipulation in an Object-Oriented Processor

Java High Level Instruction Set Computer (jHISC)

• A research computer jHISC v3 with a 64-bit (possibly 32 bits) architecture is currently under development

• Performance on OOP applications running on HISC system is expected to be faster

• Memory allocations and deallocations are done by hardware

• Secure method manipulation for OOP by defining hardware readable data structures for method context

Page 5: Method Manipulation in an Object-Oriented Processor

Java High Level Instruction Set Computer (jHISC)

• Security and Boundary checking put into hardware, moves the burden of security checking into some pipelined stages, increasing throughput of the processor

• Secure method invocation can safeguard errors produced by erroneous programming

Page 6: Method Manipulation in an Object-Oriented Processor

www.ee.cityu.edu.hk/~hisc/architecture.html

Page 7: Method Manipulation in an Object-Oriented Processor
Page 8: Method Manipulation in an Object-Oriented Processor

• Operand Desrcriptor (OD) - Hardware readable tables and a data structure that hold the information of objects

• Object Header (OH) - Contains information of the object such as object type, GC information and synchronization information.

• Data Space (DS) – Data spaces are storage for data, which include LVF

• Method Code Space – Stores instructions for the method

• Thread State Space (TSS)- For multithreading state information

Page 9: Method Manipulation in an Object-Oriented Processor

State Registers – Store the current status of the system: running instance, class, and method context

Stack- stores state changes upon method invocation and revocation

Page 10: Method Manipulation in an Object-Oriented Processor

Method Space Data Structure

Method Space – Hardware Readable structure. Stores Method Header (MH), Method Code Space (MCS), and Local Variable Frame for a particular method (LVF).

Recall:

MH - Object type, Synchronization

MCS – Stores instructions for the method (Max 2^24 instructions),

the only data structure that stores instructions in the jHISC architecture

LVF – Dynamically created inside register file (can use up to 128 registers) upon method invocation and destroyed upon revocation, used for temporary storage of data.

Page 11: Method Manipulation in an Object-Oriented Processor

Parameter Passing&

Java Methods Map to jHISC Assembly

Page 12: Method Manipulation in an Object-Oriented Processor

Internal Method Invocation

Page 13: Method Manipulation in an Object-Oriented Processor

HLL

ASSEMBLY

Page 14: Method Manipulation in an Object-Oriented Processor

Class Operand Descriptor Table (CODT)

Page 15: Method Manipulation in an Object-Oriented Processor

After Internal Method Call Returns via RVK store result into glob_z

Page 16: Method Manipulation in an Object-Oriented Processor

Glob_x Glob_y

Loc_yLoc_z Loc_xGlob_x Glob_y

Loc_yLoc_z Loc_xLoc_z Glob_y

Loc_z Glob_y

LVF_1

OUTLOCALIN

#0 #1

Before IVK

---------------------------------------Context-Switch--------------------------------------------------------IN LOCAL OUT

After IVK

After Mov Before RVK

IN

LVF_2

------------------------------------------Context-Switch---------------------------------------------------

LVF_1

IN OUTLOCAL

#0 #1

#0 #1

#0 #1

LOCAL

Parameter Passing

Page 17: Method Manipulation in an Object-Oriented Processor

Method Manipulation

• jHISC v3 processor excludes any direct pointer control transfer instruction

• Access Control - Method invocation and revocation is the only way to transfer control between objects

• OOP principles at the architectural level ensure security (helps prevent hacking/viruses trying to access protected information)

Page 18: Method Manipulation in an Object-Oriented Processor

Three Types of Method Invocation

Page 19: Method Manipulation in an Object-Oriented Processor

Method Invocation• On invocation, the system pushes

information about the current states into the machine stack

More switching means pushing more information to the stack

Page 20: Method Manipulation in an Object-Oriented Processor

Saving information in Stack based on the type of method invocation

Method – 3 double words

Class – 4 double words

Instance – 2 double words (aberration?)

Page 21: Method Manipulation in an Object-Oriented Processor

Two bits in SR.MODE register store which kind of methods are currently running

Page 22: Method Manipulation in an Object-Oriented Processor

Invoking Internal Method

Class Property Descriptor Table (CPDT) – Stores resources that class would probably access

Class Data Space – Stores static class data

Method Space (MS) -

Page 23: Method Manipulation in an Object-Oriented Processor

Method Space Data Structure

Method Space – Hardware Readable structure. Stores Method Header (MH), Method Code Space (MCS), and Local Variable Frame for a particular method (LVF).

Recall:

MH - Object type, Synchronization

MCS – Stores instructions for the method (Max 2^24 instructions),

the only data structure that stores instructions in the jHISC architecture

LVF – Dynamically created inside register file (can use up to 128 registers) upon method invocation and destroyed upon revocation, used for temporary storage of data.

Page 24: Method Manipulation in an Object-Oriented Processor

Invoking Internal Method

Class Property Descriptor Table (CPDT) – Stores resources that class would probably access

Class Data Space – Stores static class data

Method Space (MS) - You Just Saw it!

The Processor updates MS, Instruction resumes in public void DoSomething() !

Page 25: Method Manipulation in an Object-Oriented Processor

Invoking Class Method

Page 26: Method Manipulation in an Object-Oriented Processor

Invoking Instance Method

Page 27: Method Manipulation in an Object-Oriented Processor

Method Revocation

• Return from current context to caller context

• Restores previously stored state information by popping from stack

• Based on the SR.MODE, which stored the callers context the context is restored appropriately

Page 28: Method Manipulation in an Object-Oriented Processor

SR.MODE register

Page 29: Method Manipulation in an Object-Oriented Processor

Typos

Page 30: Method Manipulation in an Object-Oriented Processor

Conclusionwww.ee.cityu.edu.hk/~hisc/

• JAVA is relatively a new Object-Oriented Programming (OOP) language. It has most of the advantages of object-oriented languages such as encapsulation, polymorphism, dynamic binding and inheritance. Consequently programs developed by JAVA are more reliable and secure. However, as traditional computer architectures RISC and CISC do not provide much hardware support for OOP, their performance for OOP is notoriously poor. jHISC is developed to target for JAVA and is based on High Level Instruction Set Computer (HISC) to support Object-Oriented Programming (OOP) in hardware level. With jHISC architecture, software developers can take the advantages of OOP without the performance penalty.

Page 31: Method Manipulation in an Object-Oriented Processor

Dreams Do Come TrueFrom Virtual Machine To

Machine

“Compile Once Run Anywhere”

“jHISC Making a Virtual Reality a Reality”

Page 32: Method Manipulation in an Object-Oriented Processor

The End