Vol. 48 No. SIG 10(PRO 33) June 2007 Java Box Auto-Boxing primitive wrapper Java Auto-Boxing Auto-Boxing null SPECjbb % Eliminating Redundant B

Similar documents
jssst07.dvi

. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Pr

maegaki_4_suzuki_yuusuke.pdf

新・明解Java入門

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

IPSJ SIG Technical Report Vol.2016-ARC-221 No /8/9 GC 1 1 GC GC GC GC DalvikVM GC 12.4% 5.7% 1. Garbage Collection: GC GC Java GC GC GC GC Dalv

メタコンピュータ構成方式の研究

fmaster.dvi

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

,4) 1 P% P%P=2.5 5%!%! (1) = (2) l l Figure 1 A compilation flow of the proposing sampling based architecture simulation

28 Docker Design and Implementation of Program Evaluation System Using Docker Virtualized Environment

IPSJ SIG Technical Report Vol.2015-ARC-215 No.7 Vol.2015-OS-133 No /5/26 Just-In-Time PG 1,a) 1, Just-In-Time VM Geyser Dalvik VM Caffei

,,,,., C Java,,.,,.,., ,,.,, i

fiš„v8.dvi

Fig. 3 3 Types considered when detecting pattern violations 9)12) 8)9) 2 5 methodx close C Java C Java 3 Java 1 JDT Core 7) ) S P S

VB.NETコーディング標準

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

ALG ppt

2984 Dec ITS AMI-C 1) AMI-C Java 7) J2ME/CDC 12) API API Java J2ME/CDC 5),6) J2ME/CDC J2ME/CDC 5 1 Fig. 1 Software architecture of in-vehicle in

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java

untitled

Vol.6 No (Aug. 2013) 1,a) 2,b) 2,c) , Java Java Java Java Inner Method for Code Reuse in Fine-grained and Its Effective Im

CX-Checker CX-Checker (1)XPath (2)DOM (3) 3 XPath CX-Checker. MISRA-C 62%(79/127) SQMlint 76%(13/17) XPath CX-Checker 3. CX-Checker 4., MISRA-C CX- Ch

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =


17 Proposal of an Algorithm of Image Extraction and Research on Improvement of a Man-machine Interface of Food Intake Measuring System

Vol. 42 No. SIG 8(TOD 10) July HTML 100 Development of Authoring and Delivery System for Synchronized Contents and Experiment on High Spe

1 1 CodeDrummer CodeMusician CodeDrummer Fig. 1 Overview of proposal system c

DPA,, ShareLog 3) 4) 2.2 Strino Strino STRain-based user Interface with tacticle of elastic Natural ObjectsStrino 1 Strino ) PC Log-Log (2007 6)

Table 1. Reluctance equalization design. Fig. 2. Voltage vector of LSynRM. Fig. 4. Analytical model. Table 2. Specifications of analytical models. Fig

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in

( ) [1] [4] ( ) 2. [5] [6] Piano Tutor[7] [1], [2], [8], [9] Radiobaton[10] Two Finger Piano[11] Coloring-in Piano[12] ism[13] MIDI MIDI 1 Fig. 1 Syst

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

13金子敬一.indd

ipsj-final.dvi

22 (266) / Web PF-Web Web Web Web / Web Web PF-Web Web Web Web CGI Web Web 1 Web PF-Web Web Perl C CGI A Pipe/Filter Architecture Based Software Gener

Microsoft PowerPoint ppt

shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (..

Komatsu s Brand for New-Generation Construction and Mining Equipment Genuine Answers for Land & Environment Optimization GALEO is derived from the fol

情報処理学会研究報告 IPSJ SIG Technical Report Vol.2011-OS-118 No /7/28 LLVM LLVM Scattaring Object files by LLVM Natsuki Kawai 1 and Koichi Sa

paper.pdf

HashMapからConcurrentHashMapへの移行

アルゴリズムとデータ構造1

Microsoft Word - 430_15_Developing_Stored_Procedure.doc

Run-Based Trieから構成される 決定木の枝刈り法

Vol. 44 No. SIG 12(TOD 19) Sep MF MF MF Content Protection Mechanism Based on Media Framework and an Implementation for Autonomous Information C

JavaScript Web Web Web Web Web JavaScript Web Web JavaScript JavaScript JavaScript GC GC GC GC JavaScript SSJSVM GC SSJSVM GC GC GC SSJSVM GC GC SSJSV

main.dvi

<4D F736F F D20566F F6E658C6791D FE382C582CC4A D834F E F8F4390B394C52E646F63>

DEIM Forum 2009 B4-6, Str

2 3 Pockets Pockest Java [6] API (Backtracking) 2 [7] [8] [3] i == Pockets 2.1 C3PV web [9] Pockets [10]Pockets 1 3 C

1 OpenCL OpenCL 1 OpenCL GPU ( ) 1 OpenCL Compute Units Elements OpenCL OpenCL SPMD (Single-Program, Multiple-Data) SPMD OpenCL work-item work-group N

6-1

IPSJ SIG Technical Report Vol.2017-ARC-225 No.12 Vol.2017-SLDM-179 No.12 Vol.2017-EMB-44 No /3/9 1 1 RTOS DefensiveZone DefensiveZone MPU RTOS

spa99.dvi

, : GUI Web Java 2.1 GUI GUI GUI 2 y = x y = x y = x

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

2) TA Hercules CAA 5 [6], [7] CAA BOSS [8] 2. C II C. ( 1 ) C. ( 2 ). ( 3 ) 100. ( 4 ) () HTML NFS Hercules ( )

2006 [3] Scratch Squeak PEN [4] PenFlowchart 2 3 PenFlowchart 4 PenFlowchart PEN xdncl PEN [5] PEN xdncl DNCL 1 1 [6] 1 PEN Fig. 1 The PEN

Vol. 42 No MUC-6 6) 90% 2) MUC-6 MET-1 7),8) 7 90% 1 MUC IREX-NE 9) 10),11) 1) MUCMET 12) IREX-NE 13) ARPA 1987 MUC 1992 TREC IREX-N

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

2 27 (2010 ) 1 public final class String... { // only has private fields 2 private char[] value; // char array to hold the value 3 private int offset;

untitled

IPSJ SIG Technical Report Vol.2014-DBS-159 No.6 Vol.2014-IFAT-115 No /8/1 1,a) 1 1 1,, 1. ([1]) ([2], [3]) A B 1 ([4]) 1 Graduate School of Info

1 DHT Fig. 1 Example of DHT 2 Successor Fig. 2 Example of Successor 2.1 Distributed Hash Table key key value O(1) DHT DHT 1 DHT 1 ID key ID IP value D

Vol. 51 No (Sep. 2010) Avis Avis Automatic Visualization Tool for Programs Study on an Abstraction of Paths for Integration Testi

IPSJ SIG Technical Report Vol.2013-CE-119 No /3/15 enpoly enpoly enpoly 1) 2) 2 C Java Bertrand Meyer [1] 1 1 if person greeting()



2018 IPSJ/SIGSE Software Engineering Symposium (SES2018) 1,a) 1,b) 1,c) Java 2014 Java Java Java Stream Optional 18% Stream 5% Stream JDK6/7

Java演習(4) -- 変数と型 --

ID 3) 9 4) 5) ID 2 ID 2 ID 2 Bluetooth ID 2 SRCid1 DSTid2 2 id1 id2 ID SRC DST SRC 2 2 ID 2 2 QR 6) 8) 6) QR QR QR QR

橡告改.PDF

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

B 20 Web

TopLink å SampleClient.java... 5 Ò readallsample() querysample() cachesample() Ç..

Microsoft PowerPoint - Pro110111


GPGPU

tkk0408nari

3 p.1 3 Java Java Java try catch C Java if for while C 3.1 boolean Java if C if ( ) 1 if ( ) 1 else , 2 { } boolean true false 2 boolean Gr

ohp02.dvi

Vol.55 No (Jan. 2014) saccess 6 saccess 7 saccess 2. [3] p.33 * B (A) (B) (C) (D) (E) (F) *1 [3], [4] Web PDF a m

% 95% 2002, 2004, Dunkel 1986, p.100 1

