3.ALTERNATIVE EXECUTION TECHNIQUES FOR JAVA PROGRAMS
In addition to the standard interpreted JVM implementation, a variety of execution techniques have been proposed to reduce the execution time of Java programs. In this section, we discuss the alternative execution techniques summarized in Figure 2. As shown in this figure, there are numerous alternatives for executing Java programs compared to the execution of programs written in a typical programming language such as C. The standard mechanism for executing Java programs is through interpretation, which is discussed in Section 3.1. Compilation is another alternative for executing Java programs and a variety of Java compilers are available that operate on either Java source code or Java bytecodes. We describe several different Java compilers in Section 3.2. Finally, Java processors, which are hardware implementations of the JVM, are discussed in Section 3.3.
3.1. Java Interpreters
Java interpreters are the original method for executing Java bytecodes. An interpreter emulates the operation of a processor by executing a program, in this case, the JVM, on a target processor.In other words, the running JVM program reads and executes each of the bytecodes of the user’s application program in order. An interpreter has several advantages over a traditional compiled execution. Interpretation is very simple, and it does not require a large memory to store the compiled program. Furthermore, interpreters are relatively easy to implement. However, the primary disadvantage of an interpreter is its slow performance.
There are several existing Java interpreters. The Sun Java Developers Kit (JDK) [Sun Microsystems] is used to develop Java applications and applets that will run in all Java-enabled web browsers. The JDK contains all of the necessary classes, source files, applet viewer, debugger, compiler, and interpreter. Versions exist that execute on the SPARC Solaris, x86 Solaris, Windows NT, Windows 95, and Macintosh platforms. The Sun JVM is itself implemented in the C programming language. The Microsoft Software Development Kit (SDK) also provides the tools to compile, execute, and test Java applets and applications [Microsoft SDK Tools]. The SDK contains the Microsoft Win32 Virtual Machine for Java (Microsoft VM), classes, APIs, and so forth for the x86 and ALPHA platforms.
3.2. Java Compilers
Another technique to execute Java programs is with a compiler that translates the Java byte codes into native machine code. Like traditional high-level language compilers, a direct Java compiler starts with an application’s Java source code (or, alternatively, with its byte code) and translates it directly into the machine language of the target processor. The JIT compilers, on the other hand, are dynamically invoked compilers that compile the Java byte code during runtime. These compilers can apply different optimizations to speed up the execution of the generated native code. We discuss some common Java-specific compiler optimizations in 3.2.1. The subsequent sections describe the various Java compilers and their specific features.
เทคนิคการดำเนิน 3.alternative สำหรับโปรแกรมจาวา
นอกเหนือไปจากการดำเนินงาน JVM มาตรฐานการตีความที่หลากหลายของเทคนิคการดำเนินการที่ได้รับการเสนอให้ลดเวลาในการดำเนินการของโปรแกรมจาวา ในส่วนนี้เราได้หารือเกี่ยวกับเทคนิคการดำเนินการทางเลือกที่สรุปไว้ในรูปที่ 2 ดังแสดงในรูปนี้มีทางเลือกมากมายสำหรับการรันโปรแกรมจาวาเมื่อเทียบกับการดำเนินการของโปรแกรมที่เขียนในภาษาการเขียนโปรแกรมทั่วไปเช่นค กลไกมาตรฐานสำหรับการดำเนินงานโปรแกรมจาวาที่ผ่านการตีความซึ่งจะกล่าวถึงในส่วน 3.1รวบรวมเป็นทางเลือกในการดำเนินการโปรแกรมจาวาอื่นและความหลากหลายของคอมไพเลอร์ java มีที่ทำงานในทั้งซอร์สโค้ดจาวาหรือจาวา bytecodes เราจะอธิบายหลายคอมไพเลอร์จาวาที่แตกต่างกันในส่วน 3.2 ในที่สุดการประมวลผลจาวาที่มีการใช้งานฮาร์ดแวร์ของ JVM ที่จะกล่าวถึงในส่วน 3.3.
3.1 java แปล
java แปลเป็นวิธีการเดิมในการดำเนินการ bytecodes java ล่ามจำลองการทำงานของโปรเซสเซอร์โดยการดำเนินโครงการในกรณีนี้ JVM, เป้าหมาย processor.in คำอื่น ๆ โปรแกรม JVM ใช้อ่านและรันแต่ละ bytecodes ของโปรแกรมประยุกต์ของผู้ใช้ในการสั่งซื้อ ล่ามมีข้อดีหลายประการในช่วงการดำเนินการรวบรวมแบบดั้งเดิมการตีความเป็นเรื่องง่ายมากและมันไม่จำเป็นต้องมีหน่วยความจำขนาดใหญ่ในการจัดเก็บรวบรวมโปรแกรม นอกจากล่ามจะค่อนข้างง่ายต่อการใช้ แต่ข้อเสียหลักของล่ามคือการชะลอตัวของ.
มีหลายที่มีอยู่ java แปลดวงอาทิตย์นักพัฒนาจาวาชุด (jdk) [Sun Microsystems] ถูกนำมาใช้ในการพัฒนาโปรแกรมจาวาและจาวาที่จะทำงานในเว็บเปิดใช้งานจาวาเบราว์เซอร์ jdk มีทั้งหมดของการเรียนที่จำเป็นไฟล์ที่มาดูแอปเพล็ดีบักคอมไพเลอร์และล่าม รุ่นอยู่ที่รันบน Solaris SPARC, Solaris 86, Windows NT, Windows 95, และแพลตฟอร์มแมคอินทอชJVM ดวงอาทิตย์จะตัวเองนำมาใช้ในการเขียนโปรแกรมภาษาซี ชุดพัฒนาซอฟต์แวร์ไมโครซอฟท์ (SDK) นอกจากนี้ยังมีเครื่องมือในการรวบรวมการดำเนินการและการทดสอบ java applets และการใช้งาน [เครื่องมือ SDK ของไมโครซอฟท์] SDK มีเครื่องไมโครซอฟท์ win32 เสมือนจริงสำหรับจาวา (VM ไมโครซอฟท์), เรียน, API สำหรับ, และอื่น ๆ เพื่อ x86 และแพลตฟอร์มอัลฟา.
3.2 คอมไพเลอร์จาวา
เทคนิคในการรันโปรแกรมจาวาอีกด้วยคอมไพเลอร์ที่แปลรหัสไบต์ java เป็นรหัสเครื่องพื้นเมือง เช่นคอมไพเลอร์ภาษาระดับสูงแบบคอมไพเลอร์จาวาโดยตรงเริ่มต้นด้วยรหัสแหล่งที่มาของโปรแกรมจาวา (หรือหรือที่มีรหัสไบต์) และแปลได้โดยตรงเป็นภาษาเครื่องในการประมวลผลเป้าหมาย คอมไพเลอร์ JIT ในมืออื่น ๆ ,คอมไพเลอร์จะถูกเรียกแบบไดนามิกที่รวบรวมรหัสจาวาไบต์ในระหว่างรันไทม์ คอมไพเลอร์เหล่านี้สามารถนำมาใช้เพิ่มประสิทธิภาพที่แตกต่างกันเพื่อเพิ่มความเร็วในการทำงานของรหัสพื้นเมืองที่สร้างขึ้น เราพูดคุยทั่วไป java เฉพาะการเพิ่มประสิทธิภาพคอมไพเลอร์ใน 3.2.1 ส่วนต่อมาอธิบายคอมไพเลอร์จาวาต่างๆและคุณสมบัติเฉพาะของพวกเขา.
การแปล กรุณารอสักครู่..
