Sun Logo


CLDC HotSpottrademark Implementation Porting Guide

CLDC HotSpot Implementation, Version 2.0

Javatrademark ME Platform

05-2007



Contents

Tables

Preface

1. Introduction

1.1 CLDC HotSpot Implementation Virtual Machine

1.2 Information About This Release

2. Porting Overview

2.1 Difference Between an OS Port and CPU Port

2.2 Prerequisites and Helpful Information

2.2.1 includeDB Configuration Database

3. Starting an Operating System Port

3.1 Overview

3.1.1 Location of the Operating System Porting Interface

3.1.2 Location of Operating System-Specific Code

3.1.2.1 Creating New Copies of the Operating System-Specific Files

3.1.2.2 Location of the Compiler-Specific Porting Interface

3.2 Functionality That Needs to be Ported

3.3 Porting API Details

3.3.0.1 Implement Initialization

3.3.0.2 Real-Time-Tick Management

3.3.0.3 Implement Handle to Terminal

3.3.1 Porting the File System Interface

3.3.1.1 File I/O Interfaces

3.3.2 Memory Management Interfaces to be Implemented

3.3.3 Miscellaneous Interfaces to be Implemented

3.4 Interfaces in /src/vm/os/os_family

4. Porting the Threading System

4.1 Coding Styles for Long-Running Native Methods

4.2 Non-Blocking Scheduling Coding Style

4.3 Hybrid Threading Coding Style

5. Starting a CPU Port

6. Tuning a Port

6.1 Tuning Parameters

6.1.1 Notes About Parameters

6.2 Turning Thumb Mode On or Off

6.3 Choose which Methods to Compile AOT

6.4 Tuning the Compiler

6.5 Tuning the Memory Subsystem

7. Using Java Profilers

7.1 Concepts

7.1.1 Sampling Profiler

7.1.2 Exact Call Graph Profiler

7.2 Viewing Exact Profiler Results

7.3 Analyzing Exact Profiler Logs

7.4 Profiler Porting Requirements

8. Using the Memory Profiler

8.1 Feature List

8.2 Design

8.3 Building with Memory Profiler Support

8.4 Starting the Server

8.5 Using the Client Tool

9. Dynamic Optional Packages

9.1 Methods to Implement

10. Implementing Java ME Profiles

10.1 Overview

10.1.1 KNI Interface

10.1.2 Main Program Loop

10.1.3 Event Model

10.1.4 Combining Different Models

10.2 Build process

10.2.1 Building the Virtual Machine Binary Bundle

10.2.2 Linking CLDC HotSpot Implementation

10.3 API for Interacting with the Virtual Machine

10.3.1 Internal Header Files

10.4 Invoking the Virtual Machine

10.4.1 Initializing the Virtual Machine

10.4.2 Configuring the Virtual Machine

10.4.3 Command-Line Argument Parsing

10.4.4 Starting and Stopping the Virtual Machine

10.5 Slave Mode

10.5.1 Slave Mode Application Structure

10.5.2 APIs Used in Slave Mode

10.5.3 Long-Running Native Methods in Slave Mode

10.6 Miscellaneous Virtual Machine APIs

10.6.1 Functions Implemented Inside the Virtual Machine

10.6.2 Functions Implemented by Your Software

A. Error Codes

B. Floating Point on the ARM Platform

B.1 Low-Level Floating Point Routines

B.2 Meaning of ENABLE_SOFT_FLOAT

B.2.1 Choosing Value for ENABLE_SOFT_FLOAT

B.3 Integrating With Platform Software

C. In-Place Execution Porting Notes

C.1 Disabled Class Loading

D. Preventing MIDlets From Accessing Internal Classes

D.0.1 HiddenPackage and Class.forName

D.1 Storing In-Place Execution Binary Images

E. Binary Distribution Model

F. KDWP Extension for Memory Profiler Protocol

F.1 Memory Profiler Command Set (18)

Get Global Pointers Command (1)

Get All Objects Command (2)

Get All Classes Command (3)

Get All Roots Command (4)

Suspend (5) and Resume (6) Commands

G. Data Interface for the Memory Profiler

H. XScale Porting Notes

H.1 Build Procedure

H.1.1 Target Platform

H.1.2 Build Environment

H.1.2.1 Required Tools

H.1.3 Preprocessor Symbols

H.2 PXA 27x Optimizations

H.2.1 WMMX Instruction Enabling

H.2.2 Timer Tick Check Optimization

H.2.3 Array Copying by WMMX Instructions

H.2.4 Array Length Reload Elimination

H.2.5 Loop Optimization

H.2.6 Null Pointer Check Elimination for Linux

Index