1 7.35% 74.0% linefeed point c 200 Information Processing Society of Japan

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Vol.53 No (Mar. 2012) 1, 1,a) 1, 2 1 1, , Musical Interaction System Based on Stage Metaphor Seiko Myojin 1, 1,a

PC Development of Distributed PC Grid System,,,, Junji Umemoto, Hiroyuki Ebara, Katsumi Onishi, Hiroaki Morikawa, and Bunryu U PC WAN PC PC WAN PC 1 P

解きながら学ぶJava入門編

A Feasibility Study of Direct-Mapping-Type Parallel Processing Method to Solve Linear Equations in Load Flow Calculations Hiroaki Inayoshi, Non-member

& Vol.5 No (Oct. 2015) TV 1,2,a) , Augmented TV TV AR Augmented Reality 3DCG TV Estimation of TV Screen Position and Ro

Chip Size and Performance Evaluations of Shared Cache for On-chip Multiprocessor Takahiro SASAKI, Tomohiro INOUE, Nobuhiko OMORI, Tetsuo HIRONAKA, Han

IPSJ SIG Technical Report Vol.2009-DPS-141 No.20 Vol.2009-GN-73 No.20 Vol.2009-EIP-46 No /11/27 1. MIERUKEN 1 2 MIERUKEN MIERUKEN MIERUKEN: Spe

fiš„v3.dvi

IPSJ SIG Technical Report iphone iphone,,., OpenGl ES 2.0 GLSL(OpenGL Shading Language), iphone GPGPU(General-Purpose Computing on Graphics Proc

BASIC / / BA- SIC Web 1/10 1/10 / / JavaScript

新・明解Java入門

3. ( 1 ) Linear Congruential Generator:LCG 6) (Mersenne Twister:MT ), L 1 ( 2 ) 4 4 G (i,j) < G > < G 2 > < G > 2 g (ij) i= L j= N

2 2.1 NPCMJ ( (Santorini, 2010) (NPCMJ, 2016) (1) (, 2016) (1) (2) (1) ( (IP-MAT (CONJ ) (PP (NP (D ) (N )) (P )) (NP-SBJ *

Transcription:

Vol. 48 No. SIG 10(PRO 33) June 2007 Java Box Auto-Boxing primitive wrapper Java Auto-Boxing Auto-Boxing null SPECjbb2005 3.6% Eliminating Redundant Boxing by a Dynamic Compiler for Java Yuji Chiba Programming using auto-boxing makes it unnecessary to write code that converts a primitive value into an instance of the wrapper class because auto-boxing inserts the code implicitly. The implicit code is sometimes redundant, and we propose an optimization that eliminates the redundant code to improve performance. Our optimization also makes the implicit code redundant by null test elimination, redundant reference comparision elimination, member variable reference elimination, and unwinding execution when an interpreter takes over the execution. Evaluation using SPECjbb2005 showed that our optimization improved the performance by 3.6%. 1. Java TM version 5.0 Auto-Boxing 5) Auto-Boxing primitive wrapper int java.lang.integer Auto-Boxing 1 Auto-Boxing 1 14 get() get() 2 Map Object 1 14 int i Auto-Boxing Auto-Boxing Java Auto-Boxing Java javac javac 1 14 3 javac Integer.valueOf() valueof() 4 31 36 valueof() 128 127 Integer 128 127 Integer Systems Development Laboratory, Hitachi, Ltd. Java HotSpot Sun Microsystems, Inc. 165

166 June 2007 1: import java.util.map; 2: import java.util.hashmap; 3: 4: class MapStorage{ 5: Map map; 6: 7: MapStorage(){ 8: map = new HashMap(); 9: } 10: 11: 12: 13: Object get(int i){ 14: return (map.get(i)); 15: } 16: } 1 Auto-Boxing Fig. 1 Sample source code using auto-boxing. 1: package java.util; 2: 3: public interface Map{ 4: 5: Object get(object key); 6: } 7: 8: public class HashMap implements Map{ 9: static class Entry{ 10: final Object key; 11: final int hash; 12: Object value; 13: Entry next; 14: 15: } 16: transient Entry[] table; 17: static final Object NULL KEY = 18: new Object(); 19: 20: public Object get(object key){ 21: Object k = 22: (key == null)? NULL KEY : key; 23: int hash = k.hashcode(); 24: Entry e = 25: table[hash & (table.length-1)]; 26: while(true){ 27: if (e == null) 28: return null; 29: if ((e.hash == hash) && 30: ((k == e.key) k.equals(e.key))) 31: return e.value; 32: e = e.next; 33: } 34: } 35: } 2 Map HashMap Fig. 2 Implementation of interface Map and class HashMap. i 128 127 Auto-Boxing 1: Integer tmp = Integer.valueOf(i); 2: return (map.get(tmp)); 3 javac valueof() Fig. 3 Insertion of valueof() by javac. 1: package java.lang; 2: 3: public class Integer{ 4: private final int value; 5: 6: public Integer(int v){ 7: this.value = v; 8: } 9: 10: public int hashcode(){ 11: return value; 12: } 13: 14: public boolean equals(object obj){ 15: if (obj instanceof Integer) 16: return value==((integer)obj).value; 17: return false; 18: } 19: 20: 21: 22: private static class IntegerCache { 23: static final Integer cache[]; 24: static { 25: cache = new Integer[256]; 26: for(int i = 0; i < 256; i++) 27: cache[i] = new Integer(i - 128); 28: } 29: } 30: 31: public static Integer valueof(int i) { 3 33: return IntegerCache.cache[i + 128]; 34: } 35: return new Integer(i); 36: } 37: } Fig. 4 4 Integer An implementation of class Integer. 1 14 3 Java Auto-Boxing 2 3 4 5 SPECjbb2005 18) 6 2. Java

Vol. 48 No. SIG 10(PRO 33) Java Box 167 2 (1) 4),12) (2) 7),8) Auto-Boxing null Box 2),9),11),14),15),19),20) 3. ( 1 ) Auto-Boxing 3 valueof() null (2) 3 1 valueof() 3 2 valueof() tmp get() tmp 1: if (map!=null && map->klass==hashmap) 2: HashMap::get(map, tmp); 3: else{ 4: : 5: 3 2 6: } 5 Fig. 5 A guarded call. valueof() 2 get() get() map map HashMap map.get(tmp) 5 3) HashMap::get() 5 Java C++ Java 5 map NULL map HashMap 4 5 map NULL NullPointerException 3 2 get() 5 HashMap::get() 6 HashMap::get() 2 20 34 2 20 34 Java 6 C++ Java null 6 6 9 null 2 25 table.length

