The September/October 2016 Issue of Java Magazine

Total Page:16

File Type:pdf, Size:1020Kb

The September/October 2016 Issue of Java Magazine JAX-RS 39 | JAVA INTERFACES 47 | FANTOM 53 SEPTEMBER/OCTOBER 2016 magazine By and for the Java community Devices and IoT INTERACTING 14 WITH SENSORS CONTROLLING CNC ROUTING 24 FROM A RASPBERRY PI IOT AND 32 THE CLOUD ORACLE.COM/JAVAMAGAZINE //table of contents / 14 24 32 RASPBERRY PI– USING THE CLOUD INTERACTING WITH SENSORS CONTROLLED CNC WITH IOT ROUTER By Eric Bruno ON INTEL’S X86 GALILEO BOARD By Stephen Chin By pushing device control and Programming the Raspberry Pi analytics into an IoT-specific to manage cutting, carving, cloud, devices can be remotely and routing operations managed and operated. By Gastón Hillar Capturing and responding to data are the heart and soul of IoT. Here’s how to do both with Java on an inexpensive board that uses an x86 processor. COVER ART BY I-HUA CHEN 04 11 47 58 From the Editor JVM Language Summit 2016 New to Java Fix This Appreciating Limited Choice in Recapping a small annual conference The Evolving Nature of Interfaces By Simon Roberts Languages: The more prescriptive that dives deeply into the JVM By Michael Kölling Our latest code quiz a language is in the details, the 12 Understanding multiple inheritance and 23 easier it is to code productively. Java Books the role of Java 8’s default methods Java Proposals of Interest 06 Review of Java Performance Companion 53 JEP 293: Revising the format Letters to the Editor 39 JVM Languages of command-line options Comments, questions, suggestions, Enterprise Java Fantom Programming Language 64 and kudos By Brian Frank User Groups JAX-RS.next: A First Glance A language that runs on the JVM and 09 By Sebastian Daschner Danish JUG JavaScript VMs and delivers excellent Events A look at what’s coming next in UI-building capabilities 65 Upcoming Java conferences and events JAX-RS 2.1 Contact Us Have a comment? Suggestion? Want to submit an article proposal? Here’s how. 01 ORACLE.COM/JAVAMAGAZINE /////////////////////////////// SEPTEMBER/OCTOBER 2016 EDITORIAL PUBLISHING Editor in Chief Publisher Andrew Binstock Jennifer Hamilton +1.650.506.3794 Managing Editor Associate Publisher and Audience Claire Breen Development Director Copy Editors Karin Kinnear +1.650.506.1985 Karen Perkins, Jim Donahue Audience Development Manager Get Java Technical Reviewer Jennifer Kurtz Stephen Chin ADVERTISING SALES DESIGN Sales Director Senior Creative Director Tom Cometa Francisco G Delgadillo Account Manager Mark Makinney Certified Design Director Richard Merchán Account Manager Senior Designer Marcin Gamza Arianna Pucherelli Advertising Sales Assistant Designer Cindy Elhaj +1.626.396.9400 x 201 Oracle University Jaime Ferrand Mailing-List Rentals Senior Production Manager Contact your sales representative. Sheila Brennan Production Designer RESOURCES Kathy Cygnarowicz Oracle Products +1.800.367.8674 (US/Canada) * Oracle Services Upgrade & Save 35% +1.888.283.0591 (US) ARTICLE SUBMISSION Get noticed by hiring managers If you are interested in submitting an article, please email the editors. SUBSCRIPTION INFORMATION Subscriptions are complimentary for qualified individuals who complete the Learn from Java experts subscription form. MAGAZINE CUSTOMER SERVICE [email protected] Phone +1.847.763.9635 Join online or in the classroom PRIVACY Oracle Publishing allows sharing of its mailing list with selected third parties. If you prefer that your mailing address or email address not be included in this program, contact Connect with our Java Customer Service. certification community Copyright © 2016, Oracle and/or its affiliates. All Rights Reserved. No part of this publication may be reprinted or otherwise reproduced without permission from the editors. JAVA MAGAZINE IS PROVIDED ON AN “AS IS” BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM YOUR USE OF OR RELIANCE ON ANY INFORMATION PROVIDED HEREIN. Opinions expressed by authors, editors, and interviewees—even if they are Oracle employees—do not necessarily reflect the views of Oracle. The information is intended to outline our general product direction. It is intended for information purposes only, and may not Save 35% when you upgrade or advance your existing Java certification. Offer expires December 31, 2016. Click for further details, terms, and conditions. be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Java Magazine is published bimonthly and made available at no cost to qualified subscribers by Oracle, 500 Oracle Parkway, MS OPL-3A, Redwood City, CA 94065-1600. 02 ORACLE.COM/JAVAMAGAZINE /////////////////////////////// SEPTEMBER/OCTOBER 2016 //from the editor / Java in the Cloud Appreciating Limited Choice Oracle Cloud delivers high-performance and in Languages battle-tested platform The more prescriptive a language is in the details, and infrastructure services the easier it is to code productively. for the most demanding Java apps. ur coverage of JDK Enhancement Proposals command-line switches should be included in Oracle Cloud. O (JEPs) in this issue examines a recent pro- style guides for the language. If the Java team Built for modern app dev. posal to standardize the syntax of command-line had specified a standard convention for switches Built for you. arguments for tools that ship in the JDK. As the when it released the language (in the same way proposal points out in support of its core concern, that it recommended initial capitals for class presently there are multiple ways of asking for names and all capitals for constants), this small help from the command line. And if you happen annoyance would not exist. The more a language to guess wrong when using a given tool, you need can formalize small details, the easier it is to get to circle through the variety of possibilities. These things done. can vary from –help to --help to -?. And then But in an ideal world, even this solution is there’s the unmentioned last resort, which is to insufficient. I strongly believe that the abundance Start here: run the program with no arguments and see what of Java style guides is itself a limitation. I’d far developer.oracle.com kind of information you get in the error message. prefer that there be one consistent set of recom- I wholly support this standardization, but mendations that was universally followed. For I’d go much further. In my view, the syntax of example, writing out definitive guidelines for the #developersrule PHOTOGRAPH BY BOB ADLER/GETTY IMAGES 04 ORACLE.COM/JAVAMAGAZINE /////////////////////////////// SEPTEMBER/OCTOBER 2016 //from the editor / location of opening braces, size tions of an integer. As a result, there are additional constraints. The convenience and benefits of indents, tabs vs. spaces, how porting C from one platform For example, the executable code of such strictures that ensure to stagger or not stagger if/else to another was extraordinarily after any if statement must be uniform syntax are widely rec- sequences, Javadoc’s numerous tedious. Java solved these prob- enclosed in braces, even it if con- ognized. This is evident in the formatting options, and so forth. lems. Data items had fixed sizes tains only a single line. Many other choice of most modern develop- Obviously, this would apply to across platforms, and code could conventional items are defined by ment organizations to prescribe higher-level concerns as well: fully be run on multiple platforms what is known as “idiomatic Go.” their own “house style” for code, expanded imports vs. wildcards, without modification. The happy result is that all Go code which is frequently enforced in the sequence of import state- C’s lack of standardization looks the same. Reading and writ- code reviews, so that all develop- ments and variable declarations, caused so much pointless activ- ing it is easy. ers use the same conventions. But and so on. By having a fixed set of The lack of standardization these styles conflict with each guidelines, every Java listing would of details during the last few other for lack of a single, unified be consistent and not require re- years has been an issue in Java set of conventions. examination to adjust to a given Most modern development in small but annoying ways, If the world were all Java, I individual’s or site’s style. organizations prescribe beyond command-line syntax. For think it would not be too onerous Curiously enough, in a certain their own “house style” example, the three variants of the to put up with the differences, way, Java’s initial appearance on annotation for indicating a field although the time lost in doing so the scene addressed what, at the for code, which is frequently should not be null: @NonNull, is lost for no good reason. time, was a tremendous laxity in enforced in code reviews. But @Nonnull, and @NotNull. The But in an increasingly poly- language that made some tasks these styles conflict with each first of these was used by Check- glot world in which other lan- exceedingly tedious. The principal style and FindBugs, the last of guages (JavaScript, HTML, and language before Java was C. It was other for lack of a single, unified them by Java EE 6 and the IntelliJ so on) play significant roles, the purposely designed from a radi- set of conventions. IDE. The result was that if you lack of enforced coding standards cally nonprescriptive perspective. coded in one environment and in Java and especially across those Even today, after many rounds of moved to a different development languages combine to create a standardization, C has numerous environment, you had to change sustained and pointless drag on places where behavior is unde- your code or your toolchain to productivity.
Recommended publications
  • D2.1.5 Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds
    D2.1.5 Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds Project number: 257243 Project acronym: TClouds Trustworthy Clouds - Privacy and Re- Project title: silience for Internet-scale Critical Infras- tructure Start date of the project: 1st October, 2010 Duration: 36 months Programme: FP7 IP Deliverable type: Report Deliverable reference number: ICT-257243 / D2.1.5 / 1.0 Activity and Work package contributing Activity 2 / WP 2.1 to deliverable: Due date: September 2013 – M36 Actual submission date: 30th September, 2013 Responsible organisation: SRX Editor: Norbert Schirmer Dissemination level: Public Revision: 1.0 Abstract: cf. Executive Summary Trusted computing, remote attestation, se- cure logging, confidentiality for commodity Keywords: cloud storage, efficient resilience, tailored components D2.1.5 – Final Reports on Requirements, Architecture, and Components for Single Trusted Clouds Editor Norbert Schirmer (SRX) Contributors Johannes Behl, Stefan Brenner, Klaus Stengel (TUBS) Nicola Barresi, Gianluca Ramunno, Roberto Sassu, Paolo Smiraglia (POL) Alexander Büger, Norbert Schirmer (SRX) Tobias Distler, Andreas Ruprecht (FAU) Sören Bleikertz, Zoltan Nagy (IBM) Imad M. Abbadi, Anbang Ruad (OXFD) Sven Bugiel, Hugo Hideler, Stefan Nürnberger (TUDA) Disclaimer This work was partially supported by the European Commission through the FP7-ICT program under project TClouds, number 257243. The information in this document is provided as is, and no warranty is given or implied that the information is fit for
    [Show full text]
  • Android Cours 1 : Introduction `Aandroid / Android Studio
    Android Cours 1 : Introduction `aAndroid / Android Studio Damien MASSON [email protected] http://www.esiee.fr/~massond 21 f´evrier2017 R´ef´erences https://developer.android.com (Incontournable !) https://openclassrooms.com/courses/ creez-des-applications-pour-android/ Un tutoriel en fran¸caisassez complet et plut^ot`ajour... 2/52 Qu'est-ce qu'Android ? PME am´ericaine,Android Incorporated, cr´e´eeen 2003, rachet´eepar Google en 2005 OS lanc´een 2007 En 2015, Android est le syst`emed'exploitation mobile le plus utilis´edans le monde (>80%) 3/52 Qu'est-ce qu'Android ? Cinq couches distinctes : 1 le noyau Linux avec les pilotes ; 2 des biblioth`equeslogicielles telles que WebKit/Blink, OpenGL ES, SQLite ou FreeType ; 3 un environnement d'ex´ecutionet des biblioth`equespermettant d'ex´ecuterdes programmes pr´evuspour la plate-forme Java ; 4 un framework { kit de d´eveloppement d'applications ; 4/52 Android et la plateforme Java Jusqu'`asa version 4.4, Android comporte une machine virtuelle nomm´eeDalvik Le bytecode de Dalvik est diff´erentde celui de la machine virtuelle Java de Oracle (JVM) le processus de construction d'une application est diff´erent Code Java (.java) ! bytecode Java (.class/.jar) ! bytecode Dalvik (.dex) ! interpr´et´e L'ensemble de la biblioth`equestandard d'Android ressemble `a J2SE (Java Standard Edition) de la plateforme Java. La principale diff´erenceest que les biblioth`equesd'interface graphique AWT et Swing sont remplac´eespar des biblioth`equesd'Android. 5/52 Android Runtime (ART) A` partir de la version 5.0 (2014), l'environnement d'ex´ecution ART (Android RunTime) remplace la machine virtuelle Dalvik.
    [Show full text]
  • Code Coagulation Is an Effective Compilation Technique
    CODE COAGULATION IS AN EFFECTIVE COMPILATION TECHNIQUE FOR THE JVM by Shruthi Padmanabhan Bachelor of Engineering in Information Science, Visvesvaraya Technological University, 2009 A thesis presented to Ryerson University in partial fulfillment of the requirements for the degree of Master of Science in the program of Computer Science Toronto, Ontario, Canada, 2018 c Shruthi Padmanabhan, 2018 Author's Declaration I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. I authorize Ryerson University to lend this thesis to other institutions or individuals for the purpose of scholarly research. I further authorize Ryerson University to reproduce this thesis by photocopying or by other means, in total or in part, at the request of other institutions or individuals for the purpose of scholarly research. I understand that my thesis may be made electronically available to the public for the purpose of scholarly research only. ii Abstract CODE COAGULATION IS AN EFFECTIVE COMPILATION TECHNIQUE FOR THE JVM Shruthi Padmanabhan Master of Science, Computer Science Ryerson University, 2018 Compilers are the interface between programmers and computers. The output of a com- piler determines the speed of the resulting program as well as its energy footprint { of increasing importance in this world of climate change and battery-dependent computing. Code coagulation has the potential to improve that performance, particularly relative to (JIT) interpreters. Java and related languages are in wide use, so addressing their per- formance has large potential impact. Optijava is an experimental compiler that applies code coagulation to Java programs.
    [Show full text]
  • Master En Modelización Matemática, Estadística Y Computación 2011-2012
    MASTER EN MODELIZACIÓN MATEMÁTICA, ESTADÍSTICA Y COMPUTACIÓN 2011-2012 Curso: Bases de datos y programación orientada a objetos Parte POO [email protected] http://gtts.ehu.es/German MASTER EN MODELIZACIÓN MATEMÁTICA, ESTADÍSTICA Y COMPUTACIÓN 2011-2012 Curso: Bases de datos y programación orientada a objetos Parte POO PREMISAS 1) Es esencial asimilar lo que son clases y objetos 2) Se utilizará JAVA. Aprenderemos el núcleo del lenguaje y cómo ser autosuficientes con las librerías. 3) Nos centraremos en las capacidades de E/S y en la conexión a bases de datos. 4) Se presentará una aplicación web que acceda a la base de datos de MySQL. [email protected] http://gtts.ehu.es/German Bases de datos y Java * Java y bases de datos 1. Java necesita un modelo de persistencia para tener éxito real. 2. Larga historia de Sun con bases de datos poco exitosas. 3. Dos bases de datos dominan: Oracle (comercial) y MySQL (libre). 4. Sun compra MySQL (enero 2008). 5. Oracle compra SUN (abril 2009) (ver dimensiones SUN /ORACLE). * La importancia de las bases de datos en la economía mundial [email protected] http://gtts.ehu.es/German 18:1 SUN ocupa el puesto 186 [email protected] http://gtts.ehu.es/German Bases de datos y Java [email protected] http://gtts.ehu.es/German [email protected] http://gtts.ehu.es/German Antes de nada… la máquina virtual Proprietary/closed source implementations "Write Once, Run Anywhere" * Hewlett-Packard's Java for HP-UX, OpenVMS, Tru64 and Reliant (Tandem) UNIX platforms * J9 VM from IBM, for AIX, Linux, MVS, OS/400, Pocket PC, z/OS * Mac OS Runtime for Java (MRJ) from Apple Inc.
    [Show full text]
  • Java Magazine, November/December 2017
    DYNAMIC METHOD INVOCATION 67 | INSIDE JAVA CARD 77 | JAVA QUIZ 91 NOVEMBER/DECEMBER 2017 magazine By and for the Java community JAVA EE 8 WHAT YOU NEED TO KNOW 13 23 43 56 SERVLET 4.0 CDI 2.0 JPA 2.2 MICROPROFILE ORACLE.COM/JAVAMAGAZINE //table of contents / COVER FEATURES 23 43 56 CDI 2.0: MAKING WHAT’S NEW IN JPA 2.2 ECLIPSE MICROPROFILE: DEPENDENCY INJECTION By Josh Juneau THE LIGHT ENTERPRISE A LOT EASIER Streaming results, better date JAVA OPTION By Arjan Tijms conversions, and new annotations By Mert Çalişkan A new spec, new features, are just a few of the many handy Examining a Java EE architecture 13 and new annotations. What’s improvements. designed for microservices and SERVLET 4.0: DOING MORE FASTER not to like? distributed applications By Alex Theedom A major new release of the Servlet API embraces the HTTP/2 protocol and anticipates resource requirements. OTHER FEATURES DEPARTMENTS 67 91 05 11 Understanding Java Method Fix This From the Editor Java Proposals of Interest Invocation with Invokedynamic By Simon Roberts Java EE 8 development goes JEP 295: Ahead-of-Time Compilation By Ben Evans Our latest quiz with questions that test open source. to Native Binaries The instruction added in Java 7 makes intermediate and advanced knowledge 07 42 it possible to resolve method calls dynam- of the language ically at runtime. Java Books User Groups Review of Ken Kousen’s Modern The Netherlands JUG 77 Java Recipes 101 An Introduction to Java Card 09 By Nicolas Ponsini and Florian Tournier Contact Us The smallest Java platform is one of the Events Have a comment? Suggestion? Want to most widely distributed.
    [Show full text]
  • Spring Integration | Java Dsl Цфт Ты Вообще Кто?
    Владимир Плизгá SPRING INTEGRATION | JAVA DSL ЦФТ ТЫ ВООБЩЕ КТО? .Владимир Плизгá .Backend разработчик Позиция: главный инженер-программист, ЦФТ (Центр Финансовых Технологий) Область: разработка Интернет-банков и https://oplata.kykyryza.ru сопутствующих сервисов .Опыт в области: 6+ лет • 20+ партнёров по Интернет-банкам • 20+ партнёров по сайтам подарочных карт 2 ЧТО ТАКОЕ SPRING INTEGRATION? .Проект в экосистеме Spring * IoC – Inversion of Control * EIP – Enterprise Integration Patterns 3 ВКРАТЦЕ О EIP .Высокоуровневая программная модель для построения интеграций .Как внутри приложения .Так и между приложениями .65 паттернов на все случаи жизни .Обеспечивает слабую связность компонентов .Не зависит от стека технологий 4 КОНЦЕПЦИИ EIP: MESSAGE & CHANNEL Сообщение Канал public interface Message<T> { @FunctionalInterface T getPayload(); public interface MessageChannel { MessageHeaders getHeaders(); boolean send(Message<?> message); } } 5 КОНЦЕПЦИИ EIP: ENDPOINT . Transform . Filter . Handle . Split . Aggregate . Route . Bridge . … 6 КОНЦЕПЦИИ EIP: ADAPTER .AMQP/JMS .JBDC/JPA/NoSQL .File .Mail .Social .FTP[S]/SFTP .HTTP/WebFlux/WebSocket .RMI .… 7 ПРИЧЁМ ТУТ SPRING INTEGRATION? «Спецификация» «Имплементация» JVMS HotSpot, JRockit, Excelsior JET JPA Hibernate AMQP RabbitMQ, ActiveMQ EIP Apache Camel, Spring Integration Набор реализующих EIP компонентов, позволяющих разработчику концентрироваться на бизнес-логике и минимально заниматься инфраструктурой обмена сообщениями 8 КАК РАБОТАЕТ SPRING INTEGRATION .Комбинация каналов и точек обработки
    [Show full text]
  • JVM Warm-Up Overhead in Data-Parallel Systems
    DON’T GET CAUGHT IN THE COLD,WARM-UP YOUR JVM: UNDERSTAND AND ELIMINATE JVM WARM-UP OVERHEAD IN DATA-PARALLEL SYSTEMS by David Lion A thesis submitted in conformity with the requirements for the degree of Master of Applied Science Graduate Department of Electrical and Computer Engineering University of Toronto c Copyright 2017 by David Lion Abstract Don’t Get Caught in the Cold, Warm-up Your JVM: Understand and Eliminate JVM Warm-up Overhead in Data-Parallel Systems David Lion Master of Applied Science Graduate Department of Electrical and Computer Engineering University of Toronto 2017 Many widely used, latency sensitive, data-parallel distributed systems, such as HDFS, Hive, and Spark choose to use the Java Virtual Machine (JVM), despite debate on the overhead of doing so. This thesis analyzes the extent and causes of the JVM performance overhead in the above mentioned systems. Surprisingly, we find that the warm-up overhead is frequently the bottleneck, taking 33% of execution time for a 1GB HDFS read, and an average of 21 seconds for Spark queries. The findings on JVM warm-up overhead reveal a contradiction between the principle of parallelization, i.e., speeding up long running jobs by parallelizing them into short tasks, and amortizing JVM warm-up overhead through long tasks. We solve this problem by designing HotTub, a modified JVM that amortizes the warm-up overhead over the lifetime of a cluster node instead of over a single job. ii Acknowledgements First, I would like to thank my supervisor Professor Ding Yuan for his constant support and guidance.
    [Show full text]
  • X9ware-Installation-Guide
    X9Ware Installation Guide X9Ware LLC X9Ware Installation Guide X9Assist: Your x9.37 support tool Revision Date: 06/18/2021 Copyright 2012 – 2018 X9Ware LLC All enclosed information is proprietary to X9Ware LLC X9Ware LLC 10 Windsor Lane Manchester MO 63011 Email: s ales @ x9ware.com Page 1 of 95 X9Ware Installation Guide X9Ware LLC Table of Contents Overview...................................................................................................................................................4 Installing X9Assist and X9Utilities.........................................................................................................10 X9Assist Installation Packages...........................................................................................................10 X9Utilities Installation Packages........................................................................................................10 Installation Overview..........................................................................................................................11 Installation Notes................................................................................................................................11 X9Assist Installation on macOS.........................................................................................................12 X9Assist Automated File Copies........................................................................................................13 MSI Packages and Silent Operations..................................................................................................14
    [Show full text]
  • Java Virtual Machine
    International Journal of Advanced Technology in Engineering and Science www.ijates.com Volume No.02, Special Issue No. 01, September 2014 ISSN (online): 2348 – 7550 JAVA VIRTUAL MACHINE Manjeet Saini1, Abhishek Jain2, Ashish Chauhan3 1, 2, 3Department Of Computer Science And Engineering, Dronacharya College Of Engineering Khentawas, Farrukh Nagar, Gurgaon, Haryana ABSTRACT This machine or the „Simulated computer within the computer‟ is known as the “Java Virtual Machine” or JVM. It is an abstract machine. It is a specification that provides runtime environment in which java byte code can be executed. JVM loads, verifies and executes the code. It provides a runtime environment. It provides definitions for the Memory area, Class file format, Register set, Garbage-collected heap, fatal error reporting etc. The Java Virtual Machine forms part of a large system, the Java Runtime Environment (JRE). Each operating system and CPU architecture requires a different JRE. Keywords: Just-In-Time, Interpreter, Compiler, Ahead Of Time Compilation, Transpiler, Cross Compiler, De-Compiler, Low Level Language, Assembly Language, High Level Language, Object Code, Translator. I. INTRODUCTION Java virtual machine is a virtual machine which is used to execute the java byte code files. It is the code execution component of java development kit. A Java virtual machine (JVM) works as an interpreter. It interprets compiled java byte code also known as java binary code for computer processor or hardware platform so that it can perform java program’s instruction. James Gosling introduces JVM concept to make java platform independent language. Java allows programmers to write code that could run on any platform without the need for rewriting and recompilation for each separate platform.
    [Show full text]
  • Efficient Compilation of .NET Programs for Embedded Systems
    Journal of Object Technology Published by AITO — Association Internationale pour les Technologies Objets, c JOT 2011 Online at http://www.jot.fm. Efficient Compilation of .NET Programs for Embedded Systems Olivier Sallenaveab Roland Ducournaub a. Cortus S.A., Montpellier, France http://www.cortus.com b. LIRMM — CNRS and Université Montpellier 2, France http://www.lirmm.fr Abstract Compiling under the closed-world assumption (CWA) has been shown to be an appropriate way for implementing object-oriented lan- guages such as Java on low-end embedded systems. In this paper, we ex- plore the implications of using whole program optimizations such as Rapid Type Analysis (RTA) and coloring on programs targeting the .Net infras- tructure. We extended RTA so that it takes into account .Net specific features such as (i) array covariance, a language feature also supported in Java, (ii) generics, whose specifications in .Net impacts type analysis and (iii) delegates, which encapsulate methods within objects. We also use an intraprocedural control flow analysis in addition to RTA . We eval- uated the optimizations that we implemented on programs written in C#. Preliminary results show a noticeable reduction of the code size, class hi- erarchy and polymorphism of the programs we optimize. Array covariance is safe in almost all cases, and some delegate calls can be implemented as direct calls. Keywords array covariance, closed-world assumption, delegate, late bind- ing, subtype test, type analysis 1 Introduction High-end embedded systems such as mobile phones have widely adopted object- oriented languages like Java. Object-oriented programming offers code reuse through inheritance and more reliable designs, which improves the productivity in software development.
    [Show full text]
  • Effective Enhancement of Loop Versioning in Java
    Effective Enhancement of Loop Versioning in Java Vitaly V. Mikheev, Stanislav A. Fedoseev, Vladimir V. Sukharev, and Nikita V. Lipsky A. P. Ershov Institute of Informatics Systems, Excelsior, LLC Novosibirsk, Russia {vmikheev,sfedoseev,vsukharev,nlipsky}@excelsior-usa.com Abstract. Run-time exception checking is required by the Java Lan- guage Specification (JLS). Though providing higher software reliability, that mechanism negatively affects performance of Java programs, es- pecially those computationally intensive. This paper pursues loop ver- sioning, a simple program transformation which often helps to avoid the checking overhead. Basing upon the Java Memory Model precisely defined in JLS, the work proposes a set of sufficient conditions for appli- cability of loopversioning. Scalable intra- and interprocedural analyses that efficiently check fulfilment of the conditions are also described. Im- plemented in Excelsior JET, an ahead-of-time compiler for Java, the developed technique results in significant performance improvements on some computational benchmarks. Keywords: Java, performance, loop optimizations, ahead-of-time com- pilation 1 Introduction To date, Java has become an industry-standard programming language. As Java bytecode [3] is a (portable) form of intermediate representation, a great wealth of dynamic and static optimization techniques was proposed to improve the originally poor performance of Java applications. One of the reasons for the in- sufficient performance is obligatory run-time checks for array elements access op- erations. JLS [2] requires two checks1 for read/write of each array element a[i]: first, a has not to be null (otherwise NullPointerException should be thrown), then i must be in the range 0<=i<a.length (if not, IndexOutOfBoundException should be thrown).
    [Show full text]
  • Real-Time Code Generation in Virtualizing Runtime Environments
    Department of Computer Science Real-time Code Generation in Virtualizing Runtime Environments Dissertation submitted in fulfillment of the requirements for the academic degree doctor of engineering (Dr.-Ing.) to the Department of Computer Science of the Chemnitz University of Technology from: Dipl.-Inf. (Univ.) Martin Däumler born on: 03.01.1985 born in: Plauen Assessors: Prof. Dr.-Ing. habil. Matthias Werner Prof. Dr. rer. nat. habil. Wolfram Hardt Chemnitz, March 3, 2015 Acknowledgements The work on this research topic was a professional and personal development, rather than just writing this thesis. I would like to thank my doctoral adviser Prof. Dr. Matthias Werner for the excellent supervision and the time spent on numerous professional discus- sions. He taught me the art of academia and research. I would like to thank Alexej Schepeljanski for the time spent on discussions, his advices on technical problems and the very good working climate. I also thank Prof. Dr. Wolfram Hardt for the feedback and the cooperation. I am deeply grateful to my family and my girlfriend for the trust, patience and support they gave to me. Abstract Modern general purpose programming languages like Java or C# provide a rich feature set and a higher degree of abstraction than conventional real-time programming languages like C/C++ or Ada. Applications developed with these modern languages are typically deployed via platform independent intermediate code. The intermediate code is typi- cally executed by a virtualizing runtime environment. This allows for a high portability. Prominent examples are the Dalvik Virtual Machine of the Android operating system, the Java Virtual Machine as well as Microsoft .NET’s Common Language Runtime.
    [Show full text]