The Java® Virtual Machine Specification Java SE 14 Edition

Total Page:16

File Type:pdf, Size:1020Kb

The Java® Virtual Machine Specification Java SE 14 Edition The Java® Virtual Machine Specification Java SE 14 Edition Tim Lindholm Frank Yellin Gilad Bracha Alex Buckley Daniel Smith 2020-02-20 Specification: JSR-389 Java SE 14 Version: 14 Status: Final Release Release: March 2020 Copyright © 1997, 2020, Oracle America, Inc. All rights reserved. The Specification provided herein is provided to you only under the Limited License Grant included herein as Appendix A. Please see Appendix A, Limited License Grant. Table of Contents 1 Introduction 1 1.1 A Bit of History 1 1.2 The Java Virtual Machine 2 1.3 Organization of the Specification 3 1.4 Notation 4 1.5 Feedback 4 2 The Structure of the Java Virtual Machine 5 2.1 The class File Format 5 2.2 Data Types 6 2.3 Primitive Types and Values 6 2.3.1 Integral Types and Values 7 2.3.2 Floating-Point Types, Value Sets, and Values 8 2.3.3 The returnAddress Type and Values 10 2.3.4 The boolean Type 10 2.4 Reference Types and Values 11 2.5 Run-Time Data Areas 11 2.5.1 The pc Register 12 2.5.2 Java Virtual Machine Stacks 12 2.5.3 Heap 13 2.5.4 Method Area 13 2.5.5 Run-Time Constant Pool 14 2.5.6 Native Method Stacks 14 2.6 Frames 15 2.6.1 Local Variables 16 2.6.2 Operand Stacks 17 2.6.3 Dynamic Linking 18 2.6.4 Normal Method Invocation Completion 18 2.6.5 Abrupt Method Invocation Completion 18 2.7 Representation of Objects 19 2.8 Floating-Point Arithmetic 19 2.8.1 Java Virtual Machine Floating-Point Arithmetic and IEEE 754 19 2.8.2 Floating-Point Modes 20 2.8.3 Value Set Conversion 20 2.9 Special Methods 22 2.9.1 Instance Initialization Methods 22 2.9.2 Class Initialization Methods 22 2.9.3 Signature Polymorphic Methods 23 2.10 Exceptions 23 iii The Java® Virtual Machine Specification 2.11 Instruction Set Summary 26 2.11.1 Types and the Java Virtual Machine 26 2.11.2 Load and Store Instructions 29 2.11.3 Arithmetic Instructions 30 2.11.4 Type Conversion Instructions 32 2.11.5 Object Creation and Manipulation 34 2.11.6 Operand Stack Management Instructions 34 2.11.7 Control Transfer Instructions 34 2.11.8 Method Invocation and Return Instructions 35 2.11.9 Throwing Exceptions 36 2.11.10 Synchronization 36 2.12 Class Libraries 37 2.13 Public Design, Private Implementation 37 3 Compiling for the Java Virtual Machine 39 3.1 Format of Examples 39 3.2 Use of Constants, Local Variables, and Control Constructs 40 3.3 Arithmetic 45 3.4 Accessing the Run-Time Constant Pool 46 3.5 More Control Examples 47 3.6 Receiving Arguments 50 3.7 Invoking Methods 51 3.8 Working with Class Instances 53 3.9 Arrays 55 3.10 Compiling Switches 57 3.11 Operations on the Operand Stack 59 3.12 Throwing and Handling Exceptions 59 3.13 Compiling finally 63 3.14 Synchronization 66 3.15 Annotations 67 3.16 Modules 68 4 The class File Format 71 4.1 The ClassFile Structure 72 4.2 Names 78 4.2.1 Binary Class and Interface Names 78 4.2.2 Unqualified Names 79 4.2.3 Module and Package Names 79 4.3 Descriptors 80 4.3.1 Grammar Notation 80 4.3.2 Field Descriptors 80 4.3.3 Method Descriptors 82 4.4 The Constant Pool 83 4.4.1 The CONSTANT_Class_info Structure 86 4.4.2 The CONSTANT_Fieldref_info, CONSTANT_Methodref_info, and CONSTANT_InterfaceMethodref_info Structures 87 4.4.3 The CONSTANT_String_info Structure 88 iv The Java® Virtual Machine Specification 4.4.4 The CONSTANT_Integer_info and CONSTANT_Float_info Structures 88 4.4.5 The CONSTANT_Long_info and CONSTANT_Double_info Structures 90 4.4.6 The CONSTANT_NameAndType_info Structure 91 4.4.7 The CONSTANT_Utf8_info Structure 92 4.4.8 The CONSTANT_MethodHandle_info Structure 94 4.4.9 The CONSTANT_MethodType_info Structure 96 4.4.10 The CONSTANT_Dynamic_info and CONSTANT_InvokeDynamic_info Structures 96 4.4.11 The CONSTANT_Module_info Structure 97 4.4.12 The CONSTANT_Package_info Structure 98 4.5 Fields 99 4.6 Methods 101 4.7 Attributes 104 4.7.1 Defining and Naming New Attributes 111 4.7.2 The ConstantValue Attribute 111 4.7.3 The Code Attribute 112 4.7.4 The StackMapTable Attribute 116 4.7.5 The Exceptions Attribute 124 4.7.6 The InnerClasses Attribute 125 4.7.7 The EnclosingMethod Attribute 127 4.7.8 The Synthetic Attribute 129 4.7.9 The Signature Attribute 129 4.7.9.1 Signatures 130 4.7.10 The SourceFile Attribute 135 4.7.11 The SourceDebugExtension Attribute 136 4.7.12 The LineNumberTable Attribute 137 4.7.13 The LocalVariableTable Attribute 138 4.7.14 The LocalVariableTypeTable Attribute 140 4.7.15 The Deprecated Attribute 141 4.7.16 The RuntimeVisibleAnnotations Attribute 142 4.7.16.1 The element_value structure 144 4.7.17 The RuntimeInvisibleAnnotations Attribute 147 4.7.18 The RuntimeVisibleParameterAnnotations Attribute 148 4.7.19 The RuntimeInvisibleParameterAnnotations Attribute 149 4.7.20 The RuntimeVisibleTypeAnnotations Attribute 151 4.7.20.1 The target_info union 157 4.7.20.2 The type_path structure 162 4.7.21 The RuntimeInvisibleTypeAnnotations Attribute 167 4.7.22 The AnnotationDefault Attribute 168 4.7.23 The BootstrapMethods Attribute 169 4.7.24 The MethodParameters Attribute 171 4.7.25 The Module Attribute 173 4.7.26 The ModulePackages Attribute 180 4.7.27 The ModuleMainClass Attribute 181 4.7.28 The NestHost Attribute 182 4.7.29 The NestMembers Attribute 182 v The Java® Virtual Machine Specification 4.8 Format Checking 184 4.9 Constraints on Java Virtual Machine Code 184 4.9.1 Static Constraints 185 4.9.2 Structural Constraints 188 4.10 Verification of class Files 192 4.10.1 Verification by Type Checking 194 4.10.1.1 Accessors for Java Virtual Machine Artifacts 196 4.10.1.2 Verification Type System 200 4.10.1.3 Instruction Representation 204 4.10.1.4 Stack Map Frames and Type Transitions 207 4.10.1.5 Type Checking Abstract and Native Methods 211 4.10.1.6 Type Checking Methods with Code 214 4.10.1.7 Type Checking Load and Store Instructions 223 4.10.1.8 Type Checking for protected Members 225 4.10.1.9 Type Checking Instructions 228 4.10.2 Verification by Type Inference 347 4.10.2.1 The Process of Verification by Type Inference 347 4.10.2.2 The Bytecode Verifier 347 4.10.2.3 Values of Types long and double 351 4.10.2.4 Instance Initialization Methods and Newly Created Objects 351 4.10.2.5 Exceptions and finally 353 4.11 Limitations of the Java Virtual Machine 355 5 Loading, Linking, and Initializing 357 5.1 The Run-Time Constant Pool 357 5.2 Java Virtual Machine Startup 360 5.3 Creation and Loading 361 5.3.1 Loading Using the Bootstrap Class Loader 363 5.3.2 Loading Using a User-defined Class Loader 363 5.3.3 Creating Array Classes 364 5.3.4 Loading Constraints 365 5.3.5 Deriving a Class from a class File Representation 366 5.3.6 Modules and Layers 368 5.4 Linking 370 5.4.1 Verification 371 5.4.2 Preparation 371 5.4.3 Resolution 372 5.4.3.1 Class and Interface Resolution 374 5.4.3.2 Field Resolution 375 5.4.3.3 Method Resolution 376 5.4.3.4 Interface Method Resolution 378 5.4.3.5 Method Type and Method Handle Resolution 379 5.4.3.6 Dynamically-Computed Constant and Call Site Resolution 384 5.4.4 Access Control 388 5.4.5 Method Overriding 390 vi The Java® Virtual Machine Specification 5.4.6 Method Selection 391 5.5 Initialization 392 5.6 Binding Native Method Implementations 395 5.7 Java Virtual Machine Exit 395 6 The Java Virtual Machine Instruction Set 397 6.1 Assumptions: The Meaning of "Must" 397 6.2 Reserved Opcodes 398 6.3 Virtual Machine Errors 398 6.4 Format of Instruction Descriptions 399 mnemonic 400 6.5 Instructions 402 aaload 403 aastore 404 aconst_null 406 aload 407 aload_<n> 408 anewarray 409 areturn 410 arraylength 411 astore 412 astore_<n> 413 athrow 414 baload 416 bastore 417 bipush 418 caload 419 castore 420 checkcast 421 d2f 423 d2i 424 d2l 425 dadd 426 daload 428 dastore 429 dcmp<op> 430 dconst_<d> 432 ddiv 433 dload 435 dload_<n> 436 dmul 437 dneg 439 drem 440 dreturn 442 dstore 443 dstore_<n> 444 dsub 445 vii The Java® Virtual Machine Specification dup 446 dup_x1 447 dup_x2 448 dup2 449 dup2_x1 450 dup2_x2 451 f2d 453 f2i 454 f2l 455 fadd 456 faload 458 fastore 459 fcmp<op> 460 fconst_<f> 462 fdiv 463 fload 465 fload_<n> 466 fmul 467 fneg 469 frem 470 freturn 472 fstore 473 fstore_<n> 474 fsub 475 getfield 476 getstatic 477 goto 479 goto_w 480 i2b 481 i2c 482 i2d 483 i2f 484 i2l 485 i2s 486 iadd 487 iaload 488 iand 489 iastore 490 iconst_<i> 491 idiv 492 if_acmp<cond> 493 if_icmp<cond> 494 if<cond> 496 ifnonnull 498 ifnull 499 iinc 500 iload 501 iload_<n> 502 viii The Java® Virtual Machine Specification imul 503 ineg 504 instanceof 505 invokedynamic 507 invokeinterface 509 invokespecial 513 invokestatic 518 invokevirtual 521 ior 528 irem 529 ireturn 530 ishl 532 ishr 533 istore 534 istore_<n> 535 isub 536 iushr 537 ixor 538 jsr 539 jsr_w 540 l2d 541 l2f 542 l2i 543 ladd 544 laload 545 land 546 lastore 547 lcmp 548 lconst_<l> 549 ldc 550 ldc_w 552 ldc2_w 554 ldiv 556 lload 557 lload_<n> 558 lmul 559 lneg 560 lookupswitch 561 lor 563 lrem 564 lreturn 565 lshl 566 lshr 567 lstore 568 lstore_<n> 569 lsub 570 lushr 571 lxor 572 ix The Java® Virtual Machine Specification monitorenter 573 monitorexit 575 multianewarray 577 new 579 newarray 581 nop 583 pop 584 pop2 585 putfield 586 putstatic 588 ret 590 return 591 saload 592 sastore 593 sipush 594 swap 595 tableswitch 596 wide 598 7 Opcode Mnemonics by Opcode 601 A Limited License Grant 605 x CHAPTER 1 Introduction 1.1 A Bit of History The Java® programming language is a general-purpose, concurrent, object-oriented language.
Recommended publications
  • A Course Material on OBJECT ORIENTED PROGRAMMING by Mr
    CS 8392 OBJECT ORIENTED PROGRAMMING A Course Material on OBJECT ORIENTED PROGRAMMING By Mr.C.KAMATCHI ASSISTANT PROFESSOR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING PRATHYUSHA ENGINEERING COLLEGE 1 CS 8392 OBJECT ORIENTED PROGRAMMING CS 8392 OBJECT ORIENTED PROGRAMMING S.NO CONTENTS PAGE NO Unit I – OVERVIEW 1.1 Why Object-Oriented Programming in C++ 9 1.1.1 History of C++ 9 1.1.2 Why C++? 9 1.2 Native Types 10 1.2.1 Implicit conversions (coercion) 10 1.2.2 Enumeration Types 10 1.3 Native C++ Statements 11 1.4 Functions and pointers 11 1.4.1 functions 11 1.4.2 Declarations 12 1.4.3 Parameters and arguments 13 1.4.4 Parameters 14 1.4.5 by pointer 14 1.5 Pointers 17 1.5.1 Pointer Arithmetic 18 1.6. Implementing Adts In The Base Language. 19 1.6.1Simple ADTs 19 1.6.2 Complex ADTs 19 3 CS 8392 OBJECT ORIENTED PROGRAMMING UNIT II -BASIC CHARACTERISTICS OF OOP 2.1 Data Hiding 21 2.2 Member Functions 22 2.2.1 Defining member functions 22 2.3 Object Creation And Destruction 23 2.3.1 Object Creation 23 2.3.2 Accessing class members 24 2.3.3 Creation methods 26 2.3.4 Object destruction 27 2.4 Polymorphism And Data Abstraction 28 2.4.1 Polymorphism 28 2.5 Data Abstraction 30 2.5.1 Procedural Abstraction 30 2.5.2Modular Abstraction 31 2.5.3 Data Abstraction 31 2.6 Iterators 33 2.7 Containers 34 UNIT III -ADVANCED PROGRAMMING 3.1 Templates 36 3.1.1 Templates and Classes 38 3.1.2 Template Meta-programming overview 42 3.1.3 Compile-time programming 42 3.1.4 The nature of template meta-programming 42 4 CS 8392 OBJECT ORIENTED PROGRAMMING 3.1.5 Building blocks 44 3.2 Generic programming 47 3.2.1 Type parameter 47 3.2.2 A generic function 48 3.2.3 Subprogram parameters 48 3.3 Standard Template Library (Stl) 49 3.3.1 History 50 3.3.2 List of STL implementations.
    [Show full text]
  • Apache Harmony Project Tim Ellison Geir Magnusson Jr
    The Apache Harmony Project Tim Ellison Geir Magnusson Jr. Apache Harmony Project http://harmony.apache.org TS-7820 2007 JavaOneSM Conference | Session TS-7820 | Goal of This Talk In the next 45 minutes you will... Learn about the motivations, current status, and future plans of the Apache Harmony project 2007 JavaOneSM Conference | Session TS-7820 | 2 Agenda Project History Development Model Modularity VM Interface How Are We Doing? Relevance in the Age of OpenJDK Summary 2007 JavaOneSM Conference | Session TS-7820 | 3 Agenda Project History Development Model Modularity VM Interface How Are We Doing? Relevance in the Age of OpenJDK Summary 2007 JavaOneSM Conference | Session TS-7820 | 4 Apache Harmony In the Beginning May 2005—founded in the Apache Incubator Primary Goals 1. Compatible, independent implementation of Java™ Platform, Standard Edition (Java SE platform) under the Apache License 2. Community-developed, modular architecture allowing sharing and independent innovation 3. Protect IP rights of ecosystem 2007 JavaOneSM Conference | Session TS-7820 | 5 Apache Harmony Early history: 2005 Broad community discussion • Technical issues • Legal and IP issues • Project governance issues Goal: Consolidation and Consensus 2007 JavaOneSM Conference | Session TS-7820 | 6 Early History Early history: 2005/2006 Initial Code Contributions • Three Virtual machines ● JCHEVM, BootVM, DRLVM • Class Libraries ● Core classes, VM interface, test cases ● Security, beans, regex, Swing, AWT ● RMI and math 2007 JavaOneSM Conference | Session TS-7820 |
    [Show full text]
  • C++ for You++, AP Edition, by Maria Litvin and Gary Litvin Is Licensed Under a Creative Commons Attribution-Noncommercial-Sharealike 3.0 Unported License
    An Introduction to Programming and Computer Science Maria Litvin Phillips Academy, Andover, Massachusetts Gary Litvin Skylight Software, Inc. Skylight Publishing Andover, Massachusetts Copyright © 1998 by Maria Litvin and Gary Litvin C++ for You++, AP Edition, by Maria Litvin and Gary Litvin is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. You are free: • to Share — to copy, distribute and transmit the work • to Remix — to adapt the work Under the following conditions: • Attribution — You must attribute the work to Maria Litvin and Gary Litvin (but not in any way that suggests that they endorse you or your use of the work). On the title page of your copy or adaptation place the following statement: Adapted from C++ for You++ by Maria Litvin and Gary Litvin, Skylight Publishing, 1998, available at http://www.skylit.com. • Noncommercial — You may not use this work for commercial purposes. • Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one. See http://creativecommons.org/licenses/by-nc-sa/3.0/ for details. Skylight Publishing 9 Bartlet Street, Suite 70 Andover, MA 01810 (978) 475-1431 e-mail: [email protected] web: http://www.skylit.com Library of Congress Catalog Card Number: 97–091209 ISBN 0-9654853-9-0 To Marg and Aaron Brief Contents Part One. Programs: Syntax and Style Chapter 1. Introduction to Hardware and Software 3 Chapter 2. A First Look at a C++ Program 23 Chapter 3. Variables and Constants 49 Chapter 4.
    [Show full text]
  • Solution Brief JVM Performance Monitoring
    Solution Brief Monitoring the Health & Performance of Java Virtual Machines (JVM) Total Performance Visibility JVM: The Cornerstone of Java Enterprise Applications The Java Virtual Machine (JVM) forms the core of the Java application architecture. It plays the crucial role of interpreting and translating Java byte code into operations on the host platform. Since Java middleware (application servers such as Tomcat, JBoss EAP, JBoss AS, WildFly, WebSphere, and WebLogic) runs on the JVM, a performance issue at the JVM level has a major impact on business services supported by it. Monitoring of the JVM must be an integral part of any Java application performance monitoring strategy. IT Ops and DevOps teams use JVM Key Benefits performance metrics to troubleshoot server-side bottlenecks. Developers and architects can also benefit from JVM monitoring by uncovering code- Proactively detect and resolve level issues. Java application problems to ensure high service uptime and business continuity Key JVM Performance Questions to Answer Troubleshoot faster: Real-time • Is there any runaway thread hogging the CPU? Which line of code is it alerts pinpoint the exact line executing, in which class, and which method? of code that is impacting Java • Is the JVM heap and non-heap memory sized correctly? applications • Are there any out-of-memory-exceptions or memory leaks? In-depth analytics enable architects to optimize Java • When does garbage collection happen, and how much memory is applications to scale and support freed up each time? additional users • Are there any thread deadlocks happening that are causing Single pane of glass to monitor application processing to be hung? everything Java—from application server, JVM and database, all the way down to server and storage End-to-End JVM Monitoring with eG Enterprise infrastructure eG Enterprise is a comprehensive performance monitoring, diagnosis and reporting solution for Java application infrastructures.
    [Show full text]
  • A Study of Cache Performance in Java Virtual Machines, the University of Texas at Austin, 2002
    Cache Performance in Java Virtual Machines: A Study of Constituent Phases Anand S. Rajan, Juan Rubio and Lizy K. John Laboratory for Computer Architecture Department of Electrical & Computer Engineering The University of Texas at Austin (arajan, jrubio,[email protected]) Abstract This paper studies the cache performance of Java programs in the interpreted and just-in- time (JIT) modes by analyzing memory reference traces of the SPECjvm98 applications with the Latte JVM. Specifically, we study the cache performance of the different components of the JVM (class loader, the execution engine and the garbage collector). Poor data cache performance in JITs is caused by code installation, and the data write miss rate can be as high as 70% in the execution engine. In addition, this code installation also causes deterioration in performance of the instruction cache during execution of translated code. We also believe that there is considerable interference between data accesses of the garbage collector and that of the compiler-translator execution engine of the JIT mode. We observe that the miss percentages in the garbage collection phase are of the order of 60% for the JIT mode; we believe that interference between data accesses of the garbage collector and the JIT execution engine lead to further deterioration of the data cache performance wherever the contribution of the garbage collector is significant. We observe that an increase in cache sizes does not substantially improve performance in the case of data cache writes, which is identified to be the principal performance bottleneck in JITs. 1 1. Introduction Java[1] is a widely used programming language due to the machine independent nature of bytecodes.
    [Show full text]
  • Java and C I CSE 351 Autumn 2016
    L26: JVM CSE351, Spring 2018 Java Virtual Machine CSE 351 Spring 2018 Model of a Computer “Showing the Weather” Pencil and Crayon on Paper Matai Feldacker-Grossman, Age 4 May 22, 2018 L26: JVM CSE351, Spring 2018 Roadmap C: Java: Memory & data Integers & floats car *c = malloc(sizeof(car)); Car c = new Car(); x86 assembly c->miles = 100; c.setMiles(100); c->gals = 17; c.setGals(17); Procedures & stacks float mpg = get_mpg(c); float mpg = Executables free(c); c.getMPG(); Arrays & structs Memory & caches Assembly get_mpg: Processes language: pushq %rbp Virtual memory movq %rsp, %rbp ... Memory allocation popq %rbp Java vs. C ret OS: Machine 0111010000011000 code: 100011010000010000000010 1000100111000010 110000011111101000011111 Computer system: 2 L26: JVM CSE351, Spring 2018 Implementing Programming Languages Many choices in how to implement programming models We’ve talked about compilation, can also interpret Interpreting languages has a long history . Lisp, an early programming language, was interpreted Interpreters are still in common use: . Python, Javascript, Ruby, Matlab, PHP, Perl, … Interpreter Your source code implementation Your source code Binary executable Interpreter binary Hardware Hardware 3 L26: JVM CSE351, Spring 2018 An Interpreter is a Program Execute (something close to) the source code directly Simpler/no compiler – less translation More transparent to debug – less translation Easier to run on different architectures – runs in a simulated environment that exists only inside the interpreter process . Just port the interpreter (program), not the program-intepreted Slower and harder to optimize 4 L26: JVM CSE351, Spring 2018 Interpreter vs. Compiler An aspect of a language implementation . A language can have multiple implementations . Some might be compilers and other interpreters “Compiled languages” vs.
    [Show full text]
  • Java Virtual Machine Is a Virtual Machine, an Abstract Computer That Has Its Own ISA, Own Memory, Stack, Heap, Etc
    Java Virtual Machine i Java Virtual Machine About the Tutorial Java Virtual Machine is a virtual machine, an abstract computer that has its own ISA, own memory, stack, heap, etc. It is an engine that manages system memory and drives Java code or applications in run-time environment. It runs on the host Operating system and places its demands for resources to it. Audience This tutorial is designed for software professionals who want to run their Java code and other applications on any operating system or device, and to optimize and manage program memory. Prerequisites Before you start to learn this tutorial, we assume that you have a basic understanding of Java Programming. If you are new to these concepts, we suggest you to go through the Java programming tutorial first to get a hold on the topics mentioned in this tutorial. Copyright & Disclaimer Copyright 2019 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] ii Java Virtual Machine Table of Contents About the Tutorial ..........................................................................................................................................
    [Show full text]
  • Java Virtual Machine Guide
    Java Platform, Standard Edition Java Virtual Machine Guide Release 14 F23572-02 May 2021 Java Platform, Standard Edition Java Virtual Machine Guide, Release 14 F23572-02 Copyright © 1993, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition
    [Show full text]
  • UV Mapping Textures to Shapes
    Exploring JavaFX 8 Stephen Chin (@steveonjava) Java Technology Ambassador JavaOne Content Chair ♯jdt2014_A3 1 JavaFX Platform Immersive Application Experience • Cross-platform Animation, Video, Charting • Integrate Java, JavaScript, and HTML5 in the same application • New graphics stack takes advantage of hardware acceleration for 2D and 3D applications • Bidirectional integration with Swing applications using JFXPanel and SwingNode 2 How to Get JavaFX . Step 1: Download Java 8 3 How to Develop JavaFX Use Your Favorite IDE 4 Architecture of JavaFX 8 JavaFX Public API Quantum Toolkit Glass Media Web Prism WinTk Engine Engine Java2D Open GL D3D Java Virtual Machine 5 Package Your Application Applets, Web Start, and Native Packaging Good Better Best 6 New Features in JavaFX 8 7 Controls DatePicker . Allows selection of dates and ranges . Can use custom formats and calendars . Supports Cascading Style Sheets 9 TreeTableView . Combines a TreeView and a TableView . Optional menu for hiding and showing columns . Root can be hidden . Supports multiple selection . Supports CSS 10 New Modena UI Theme 11 12 Build Applications Visually JavaFX Scene Builder 2 13 14 Displaying HTML in JavaFX public class WebViewTest extends Application { public static void main(String[] args) { launch(WebViewTest.class, args); } @Override public void start(Stage stage) { WebView webView = new WebView(); webView.getEngine().load("http://google.com"); Scene scene = new Scene(webView); stage.setScene(scene); stage.setTitle("Web Test"); stage.show(); }} 15 Displaying HTML in JavaFX 16 Calling Javascript from JavaFX String script = "alert('We have got a message, Houston!');”; eng.executeScript(script); 17 JavaScript to Java Type Conversion JavaScript Java null null undefined “undefined” number java.lang.Number (Integer or Double) string java.lang.String boolean java.lang.Boolean object netscape.javascript.JSObject 18 Responding to Browser Events .
    [Show full text]
  • Tutorial I: STM in Managed Runtimes
    Schedule of IISWC Tutorials and Workshops Morning Session, September 29 (Saturday) Tutorial I: STM in Managed Runtimes The influential article "The Landscape of Parallel Computing Research: A View From Berkeley” suggests the only path toward significantly faster CPUs is chip multiprocessing. Programmers will simply have to adapt by writing concurrent code, regardless of any consequential problems with threads. An important trend in application development is that new applications are being developed based on a Managed Runtime Environment (MRTE) such as Java or .NET. These languages provide features such as garbage collection and dynamic class loading that require a managed runtime system (i.e. the Java Virtual Machine (JVM) for Java and .NET for C#). Software transactional memory (STM) promises to alleviate the difficulty of programming using conventional mechanisms such as locks in a threaded environment. In this tutorial we will describe the various mechanisms that are available for software developers to implement transactional applications in Managed Runtimes. We will then use a case study to delve into the workload characteristics when run under a Software Transactional memory system. The case study will be based on workloads and a runtime developed using the Apache Harmony Environment and the High Performance McRT (Multicore Runtime) STM. Apache Harmony (http://harmony.apache.org) is the open source Java SE implementation done under Apache License v2. McRT STM is a high performance runtime environment. The workloads we will characterize and demonstrate include simple micros as well as large multithreaded Java applications. Speakers: Suresh Srinivas is a Principal Engineer in the Software Solutions Group within Intel Corporation where he is currently focused on new technology development using open source technologies.
    [Show full text]
  • Java (Software Platform) from Wikipedia, the Free Encyclopedia Not to Be Confused with Javascript
    Java (software platform) From Wikipedia, the free encyclopedia Not to be confused with JavaScript. This article may require copy editing for grammar, style, cohesion, tone , or spelling. You can assist by editing it. (February 2016) Java (software platform) Dukesource125.gif The Java technology logo Original author(s) James Gosling, Sun Microsystems Developer(s) Oracle Corporation Initial release 23 January 1996; 20 years ago[1][2] Stable release 8 Update 73 (1.8.0_73) (February 5, 2016; 34 days ago) [±][3] Preview release 9 Build b90 (November 2, 2015; 4 months ago) [±][4] Written in Java, C++[5] Operating system Windows, Solaris, Linux, OS X[6] Platform Cross-platform Available in 30+ languages List of languages [show] Type Software platform License Freeware, mostly open-source,[8] with a few proprietary[9] compo nents[10] Website www.java.com Java is a set of computer software and specifications developed by Sun Microsyst ems, later acquired by Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment . Java is used in a wide variety of computing platforms from embedded devices an d mobile phones to enterprise servers and supercomputers. While less common, Jav a applets run in secure, sandboxed environments to provide many features of nati ve applications and can be embedded in HTML pages. Writing in the Java programming language is the primary way to produce code that will be deployed as byte code in a Java Virtual Machine (JVM); byte code compil ers are also available for other languages, including Ada, JavaScript, Python, a nd Ruby.
    [Show full text]
  • Rupiah: Towards an Expressive Static Type System for Java Pdfsubject
    Rupiah: Towards an Expressive Static Type System for Java by John N. Foster A Thesis Submitted in partial fulfillment of of the requirements for the Degree of Bachelor of Arts with Honors in Computer Science WILLIAMS COLLEGE Williamstown, Massachusetts May 20, 2001 Abstract Despite Java’s popularity, several practical limitations imposed by the language’s type sys- tem have become increasingly apparent in recent years. A particularly glaring omission is the lack of a generic mechanism. As a result of this shortcoming, many recent projects have extended Java to support polymorphism in the style of C++ templates or Ada gener- ics. One project, GJ [BOSW98], adds F-bounded parametric polymorphism [CCH+89] to Java via a homogeneous translation (such that only one class file results from each com- piled source file), and produces bytecode that is compatible with the standard Java Virtual Machine. However while GJ’s simple translation based on erasure allows for maximum interaction with existing Java code, the new parameterized types that it supports do not operate consistently with Java’s semantics for lightweight reflection (i.e., checked type-casts and instanceof operations). We present Rupiah, a language based on features adapted from LOOM [BFP97], a provably type-safe language, and implemented by a translation based on GJ. However its translation differs from GJ’s in that it harnesses Java’s built-in reflection to store infor- mation about parameterized types. The resulting bytecode correctly executes checked cast and instanceof expressions because it has access to the necessary type information at run-time. We also add a ThisType construct, which solves many of the problems that arise when binary methods are mixed with inheritance, and we replace subtyping with a different relation, matching.
    [Show full text]