168 June 2007 1: Integer tmp = Integer::valueOf(i); 2: if(map!=null && map->klass==hashmap){ 3: Object k = 4: (tmp == NULL)? NULL KEY : tmp; 5: int hash = k->hashcode(); 6: if (map->table == NULL){ 7: : 8: 2 25 9: } 10: unsigned index = (unsigned) 11: (hash & (map->table->length-1)); 12: if (index >= map->table->length){ 13: : 14: 2 25 15: } 16: Entry e = map->table[index]; 17: while(true){ 18: if (e == NULL) 19: return NULL; 20: if ((e->hash == hash) && 21: ((k == e->key) 22: (k->equals(e->key)))) 23: return e->value; 24: e = e->next; 25: : 26: 27: } 28: } 29: else{ 30: : 31: 3 2 32: } 6 HashMap::get() Fig. 6 Code after inlining HashMap::get(). null 6 12 15 2 25 6 25 26 6),21) 6 6 25 26 2 26 6 3.1 null 6 4 valueof() tmp valueof() 4 tmp 2 tmp null valueof() 4 31 36 33 cache 35 null cache 22 29 null valueof() null cache null valueof() null cache 6 4 null 3 4 tmp k 1) k 7 3.2 7 3 19 20 valueof() tmp valueof() 3 20 tmp tmp Integer 4 20 cache Java IntegerCache

