Presentation is loading. Please wait.

Presentation is loading. Please wait.

Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu,

Similar presentations


Presentation on theme: "Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu,"— Presentation transcript:

1

2 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu, Fei Advisor: Yu, Yong

3 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Motivation C+J portable library Distribution and Execution Mechanism Contribution and future work Table of Contents C+J Software Architecture

4 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Runtime overhead is significant even using JIT Space efficiency degrades greatly when heap allocations is universal and frequent Heap allocation is slower than stack allocation by two significant orders Motivation Shortfalls of Java Architecture 16 bytes 32 bytes Space for Reference 4 bytes Space for Object (20 bytes) Space efficiency as individual object size(X-axis) grows assuming there are no memory fragments, which is in an ideal case Heapallocations allocate more space than you want (see malloc.c)

5 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Digital signature on ActiveX only guarantees its source, not its runtime security; ActiveX does not work on other platforms. Need a more general and flexible architecture while maintaining high performance Motivation

6 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Advantages of C+J library C+J applications can run on different OS without recompilation C+J applets can run in Web browsers High performance, suitable for less powerful mobile devices C++ is the most widely used programming language C+J library is well designed; it has two layers in order to be portable C+J portable library

7 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Structure of C+J Library C+J portable library

8 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Usage: C+J compared with Java Java package vs. C++ namespace Class and Interface Exception Keyword: synchronized C+J portable library

9 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Java package vs. C++ namespace cpp - cpp::lang - cpp::awt - cpp::awt::Graphics -... - cpp::io - cpp::net cpp::util java - java.lang - java.awt - java.awt.Graphics -... - java.io - java.net java.util C+J portable library

10 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. interface Shape{ public int getArea(); public void draw(); } class Rect implements Shape{... public int getArea(){ return a*b; } ; public void draw(){... } ; } class Shape{ public: virtual int getArea() =0 ; virtual void draw() =0 ; } ; class Rect : public Shape, public Object{ public:... virtual int getArea(); virtual void draw();... } ; int Rect::getArea() { return a*b; } void Rect::draw() {... }... C+J portable library

11 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. #define throws(Exception) // trick: I currently define it to be empty class Socket : public Object { … Socket(char* host, int port) throws(UnknownHostException | IOException); … // this annotation can be utilized by pre-processor }; Socket(char* host, int port) throw (UnknownHostException, IOException); ANSI C++ standard usage C+J portable library Exception

12 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Keyword synchronized Function(){... synchronized( Obj ){... }... } Function(){... { Synchronize belowWith( Obj );... }... } Using JavaUsing C+J lib C+J portable library

13 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Flexible Distribution Format Share binaries among different operating systems Can be compiled into intermediate code Distribution & Execution Mechanism

14 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Share executable of local application C+J Application C+J Dynamic Link Lib For Windows x86 Abstract layer for OS Distribution & Execution Mechanism

15 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Application C+J Dynamic Link Lib For Linux x86 Distribution & Execution Mechanism Share executable of local application Abstract layer for OS Same binary

16 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Compile to Intermediate Code Source Code Intermediate Code compile Download Translator Native Machine code Final executable Insert SFI protection Client Browser Distribution & Execution Mechanism

17 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Software-based Fault Isolation(SFI) Security issues in machine instruction level Privileged Instructions Memory Access Control Flow Solutions : Static check for instruction and immediate address Runtime protection(code inserted ) Runtime Overhead: about 10% R/W/Jump address AND, OR operations Control Flow restricted in protected region Distribution & Execution Mechanism

18 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Hidden Execution Sequence Attack call ebx Hidden Execution Sequence Normal Execution Sequence Hidden JMP instruction, jump out of restricted region Distribution & Execution Mechanism

19 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. SFI on x86 No need to reserve 5 registers No need to use hash table to verify the correctness of function entry No need for stack extension call ebx f1: ret ret_id func_id Globle Table 1: ret_id -> address Distribution & Execution Mechanism Globle Table 2: func_id -> address

20 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Runtime overhead: C+J Applet vs Java Applet C+J Dynamic Lib C+J Applet Time:100% (no overhead) Space:100% (no overhead) Time:110% (SFI overhead) Space:100% (no overhead) Java class library Time:???% Space:300%-400% + Java Applet Time:???% Space:300%-400% + C+J Applet Distribution & Execution Mechanism

21 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Contribution Clean C+J library design C+J core library development Innovative cross-platform Architecture Share binaries among OSes, cross-platform development Run C+J Applet in Web browser A new SFI approach for CISC processors Conclusion

22 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. Future Conclusion Provides an ideal software architecture for mobile devices High performance Cross-platform development Flexible cross-platform distribution

23 Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. The End C+J Based Software Architecture Thank you


Download ppt "Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu,"

Similar presentations


Ads by Google