Optimizing PHP Bytecode Using Type-Inferred SSA Form

Total Page:16

File Type:pdf, Size:1020Kb

Optimizing PHP Bytecode Using Type-Inferred SSA Form Bachelor Thesis Optimizing PHP Bytecode using Type-Inferred SSA Form Nikita Popov Matriculation Number: 347863 Technische Universität Berlin Faculty IV · Electrical Engineering and Computer Science Department of Computer Engineering and Microelectronics Embedded Systems Architectures (AES) Einsteinufer 17 · D-10587 Berlin A thesis submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science according to the examination regulations at the Technische Uni- versität Berlin for the Bachelor in Computer Science of May 28, 2014. Department of Computer Engineering and Microelectronics Embedded Systems Architectures (AES) Technische Universität Berlin Berlin Author Nikita Popov Thesis period February 16, 2016 to July 5, 2016 Referees Prof. Dr. B. Juurlink, Embedded Systems Architectures (AES) Prof. Dr. S. Glesner, Software Engineering for Embedded Sys- tems Supervisor Dr. B. Cosenza, Embedded Systems Architectures (AES) Declaration According to §46(8) of the Examination Regulations I hereby confirm to have written the following thesis on my own, not having used any other sources or resources than those listed. Berlin, July 4, 2016 Nikita Popov Abstract PHP is a dynamically typed programming language, which is commonly used for the server-side implementation of web applications. As such its performance is often critical to the response time, throughput and resource utilization of such applications. This thesis aims to reduce runtime overhead by applying classical data-flow optimiza- tions to the PHP bytecode in static single assignment form. Type inference is used both to enable the use of type-specialized instructions and to ensure the correctness of other optimizations, which are commonly only applicable to certain types. Next to type- specialization, we also implement flow-sensitive constant propagation, dead code elimina- tion and copy propagation. Additionally, inlining is used to increase the applicability of other optimizations. The main challenge is to reconcile classical compiler optimizations, that have been developed in the context of statically typed and compiled languages, with a programming language that is not only dynamically and weakly typed, but also supports a plethora of other dynamic language features. This requires a careful analysis of language semantics and modification of standard algorithms to support them. Our approach results in significant performance gains for numerically intensive and tightly looped code, as is typically found in benchmark scripts. We achieve a mean speedup of 1.42× on PHP’s own benchmark suit. However, when considering real appli- cations we have found the speedup to be limited to 1-2%. v Zusammenfassung PHP ist eine dynamisch typisierte Programmiersprache, welche häufig für die Server- seitige Implementierung von Web-Applikationen genutzt wird. Aus diesem Grund ist die Effizienz der PHP-Implementierung kritisch für die Ausführungszeit, den Durchsatz und den Ressourcen-Verbrauch derartiger Applikationen. Ziel dieser Bachelorarbeit ist es die Performanz der PHP-Implementierung zu ver- bessern, indem klassische Datenfluss-Optimierungsmethoden auf den PHP Bytecode in Single-Static-Assignment Form angewendet werden. Typ-Inferenz wird genutzt, sowohl um die Nutzung von Typ-spezialisierten Instruktionen zu ermöglichen, als auch um die Korrektheit anderer Optimierungen sicherzustellen, welche oftmals nicht auf alle Typen anwendbar sind. Neben Typ-Spezialisierung wurde auch Kontrollfluss-sensitive Propaga- tion von Konstanten, Elimination von totem Code, sowie Propagation von Kopien umge- setzt. Zusätzlich wird durch Inline-Ersetzung von Funktionen die Anwendbarkeit anderer Optimierungen erhöht. Hierbei ist die hauptsächliche Herausforderung, dass klassische Compiler-Optimierungs- methoden im Kontext von statisch typisierten und kompilierten Sprachen entwickeln wur- den, während PHP nicht nur dynamisch und schwach typisiert ist, sondern auch eine Vielzahl anderer dynamischer Sprachelemente unterstützt. Dies erfordert eine sorgfälti- ge Analyse der Sprachsemantik und Anpassung von Standard-Algorithmen, um diese zu unterstützen. Unsere Herangehensweise führt zu signifikanten Verbesserungen in der Ausführungszeit von numerisch intensivem Code, wie er typischerweise in Benchmarks gefunden wird. In PHP’s eigener Benchmark-Suite verringert sich die Ausführungszeit im Durchschnitt um einen Faktor von 1,42. Für realistische Applikationen begrenzt sich die Verbesserung jedoch auf 1-2%. vi Contents List of Figures ix List of Listings x 1. Introduction 1 1.1. Historical context . .2 1.2. Prior work . .2 1.3. Attribution . .5 1.4. Outline . .5 2. PHP Language Semantics 7 2.1. Dynamic and weak typing . .7 2.2. References . .8 2.3. The use-def nature of assignments . .9 2.4. Dynamic scope introspection and modification . 10 2.5. Error handling . 11 2.6. Global variables and the pseudo-main scope . 12 2.7. $this binding in methods . 13 2.8. Type annotations . 14 3. Prerequisites 16 3.1. Compilation and execution pipeline . 16 3.2. Instruction format . 17 3.3. Control flow graph . 18 3.4. Dominance, dominator trees and dominance frontiers . 19 3.5. Live-variable analysis . 21 3.6. Static single assignment form . 21 3.6.1. Motivation . 21 3.6.2. SSA properties: Minimal, pruned, strict . 23 3.6.3. Construction of SSA form . 24 3.6.4. Specifics of SSA form in PHP . 25 3.6.5. Extended SSA form: Pi nodes . 27 3.6.6. Phi placement after pi placement . 29 4. Analysis and Optimization 31 4.1. Sparse conditional propagation of data-flow properties . 31 4.1.1. Requirements . 31 vii Contents 4.1.2. Algorithm . 32 4.1.3. Properties . 34 4.2. Type inference . 35 4.2.1. Type lattice . 36 4.2.2. Join operator and transfer function . 37 4.2.3. Flow-sensitivity: Feasible successors . 39 4.2.4. Flow-sensitivity: Pi type constraints . 40 4.2.5. Type narrowing . 41 4.3. Constant propagation . 44 4.3.1. Constant propagation lattice . 45 4.3.2. Transfer function and feasible successors . 45 4.3.3. Specifics of constant propagation in PHP . 46 4.3.4. Combining type inference and constant propagation . 49 4.4. Dead code elimination . 50 4.4.1. Algorithm . 50 4.4.2. PHP specific considerations . 51 4.5. Type specialization . 52 4.6. SSA liveness checks . 53 4.7. Copy propagation on conventional SSA form . 56 4.8. Function inlining . 58 4.9. Propagating information along the dominator tree . 59 4.10. Testing and verification . 60 5. Results 61 5.1. Microbenchmarks . 61 5.2. Real applications . 63 6. Conclusion and Outlook 65 A. Source Code 67 Acronyms 68 Bibliography 69 viii List of Figures 3.1. PHP compilation and execution pipeline . 17 3.2. Control flow graph orderings . 19 3.3. Dominator trees . 20 3.4. Motivation for SSA form . 22 3.5. Strict SSA form . 23 3.6. SSA form with assignments treated as uses . 26 3.7. Motivational example for extended SSA form . 27 3.8. φ-placement after π-placement . 29 4.1. Motivating example for type narrowing . 42 4.2. Constant propagation lattice . 45 4.3. Handling of references during constant propagation . 47 4.4. Related variable interference after copy propagation . 56 5.1. Normalized execution times for microbenchmarks . 62 5.2. Effect of indiviual optimizations on microbenchmarks . 63 ix List of Listings 1. Main loop of propagation framework . 33 2. Handling of individual instructions in the propagation framework . 34 3. Marking edges as feasible in propagation framework . 35 4. Main component of type narrowing algorithm . 43 5. Dead code elimination algorithm . 50 6. Instruction granularity live-in oracle using Boissinot’s algorithm . 56 x 1. Introduction Dynamic scripting languages are commonly chosen over classic statically typed languages, because their use of dynamic typing and lack of an explicit compilation step enables a higher degree of productivity. Unfortunately, the same features that make these languages productive, also make them hard to implement efficiently: In order to support their dynamic features, scripting languages are traditionally implemented using interpreters. An increasingly common avenue used to improve the performance of such languages, is the employment of a just-in-time (JIT) compiler, which generates native machine code at runtime. However, the implementation of JIT compilers is not only a major feat of engineering, but also carries a significant increase in implementation complexity. This thesis pursues a different approach, namely the use of classical data-flow optimization techniques to improve the quality of the interpreted bytecode. We implement our performance optimizations for the PHP programming language, which is commonly used for the server-side implementation of web applications. PHP powers both some of the largest websites such as Facebook1, Wikipedia and Yahoo, but also countless small websites, like personal blogs, discussion forums, etc. End-to-end web application performance depends on more factors than only the per- formance of the server-side programming language, in particular it also includes net- work transmissions, processing of database queries and client-side rendering. Nonetheless PHP’s performance plays an important role in determining the response time, throughput and resource utilization of web applications. Our approach to optimization is to reduce runtime overhead by applying classical data- flow optimizations, such as constant propagation, dead code elimination and copy prop- agation, to the PHP bytecode in static single assignment (SSA) form. Type inference is used both to enable the use of type-specialized
Recommended publications
  • The LLVM Instruction Set and Compilation Strategy
    The LLVM Instruction Set and Compilation Strategy Chris Lattner Vikram Adve University of Illinois at Urbana-Champaign lattner,vadve ¡ @cs.uiuc.edu Abstract This document introduces the LLVM compiler infrastructure and instruction set, a simple approach that enables sophisticated code transformations at link time, runtime, and in the field. It is a pragmatic approach to compilation, interfering with programmers and tools as little as possible, while still retaining extensive high-level information from source-level compilers for later stages of an application’s lifetime. We describe the LLVM instruction set, the design of the LLVM system, and some of its key components. 1 Introduction Modern programming languages and software practices aim to support more reliable, flexible, and powerful software applications, increase programmer productivity, and provide higher level semantic information to the compiler. Un- fortunately, traditional approaches to compilation either fail to extract sufficient performance from the program (by not using interprocedural analysis or profile information) or interfere with the build process substantially (by requiring build scripts to be modified for either profiling or interprocedural optimization). Furthermore, they do not support optimization either at runtime or after an application has been installed at an end-user’s site, when the most relevant information about actual usage patterns would be available. The LLVM Compilation Strategy is designed to enable effective multi-stage optimization (at compile-time, link-time, runtime, and offline) and more effective profile-driven optimization, and to do so without changes to the traditional build process or programmer intervention. LLVM (Low Level Virtual Machine) is a compilation strategy that uses a low-level virtual instruction set with rich type information as a common code representation for all phases of compilation.
    [Show full text]
  • Website Migrate Upgrade SLA Hosting Final
    IMPENDLE LOCAL MUNICIPALITY TENDER NUMBER: ILM/SCM/Quotation/12/2021 WEBSITE MIGRATE Re-DESIGN & 36MONTHS TENTANT HOSTING FOR IMPENDLE LOCAL MUNICIPALITY CLOSING DATE AND TIME: 13 JANUARY 2021 @ 12H00 PM NAME OF ORGANISATION POSTAL ADDRESS CONTACT PERSON TELEPHONE NO. FAX NO. E-MAIL ADDRESS TENDER PRICE TABLE OF CONTENT ITEM NO. DESCRIPTION PAGE NO. 1. Check List 3-4 2. Tender Advert 5-6 3. Tender Specification/ Scope of Work 7-13 4. Form of Offer and Acceptance 14-15 5. Invitation to Bid 16-18 6. Tax Clearance Certificate 19 7. Pricing Schedule 22 8. Declaration of Interest 21-23 9. Preference Points Claim Form 24-28 10. Local Content 29-32 11. Contract form for purchase of goods 33-34 12. Past Supply Chain Practices 36-36 13. Certificate of Independent Bid Declaration 37-39 14. Company Registration 40 15. Proof of municipal rates and taxes 41-43 16. BEE Certificate 44 17. CSD Registration 45 18. General Conditions of Tender 46-50 19. General Conditions of Contract 2010 51-61 Tenderers are advised to check the number of pages and should any be missing or duplicated, or the reproduction indistinct, or any descriptions ambiguous, or this document contain any obvious errors they shall inform the Impendle Municipality at once and have the same rectified. No liability whatsoever will be admitted in respect of errors in any tender due to the tenderers failure to observe this requirement. QUOTATION CHECKLIST PLEASE ENSURE THAT THE FOLLOWING FORMS HAVE BEEN DULY COMPLETED AND SIGNED AND THAT ALL DOCUMENTS AS REQUESTED, ARE ATTACHED TO THE TENDER DOCUMENT: Tenderer to Office Use No Description Tick ( ) Only 1.
    [Show full text]
  • Report on Biodiversity and Tropical Forests in Indonesia
    Report on Biodiversity and Tropical Forests in Indonesia Submitted in accordance with Foreign Assistance Act Sections 118/119 February 20, 2004 Prepared for USAID/Indonesia Jl. Medan Merdeka Selatan No. 3-5 Jakarta 10110 Indonesia Prepared by Steve Rhee, M.E.Sc. Darrell Kitchener, Ph.D. Tim Brown, Ph.D. Reed Merrill, M.Sc. Russ Dilts, Ph.D. Stacey Tighe, Ph.D. Table of Contents Table of Contents............................................................................................................................. i List of Tables .................................................................................................................................. v List of Figures............................................................................................................................... vii Acronyms....................................................................................................................................... ix Executive Summary.................................................................................................................... xvii 1. Introduction............................................................................................................................1- 1 2. Legislative and Institutional Structure Affecting Biological Resources...............................2 - 1 2.1 Government of Indonesia................................................................................................2 - 2 2.1.1 Legislative Basis for Protection and Management of Biodiversity and
    [Show full text]
  • Toward IFVM Virtual Machine: a Model Driven IFML Interpretation
    Toward IFVM Virtual Machine: A Model Driven IFML Interpretation Sara Gotti and Samir Mbarki MISC Laboratory, Faculty of Sciences, Ibn Tofail University, BP 133, Kenitra, Morocco Keywords: Interaction Flow Modelling Language IFML, Model Execution, Unified Modeling Language (UML), IFML Execution, Model Driven Architecture MDA, Bytecode, Virtual Machine, Model Interpretation, Model Compilation, Platform Independent Model PIM, User Interfaces, Front End. Abstract: UML is the first international modeling language standardized since 1997. It aims at providing a standard way to visualize the design of a system, but it can't model the complex design of user interfaces and interactions. However, according to MDA approach, it is necessary to apply the concept of abstract models to user interfaces too. IFML is the OMG adopted (in March 2013) standard Interaction Flow Modeling Language designed for abstractly expressing the content, user interaction and control behaviour of the software applications front-end. IFML is a platform independent language, it has been designed with an executable semantic and it can be mapped easily into executable applications for various platforms and devices. In this article we present an approach to execute the IFML. We introduce a IFVM virtual machine which translate the IFML models into bytecode that will be interpreted by the java virtual machine. 1 INTRODUCTION a fundamental standard fUML (OMG, 2011), which is a subset of UML that contains the most relevant The software development has been affected by the part of class diagrams for modeling the data apparition of the MDA (OMG, 2015) approach. The structure and activity diagrams to specify system trend of the 21st century (BRAMBILLA et al., behavior; it contains all UML elements that are 2014) which has allowed developers to build their helpful for the execution of the models.
    [Show full text]
  • Superoptimization of Webassembly Bytecode
    Superoptimization of WebAssembly Bytecode Javier Cabrera Arteaga Shrinish Donde Jian Gu Orestis Floros [email protected] [email protected] [email protected] [email protected] Lucas Satabin Benoit Baudry Martin Monperrus [email protected] [email protected] [email protected] ABSTRACT 2 BACKGROUND Motivated by the fast adoption of WebAssembly, we propose the 2.1 WebAssembly first functional pipeline to support the superoptimization of Web- WebAssembly is a binary instruction format for a stack-based vir- Assembly bytecode. Our pipeline works over LLVM and Souper. tual machine [17]. As described in the WebAssembly Core Specifica- We evaluate our superoptimization pipeline with 12 programs from tion [7], WebAssembly is a portable, low-level code format designed the Rosetta code project. Our pipeline improves the code section for efficient execution and compact representation. WebAssembly size of 8 out of 12 programs. We discuss the challenges faced in has been first announced publicly in 2015. Since 2017, it has been superoptimization of WebAssembly with two case studies. implemented by four major web browsers (Chrome, Edge, Firefox, and Safari). A paper by Haas et al. [11] formalizes the language and 1 INTRODUCTION its type system, and explains the design rationale. The main goal of WebAssembly is to enable high performance After HTML, CSS, and JavaScript, WebAssembly (WASM) has be- applications on the web. WebAssembly can run as a standalone VM come the fourth standard language for web development [7]. This or in other environments such as Arduino [10]. It is independent new language has been designed to be fast, platform-independent, of any specific hardware or languages and can be compiled for and experiments have shown that WebAssembly can have an over- modern architectures or devices, from a wide variety of high-level head as low as 10% compared to native code [11].
    [Show full text]
  • Coqjvm: an Executable Specification of the Java Virtual Machine Using
    CoqJVM: An Executable Specification of the Java Virtual Machine using Dependent Types Robert Atkey LFCS, School of Informatics, University of Edinburgh Mayfield Rd, Edinburgh EH9 3JZ, UK [email protected] Abstract. We describe an executable specification of the Java Virtual Machine (JVM) within the Coq proof assistant. The principal features of the development are that it is executable, meaning that it can be tested against a real JVM to gain confidence in the correctness of the specification; and that it has been written with heavy use of dependent types, this is both to structure the model in a useful way, and to constrain the model to prevent spurious partiality. We describe the structure of the formalisation and the way in which we have used dependent types. 1 Introduction Large scale formalisations of programming languages and systems in mechanised theorem provers have recently become popular [4–6, 9]. In this paper, we describe a formalisation of the Java virtual machine (JVM) [8] in the Coq proof assistant [11]. The principal features of this formalisation are that it is executable, meaning that a purely functional JVM can be extracted from the Coq development and – with some O’Caml glue code – executed on real Java bytecode output from the Java compiler; and that it is structured using dependent types. The motivation for this development is to act as a basis for certified consumer- side Proof-Carrying Code (PCC) [12]. We aim to prove the soundness of program logics and correctness of proof checkers against the model, and extract the proof checkers to produce certified stand-alone tools.
    [Show full text]
  • Program Dynamic Analysis Overview
    4/14/16 Program Dynamic Analysis Overview • Dynamic Analysis • JVM & Java Bytecode [2] • A Java bytecode engineering library: ASM [1] 2 1 4/14/16 What is dynamic analysis? [3] • The investigation of the properties of a running software system over one or more executions 3 Has anyone done dynamic analysis? [3] • Loggers • Debuggers • Profilers • … 4 2 4/14/16 Why dynamic analysis? [3] • Gap between run-time structure and code structure in OO programs Trying to understand one [structure] from the other is like trying to understand the dynamism of living ecosystems from the static taxonomy of plants and animals, and vice-versa. -- Erich Gamma et al., Design Patterns 5 Why dynamic analysis? • Collect runtime execution information – Resource usage, execution profiles • Program comprehension – Find bugs in applications, identify hotspots • Program transformation – Optimize or obfuscate programs – Insert debugging or monitoring code – Modify program behaviors on the fly 6 3 4/14/16 How to do dynamic analysis? • Instrumentation – Modify code or runtime to monitor specific components in a system and collect data – Instrumentation approaches • Source code modification • Byte code modification • VM modification • Data analysis 7 A Running Example • Method call instrumentation – Given a program’s source code, how do you modify the code to record which method is called by main() in what order? public class Test { public static void main(String[] args) { if (args.length == 0) return; if (args.length % 2 == 0) printEven(); else printOdd(); } public
    [Show full text]
  • A New JIT Compiler in Zing JVM Agenda
    Falcon a new JIT compiler in Zing JVM Agenda • What is Falcon? Why do we need a new compiler? • Why did we decide to use LLVM? • What does it take to make a Java JIT from LLVM? • How does it fit with exiting technology, like ReadyNow? 2 Zing JVM Zing: A better JVM • Commercial server JVM • Key features • C4 GC, ReadyNow!, Falcon 5 What is Falcon? • Top tier JIT compiler in Zing JVM • Replacement for С2 compiler • Based on LLVM 6 Development Timeline PoC GA on by default Apr Dec Apr 2014 2016 2017 Estimated resource investment ~20 man-years (team of 4-6 people) 7 Why do we need a new compiler? • Zing used to have C2 like OpenJDK • C2 is aging poorly — difficult to maintain and evolve • Looking for competitive advantage over competition 8 Alternatives • Writing compiler from scratch? Too hard • Open-source compilers • GCC, Open64, Graal, LLVM… 9 Alternatives • Writing compiler from scratch? Too hard • Open-source compilers short list • Graal vs LLVM 10 “The LLVM Project is a collection of modular and reusable compiler and toolchain technologies” – llvm.org Where LLVM is used? • C/C++/Objective C • Swift • Haskell • Rust • … 12 Who makes LLVM? More than 500 developers 13 LLVM • Started in 2000 • Stable and mature • Proven performance for C/C++ code 14 LLVM IR General-purpose high-level assembler int mul_add(int x, int y, int z) { return x * y + z; } define i32 @mul_add(i32 %x, i32 %y, i32 %z) { entry: %tmp = mul i32 %x, %y %tmp2 = add i32 %tmp, %z ret i32 %tmp2 } 15 Infrastructure provides • Analysis, transformations • LLVM IR => LLVM IR •
    [Show full text]
  • Kkcbmco 6.90 for 14.2 Million 65, Over
    i ’ WEDNESDAY, FEBRUARY 8, IM l Average Daily Net Prees Run PAGE SIXT EEW The Weather''/^' jKanrt|?jati?r ^wnitts For ta* Weak « a M Faraeaat af V. 8. WaatMe M N De«.<ii, luee Baoontaig partly 13,314 night, not aa eoid. Low iO-M, 9Mt T ^ Church Units }. day paitbr olaady, no* aa^idML'f A bout Tow n MamUer o f tlM Audit Afternoon terapensturee hi IHe’f l ^ Bonan of Oinalatloa Manchester-^A City o f Village Charm >n>* PolUh Ainerlc»n C5ub ■Win To O bserve I .............. .......iiiiiiiiiAiininiiai ,pon«r * pre-L«iten party Satui^ x : ^ «v«niu« at the clubhouse. 106 • Cimtoq S t A buffet will be tprved Day of Prayer VOL. LX X X, NO. 110 (EIGHTEEN PAGESf MANCHESTER, CONN., THURSDAY, FEBRUARY 9, 1961 (Classified Advertising on Page 16) PRICE FIVE CBNtE • a tS p.M.. and there will be dans- MAIN STREET. MANCHESTER FREE PARKING ing until 1 a.m. Church bells wiU ring at noon Rear of oUr store TWdsht'a neetins ot ^ e Italian on Friday, Feb.' 17, calling wor- Your Store of Village Charm .., Inspector Finds American Ladles' Auxiliary has ahippers to the Word Day of Pray­ ■ ' been canceled because of parking er service at 2 p.m. at the Center PUC Chairman Says 40 Dead Swine problems created by the snow. The , Congregational Church. anxillary will meet March 8 at the Theme of fhla year’s ohaerv- In East Hartford cluUiouae on Eldridge S t ance. aponaored by the Manches­ ter Council of Oiurch Women, New Haven Railroad Two Manchester residents and a will be "Forward Through the Samuel and John Lombardo, op­ Coventry resident have been made erators of the Eaatem Meat Peck­ new ciUxens at U S.
    [Show full text]
  • JVM Bytecode
    Michael Rasmussen ZeroTurnaround Intro The JVM as a Stack Machine Bytecode taxonomy Stack manipulation Using locals Control flow Method invocation Tooling Next time public class Test { public static void main(String[] args) { System.out.println("Hello World!"); } } 00000000 ca fe ba be 00 00 00 31 00 22 0a 00 06 00 14 09 |.......1."......| 00000010 00 15 00 16 08 00 17 0a 00 18 00 19 07 00 1a 07 |................| 00000020 00 1b 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29 |.....<init>...()| 00000030 56 01 00 04 43 6f 64 65 01 00 0f 4c 69 6e 65 4e |V...Code...LineN| 00000040 75 6d 62 65 72 54 61 62 6c 65 01 00 12 4c 6f 63 |umberTable...Loc| 00000050 61 6c 56 61 72 69 61 62 6c 65 54 61 62 6c 65 01 |alVariableTable.| 00000060 00 04 74 68 69 73 01 00 06 4c 54 65 73 74 3b 01 |..this...LTest;.| 00000070 00 04 6d 61 69 6e 01 00 16 28 5b 4c 6a 61 76 61 |..main...([Ljava| 00000080 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56 01 |/lang/String;)V.| 00000090 00 04 61 72 67 73 01 00 13 5b 4c 6a 61 76 61 2f |..args...[Ljava/| 000000a0 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 01 00 0a 53 |lang/String;...S| . 000001d0 b6 00 04 b1 00 00 00 02 00 0a 00 00 00 0a 00 02 |................| 000001e0 00 00 00 04 00 08 00 05 00 0b 00 00 00 0c 00 01 |................| 000001f0 00 00 00 09 00 10 00 11 00 00 00 01 00 12 00 00 |................| 00000200 00 02 00 13 |....| Compiled from "Test.java” public class Test { public Test(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello World! 5: invokevirtual #4 // Method java/io/PrintStream.println: // (Ljava/lang/String;)V 8: return } Welcome my son Welcome to the machine Where have you been? It's alright we know where you've been.
    [Show full text]
  • Pfc6168.Pdf (438.8Kb)
    ESCUELA TÉCNICA SUPERIOR DE INGENIERÍA DE TELECOMUNICACIÓN UNIVERSIDAD POLITÉCNICA DE CARTAGENA Proyecto Fin de Carrera TÍTULO: Iphone Bookshelf AUTOR: David Zamora Gutiérrez DIRECTOR: Francesc Burrull i Mestres Febrero / 2015 INDEX IPhone application………………………………………………………………... o Tools……………………………………………………………………… . Iphone…………………………………………………………….. Objective-C……………………………………………………….. o Code………………………………………………………………………. Web site…………………………………………………………………………... o Tools……………………………………………………………………… . Codeigniter……………………………………………………….. Php………………………………………………………………... Http……………………………………………………………….. Html………………………………………………………………. Mysql……………………………………………………………... Apache……………………………………………………………. CSS……………………………………………………………….. E-books…………………………………………………………… o Code………………………………………………………………………. References……………………………………………………………………....... IPHONE APPLICATION TOOLS IPHONE The iPhone is a line of Internet- and multimedia-enabled smartphones designed and marketed by Apple Inc. The first iPhone was unveiled by Apple CEO Steve Jobs on January 9, 2007, and released on June 29, 2007. An iPhone can function as a video camera (video recording was not a standard feature until the iPhone 3GS was released), a camera phone, can send texts and receive visual voicemail, a portable media player, and an Internet client with email and web browsing capabilities, and both Wi-Fi and 3G connectivity. The user interface is built around the device's multi-touch screen, including a virtual keyboard rather than a physical one. Third-party as well as Apple application software is available from the App Store, which launched in mid-2008 and now has over 350,000 "apps" approved by Apple. These apps have diverse functionalities, including games, reference, GPS navigation, social networking, e-books... To create applications for this device it’s use the APPLE SDK. APPLE SDK The SDK basically consists of a set of tools that Apple provides to build, debug and test our developments. It contains the following programs: - XCODE: Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS.
    [Show full text]
  • Phalanger Compiling PHP for .NET and Silverlight
    Phalanger Compiling PHP for .NET and Silverlight http://php-compiler.net Tomáš Petříček, C# MVP ([email protected]) Formerly by: Tomáš Matoušek, Ladislav Prošek, et al. Agenda Phalanger Introduction What is Phalanger? And what is it good for? Phalanger for Silverlight How (and why) to write Silverlight client apps in PHP .NET and PHP interoperability Calling C# code from PHP Calling PHP code from C# Interesting Compilation Problems Conditional type binding Calling overloaded methods DEMO Let’s look at some cool demo first :-)! http://tomasp.net/files/copter/default.html Introduction . Phalanger: PHP Language Compiler for .NET . Initially targeting .NET Framework 1.1 . Now using .NET 2.0, Mono and Silverlight 2.0 . We’re planning to use (parts of) DLR in the future . What can you do with Phalanger? . Compile various open-source PHP applications for .NET . Use PHP functions & objects from (other) .NET languages . Use .NET classes from PHP programs . Write Silverlight applications in PHP Agenda Phalanger Introduction What is Phalanger? And what is it good for? Phalanger for Silverlight How (and why) to write Silverlight client apps in PHP .NET and PHP interoperability Calling C# code from PHP Calling PHP code from C# Interesting Compilation Problems Conditional type binding Calling overloaded methods Phalanger: PHP for Silverlight . Similar as other Silverlight dynamic languages . XAML file is loaded by Silverlight plugin in the browser . PHP source code referenced using XAML element: <php:PhalangerLoader Source="script.phpx" /> . Downloaded, compiled and executed on the client . “Loader” element, compiler and runtime in one DLL file <Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:php="clr-namespace:PHP.Silverlight; assembly=Bin/PhpNetCore.dll" Width="800" Height="600" Background="White"> <php:PhalangerLoader Source="simpledemo_php.phpx" /> </Canvas> Phalanger: PHP for Silverlight .
    [Show full text]