Vol. 48 No. SIG 10(PRO 33) Java Box 169 1: Integer tmp = Integer::valueOf(i); 2: if(map!=null && map->klass==hashmap){ 3: int hash = tmp->hashcode(); 4: if (map->table == NULL){ 5: : 6: 2 25 7: } 8: unsigned index = (unsigned) 9: (hash & (map->table->length-1)); 10: if (index >= map->table->length){ 11: : 12: 2 25 13: } 14: Entry e = map->table[index]; 15: while(true){ 16: if (e == NULL) 17: return NULL; 18: if ((e->hash == hash) && 19: ((tmp == e->key) 20: (tmp->equals(e->key)))) 21: return e->value; 22: e = e->next; 23: : 24: 25: } 26: } 27: else{ 28: : 29: 3 2 30: } 1: Integer tmp = Integer::valueOf(i); 2: if(map!=null && map->klass==hashmap){ 3: int hash = tmp->value; 4: if (map->table == NULL){ 5: : 6: 2 25 7: } 8: unsigned index = (unsigned) 9: (hash & (map->table->length-1)); 10: if (index >= map->table->length){ 11: : 12: 2 25 13: } 14: Entry e = map->table[index]; 15: while(true){ 16: if (e == NULL) 17: return NULL; 18: if ((e->hash == hash) && 19: ((e->key instanceof Integer) && 20: (tmp->value==e->key->value))) 21: return e->value; 22: e = e->next; 23: : 24: 25: } 26: } 27: else{ 28: : 29: 3 2 30: } 7 null Fig. 7 Code after null test elimination. Fig. 8 8 Code after redundant comparison elimination. Integer hashcode() equals() 4 10 12 14 18 19 2 tmp e->key 20 equals() tmp e->key 19 19 2 tmp e->key 20 19 19 equals() tmp Integer Integer equals() 2 19 19 3 20 8 3.3 8 3 20 valueof() tmp valueof() 3 20 tmp value valueof() i 3 20 tmp->value i valueof() 4 31 36 valueof() i -128 127 valueof() Integer cache -128 127 Integer 8 3 20 tmp->value

170 June 2007 i (1) cache -128 127 Integer (2) valueof() value valueof() cache 3.4 8 3 20 tmp 8 5 11 23 28 tmp tmp tmp valueof() valueof() valueof() Java OutOfMemoryError valueof() 8 5 11 23 28 tmp valueof() valueof() valueof() valueof() valueof() 8 5 11 23 28 tmp 2 valueof() HotSpot TM VM HotSpotVM Integer HotSpotVM 8 tmp valueof() valueof() 9 4. 3 Box valueof() null 10) valueof()

Vol. 48 No. SIG 10(PRO 33) Java Box 171 1: if(map!=null && map->klass==hashmap){ 2: int hash = i; 3: if (map->table == NULL){ 4: : 5: 3 1 6: } 7: unsigned index = (unsigned) 8: (hash & (map->table->length-1)); 9: if (index >= map->table->length){ 10: : 11: 3 1 12: } 13: Entry e = map->table[index]; 14: while(true){ 15: if (e == NULL) 16: return NULL; 17: if ((e->hash == hash) && 18: ((e->key instanceof Integer) && 19: (i==e->key->value))) 20: return e->value; 21: e = e->next; 22: : 23: 24: } 25: } 26: else{ 27: : 28: 3 1 29: } 9 valueof() Fig. 9 Code after eliminating valueof(). 3 3 1 valueof() 3 1 valueof() 10 (a) 10 (a) Box 6 Integer 10 (a) 6 6 tmp 8 get() get() get() 8 6 8 6 4: } 5: else{ 6: tmp = new Integer(i); 7: } 8: return (map.get(tmp)); (a) 4: return (map.get(tmp)); 5: } 6: else{ 7: tmp = new Integer(i); 8: return (map.get(tmp)); 9: } Fig. 10 (b) 10 Partial redundancy elimination. tmp i Integer tmp null null 8 8 tmp 6 3 8 tmp null 4.1 1 3.1 10 (a) 10 (a) 8 get() if else 10 (b) 10 (b) 8 get() tmp 7 get() tmp Integer.valueOf() Integer

172 June 2007 4: return (map.get(tmp)); 5: } 6: else{ 7: tmp = new Integer(i); 8: if(map!=null && map->klass==hashmap){ 9: Object k = 10: (tmp == NULL)? NULL KEY : tmp; 11: int hash = k->hashcode(); 12: if (map->table == NULL){ 13: : 14: 2 25 15: } 16: unsigned index = (unsigned) 17: (hash & (map->table->length-1)); 18: if (index >= map->table->length){ 19: : 20: 2 25 21: } 22: Entry e = map->table[index]; 23: while(true){ 24: if (e == NULL) 25: return NULL; 26: if ((e->hash == hash) && 27: ((k == e->key) 28: (k->equals(e->key)))) 29: return e->value; 30: e = e->next; 31: : 32: 33: } 34: } 35: else{ 36: : 37: 3 2 38: } 39: } 11 map.get(tmp) Fig. 11 Code after inlining map.get(tmp). 4.2 null 10 (b) 8 map.get(tmp) 5 HashMap::get() 11 11 7 tmp 10 10 null 7 tmp null null null k 12 4: return (map.get(tmp)); 5: } 6: else{ 7: tmp = new Integer(i); 8: if(map!=null && map->klass==hashmap){ 9: int hash = tmp->hashcode(); 10: if (map->table == NULL){ 11: : 12: 2 25 13: } 14: unsigned index = (unsigned) 15: (hash & (map->table->length-1)); 16: if (index >= map->table->length){ 17: : 18: 2 25 19: } 20: Entry e = map->table[index]; 21: while(true){ 22: if (e == NULL) 23: return NULL; 24: if ((e->hash == hash) && 25: ((tmp == e->key) 26: (tmp->equals(e->key)))) 27: return e->value; 28: e = e->next; 29: : 30: 31: } 32: } 33: else{ 34: : 35: 3 2 36: } 37: } 12 Fig. 12 Code after copy propagation. 4.3 12 7 tmp 9 25 26 9 tmp->hashcode() tmp->value tmp->value i tmp 7 i Integer 26 equals() tmp->value 9 hash 13

Vol. 48 No. SIG 10(PRO 33) Java Box 173 4: return (map.get(tmp)); 5: } 6: else{ 7: tmp = new Integer(i); 8: if(map!=null && map->klass==hashmap){ 9: if (map->table == NULL){ 10: : 11: 2 25 12: } 13: unsigned index = (unsigned) 14: (i & (map->table->length-1)); 15: if (index >= map->table->length){ 16: : 17: 2 25 18: } 19: Entry e = map->table[index]; 20: while(true){ 21: if (e == NULL) 22: return NULL; 23: if ((e->hash == i) && 24: ((tmp == e->key) 25: ((e->key instanceof Integer) 26: && (i == e->key->value)))) 27: return e->value; 28: e = e->next; 29: : 30: 31: } 32: } 33: else{ 34: : 35: 3 2 36: } 37: } Fig. 13 13 Code after member variable reference elimination. 4.4 13 7 tmp tmp == e->key 24 10 16 29 34 3 24 4: return (map.get(tmp)); 5: } 6: else{ 7: if(map!=null && map->klass==hashmap){ 8: if (map->table == NULL){ 9: : 10: 2 25 11: } 12: unsigned index = (unsigned) 13: (i & (map->table->length-1)); 14: if (index >= map->table->length){ 15: : 16: 2 25 17: } 18: Entry e = map->table[index]; 19: while(true){ 20: if (e == NULL) 21: return NULL; 22: if ((e->hash == i) && 23: ((e->key instanceof Integer) 24: && (i == e->key->value))) 25: return e->value; 26: e = e->next; 27: : 28: 29: } 30: } 31: else{ 32: : 33: 3 2 34: } 35: } 14 Fig. 14 Code after instance allocation elimination. tmp tmp tmp tmp tmp tmp tmp tmp 7 14

174 June 2007 4.5 Box Box Box 14 2 3 Box Box Box 5. HotSpot 13) HotSpot Sun Microsystems JDK version 1.5.0 05 Cosminexus version 7.1 Hewlett-Packard ZX6000 CPU Itanium R 2 900 MHz 2 2GByte OS CentOS 4.3 2 1 get() 100 SPECjbb2005 SPECjbb2005 1.5 GByte SPECjbb2005 Auto-Boxing 3 9 17% SPECjbb2005 3.6% Auto-Boxing Box Java Auto-Boxing version 5.0 Box API valueof() Box Java SPECjbb2000 17) 202 jess SPECjvm98 16) 1 Integer Box 202 jess Box 3.5% Box Box Box Box 202 jess Auto-Boxing API Integer.valueOf() Box 202 jess Box 6. Box Box Box Box null SPECjbb2005 3.6% Itanium Intel Corporation

Vol. 48 No. SIG 10(PRO 33) Java Box 175 1) Aho, A.V., Sethi, R. and Ullman, J.D.: Compilers Principles, Techniques and Tools, Addison-Wesley, Reading, Mass. (1986). 2) Brooks, R.A., Gabriel, R.P. and Steele Jr., G.L.: An Optimizing Compiler for Lexically Scoped LISP, Proc.1982 SIGPLAN Symposium on Compiler Construction, pp.261 275 (1982). 3) Calder, B. and Grunwald, D.: Reducing Indirect Function Call Overhead in C++ Programs, Proc. 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp.397 408 (1994). 4) Cierniak, M., Lueh, G.-Y. and Stichnoth, J.M.: Practicing JUDO: Java Under Dynamic Optimizations, Proc. ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, pp.13 26 (2000). 5) Gosling, J., Joy, B., Steele Jr., G.L. and Bracha, G.: The Java Language Specification, 3rd edition, Addison-Wesley, Reading, Mass. (2005). 6) Hölzle, U., Chambers, C. and Ungar, D.: Debugging Optimized Code with Dynamic Deoptimization, Proc. ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, pp.32 43 (1992). 7) Ishizaki, K., Takeuchi, M., Kawachiya, K., Suganuma, T., Gohda, O., Inagaki, T., Koseki, A., Ogata, K., Kawahito, M., Yasue, T., Ogasawara, T., Onodera, T., Komatsu, H. and Nakatani, T.: Effectiveness of Cross-Platform Optimizations for a Java Just-In-Time Compiler, Proc. 18th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Language and Applications, pp.187 204 (2003). 8) Kotzmann, T. and Mössenböck, H.: Escape Analysis in the Context of Dynamic Compilation and Deoptimization, Proc. 1st ACM/USENIX International Conference on Virtual Execution Environments, pp.111 120 (2005). 9) Leroy, X.: Unboxed Objects and Polymorphic Typing, Proc. 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp.177 188 (1992). 10) Morel, E. and Renvoise, C.: Global Optimization by Supression of Partial Redundancies, Comm. ACM, Vol.22, No.2, pp.96 103 (1979). 11) Morrison, R., Dearle, A., Connor, R.C.H. and Brown, A.L.: An Ad Hoc Approach to the Implementation of Polymorphism, ACM Trans. Progr. Lang. Syst., Vol.13, No.3, pp.342 371 (1991). 12) Ogasawara, T., Komatsu, H. and Nakatani, T.: EDO: Exception-Directed Optimization in Java, ACM Trans. Prog. Lang. Syst., Vol.28, No.1, pp.70 105 (2006). 13) Paleczny, M., Vick, C. and Click, C.: The Java HotSpot Server Compiler, Proc. Java Virtual Machine Research and Technology symposium, pp.1 12 (2001). 14) Peterson, J.: Untagged Data in Tagged Environments: Choosing Optimal Representations at Compile Time, Proc. 4th International Conference on Functional Programming Language and Computer Architecture, pp.89 99 (1989). 15) Peyton Jones, S.L. and Launchbury, J.: Unboxed Values as First Class Citizens in a Nonstrict Functional Language, Proc. 5th ACM Conference on Functional Programming Language and Computer Architecture, pp.636 666 (1991). 16) Standard Performance Evaluation Corporation: SPEC JVM98 Benchmarks (1998). http://www.spec.org/jvm98/ 17) Standard Performance Evaluation Corporation: SPEC JBB2000 (2000). http://www.spec.org/jbb2000/ 18) Standard Performance Evaluation Corporation: SPEC jbb2005 (2005). http://www.spec.org/jbb2005/ 19) Steele Jr., G.L.: Fast Arithmetic in MacLISP, Proc. 1977 MACSYMA User s Conference, pp.215 224 (1977). 20) Thiemann, P.J.: Unboxed Values and Polymorphic Typing Revisited, Proc. 7th International Conference on Functional Programming Language and Computer Architecture, pp.24 35 (1995). 21) (2004). ( 18 11 15 ) ( 19 3 5 ) 1972 1997