read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents...

202
Porting Guide for the Connected Device Configuration, Version 1.0 and the Foundation Profile, Version 1.0 February 26, 2001 1 of 4

Transcript of read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents...

Page 1: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide

for the Connected Device Configuration, Version 1.0

and the Foundation Profile, Version 1.0

February 26, 2001

1 of 4

Page 2: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

This guide describes how to port the Connected Device Configuration Release,Version 1.0 (CDC) and the Foundation Profile Release, Version 1.0. Bothreleases have been implemented on Linux and VxWorks. The CDC includes theCVM, a virtual machine for use on embedded devices. The CDC and theFoundation Profile are components of the JavaTM 2 Platform, Micro Edition(J2METM).

CONTENTS

Copyright

Getting Started Chapters:

Overview Building the Implementations Running the CVM

Porting Chapters:

Porting the Implementations Porting Notes for PersonalJava Technology Users Host Programming Interface (HPI) Reference C Stack Check

Debugging Chapters:

C Debugging with GDB Java Debugging with JDB

Memory System Chapters:

Creating a Garbage Collector How to be GC-safe in CVM Direct Memory Interface Reference Indirect Memory Interface Reference

Tools: JavaMemberDepend (class member dependency checker) Reference JavaCodeCompact for CVM (preloader) Reference

Appendixes: Appendix A Appendix B

2 of 4

Page 3: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Related Documents

API Specifications for these releases:

Download the javadocs for these releases from the Sun Microsystemswebsite at http://java.sun.com/products/ after Sun publicly announcesthese releases and makes them available via the Sun Community SourceLicense mechanism at http://www.sun.com/software/communitysource/. CDC release - http://java.sun.com/products/cdc/ CVM - http://java.sun.com/products/cdc/cvm/ Foundation Profile release - http://java.sun.com/products/foundation/

After you unzip the downloaded file, use your Web browser to view thestart page in install/javadoc/index.html under the directory inwhich you unzipped the downloaded file.

Official CDC and Foundation Profile Specifications:

The official CDC and Foundation Profile specifications are located at theJava Community Process (JCP) website for Java Specification Requests(JSRs) #36 and #46. These represent the only official versions of the CDCand the Foundation Profile specifications. Specifications generated fromthe source files of the reference implementations are not valid. Official CDC specification, JSR #36 -http://java.sun.com/aboutJava/communityprocess/jsr/jsr_036_j2mecd.htmlOfficial Foundation Profile specification, JSR #46 -http://java.sun.com/aboutJava/communityprocess/jsr/jsr_046_j2mefnd.html

The following documents may also be of interest:

Java 2 Platform, Micro Edition (J2ME) athttp://java.sun.com/products/j2me CLDC and the K Virtual Machine (KVM) athttp://java.sun.com/products/cldc/ Java Community ProcessSM athttp://java.sun.com/aboutJava/communityprocess/ The Java Language Specification athttp://java.sun.com/docs/books/jls/index.html The Java Virtual Machine Specification, Second Edition athttp://java.sun.com/docs/books/vmspec/index.html Portable Operating Systems Interface (POSIX) catalog athttp://standards.ieee.org/catalog/posix.html The Standard C Library at

3 of 4

Page 4: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

http://www.prenhall.com/books/ptr_0131315099.html

Please send comments to: [email protected].

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

4 of 4

Page 5: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Copyright Notice

Sun Microsystems, Inc. Copyright © 2000, 2001 Sun Microsystems, Inc.,901 San Antonio Road,Palo Alto, California 94303, U.S.A.All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the productthat is described in this document. In particular, and without limitation, these intellectual property rightsmay include one or more of the U.S. patents listed at http://www.sun.com/patents and one or moreadditional patents or pending patent applications in the U.S. and in other countries. This document and the product to which it pertains are distributed under licenses restricting their use,copying, distribution, and decompilation. No part of the product or of this document may be reproducedin any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, Java, PersonalJava, Embedded Java, J2SE, J2ME, the 100% PureJava logo and the Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems,Inc. in the U.S. and other countries.Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms andConditions. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS,REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OFMERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE ORNON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCHDISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright © 2000, 2001 Sun Microsystems, Inc.,901 San Antonio Road,Palo Alto, California 94303, Etats-Unis.Tous droits réservés. Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans leproduit qui est décrit dans ce document. En particulier, et sans la limitation, ces droits de propriétéintellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents etun ou les brevets plus supplémentaires ou les applications de brevet en attente dans les Etats - Unis etdans les autres pays.

Page 6: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignentl'utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document nepeut être reproduite sous aucune forme, parquelque moyen que ce soit, sans l'autorisation préalable etécrite de Sun et de ses bailleurs de licence, s'il y ena. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, estprotégé par un copyright et licencié par des fournisseurs de Sun. Sun, Sun Microsystems, le logo Sun, Java, PersonalJava, Embedded Java, J2SE, J2ME, le logo 100%Pure Java et le logo Java Coffee Cup sont des marques de fabrique ou des marques déposées de SunMicrosystems, Inc. aux Etats-Unis et dans d'autres pays. LA DOCUMENTATION EST FOURNIE "EN L'ÉTAT" ET TOUTES AUTRES CONDITIONS,DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENTEXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRISNOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, AL'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFAÇON.

Page 7: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

OverviewThis guide describes how to port the Connected Device Configuration Release, Version 1.0 (CDC) andthe Foundation Profile Release, Version 1.0. Both releases have been implemented on Linux andVxWorks. The CDC includes the CVM, a virtual machine for use on embedded devices. The CDC andthe Foundation Profile are components of the JavaTM 2 Platform, Micro Edition (J2METM).

Contents

Document Roadmap J2ME for Embedded Devices

CLDC CDC Overview

CDC Standardization Memory Footprint Connectivity CDC Class Library Deprecated API Removal

CVM Overview Memory System Portability Fast Synchronization ROMable Classes Native Thread Support Small Class Footprint Java 2 Platform, v1.3 VM Support Stack Usage Startup and Shutdown Interfaces

Foundation Profile Overview Overview of Foundation Profile Class Library Relationship to the J2SE

Document RoadmapThis guide covers six major sections corresponding to the different phases of the portingprocess:

Getting Started - how to install and run the implementations Porting - how to port the implementations

1 of 8

CDC and Foundation Profile Overview

Page 8: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Debugging - how to debug both C and Java code Memory System - how to create your own garbage collector Tools - two tools required for porting are included Appendixes - two lists of implicit references related to C stack check.

J2ME for Embedded DevicesJavaTM technology has become the platform of choice for getting work done in the network.With the advent of the PersonalJavaTM application environment and the EmbeddedJavaTM

application environment, the benefits of Java technology use were extended into cell phones,set-top boxes for television, and embedded devices.

Sun Microsystem's Java 2 Platform, Micro Edition (J2ME) technology is designed to addressthe needs of consumer electronic and embedded devices, such as two-way pagers and PDAs.These devices are special-purpose, limited-function devices, not general-purpose computingmachines, and are characterized by 32-bit processors and network connectivity.

Devices that currently use the PersonalJava application environment can easily be ported toCDC and the Foundation Profile. The chapter Porting Notes for PersonalJava TechnologyUsers describes the porting issues.

The J2ME architecture is based on two fundamental elements: a configuration and a profile.Together, a configuration and a profile deliver a specification for consumer electronics andembedded device manufactures to implement on their products. A "configuration" is a virtual machine and a minimal set of basic class libraries and APIs. Aconfiguration specifies a generalized runtime environment for consumer electronic andembedded devices. A "profile" is an industry-defined specification of the Java APIs used by manufacturers anddevelopers to address a specific type of device.

J2ME consists of two configurations: the Connected, Limited Device Configuration (CLDC)and the Connected Device Configuration (CDC). CLDC was developed for devices with asmall amount of memory using a modular approach consisting of a configuration and aprofile. CDC was developed for devices with a large amount of memory, but using themodular configuration and profile architecture. Currently, J2ME has one profile, theFoundation Profile. In the future, other profiles may be added to provide for a user interfaceand increased Internet connectivity and web fidelity.

CLDC

The CLDC is used in small, resource-constrained devices, each with a memory budget in therange of 160 KB to 512 KB. CLDC provides the minimal functionality needed to minimizethe memory footprint for these memory-constrained devices. These devices typically contain16- or 32-bit processors and a minimum total memory footprint of 128 KB.

The CLDC is composed of the K Virtual Machine (KVM) and basic class libraries that canbe used on a variety of devices. The KVM is a highly portable Java virtual machine designed

2 of 8

CDC and Foundation Profile Overview

Page 9: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

from the ground up for small-memory, limited-resource, network-connected devices.

For more information on the CLDC, see http://java.sun.com/products/cldc/.

CDC OverviewThe CDC contains the full Java 2 platform virtual machine, the CVM, and the minimal classlibraries and APIs to get the system up and running. For an application to do useful work, aprofile is also required. The Foundation Profile, which includes all the remaining classlibraries and APIs that are designed for consumer devices, must be used with the CDC. Inaddition, another profile would be required if an application needs a GUI.

Devices that currently use the PersonalJava application environment can easily be ported toCDC. The chapter Porting Notes for PersonalJava Technology Users addresses the portingissues.

Devices that currently use CLDC (and therefore have a profile) can use that profile withCDC without modification. The CDC is a superset of CLDC and, therefore, aCLDC-compliant profile is upwardly compatible with CDC.

The following figure shows the CDC architecture.

CDC Standardization

The CDC is a Java Community Process effort (JSR-36) that has standardized a portable,Java technology building block for consumer electronic and embedded devices. The CDCprovides for a virtual machine and set of basic libraries appropriate for use with anindustry-defined profile, such as the Foundation Profile. The CDC standardization effort wasthe result of a collaboration of companies representing the consumer electronic industry.

Memory Footprint

3 of 8

CDC and Foundation Profile Overview

Page 10: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Target devices for CDC typically have two megabytes or more of total memory, includingboth RAM and flash or ROM, available for the Java platform. These are devices typicallyrequiring the full feature functionality of the Java 2 platform virtual machine.

Connectivity

Target devices for CDC typically contain connectivity to some kind of network, often awireless, intermittent connection, and with limited (often 9600 bps or less) bandwidth. Someof the devices that might be supported by CDC include; residential gateways, emerging nextgeneration smartphones and communicators, two-way pagers, personal digital assistants(PDAs), organizers, home appliances, point-of-sale terminals, and automobile navigationsystems.

CDC Class Library

The CDC class library is the minimal set of APIs needed to support a Java 2 platform VM. Ingeneral, the CDC contains the minimal Java packages from JavaTM 2 Platform, StandardEdition (J2SETM) to allow a Java VM to be built and to run.

The basic Java packages for the CDC are as follows: java.lang - Java VM system classes. java.util - underlying Java utilities. java.net - UDP Datagram and File I/O. java.io - Java File I/O java.text - bare minimal support for I18n (ex. error messages). java.security - minimal fine grain security and encryption for object serialization.

Deprecated API Removal

The CDC and Foundation Profile make corrections to the J2SE-based API library byremoving all non-critical deprecated APIs. For the full listing of deprecated APIs see the"Deprecate" API section of the javadoc specification. The reasons why the J2SE-baseddeprecated APIs were removed include the following:

For a clean-start with the correct set of APIs. Because a deprecated method from the J2SE bydefinition means: "This API is going away, don't use it anymore! Use its equivalent instead!", acorrect set of APIs should start out with not having any deprecated APIs in them. Deprecated APIs do not have to be supported and maintained anymore. No maintenance resourcesare needed for these removed, deprecated APIs. No bug fix or syncing with the J2SE is needed. Each deprecated API has an equivalent new API and in all cases the equivalent API is the cleanerand more correct one to use. When there was a problem with the equivalent API (such as java.util.Properties.store()not being in the PersonalJava application environment, version 3.0), that specific deprecated APIwas put back in because an equivalent was not readily available. CDC does not claim binary backward compatibility. We are starting fresh as a source code releaseand, as such, we require developers on CDC to update their code not to use APIs that have been

4 of 8

CDC and Foundation Profile Overview

Page 11: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

marked as deprecated, but instead use the new equivalents. This is good especially for theI18n-related deprecated APIs and all other deprecated APIs that the J2SE has decided are "notcorrect" anymore.

CVM OverviewSun Microsystem's new virtual machine, CVM, is designed for consumer and embeddeddevices. The CVM is compact, consumer-device oriented, and works in a connectedenvironment. It is a small footprint Java virtual machine incorporating the latest in VMtechnology, while remaining suitable for the embedded world. It is very portable,RTOS-aware, deterministic, and space-efficient. It allows devices to map Java threadsdirectly to native threads, and can run Java classes out of ROM. It combines these"embedded-friendly" features with advanced JVM features such as a precise memory system,a generational garbage collector, and fast Java synchronization. Finally, CVM supports allJava 2 platform, version 1.3, VM features and libraries for security, weak references, JNI,RMI and JVMDI.

Memory System

CVM incorporates an advanced memory system featuring the following:

Exactness Small average garbage collection pause times Full separation of VM from the memory system Pluggable garbage collectors Generational garbage collection

Portability

CVM is implemented in C, with very little assembler. In addition, CVM contains a rich,well-documented porting layer that is RTOS-aware, supports multiple porting options forareas that are difficult to implement by a porter, and in general tries to leave only the bareminimum to the porter for fast re-targeting.

Fast Synchronization

CVM has extremely fast common-case synchronization, making use of the observation thatthe vast majority of locking operations in a Java language program are uncontended.Therefore, CVM does most synchronization operations with just a few machine instructions,and without consuming additional lock resources from the underlying operating system.

ROMable Classes

CVM can run with "pre-loaded", mostly read-only classes, alongside dynamically loadedclasses. This provides better start-up time, less fragmentation, more data sharing, and theability to execute bytecodes out of ROM.

5 of 8

CDC and Foundation Profile Overview

Page 12: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Native Thread Support

CVM supports native threads and arbitrary thread pre-emption at machine instructionboundaries. CVM has proper internal synchronization and handles exact garbage collection(GC) and Java synchronization correctly in the presence of pre-emptive native threading.

Small Class Footprint

The memory footprint required by CVM for classes is quite small, both for dynamicallyloaded and ROMized classes. The reduction in memory footprint for classes is around 40%compared to JDK classic and around 17% compared to the PersonalJava applicationenvironment.

Java 2 Platform, v1.3 VM Support

CVM supports the full Java 2 platform, version 1.3 VM specification and libraries, includingsupport for weak references, reflection, serialization, JNI, and RMI. In addition, fine-grainedJava 2 platform security APIs, and the Java Platform Debugger Architecture are supported.

Stack Usage

CVM features deterministic and reduced-footprint native stack usage, achieved by carefulstatic analysis of the VM code. The static analysis has resulted in the placement of nativestack checks at possible recursion points in the VM code to detect and prevent native stackoverflows.

Startup and Shutdown

CVM can cleanly shutdown and re-start in a single address space OS, such as an RTOS,without help from a process model, freeing up all allocated memory and stopping all threadswithout any resource leaks.

Interfaces

The CVM provides extensible and well-defined interfaces. The interfaces between thecomponents, like garbage collection, type system, locking and interpreter are clearly defined,well-separated, and well-documented. It is much easier to add new features to CVMcompared to the previous Personal Java Virtual Machine.

Foundation Profile OverviewThe Foundation Profile is a set of Java APIs that, together with the CDC, provides a completeJ2ME application runtime environment targeted at consumer electronics and embedded devices.The CVM in the CDC is the engine for the Foundation Profile libraries. Typical implementations

6 of 8

CDC and Foundation Profile Overview

Page 13: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

will use a subset of the J2SE, depending on any additional profiles supported.

The Foundation Profile specification has been developed through the Java Community ProcessSM

(JCP) program by an expert group composed of companies representing the consumer electronicsindustry and has been approved by them. For more information about the Java Community Process,see http://java.sun.com/aboutJava/communityprocess/.

Overview of Foundation Profile Class Library

In general, the Foundation Profile contains the complete basic Java packages from J2SE,except that the Graphical User Interface (GUI) dependencies on java.awt are removed.

The basic Java packages from CDC are modified in the Foundation Profile in the followingways: java.lang - rounds out full java.lang.* J2SE package support for the Java language(Compiler, UnknownError, etc.). java.util - adds full zip support and other J2SE utilities (Timer, etc.). java.net - adds TCP/IP Socket and HTTP connections. java.io - rounds out full java.io.* J2SE package support for Java input/output (Readersand Writers). java.text - rounds out full java.text.* J2SE package support for I18n (Annotation,Collator, Iterator, etc.). java.security - adds Code Signing and Certificates.

Relationship to the J2SE

The Foundation Profile set of libraries is based on the J2SE v1.3. The following classes inthe Foundation Profile differ from the same-name classes in the J2SE, as described below.

java.lang.ClassLoader The following line was removed: import java.io.StringWriter;

There is no change in behavior, as ClassLoader does not use the imported class. java.lang.SecurityManager The java.awt dependencies have been removed, as the Foundation Profile does not include thejava.awt package. Hard-coded references to java.awt were changed to use reflection todetermine if the java.awt package is present. (It could be present in another profile.)

If java.awt is present, there is no difference in SecurityManager behavior compared to the J2SE.

If java.awt is not present:

checkTopLevelWindow(Object window) returns false. checkSystemClipboardAccess() throws SecurityException("AWT notavailable").

7 of 8

CDC and Foundation Profile Overview

Page 14: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

checkAwtEventQueueAccess() throws SecurityException("AWT notavailable").

java.text.resources.LocaleElements The java.awt dependency has been removed, as the Foundation Profile does not include thejava.awt package. Specifically, the following line is commented out: import java.awt.ComponentOrientation;

The following line is also commented out: { "Orientation", ComponentOrientation.LEFT_TO_RIGHT },

If java.awt is present through an additional profile, LocaleElements will not have access to theComponentOrientation resource. java.text.resources.LocaleElements_en_US The java.awt dependency has been removed, as the Foundation Profile does not include thejava.awt package. Specifically, the following line is commented out: import java.awt.ComponentOrientation;

There is no change in behavior, as LocaleElements_en_US does not use the imported class. sun.net.www.ParseUtil The following line was removed: import java.util.BitSet;

There is no change in behavior, as ParseUtil does not use the imported class.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

8 of 8

CDC and Foundation Profile Overview

Page 15: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Building the ImplementationsThis chapter describes system requirements, installation instructions and build information for both theLinux and VxWorks implementations of the CVM.

Contents

Host and Target System Requirements System Requirements for the Linux Implementation System Requirements for the VxWorks Implementation

Linux Build Information Linux Build Procedures

Tornado/VxWorks Build Information Tornado/VxWorks Build Procedures

Build Options Environment Setup Issues

Multicast Network Configuration on Linux Limit on Datagram Sizes on VxWorks Locale Operations

Compiler Warnings Compiling Java Applications

Host and Target System RequirementsThe implementations of the CVM are developed, compiled, and linked on a build system,also called a host development system. The resulting output is then moved onto a targetsystem for execution.

The current release provides implementations for two target environments:

Linux operating system, operating on Intel Pentium hardware. VxWorks real-time operating system also on Pentium hardware

The porting of these implementations can take place without any of the tools or systemsmentioned below. However, to build the source without a porting effort first, you will needto fulfill the following system requirements.

System Requirements for the Linux Implementation

1 of 9

Building the Implementations

Page 16: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The Linux implementation can be built and executed on the same system. Its requirementsare:

Red Hat Linux 6.2 or later x86-compatible hardware (For details, see the hardware support page of the Red Hatwebsite at http://www.redhat.com/support/hardware.) Java 2 SDK, Standard Edition, v1.3 or later The OS must be configured for multicast (required for execution) 100MB available disk space 16MB RAM minimum

System Requirements for the VxWorks Implementation

The host development environment for the VxWorks implementation has been SolarisTM 7Operating Environment on SPARCTM platform using the Tornado development environmentfrom Wind River Systems. The target platform is the PC architecture using Pentiumprocessors. To make sure that you have the necessary tools to build the source for theVxWorks implementations we have worked with Wind River Systems to provide thenecessary bundle of command line tools. We have also specified a PC target platform foryour convenience.

Acquiring the necessary host and target environments will allow you to begin working withthe VxWorks implementations immediately on receipt. If you have questions regarding thenecessary items, please contact your licensee support representative. For information onTornado and VxWorks, see the Wind River Systems website at http://www.wrs.com/. Forinformation about Pentium hardware, see the Intel website at http://www.intel.com/.

Host Development Environment

Solaris 7 Operating Environment or later SPARC hardware Tornado 2.0 development system Java 2 SDK, Standard Edition, v1.3 or later 500MB available disk space 128MB RAM (256MB recommended)

Target Environment

VxWorks 5.4 operating system PC with Pentium Processor 8MB RAM minimum (32MB RAM recommended) 3COM 3C905CTX pci ethernet 10/100 10 base T 1.44MB floppy Must be on the same network as the host development system

The host and target will need to be on the same network, and it is easiest if the target has astatic IP address. We have purchased our development targets from a local vendor with thefollowing specifications. You may wish to contact this vendor directly, or choose anothervendor who can deliver an equivalent system.

2 of 9

Building the Implementations

Page 17: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Dreamtech Computers and Local Area Networking 40950 Encyclopedia Circle Fremont, CA 94538 (510)353-1800 http://www.dreamtech.com Dream PII/366Ci designer basic computer This item consists of the following:

D359T3 1.44 megabyte 3.5" floppy disk ATX W2 250W ps & mid tower computer case PS2 enhanced 104 key win '98 keyboard CPU heat sink Pentium II Celeron fan 366MHz PII Celeron w/AGP VGA & audio 3COM 3C905CTX pci ethernet 10/100 10 base T PC100 4MGx64 168 pin 8ns sdram (32MB ram)

Linux Build InformationThe instructions in the Linux Build Procedures assume that you have already downloadedand unzipped the CDC and Foundation Profile distribution. The directories in theinstructions are relative to the directory in which you unzipped the CDC and FoundationProfile distribution. See the procedures below to build the Linux implementation of CDCwith or without the Foundation Profile. The Foundation Profile cannot be built withoutCDC.

The Red Hat Linux system includes GNU development tools to use in building the Linuximplementation. The C compiler should be version egcs-2.91.66 or later, and the make utilityshould be GNU make version 3.78 or later.

Linux Build Procedures

To build CDC without the Foundation Profile, complete the following steps:

1. On the host system, change directories to build/linux, and enter the followingcommand:

make CVM_DEBUG=true

This produces the file build/linux/bin/cvm, which is an executable image, as wellas build/linux/lib/cdc.jar, which is a JAR archive to be used for the CVM'sboot classpath. The default boot classpath is ../lib/cdc.jar. The build alsoproduces build/linux/testclasses.jar, a collection of simple tests.

2. Change directory into the bin directory using:

cd bin

3 of 9

Building the Implementations

Page 18: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3. Test for rudimentary operation of the system using:

./cvm -Djava.class.path=../testclasses.zip HelloWorld

This step should print Hello world. to your screen, indicating a successful build.

To build the Foundation Profile, which will include CDC as well, modify the first step aboveto use the J2ME_CLASSLIB build option:

make CVM_DEBUG=true J2ME_CLASSLIB=foundation

This will produce build/linux/bin/cvm and build/linux/lib/foundation.jar, and setthe default boot classpath accordingly.

Tornado/VxWorks Build InformationThe instructions in Tornado/VxWorks Build Procedures assume that you have alreadydownloaded and unzipped the CDC and Foundation Profile distribution. The directories inthe instructions are relative to the directory in which you unzipped the CDC and FoundationProfile distribution. See the procedures below to build the Tornado/VxWorksimplementation of CDC with or without the Foundation Profile. The Foundation Profilecannot be built without CDC.

The Tornado development system includes GNU development tools to use in building theimplementation. If you already have GNU make installed on your system, it must be GNUversion 3.74 or later to build the implementation. If you do not have the correct version ofGNU, you can use the copy under your Tornado directory, intornado2/host/$(WIND_HOST)/bin/make. Type make -version to verify that GNU makeis in your command path.

If you do not have Tornado installed on your host system, you can download theTornado/VxWorks evaluation bundle for the CDC at the following URLhttp://www.wrs.com/j2me-cdc/.

Before building the implementation, complete the following steps:

1. On the host system, edit build/vxworks/config_vxworks.mk to provide thefollowing:

Target IP address Host IP address Host name Base directory for Tornado software (wind_base)

You may need to change additional values.

2. Create or edit the .rhosts file in your home directory, and add the target systemname to the file.

4 of 9

Building the Implementations

Page 19: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Tornado/VxWorks Build Procedures

To build CDC without the Foundation Profile, complete the following steps:

1. On the host system, change directories to build/vxworks, and enter the followingcommand:

make CVM_DEBUG=true

This may produce some compiler warnings about incompatibilities of argument listsfor some system library functions. These may be ignored.

The products of this step are the files build/vxworks/bin/cvm.o, which is arelocatable file to be bound into the vxWorks kernel, andbuild/vxworks/lib/cdc.jar, which is a JAR archive to be used for the CVM's bootclasspath. The default boot classpath is ../lib/cdc.jar. The build also producesbuild/vxworks/testclasses.jar, a collection of simple tests.

2. In build/vxworks, enter the following command:

make CVM_DEBUG=true download_image

Note: Steps 3 through 5 assume the presence of a floppy drive on your Solaris system.If your system does not have a floppy drive, you need to review the steps involved inthe make targets "boot_disk" and "boot_rom" in the filebuild/vxworks/rules_vxworks.mk, and adapt them to your host system. Once youhave created the boot disk, proceed with step 6.

3. Insert a diskette into the floppy drive of your host system. Format the diskette usingfdformat. The diskette is automatically ejected when formatting is done. Reinsert thediskette.

4. In build/vxworks, enter the following command:

make boot_disk

The diskette is automatically ejected after the command is carried out. Reinsert thediskette.

5. In build/vxworks, enter the following command:

make boot_rom

6. Insert the diskette into a floppy drive on the target system, and boot the target system.

Note: For convenience, you may want to edit your home/.wind/startup file (wherehome is your home directory) on the host system to add the commands in steps 7 and8.

7. On the target console, enter the following command:

5 of 9

Building the Implementations

Page 20: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

cd "top_dir/build/vxworks/bin"

where top_dir is the network directory in which you unzipped the CDC distribution.

8. On the target console, enter the following command:

runJava "-Djava.class.path=top_dir/build/vxworks/testclasses.zip

HelloWorld"

where top_dir is the network directory in which you unzipped the CDC distribution.This step should print Hello world. to your screen, indicating a successful build.

To build the Foundation Profile, which will include CDC as well, modify the first step aboveto use the J2ME_CLASSLIB build option:

make CVM_DEBUG=true J2ME_CLASSLIB=foundation download_image

This will produce build/vxworks/bin/cvm.o and build/vxworks/lib/foundation.jar,and set the default boot classpath accordingly.

Build OptionsThe following tables describe the CVM configuration options that developers may want touse with the make utility. Use of any other CVM configuration options is not supported. Thedefault values are set in build/share/defs.mk.

Option Default Description

CPU PENTIUMThe target CPU. This option is specific toVxWorks targets.

CVM_DEBUG falseIf true, builds the debug version of the CVM. Iffalse, builds the non-debug CVM.

CVM_DEBUG_ASSERTS $(CVM_DEBUG) If true, then enable asserts.

CVM_DEBUG_CLASSINFO $(CVM_DEBUG)

If true, builds the CVM with the ability tointerpret class debugging information in theclass files. Also causes preloaded classes toinclude debugging information if they werecompiled with it. Note that the build must alsohave CVM_JAVAC_DEBUG set to true, for thisoption to have any effect.

CVM_DEBUG_DUMPSTACK $(CVM_DEBUG)

If true, then include support for theCVMdumpStack and CVMdumpFrame functions.The CVMdumpStack function is useful fordumping a stack if CVM has crashed.

6 of 9

Building the Implementations

Page 21: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVM_DEBUG_STACKTRACES true

If true, then include code for doingThrowable.printStackTrace andThrowable.fillInStackTrace. If false, thenthe printStackTrace function prints only a"not supported" message. This function can beused in both debug and non-debug builds. Toreduce the footprint of non-debug builds, setthis option to false.

CVM_GCCHOICE generationalSets the garbage collector type to use. Validvalues include: generational, marksweep,semispace.

CVM_JAVAC_DEBUG $(CVM_DEBUG)

If true, runs javac with the -g option tocompile classes with debugging informationsuch as line numbers. If false, runs javac withthe -g:none option

CVM_JVMDI falseIf true, builds the CVM with JVMDI support.If false, builds the CVM without JVMDIsupport.

CVM_NO_LOSSY_OPCODES $(CVM_JVMDI)

If true, field-related opcodes whose argumentswould ordinarily be quickened into offsetsinstead have their arguments quickened intoconstant pool references, to ensure that thefieldblock for the field is available. This isrequired to allow the debugger to set fieldwatchpoints.

CVM_OPTIMIZED !CVM_DEBUG If true, turns on C compiler optimizations.

CVM_PRELOAD_LIB false If true, preloads the CDC class library.

CVM_SYMBOLS trueIf true, includes debugging and symbolinformation for C (the -g option), even if thebuild is optimized.

CVM_TERSEOUTPUT trueIf true, avoids printing detailed messages thatshow each build step. If false, prints messagesthat show each build step.

J2ME_CLASSLIB cdcControls the class library produced by the build.Choices are cdc and foundation.

Environment Setup Issues

Multicast Network Configuration on Linux

7 of 9

Building the Implementations

Page 22: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

To run the system you have built, the target system must be configured to support the multicastnetwork configuration. For a Linux target, running CDC and the Foundation Profile can be doneeach time Linux boots or commands can be added to the /etc/sysconfig/init file. Thecommands to be executed, which requires root privilege, are as follows:

/sbin/ifconfig eth0 allmulti/sbin/ifconfig lo allmulti/sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0/sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev lo

Limit on Datagram Sizes on VxWorks

On VxWorks, datagrams are limited in size by the OS implementation. The datagram sizes aredefined by the following VxWorks configuration constants:

Configuration Constant Default Value and Description

UDP Send Buffer Size Default Value: 9216(UDP_SND_SIZE_DFLT) Sets the default send buffer size of a UDP connection.

UDP Receive Buffer Size Default Value: 41600(UDP_RCV_SIZE_DFLT) Sets the default receive buffer size of a UDP connection.

The UDP_SND_SIZE_DFLT and UDP_RCV_SIZE_DFLT constants define the respective send andreceive buffer sizes which limit the size of datagrams sent and received. These limits, however, canbe changed by changing the value of these constants in the VxWorks prjParams.h file andrecompiling VxWorks.

NOTE: Changing the values of these constants will impact the memory footprint of the target OSaccordingly.

Locale Operations

The system properties user.region, user.language, and file.encoding are set when the CVMinitializes and before the command line arguments are parsed. Thus, it is not possible to change thebehavior of the CVM by specifying these properties on the command line.

On Linux, these properties are extracted from the user's shell environment. To change the behaviorof the CVM on Linux, simply change the locale environment variables to the desired settings.

On VxWorks there is no locale information in the shell environment. To change these systemproperties, edit the file src/vxworks/native/java/lang/java_props_md.c, alter thesprops->language, sprops->, and sprops->encoding fields to the desired values, andrecompile.

Compiler WarningsWhen compiling CVM, a certain number of warning messages are produced by the C

8 of 9

Building the Implementations

Page 23: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

compiler. This is especially noticeable when the target is VxWorks. All such compilerwarnings produced by all supported tool sets have been investigated and found to be benign.There are similar warnings produced by javac concerning deprecated methods that are alsobenign.

Compiling Java ApplicationsThe Java applications you write must be compiled against the appropriate library. By default,the Java 2 SDK Standard Edition v1.3 compiler will compile against the Java 2 SDKStandard Edition v1.3 libraries. This would allow compilation of applications using libraryelements not part of CDC or Foundation Profile and would prevent compilation ofapplications using any of the CLDC components CDC uses.

This problem can be avoided using the javac -bootclasspath compiler option. Forexample, to compile the source file MyApp.java against CDC for the Linux build, thiscommand could be used:

> javac -bootclasspath top_dir/build/linux/btclasses.zip:\top_dir/build/linux/lib/cdc.jar MyApp.java

To compile the source file MyApp.java against the Foundation Profile for the Linux build,this command could be used:

> javac -bootclasspath top_dir/build/linux/btclasses.zip:\top_dir/build/linux/lib/foundation.jar MyApp.java

To compile the CDC alone or with the Foundation Profile for the VxWorks build, change theword linux to vxworks in the above examples.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

9 of 9

Building the Implementations

Page 24: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Running the CVMThis chapter describes how to invoke the CVM and includes a list of runtime options.

Contents

Invoking the CVM Invoking the CVM on Linux from a Shell Command Line Invoking the CVM on VxWorks from C Code Invoking the CVM on VxWorks from a Shell Command Line

Time/Date Operations Runtime Options

Invoking the CVMThe method of starting the CVM depends on the target platform environment on which it isrun. The following are examples that outline several commonly used methods for starting theCVM on the various target platforms.

The following examples assume you have already built the CVM executable. The examplesdemonstrate the execution of a HelloWorld Java class located in the testclasses.ziparchive, which is built during the build process. See Building the Implementations for detailson building the CVM executable.

Invoking the CVM on Linux from a Shell Command Line

For Linux, the CVM is an executable located in the build/linux/bin directory relative to the topdirectory where you unzipped the CDC and Foundation Profile distribution. To start the CVM,type in the following at the command prompt:

> cd topdir/build/linux/bin> cvm -Djava.class.path=../testclasses HelloWorld

Invoking the CVM on VxWorks from C Code

For VxWorks, the entry point to the CVM is either the runJava() function or the runJavaArgs()function.

The runJava() function takes a single string as an argument as follows:

1 of 5

Running the CVM

Page 25: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

int runJava(const char *options);

options is a string which consist of CVM runtime options delimited by blank spaces followed bythe name of the main Java class to be executed. For example,

void yourFunction(void) { extern int runJava(const char *options); runJava("-Djava.class.path=../testclasses HelloWorld");}

The runJavaArgs() function takes up to ten individual string arguments as follows:

int runJavaArgs(const char *a0, const char *a1, const char *a2, const char *a3, const char *a4, const char *a5, const char *a6, const char *a7, const char *a8, const char *a9);

Each of the string is to hold a single CVM runtime option or one main Java class to be executed.Unused arguments can be passed NULL strings. For example,

#undef NULL#define NULL ((void *)0)void yourFunction(void) { extern int runJavaArgs(const char *a0, const char *a1, const char *a2, const char *a3, const char *a4, const char *a5, const char *a6, const char *a7, const char *a8, const char *a9);

runJavaArgs("-Djava.class.path=../testclasses", "HelloWorld", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);}

Note: The two functions behave identically, with the following exception: the string arguments ofthe runJavaArgs() function can contain blank spaces which are not construed as delimitersbetween CVM runtime options, but all blank spaces in the string argument of the runJava()function will be construed as delimiters between CVM runtime options. Hence, when starting theCVM using the runJavaArgs() function, a CVM runtime option may contain blank spaces. This isnot true for the runJava() function.

Note: On VxWorks, starting a second virtual machine instance while one is already running is notcurrently supported. Instead, to run multiple Java applications on the same VM instance, use awrapper main Java program to invoke each of the Java applications.

Invoking the CVM on VxWorks from a Shell Command Line

From a VxWorks shell command prompt, the CVM can be started using the runJava() function asfollows:

-> runJava "-Djava.class.path=../testclasses HelloWorld"

From a VxWorks shell command prompt, the CVM can also be started using the runJavaArgs()function with up to ten individual string arguments as follows:

-> runJavaArgs "-Djava.class.path=../testclasses","HelloWorld"

2 of 5

Running the CVM

Page 26: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

See the notes above on the differences between runJava() and runJavaArgs() and the limitationon the number of CVM virtual machine instances running on VxWorks at the same time.

Time/Date OperationsFor the CVM to perform time/date oriented operations on VxWorks, the internaltime-of-day clock of VxWorks must be set to the correct time in GMT. The CVM can thenbe told which time zone it is operating in via the user.timezone property. Refer to thetarget's Board Support Package documentation and the timeLib module of VxWorks forways to set the OS time-of-day clock.

Runtime OptionsThe following are CVM runtime options that can be specified when CVM is started:

-Dproperty=value Set a system property value.

-fullversion Display build version information, then exit.

-showversion Display product version information and continue.

-version Display product version information, then exit.

-Xbootclasspath=bootclasspath Specify a colon-separated (Linux) or semicolon-separated (VxWorks) list ofdirectories, JAR archives, and ZIP archives to search for boot class files. These areused in place of the boot class files included in the CDC. If CVM is started from thebin directory that contains the CVM executable, the default bootclasspath is the../lib directory.

-Xbootclasspath/a=path Specify a colon-separated (Linux) or semicolon-separated (VxWorks) path ofdirectories, JAR archives, and ZIP archives to append to the default boot class path.

-Xbootclasspath/p=path Specify a colon-separated (Linux) or semicolon-separated (VxWorks) path ofdirectories, JAR archives, and ZIP archives to prepend in front of the default bootclass path.

-Xdebug Enables debugging support in the VM. Refer to the jdb description athttp://java.sun.com/j2se/1.3/docs/tooldocs/win32/jdb.html#description for more detailsand an example. Note: This runtime option is only supported if CVM was built with theCVM_JVMDI=true option.

-XfullShutdown Make sure all resources are freed and the VM destroyed upon exit. This is the defaultfor non-process-model operating systems, such as VxWorks, but is not usually donefor process-model operating systems, such as Linux.

-Xgc:gc_specific_options

3 of 5

Running the CVM

Page 27: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Specifies garbage collector (GC) specific options. For the default generational garbagecollector that is bundled with the CDC/Foundation distribution, the GC specific optionis youngGen=nnn to specify the size of the young object generation, in bytes. Appendthe letter k or K to indicate kilobytes, or m or M to indicate megabytes. The defaultvalue is 1M. Note: If a licensee implements a custom garbage collector, the accepted GC specificoptions will depend on that custom implementation.

-Xmssize Specify the size, in bytes, of the memory allocation pool. (This value may be roundedup by the GC implementation). Append the letter k or K to indicate kilobytes, or m or Mto indicate megabytes. The default value is 4M. Examples:

-Xms6291456-Xms6144k-Xms6m

-Xrunlib Load a dynamic library.

-Xsssize Set thread stack size in bytes. As is the case for the -Xms option, the size value canuse the letters k, K, m, or M to indicate kilobytes or megabytes.

-Xtrace:value Turn on trace flags. The following list shows the hexadecimal values to turn on eachtrace flag. To turn on multiple flags, bitwise-OR the values of all the flags you wish toturn on, and provide that result as the -Xtrace value. Note: This runtime option is only supported if CVM was built with theCVM_DEBUG=true option.

4 of 5

Running the CVM

Page 28: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Value What Is Traced

0x00000001 Opcode execution

0x00000002 Method execution

0x00000004 Internal state of the interpreter loop on method calls and returns

0x00000008 Fast common-case path of Java synchronization

0x00000010 Slow rare-case path of Java synchronization

0x00000020 Mutex locking and unlocking operations

0x00000040 Consistent state transitions. Garbage Collection (GC)-safety state only.

0x00000080 GC start and stop notifications

0x00000100 GC root scans

0x00000200 GC heap object scans

0x00000400 GC object allocation

0x00000800 GC algorithm internals

0x00001000 Transitions between GC-safe and GC-unsafe states

0x00002000 Class static initializers

0x00004000 Java exception handling

0x00008000 Heap initialization and destruction, global state initialization, and the safeexit feature

0x00010000 Read and write barriers for GC

0x00020000 Generation of GC maps for Java stacks

0x00040000 Class loading

0x00080000 Class lookup in VM-internal tables

0x00100000 Type system operations

0x00200000 Java code verifier operations

0x00400000 Weak reference handling

0x00800000 Class unloading

0x01000000 Class linking

-Xverify:[all | remote | none] Verify classes according to the suboption. -Xverify:all verifies all classes.-Xverify:remote verifies remote classes only. -Xverify:none turns off classverification.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

5 of 5

Running the CVM

Page 29: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Porting the ImplementationsThis chapter describes how to port the CDC and Foundation Profile releases.

Contents

Porting the Build Environment What Happens During the Build Process Build Variables

Porting the HPI Standard Library HPI Implementations

Porting the Platform-Dependent Class Library Support Porting the Java Debugger Support Porting Underlying Native Functions in the Libraries

Porting the Build EnvironmentThis chapter is for developers who want to build the system on another operating system.Together, the build/share and build/target_name directories form the buildenvironment. The build process stores build-generated files under build/target_name.

To set up your own build tree, make a new directory, build/your_target, and populate itwith make directive files. You can start by copying and renaming the corresponding filesfrom build/linux or build/vxworks, then editing the make variables as appropriate.

What Happens During the Build Process

When you run make, the following steps occur as part of the build process.

Step Utility Input Output

1javac (Java languagecompiler)

Must preload .java files under src/share/classes

build/target_name/ btclasses/*.class

2JavaMemberDepend (Class memberdependency checker)

build/target_name/ btclasses/*.class

List of classes required for transitive closure. The list is in build/target_name/ generated/javavm/ runtime/tranlist.

1 of 7

Porting the Implementations

Page 30: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3zip (compression utility)

Classes listed in build/ target_name/generated/ javavm/runtime/tranlist

build/target_name/ btclasses.zip

4javac (Java languagecompiler)

Runtime classes CVM test files insrc/share/javavm/ test/*.java

build/target_name/lib/ cdc.jar orbuild/target_name/ lib/foundation.jar build/target_name/ testclasses/*.class

5zip (compression utility)

CVM test classes in build/ target_name/ testclasses/*.class

build/target_name/ testclasses.zip

6

javah (Native methodfunction prototypegenerator)

Runtime classesJNI header files inbuild/target_name/ generated/jni/*.h

7JavaCodeCompact (Class preloader)

build/target_name/ btclasses.zip

JNI header files in build/ target_name/generated/ jni/*.h Preloaded class data structuresin build/target_name/ generated/javavm/runtime/ romjava*.c and romjava.h Additional C file interfaces

8 C compilerNative methods and CVM source (.c) files

Object files inbuild/target_name/ obj/*.o

9 C compiler

Preloaded classes inbuild/target_name/ generated/javavm/ runtime/romjava*.c

Object files inbuild/target_name/ obj/romjava*.o

10 archive utilityObject files in build/ target_name/obj/ romjava*.o

Object archive file inbuild/target_name/obj/ libromjava.a

11 linker

Object files inbuild/target_name/ obj/*.o from step 8 Object archive file inbuild/target_name/obj/ libromjava.a from step 10

Virtual machine binary* inbuild/target_name/bin.

* NOTE: The virtual machine binary may take different forms depending on the targetplatform. For example, the Linux implementation's virtual machine binary is an executable inbuild/linux/bin/cvm. For the VxWorks implementation, the virtual machine binary is alinkable object file in build/vxworks/bin/cvm.o.

2 of 7

Porting the Implementations

Page 31: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Build Variables

The following table describes the build variables that you may want to change if you port thebuild environment. These variables appear in the filebuild/target_name/defs_target_name.mk.

Option Description

AR_CREATE_FLAGS Specifies flags for the $(AR) tool to use when creating an archive.

AR_UPDATE_FLAGS Specifies flags for the $(AR) tool to use when updating an archive.

ASM_RULE Specifies the command to compile assembly language (.s) files.

AT

Specifies the prefix for build commands, allowing control over whetherthe command is echoed. This option is set automatically to @, unlessCVM_TERSEOUTPUT=false. $(AT) is usually used to prefix the commandsgiven in other macros, such as CC_RULE.

CCDEPEND

Specifies the flag to pass to the C compiler to produce header filedependency makefiles for each C file. Use -M for gcc. Note: If your Ccompiler does not support this feature, you must editdefs_$(CVM_TARGET).mk to set GENERATEMAKEFILES=false.

CC_RULE Command to compile C files.

CFLAGSSpecifies the flags to pass to the C compiler. Note: Use the CPPFLAGSoption to specify preprocessor flags.

CPPFLAGSSpecifies the flags to pass to the C preprocessor. This must include$(CVM_DEFINES).

CVM The name of the CVM executable created by $LINK_RULE.

CVM_DEFINES

A list of all C macro defines to add to the CPPFLAGS setting. The list iscreated automatically by processing the make command line arguments.For example, passing in CVM_DEBUG=true automatically adds-DCVM_DEBUG to CVM_DEFINES.

CVM_INCLUDES A list of all directories that contain included files.

CVM_JAVABINThe directory where the java, javac, javah, javadoc, and jar tools canbe found.

CVM_SRCDIRS

A list of all C and assembly language source directories. Most of thedirectories in the list are set up in defs.mk, including platform-specificdirectories that contain native method implementations. Note: You needto add to this list the platform-specific directories that implement theporting layer for your platform.

3 of 7

Porting the Implementations

Page 32: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVM_TARGET

The name of the target operating system, such as linux for Linux orvxworks for VxWorks. This value is used to locate directories specific tothe target. For example, build/$(CVM_TARGET) is where the target buildis done, and is also the location of any target-specific makefile, such asbuild/$(CVM_TARGET)/defs_$(CVM_TARGET).mk. Also, target-specificsource files are in src/$(CVM_TARGET).

CVM_TARGETOBJSA list of all platform-specific object files. The object files correspondingto any source file in src/$(CVM_TARGET) should go in this list.

FILESEPThe file separator character on the host operating system. For example, ifyour host system is a Unix or Unix-like operating environment, thisshould be set to the slash character (/).

LIB_FLAGSFlags to pass to the tool used to combine multiple object files into oneobject file.

LIB_RULE Command to combine multiple object files into one object file.

LINKFLAGS

Flags to pass to the tool used to link multiple object files into anexecutable. On some platforms, such as VxWorks, the result is notactually an executable. Instead, the result is an object file that is linked tothe VxWorks kernel later.

LINK_RULE Command to link object files into an executable.

ZIPName of the zip tool to use. Use the full path name if it is not in thedefault execution path.

Porting the HPIThe CVM implementation expects certain functionality to be available. The requiredfunctionality may be provided by the target OS or by implementation-specific code betweenthe OS and the CVM implementation. Required functionality includes:

Threads Synchronization (mutexes and condition variables) Dynamic linking malloc (POSIX memory allocation utility) or equivalent Input/output (I/O) functions Berkeley Standard Distribution (BSD) sockets File system support Function libraries must be thread-safe. A thread blocking in a library should not blockany other VM threads.

The HPI header files show everything that must be defined or implemented to provide therequired functionality for porting the VM. More detail on the HPI is available in thechapter Host Programming Interface (HPI) Reference.

4 of 7

Porting the Implementations

Page 33: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

To port the HPI, you need to look at the following files:

HPI header files that define the porting interface are insrc/share/javavm/include/porting/. Platform-dependent HPI header files to include for Linux are insrc/linux/javavm/include/, and those for VxWorks are insrc/vxworks/javavm/include/. Platform-dependent HPI functions for Linux are in src/linux/javavm/runtime/,and those for VxWorks are in src/vxworks/javavm/runtime/.

Standard Library HPI Implementations

If the target system provides POSIX and ANSI C libraries, you can layer your port on top ofthe standard library HPI implementations in src/porting/posix andsrc/porting/ansi_c, thus reducing the amount of porting work needed.

Porting the Platform-Dependent Class LibrarySupport

The implementations of the platform-dependent classes and native methods are insrc/target_name/classes and src/target_name/native.

Porting the Java Debugger SupportThe debugger support requires some porting of the networking and dynamic linking codeimplementation in ext/jpda.

Porting Underlying Native Functions in theLibraries

The CDC and the Foundation Profile have Java class libraries that were ported from theJ2SE, v1.3 to the given sample implementation platform (such as Linux). When porting theCDC and the Foundation Profile Java class libraries to other platforms, you must port theunderlying native functions that are machine dependent to the new platform operatingsystem.

This is done by checking to make sure that each "*_md*" (machine dependent) file iscorrectly written for the platform you are porting to. See the comments in each file tounderstand what is needed for porting. Usually, if the new platform has the standard Clibrary, there are not many changes to make.

As a guideline, see the following machine dependent files in the Linux sample implementationsource bundle and decide what is appropriate for the new platform:

5 of 7

Porting the Implementations

Page 34: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

./src/linux/javavm/include/doubleword_md.h ./src/linux/javavm/include/errno_md.h ./src/linux/javavm/include/path_md.h ./src/linux/javavm/include/io_md.h ./src/linux/javavm/include/defs_md.h ./src/linux/javavm/include/float_md.h ./src/linux/javavm/include/int_md.h ./src/linux/javavm/include/endianness_md.h ./src/linux/javavm/include/jni_md.h ./src/linux/javavm/include/globals_md.h ./src/linux/javavm/include/sync_md.h ./src/linux/javavm/include/time_md.h ./src/linux/javavm/include/net_md.h ./src/linux/javavm/include/threads_md.h ./src/linux/javavm/runtime/time_md.c ./src/linux/javavm/runtime/fp_md.c ./src/linux/javavm/runtime/io_md.c ./src/linux/javavm/runtime/sync_md.c ./src/linux/javavm/runtime/globals_md.c ./src/linux/javavm/runtime/linker_md.c ./src/linux/javavm/runtime/threads_md.c ./src/linux/javavm/runtime/net_md.c ./src/linux/javavm/runtime/system_md.c ./src/linux/bin/java_md.c ./src/linux/native/java/io/canonicalize_md.c ./src/linux/native/java/io/FileSystem_md.c ./src/linux/native/java/io/UnixFileSystem_md.c ./src/linux/native/java/lang/Runtime_md.c ./src/linux/native/java/lang/java_props_md.c ./src/linux/native/java/lang/UNIXProcess_md.c ./src/linux/native/java/net/net_util_md.h ./src/linux/native/java/net/InetAddressImpl_md.c ./src/linux/native/java/net/SocketInputStream_md.c ./src/linux/native/java/net/PlainSocketImpl_md.c ./src/linux/native/java/net/PlainDatagramSocketImpl_md.c ./src/linux/native/java/net/net_util_md.c ./src/linux/native/java/net/SocketOutputStream_md.c ./src/linux/native/java/util/TimeZone_md.c ./src/linux/native/java/util/TimeZone_md.h ./ext/jpda/src/linux/back/exec_md.c ./ext/jpda/src/linux/back/path_md.h ./ext/jpda/src/linux/back/dlAlloc_md.h ./ext/jpda/src/linux/back/linker_md.c ./ext/jpda/src/linux/back/util_md.h ./ext/jpda/src/linux/transport/socket/socket_md.h ./ext/jpda/src/linux/transport/socket/socket_md.c

See the build/share makefiles to find and edit the rules for creating and building your own

6 of 7

Porting the Implementations

Page 35: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

src/<platform>/javavm, src/<platform>/native and ext/jpda/src/<platform>/ paralleldirectories as the location of the new platform native function machine dependent files youare creating.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

7 of 7

Porting the Implementations

Page 36: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Porting Notes for PersonalJava Technology UsersThis chapter describes the differences between the PersonalJava application environment and the CDCand the Foundation Profile and shows strategies to reuse the work done for your port of the PersonalJavaapplication environment.

Contents

Porting Process HPI Differences

JNI Native Method Invocation Threads Monitors

Porting ProcessConverting an existing port of the PersonalJava platform to the CDC and the FoundationProfile port will require the most effort in the makefile and HPI areas.

The CDC and the Foundation Profile differ from the PersonalJava platform in the followingareas:

makefile structure See the section Porting the Build Environment in the chapter Porting theImplementations.

Host Programming Interface, or HPI (VM porting layer) See the section HPI Differences below. Java 2 SDK v1.3-based The current release of PersonalJava application environment (3.1) is based on JDKTM

1.1. Classes and native methods should not require much change from the referenceimplementation. See the section Porting the Platform-Dependent Class LibrarySupport. Note that the CDC and the Foundation Profile do not include GUIsupport such as the AWT window system in the PersonalJava application environment.

Debugger support The debugger support requires some porting of the networking and dynamic linkingcode.

1 of 5

Porting Notes for PersonalJava Technology Users

Page 37: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

HPI DifferencesThe most significant HPI differences are in the following areas:

JNI native method invocation Threads Monitors

JNI Native Method Invocation

The CVMjniInvokeNative() function replaces the sysInvokeNative() function from thePersonalJava platform. This function translates the Java language calling convention into theC convention used in native methods. The CVM passes all the arguments in the Java stack,and expects the results to be placed there as well.

The CVMjniInvokeNative() function differs from the sysInvokeNative() function in thefollowing ways:

CVMjniInvokeNative() uses terse signatures that take up less space and allow fasterparsing. Because the signature codes were ASCII characters, the sysInvokeNative()reference implementation had to perform multiple compares to find a match. ForCVMjniInvokeNative(), the signature code is a 4-bit integer, allowing a fast tablelookup or computed branch or jump. The return value is stored into a structure, a pointer to which is passed as anargument. For sysInvokeNative(), the return value was stored onto the Java stack. CVMjniInvokeNative() returns the number of words taken up by the result value, or-1 if the result is an object. sysInvokeNative() returns the new top-of-stack pointer.

Threads

Because CVM does more work above the porting layer than the PersonalJava VM did, theporting layer has been simplified significantly.

The following table compares CVM thread functions to PersonalJava VM thread functions.It does not include the full method signatures and descriptions. For full signatures anddescriptions of the CVM thread functions, see the threads.h section of the HPI referencechapter.

CVM Function Comparison to PersonalJava VM FunctionsCVMthreadAttach() Replaces sysThreadAlloc() and the parts of

2 of 5

Porting Notes for PersonalJava Technology Users

Page 38: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

sysThreadCreate() that fill in the sys_thread_t pointer.

Associates a CVMthreadID pointer with the current thread.CVMthreadAttach() is called for threads created byCVMthreadCreate() as well as for existing threads that areattached using the JNI AttachCurrentThread() function.

CVMthreadCreate() CVMthreadCreate() is simpler than sysThreadCreate(), because CVM does more work above the porting layer thanthe PersonalJava VM did. A CVMThreadID is allocated bythe CVM and associated with the thread usingCVMthreadAttach(). There is no need to allocate andreturn a thread-private structure (sys_thread_t), and thereare no flags and no thread cookie. The CVM maintains thelist of threads, so the HPI doesn't have to do it. (There is noequivalent to sysThreadEnumerate().) The thread is notstarted in the suspended state.

CVMthreadDetach() Replaces sysThreadFree() and sysThreadExit().

Disassociates the CVMthreadID pointer from the currentthread CVMthreadDetach() is called for threads that havebeen detached using the JNI DetachCurrentThread()function, as well as for threads created byCVMthreadCreate(), when the start function is ready toreturn.

Unlike the PersonalJava threads implementation,CVMthreadDetach() does not need to zero out Threadfields such as eetop and PrivateInfo. Nor does it need tomake any calls into the VM to perform further cleanup, aswas needed for monitors in the PersonalJavaimplementation.

CVMthreadDetach() only needs to deallocate any resourcesthat were allocated by CVMthreadAttach(). The CDCreference implementation uses the POSIXthreadDetach()function, which simply makes sure that future calls toCVMthreadGetSelf()return NULL.

CVMthreadInterruptWait() Equivalent to sysThreadInterrupt() in the PersonalJavaplatform.

CVMthreadIsInterrupted() Equivalent to sysThreadIsInterrupted() in thePersonalJava platform.

CVMthreadResume() Equivalent to sysThreadResume() in the PersonalJavaplatform.

CVMthreadSelf() Equivalent to sysThreadSelf() in the PersonalJavaplatform. If a CVMThreadID pointer is associated with thecurrent thread, then CVMthreadSelf() returns the pointer.Otherwise, it returns NULL.

3 of 5

Porting Notes for PersonalJava Technology Users

Page 39: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMthreadSetPriority() Equivalent to sysThreadSetPriority() in thePersonalJava platform.

CVMthreadStackCheck() Equivalent to sysThreadCheckStack() in the PersonalJavaplatform.

CVMthreadSuspend() Equivalent to sysThreadSuspend() in the PersonalJava platform.

CVMthreadYield() Equivalent to sysThreadYield() in the PersonalJavaplatform.

Monitors

For the PersonalJava platform, the VM porting layer had to implement a monitor abstraction.For the CDC, the monitor implementation has moved into the CVM, and the VM portinglayer instead needs to implement mutex and condition variable abstractions.

The CDC implementation uses POSIX thread functions. The mutex and condition variablesimplementation is in src/porting/posix/posix_sync_md.c. If your platform provides thePOSIX threads library, you may be able to use this file with no changes.

If you ported the PersonalJava VM and based the monitor implementation on a privatemutex and condition variable layer, as is the case for the PersonalJava referenceimplementations that used Solaris native threads, you can reuse your implementation withsimple changes. Examples of these simple changes are shown in the following table. Thesys_mon_t structure from the PersonalJava platform is replaced by the combination of theCVMMutex and CVMCondVar structures in the CDC.

CDC Functions Corresponding Personal Java VMFunctions

CVMBool CVMmutexInit(CVMMutex* m); void CVMmutexDestroy(CVMMutex* m); CVMBool CVMcondvarInit(CVMCondVar *c,

CVMMutex* m); void CVMcondvarDestroy(CVMCondVar*c);

int sysMonitorInit(sys_mon_t *mid); int sysMonitorDestroy(sys_mon_t*mid);

void CVMmutexLock(CVMMutex* m); void CVMmutexUnlock(CVMMutex* m);

int sysMonitorEnter(sys_mon_t *mid); bool_t sysMonitorEntered(sys_mon_t

*mid); int sysMonitorExit(sys_mon_t *mid);

void CVMcondvarNotify(CVMCondVar* c);

void CVMcondvarNotifyAll(CVMCondVar*

c); CVMBool CVMcondvarWait(CVMCondVar* c,

CVMMutex* m, CVMJavaLong millis);

int sysMonitorNotify(sys_mon_t

*mid); int sysMonitorNotifyAll(sys_mon_t

*mid); int sysMonitorWait(sys_mon_t *mid,int millis, bool_t clear);

4 of 5

Porting Notes for PersonalJava Technology Users

Page 40: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Additional notes on monitors are organized by topic below:

Mutex locking In the CDC, a thread never attempts to lock the same mutex more than once. Thisdiffers from the behavior of sysMonitorEnter and sysMonitorExit in thePersonalJava platform, which required a recursive entry count. Monitor waiting You can modify your sysMonitorWait implementation so that the "clear" flag isalways true (the interrupted state should always be cleared). A recursive entry count isnot needed, nor is a check of the monitor ownership (or in this case, the conditionvariable mutex). Monitor notification You can modify your sysMonitorNotify and sysMonitorNotifyAllimplementation so that it no longer checks that the current thread owns the monitor.This check is unnecessary in the CDC.

For a description of the definitions required to support mutexes and condition variables forthe CVM, see the sync.h section of the chapter Host Programming Interface (HPI)Reference.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

5 of 5

Porting Notes for PersonalJava Technology Users

Page 41: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Host Programming Interface (HPI) ReferenceThis chapter describes the definitions required by the Host Programming Interface (HPI). The HPIdefines the set of APIs that must be implemented when porting CVM.

Contents

Introduction defs.h doubleword.h endianness.h float.h globals.h int.h io.h jni.h linker.h net.h path.h sync.h system.h threads.h time.h vm-defs.h

IntroductionThe HPI connects the CVM to its target operating system. The HPI is defined in the headerfiles in src/share/javavm/include/porting/. These shared header files "include"machine-dependent header files that reside in src/<platform>/javavm/include/.

Note: Some parts of the HPI are implemented as functions and other parts as macros. Themacros are defined in header files that are included by the HPI header files.

The following table summarizes the header files that define the HPI. Additional informationfor each header file follows this table.

1 of 27

HPI Reference

Page 42: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Header File Description

defs.h Lists CVM primitive types, macros for ANSI header file locations, macros forHPI included header file locations, and macros indicating whether theimplementation supports certain advanced features. Explicitly includes amachine-dependent definitions header file. The reference implementation of theincluded file resides in src/<platform>/javavm/include/defs_md.h.

doubleword.h Declares 64-bit conversion functions, and functions related to the long anddouble data types.

endianness.h Lists macros that indicate endianness (big endian or little endian).

float.h Declares functions related to the float data types.

globals.h Lists functions related to the per-VM global state and the per-address-spacestatic state.

int.h Lists functions related to the integer (int) data types.

io.h Lists I/O-related macros and functions.

jni.h Lists functions and other information related to the Java Native Interface(JNI).

linker.h Lists functions and other information related to dynamic linking.

net.h Lists functions related to networking.

path.h Lists macros and a function related to paths.

sync.h Lists functions used to facilitate thread synchronization and mutual exclusionlocks.

system.h Lists functions and other information related to system functions.

threads.h Lists functions and other information related to threads.

time.h Lists time functions.

vm-defs.h Declares CVM data structure names and data types. The data types areexported to the HPI implementation.

defs.h

The file src/share/javavm/include/porting/defs.h specifies the following definitionrequirements.

Type Definitions

2 of 27

HPI Reference

Page 43: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Type Description

CVMfloat32 Single-precision IEEE floating point type.

CVMfloat64 Double-precision IEEE floating point type.

CVMInt8 Signed 8-bit integer type.

CVMInt16 Signed 16-bit integer type.

CVMInt32 Signed 32-bit integer type.

CVMInt64 Signed 64-bit integer type.

CVMSize Size in bytes of a data type. Equivalent to ANSI C size_t.

CVMUint8 Unsigned 8-bit integer type.

CVMUint16 Unsigned 16-bit integer type.

CVMUint32 Unsigned 32-bit integer type.

CVMUint64 Unsigned 64-bit integer type.

ANSI Header File Locations

3 of 27

HPI Reference

Page 44: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Macro Description

CVM_HDR_ANSI_ASSERT_H Provides the location of the ANSI header file assert.h.

CVM_HDR_ANSI_CTYPE_H Provides the location of the ANSI header file ctype.h.

CVM_HDR_ANSI_ERRNO_H Provides the location of the ANSI header file errno.h.

CVM_HDR_ANSI_LIMITS_H Provides the location of the ANSI header file limits.h.

CVM_HDR_ANSI_SETJMP_H Provides the location of the ANSI header file setjmp.h.

CVM_HDR_ANSI_STDARG_H Provides the location of the ANSI header file stdarg.h.

CVM_HDR_ANSI_STDDEF_H Provides the location of the ANSI header file stddef.h.

CVM_HDR_ANSI_STDIO_H Provides the location of the ANSI header file stdio.h.

CVM_HDR_ANSI_STDLIB_H Provides the location of the ANSI header file stdlib.h.

CVM_HDR_ANSI_STRING_H Provides the location of the ANSI header file string.h.

CVM_HDR_ANSI_TIME_H Provides the location of the ANSI header file time.h.

HPI Included Header File Locations

4 of 27

HPI Reference

Page 45: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Macro Description

CVM_HDR_DOUBLEWORD_H Provides the location of the HPI header file included byporting/doubleword.h.

CVM_HDR_ENDIANNESS_H Provides the location of the HPI header file included byporting/endianness.h.

CVM_HDR_FLOAT_H Provides the location of the HPI header file included byporting/float.h.

CVM_HDR_GLOBALS_H Provides the location of the HPI header file included byporting/globals.h.

CVM_HDR_INT_H Provides the location of the HPI header file included byporting/int.h.

CVM_HDR_IO_H Provides the location of the HPI header file included byporting/io.h.

CVM_HDR_JNI_H Provides the location of the HPI header file included byporting/jni.h.

CVM_HDR_LINKER_H Provides the location of the HPI header file included byporting/linker.h.

CVM_HDR_NET_H Provides the location of the HPI header file included byporting/net.h.

CVM_HDR_PATH_H Provides the location of the HPI header file included byporting/path.h.

CVM_HDR_SYNC_H Provides the location of the HPI header file included byporting/sync.h.

CVM_HDR_THREADS_H Provides the location of the HPI header file included byporting/threads.h.

CVM_HDR_TIME_H Provides the location of the HPI header file included byporting/time.h.

Advanced Platform Features

The following macros represent advanced features. These features are not required, but theysupport VM optimization such as fast locking. If the macros are not defined, a defaultimplementation is used.

For information about the functions referenced in the descriptions below, see the section onthe sync.h header file.

5 of 27

HPI Reference

Page 46: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Macro Description

CVM_ADV_ATOMIC_CMPANDSWAP Define this if atomic compare-and-swap(CVMatomicCompareAndSwap) is supported.

CVM_ADV_ATOMIC_INCDEC Define this if atomic increment (CVMatomicIncrement) andatomic decrement (CVMatomicDecrement) are supported.

CVM_ADV_ATOMIC_SWAP Define this if atomic swap (CVMatomicSwap) is supported.

CVM_ADV_MUTEX_SET_OWNER Define this if setting the owner of a mutex(CVMmutexSetOwner) is supported.

CVM_ADV_SCHEDLOCK Define this if a scheduler lock (CVMschedLock) is supported.

doubleword.h

The file src/share/javavm/include/porting/doubleword.h specifies the followingdefinition requirements.

64-bit Conversion Functions

Declaration Description

void CVMdouble2Jvm(CVMUint32location[2], CVMJavaDouble val);

Reads a 64-bit Java double in nativerepresentation from val and writes the resultin two-word JVM representation to location.

CVMJavaDouble CVMjvm2Double(constCVMUint32 location[2]);

Reads a 64-bit Java double in two-word JVMrepresentation from location and returns theresult in native representation. There is norestriction on the JVM representation, exceptthat a value written using CVMdouble2Jvm()must return the same value whenCVMjvm2Double() is called (The operation isreversible).

CVMJavaLong CVMjvm2Long(constCVMUint32 location[2]);

Reads a 64-bit Java long in two-word JVMrepresentation from location and returns theresult in native representation. There is norestriction on the JVM representation, exceptthat a value written using CVMlong2Jvm()must return the same value whenCVMjvm2Long() is called (The operation isreversible).

void CVMlong2Jvm(CVMUint32location[2], CVMJavaLong val);

Reads a 64-bit Java long in nativerepresentation from val and writes the result

6 of 27

HPI Reference

Page 47: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

location[2], CVMJavaLong val); representation from val and writes the resultin two-word JVM representation to location.

void CVMmemCopy64(CVMUint32 to[2],const CVMUint32 from[2]);

Copies two typeless 32-bit words from onelocation to another. This is semanticallyequivalent to:

to[0] = from[0];to[1] = from[1];

but this interface is provided for thoseplatforms that could optimize this into a single64-bit transfer.

Long Conversion Functions

Declaration Description

extern CVMJavaLongCVMdouble2Long(CVMJavaDouble val);

Converts double to long, according to d2lbytecode semantics.

extern CVMJavaLongCVMdouble2LongBits(CVMJavaDouble val);

Converts double bits to long bits, accordingto Double.doubleToRawLongBits().

extern CVMJavaLongCVMint2Long(CVMJavaInt val);

Converts int to long, according to i2lbytecode semantics.

extern CVMJavaDoubleCVMlong2Double(CVMJavaLong val);

Converts long to double, according to l2dbytecode semantics.

extern CVMJavaFloatCVMlong2Float(CVMJavaLong val);

Converts long to float, according to l2fbytecode semantics.

extern CVMJavaIntCVMlong2Int(CVMJavaLong val);

Converts long to int, according to l2ibytecode semantics.

extern void *CVMlong2VoidPtr(CVMJavaLong val);

Converts long to void *.

extern CVMJavaDoubleCVMlongBits2Double(CVMJavaLong val);

Converts long bits to double bits, accordingto Double.longBitsToDouble().

extern CVMJavaLongCVMvoidPtr2Long(void * val);

Converts void * to long.

Long Arithmetic Functions

7 of 27

HPI Reference

Page 48: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

CVMJavaLong CVMlongAdd(CVMJavaLong op1,CVMJavaLong op2);

Follows the ladd bytecodesemantics.

CVMJavaLong CVMlongAnd(CVMJavaLong op1,CVMJavaLong op2);

Follows the land bytecodesemantics.

CVMJavaLong CVMlongDiv(CVMJavaLong op1,CVMJavaLong op2);

Follows the ldiv bytecodesemantics.

CVMJavaLong CVMlongMul(CVMJavaLong op1,CVMJavaLong op2);

Follows the lmul bytecodesemantics.

CVMJavaLong CVMlongOr(CVMJavaLong op1,CVMJavaLong op2);

Follows the lor bytecodesemantics.

CVMJavaLong CVMlongRem(CVMJavaLong op1,CVMJavaLong op2);

Follows the lrem bytecodesemantics.

CVMJavaLong CVMlongSub(CVMJavaLong op1,CVMJavaLong op2);

Follows the lsub bytecodesemantics.

CVMJavaLong CVMlongXor(CVMJavaLong op1,CVMJavaLong op2);

Follows the lxor bytecodesemantics.

More Long Functions

Declaration Description

CVMInt32 CVMlongCompare(CVMJavaLong op1,CVMJavaLong op2);

Compares op1 and op2 according tothe lcmp bytecode semantics. Returntype is CVMInt32 (value is 0, 1, or -1).

CVMJavaLong CVMlongConstZero(); Follows the lconst_0 bytecodesemantics.

CVMJavaLong CVMlongConstOne(); Follows the lconst_1 bytecodesemantics.

CVMInt32 CVMlongEq(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is equal to op2.Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongEqz(CVMJavaLong op); Evaluates whether op is equal to zero.Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

8 of 27

HPI Reference

Page 49: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMInt32 CVMlongGe(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is greater thanor equal to op2. Return type is CVMBool(value is CVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongGez(CVMJavaLong op); Evaluates whether op is greater than orequal to zero. Return type is CVMBool(value is CVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongGt(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is greater thanop2. Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongLe(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is less than orequal to op2. Return type is CVMBool(value is CVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongLt(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is less than op2.Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongLtz(CVMJavaLong op); Evaluates whether op is less than zero.Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

CVMInt32 CVMlongNe(CVMJavaLong op1,CVMJavaLong op2);

Evaluates whether op1 is not equal toop2. Return type is CVMBool (value isCVM_TRUE or CVM_FALSE).

CVMJavaLong CVMlongNeg(CVMJavaLong op); Returns the negation of op, accordingto the lneg bytecode semantics.

CVMJavaLong CVMlongNot(CVMJavaLong op); Returns the complement of opaccording to the lnot bytecodesemantics.

CVMJavaLong CVMlongShl(CVMJavaLong op1,CVMJavaInt op2);

Returns the signed shift left of op,according to the lshl bytecodesemantics.

CVMJavaLong CVMlongShr(CVMJavaLong op1,CVMJavaInt op2);

Returns the signed shift right of op,according to the lshr bytecodesemantics.

CVMJavaLong CVMlongUshr(CVMJavaLong op1,CVMJavaInt op2);

Returns the unsigned shift right of op,according to the lushr bytecodesemantics.

Double Functions

9 of 27

HPI Reference

Page 50: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

CVMJavaFloat CVMdouble2Float(CVMJavaDoubleval);

Converts the double val to afloat, according to the d2fbytecode semantics.

CVMJavaInt CVMdouble2Int(CVMJavaDouble val); Converts the double val to anint, according to the d2ibytecode semantics.

CVMJavaDouble CVMdoubleAdd(CVMJavaDouble op1,CVMJavaDouble op2);

Adds op1 to op2 according to thedadd bytecode semantics.

CVMInt32 CVMdoubleCompare(CVMJavaDouble op1,CVMJavaDouble op2, CVMInt32 direction);

Compares op1 and op2,according to the dcmpl(direction is -1) or dcmpg(direction is 1) bytecodesemantics.

CVMJavaDouble CVMdoubleConstOne(); Follows the dconst_1 bytecodesemantics.

CVMJavaDouble CVMdoubleConstZero(); Follows the dconst_0 bytecodesemantics.

CVMJavaDouble CVMdoubleDiv(CVMJavaDouble op1,CVMJavaDouble op2);

Follows the ddiv bytecodesemantics.

CVMJavaDouble CVMdoubleMul(CVMJavaDouble op1,CVMJavaDouble op2);

Follows the dmul bytecodesemantics.

CVMJavaDouble CVMdoubleNeg(CVMJavaDouble op); Returns the negation of op,according to the dneg bytecodesemantics.

CVMJavaDouble CVMdoubleRem(CVMJavaDouble op1,CVMJavaDouble op2);

Follows the drem bytecodesemantics.

CVMJavaDouble CVMdoubleSub(CVMJavaDouble op1,CVMJavaDouble op2);

Follows the dsub bytecodesemantics.

CVMJavaDouble CVMint2Double(CVMJavaInt val); Converts int to double, accordingto the i2d bytecode semantics.

endianness.h

The file src/share/javavm/include/porting/endianness.h specifies the followingdefinition requirements.

10 of 27

HPI Reference

Page 51: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

CVM_DOUBLE_ENDIANNESS Indicates whether the platform uses the big endian convention orthe little endian convention for the double data types. Set this toCVM_LITTLE_ENDIAN or CVM_BIG_ENDIAN as appropriate for yourplatform.

CVM_ENDIANNESS Indicates whether the platform uses the big endian convention orthe little endian convention. Set this to CVM_LITTLE_ENDIAN orCVM_BIG_ENDIAN as appropriate for your platform.

float.h

The file src/share/javavm/include/porting/float.h specifies the following definitionrequirements.

Declaration Description

CVMJavaDouble CVMfloat2Double(CVMJavaFloatop);

Converts float to double, accordingto the f2d bytecode semantics.

CVMJavaInt CVMfloat2Int(CVMJavaFloat op); Converts float to int, according tothe f2i bytecode semantics.

extern CVMJavaLong CVMfloat2Long(CVMJavaFloatop);

Converts float to long, accordingto the f2l bytecode semantics.

CVMJavaFloat CVMfloatAdd(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the fadd bytecodesemantics.

CVMInt32 CVMfloatCompare(CVMJavaFloat op1,CVMJavaFloat op2, CVMInt32 direction);

Compares op1 and op2, accordingto the fcmpl (direction is -1) orfcmpg (direction is 1) bytecodesemantics.

CVMJavaFloat CVMfloatDiv(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the fdiv bytecodesemantics.

CVMJavaFloat CVMfloatMul(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the fmul bytecodesemantics.

CVMJavaFloat CVMfloatNeg(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the fneg bytecodesemantics.

CVMJavaFloat CVMfloatRem(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the frem bytecodesemantics.

CVMJavaFloat CVMfloatSub(CVMJavaFloat op1,CVMJavaFloat op2);

Follows the fsub bytecodesemantics.

11 of 27

HPI Reference

Page 52: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

semantics.

globals.h

The file src/share/javavm/include/porting/globals.h specifies the followingdefinition requirements.

Declaration Description

extern void CVMdestroyStaticState(); Destroysplatform-specificper-address-spacestatic state.

extern voidCVMdestroyVMTargetGlobalState(CVMTargetGlobalState *);

Destroysplatform-specificper-VM global state.

extern void CVMinitStaticState(); Initializesplatform-specificper-address-spacestatic state.

extern voidCVMinitVMTargetGlobalState(CVMTargetGlobalState *);

Initializesplatform-specificper-VM global state.

struct CVMTargetGlobalState {}; Defines theplatform-specificglobal state.

int.h

The file src/share/javavm/include/porting/int.h specifies the following definitionrequirements.

Declaration Description

CVMJavaInt CVMintAdd(CVMJavaInt op1,CVMJavaInt op2);

Adds two integers according to the iaddbytecode semantics.

CVMJavaInt CVMintSub(CVMJavaInt op1,CVMJavaInt op2);

Subtracts two integers according to theisub bytecode semantics.

CVMJavaInt CVMintMul(CVMJavaInt op1,CVMJavaInt op2);

Multiplies two integers according to theimul bytecode semantics.

CVMJavaInt CVMintDiv(CVMJavaInt op1,CVMJavaInt op2);

Divides two integers according to theidiv bytecode semantics.

12 of 27

HPI Reference

Page 53: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMJavaInt CVMintRem(CVMJavaInt op1,CVMJavaInt op2);

Returns the remainder of the division oftwo integers according to the irembytecode semantics.

CVMJavaInt CVMintAND(CVMJavaInt op1,CVMJavaInt op2);

ANDs two integers according to theiand bytecode semantics.

CVMJavaInt CVMintOr(CVMJavaInt op1,CVMJavaInt op2);

ORs two integers according to the iorbytecode semantics.

CVMJavaInt CVMintXor(CVMJavaInt op1,CVMJavaInt op2);

XORs two integers according to theixor bytecode semantics.

CVMJavaInt CVMintNeg(CVMJavaInt op); Negates the specified integer accordingto the ineg bytecode semantics.

CVMJavaInt CVMintUshr(CVMJavaInt op1,CVMJavaInt num);

Performs an unsigned right shiftaccording to the iushr bytecodesemantics.

CVMJavaInt CVMintShl(CVMJavaInt op1,CVMJavaInt num);

Performs an left shift according to theishl bytecode semantics.

CVMJavaInt CVMintShr(CVMJavaInt op1,CVMJavaInt num);

Performs an right shift according to theiushr bytecode semantics.

CVMJavaInt CVMintNeg(CVMJavaInt op); Performs a negation operation accordingto the ineg bytecode semantics.

CVMJavaFloat CVMint2Float(CVMJavaIntval);

Converts an integer to a float accordingto the i2f bytecode semantics.

CVMJavaByte CVMint2Byte(CVMJavaInt val); Converts an integer to a byte accordingto the i2b bytecode semantics.

CVMJavaChar CVMint2Char(CVMJavaInt val); Converts an integer to a char accordingto the i2c bytecode semantics.

CVMJavaShort CVMint2Short(CVMJavaIntval);

Converts an integer to a short accordingto the i2s bytecode semantics.

CVMUint16 CVMgetUint16(CVMconst CVMUint8*ptr);

Returns an 8 bit unsigned integer as a 16bit unsigned integer.

CVMUint32 CVMgetUint32(CVMconst CVMUint8*ptr);

Returns an 8 bit unsigned integer as a 32bit unsigned integer.

CVMInt16 CVMgetInt16(CVMconst CVMUint8*ptr);

Returns an 8 bit unsigned integer as a 16bit signed integer.

13 of 27

HPI Reference

Page 54: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMInt32 CVMgetInt32(CVMconst CVMUint8*ptr);

Returns an 8 bit unsigned integer as a 32bit signed integer.

CVMInt32 CVMgetAlignedInt32(ptr_)(constCVMUint8 *ptr);

Macro for accessing word alignedbig-endian integers. A little-endianplatform like x86 would need to makesure the bytes get reversed.

io.h

The file src/share/javavm/include/porting/io.h specifies the following definitionrequirements.

Declaration Description

CVMInt32CVMioGetLastErrorString(char *buf,int len);

Gets the last error string using a caller suppliedbuffer.

char* CVMioReturnLastErrorString(); Returns the last error string without any callerbuffers.

char * CVMioNativePath(char *path); Converts a pathname into native format. Thisfunction does syntactic cleanup, such asremoving redundant separator characters. Itmodifies the specified pathname string inplace.

CVMInt32 CVMioFileType(const char*path);

Returns the file type of the specified file path.Valid values are: CVM_IO_FILETYPE_REGULAR (0) CVM_IO_FILETYPE_DIRECTORY (1) CVM_IO_FILETYPE_OTHER (2) CVM_IO_FILETYPE_EEXIST (-100) CVM_IO_FILETYPE_ERR (-1)

CVMInt32 CVMioOpen(const char *name,CVMInt32 openMode, CVMInt32filePerm);

Opens a file descriptor. This function returns anegative error code on error, or if the fileopened is a directory. The return value is anon-negative integer that is the file descriptoron success. Valid values are: CVM_IO_FILETYPE_REGULAR (0) CVM_IO_FILETYPE_DIRECTORY (1) CVM_IO_FILETYPE_OTHER (2) CVM_IO_FILETYPE_EEXIST (-100) CVM_IO_FILETYPE_ERR (-1)

CVMInt32 CVMioClose(CVMInt32 fd); Closes a file descriptor fd. This functionreturns -1 on error, and 0 on success.

14 of 27

HPI Reference

Page 55: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMInt64 CVMioSeek(CVMInt32 fd,CVMInt64 offset, CVMInt32 whence);

Moves the file pointer to where the next readfrom the file will come from. fd -- the file pointer to move. offset -- the number of bytes to move the filepointer by. whence -- the start from where to move thefile pointer.

CVMInt32 CVMioSetLength(CVMInt32 fd,CVMInt64 length);

Sets the length of the file associated with thegiven descriptor to the given length. If the newlength is longer than the current length, thenthe file is extended; the contents of theextended portion are not defined. fd -- the file descriptor. length -- the new file length.

CVMInt32 CVMioSync(CVMInt32 fd); Synchronizes the file descriptor's in memorystate with that of the physical device. Returns-1 on error, 0 for success. fd - the file descriptor.

CVMInt32 CVMioAvailable(CVMInt32 fd,CVMInt64 *bytes);

Returns the number of bytes available forreading from a given file descriptor. fd -- the file descriptor. bytes -- the number of bytes to read.

size_t CVMioRead(CVMInt32 fd, void*buf, CVMUint32 nBytes);

Reads data from a file descriptor into anuntyped buffer. This function returns -1 onerror, 0 on success. fd -- the file descriptor to read from. buf -- the buffer to put the data into. nbytes -- the number of bytes to read.

size_t CVMioWrite(CVMInt32 fd, constvoid *buf, CVMUint32 nBytes);

Writes data from the specified buffer to a filedescriptor. This function returns -1 on error, 0on success. fd -- the file descriptor to write to. buf -- the buffer to fetch the data. nbytes -- the number of bytes to write.

CVMInt32 CVMioFileSizeFD(CVMInt32fd, CVMInt64 *size);

Returns the file size in bytes. fd -- the file descriptor. bytes -- the number of bytes.

jni.h

The file src/share/javavm/include/porting/jni.h specifies the following definitionrequirements.

15 of 27

HPI Reference

Page 56: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

CVMInt32 CVMjniInvokeNative(void *env,void *nativeCode, CVMUint32 *args,CVMUint32 *terseSig, CVMInt32 argsSize,void *classObject, CVMJNIReturnValue*returnValue);

Translates the "Java" calling conventioninto the "C" calling convention used innative methods. The Java VM passes allthe arguments in the Java stack, and placesthe results there as well. Arguments arecopied into the C stack (or registers), andreturn values are placed into theCVMJNIReturnValue structure pointed toby "returnValue". Upon return, the JavaVM copies the result from there to theJava stack.

Arguments

The following table describes the CVMjniInvokeNative arguments.

Argument Description

env Pointer to the JNI environment, which should be passed unmodified as the firstargument to the native method.

nativeCode Pointer to the "real" native method function.

args Pointer to the Java stack, where all the arguments are stored (as args[0],args[1], etc.). The Java stack slot for a single-word integer and float argumentscan be read as a jint and jfloat, respectively, and passed to the native methodunchanged. For double-word arguments, a jlong or jdouble value should beread from the current two stack slots using the same method asCVMjvm2Long and CVMjvm2Double, respectively. For an object argument, aNULL (0) value should be passed if the stack slot contains 0, otherwise theaddress of the stack slot should be passed as a jobject to the native method.

terseSig The encoded "terse" signature of the native method. It contains 32-bit wordscontaining 8 4-bit nibbles each. Each nibble contains a signature parsing codeor the type code of an argument in the native method signature:

0x00 RELOAD 0x01 END 0x02 void ("V") (never seen in an argument, only in a return value) 0x03 int ("I") 0x04 short ("S") 0x05 char ("C") 0x06 long ("J") 0x07 byte ("B") 0x08 float ("F")

16 of 27

HPI Reference

Page 57: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

0x09 double ("D") 0x0A boolean ("Z") 0x0B object ("Z")

The return type comes first, then the arguments, followed by an END code.Nibbles are read from the least-significant bits of the word first. Mostsignatures fit in a single word. For longer signatures, multiple words are used.A RELOAD nibble is used as an escape code to signal that the next word is apointer to a new terse signature word, which allows chaining of words forlonger signatures.

argsSize The total size (in 32-bit words) of the arguments on the Java stack. Note thatthe Java stack does not have any alignment requirement, and stores allarguments consecutively in words and double words. The argument sizeincludes the "this" pointer for non-static methods.

classObject NULL (0) for non-static methods, or a jclass for static methods. Non-staticnative methods receive an object reference as the second argument (which issimply the address of args[0]). The "real" method arguments to non-staticmethods begin at args[1]. Static native methods receive a class reference("classObject") as the second argument.

returnValue The return value of the native method is placed in returnValue->i forword-sized results, or returnValue->64 for double-word-sized results,according to the following values:

jdouble - CVMdouble2Jvm to returnValue->64 jlong - CVMlong2Jvm to returnValue->64 jint - copy to returnValue->i jbyte - CVMbyte2Int to returnValue->i jchar - CVMchar2Int to returnValue->i jshort - CVMshort2Int to returnValue->i jfloat - CVMfloat2Int to returnValue->f jobject - CVMobject2Int to returnValue->o

Return Value

The CVMJNIReturnValue union is used to return the JNI method result. It is passed toCVMjniInvokeNative, which stores the result in the union after the Java method returns toCVMjniInvokeNative.

typedef union { CVMInt32 i; CVMJavaFloat f; CVMUint32 v64[2]; void *o;} CVMJNIReturnValue;

Function return value

The return value of CVMjniInvokeNative is:

17 of 27

HPI Reference

Page 58: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

0 if the native method returns void 1 if the native method returns a word 2 if the native method returns a double word -1 if the native method returns an object.

linker.h

The file src/share/javavm/include/porting/linker.h specifies the following definitionrequirements.

These routines look very similar to the dynamic linking facilities on Solaris. However, onVxWorks, there is currently no notion of a local symbol table. Therefore, symbol lookup isslow on VxWorks as we have to iterate through the entire system symbol table every time. Itis required by the Java libraries that sit above these routines that a notion of local symbolnamespaces be maintained.

On VxWorks, these routines require three libraries to be built into your project if they arenot already:

loadLib moduleLib symLib

Declaration Description

void * CVMdynlinkOpen(const void*absolutePathName);

Dynamically links in a shared object. Thistakes a platform-dependent, absolutepathname to the shared object. Calling codeis responsible for constructing this name.

Returns an abstract "handle" to the sharedobject which must be used for later symbolqueries, or NULL if an error occurred.

void * CVMdynlinkSym(void *dsoHandle,const void *name);

Finds a function or data pointer in analready-opened shared object. Takes thedynamic shared object handle and aplatform-dependent symbol as an argument(typically, but not always, a char*). Onsystems that support it, this can be a globalsymbol table lookup; otherwise an internallist of shared objects will have to be searchedfor the symbol. This function is alsoresponsible for adding any necessary"decorations" to the symbol name beforedoing the lookup.

18 of 27

HPI Reference

Page 59: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

void * CVMdynlinkClose(void*dsoHandle);

Closes a dynamic shared object. This shouldprobably have the semantics that its symbolsare unloaded, but VxWorks, at least, doesn'tcurrently appear to have a module unloadingfacility. This function takes the dynamicshared object handle from CVMdynlinkOpen.

CVMBool CVMdynlinkBuildLibName(void*holder, int holderlen, void *pname,void *fname);

This is a Java-specific function that creates astring for the dynamic lib open call by addingthe appropriate prefixs and extensions to afilename and the path. holder - the destination buffer holderlen - the buffer size in bytes pname - the directory prefix or NULL fname - the "base name" of the library.

For example,CVMdynlinkBuildLibName(buf, bufLen,"foo", "bar") might result in a library name of"foo/libbar.so".

All buffers are of a platform-specific datatype, but are typically char*. ReturnsCVM_FALSE if the holder buffer is not bigenough.

net.h

The file src/share/javavm/include/porting/net.h specifies the following definitionrequirements.

Data types

struct sockaddr;struct protoent *CVMnetGetProtoByName(char *protoName);

Functions

Declaration Description

CVMInt32 CVMnetSocketClose(CVMInt32fd);

Closes the socket associated with the filedescriptor. Corresponds to X/Open "close".

CVMInt32CVMnetSocketShutdown(CVMInt32 fd,CVMInt32 howto);

Shuts down either the send, receive, or bothsides of a socket, based on the value of howto.Corresponds to X/Open "shutdown".

19 of 27

HPI Reference

Page 60: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMInt32CVMnetSocketAvailable(CVMInt32 fd,CVMInt32 *pbytes);

Gets the number of bytes available for thegiven socket for reading and stores the resultinto the value pointed to by the secondargument. The result should satisfy therequirements ofjava.net.SocketInputStream.available().

CVMInt32 CVMnetConnect(CVMInt32 fd,struct sockaddr *him, CVMInt32 len);

Corresponds to X/Open "connect" in<sys/socket.h>.

CVMInt32 CVMnetAccept(CVMInt32 fd,struct sockaddr *him, CVMInt32*len);

Corresponds to X/Open "accept" in<sys/socket.h>.

CVMInt32 CVMnetSendTo(CVMInt32 fd,char *buf, CVMInt32 len, CVMInt32flags, struct sockaddr *to, CVMInt32tolen);

Corresponds to X/Open "sendto" in<sys/socket.h>.

CVMInt32 CVMnetRecvFrom(CVMInt32 fd,char *buf, CVMInt32 nBytes, CVMInt32flags, struct sockaddr *from,CVMInt32 *fromlen);

Corresponds to X/Open "recvfrom" in<sys/socket.h>.

CVMInt32 CVMnetListen(CVMInt32 fd,CVMInt32 count);

Corresponds to X/Open "listen" in<sys/socket.h>.

CVMInt32 CVMnetRecv(CVMInt32 fd,char *buf, CVMInt32 nBytes, CVMInt32flags);

Corresponds to X/Open "recv" in<sys/socket.h>.

CVMInt32 CVMnetSend(CVMInt32 fd,char *buf, CVMInt32 nBytes, CVMInt32flags);

Corresponds to X/Open "send" in<sys/socket.h>.

CVMInt32 CVMnetTimeout(CVMInt32 fd,CVMInt32 timeout);

Used to timeout blocking operations, asdefined byjava.net.SocketOptions.SO_TIMEOUT.Returns immediately if an "accept", "recv", or"recvfrom" operation would succeed withoutblocking. Otherwise blocks for up to "timeout"milliseconds.

Corresponds to X/Open "poll" in<sys/socket.h> with the "POLLIN" flag set.

CVMInt32 CVMnetSocket(CVMInt32domain, CVMInt32 type, CVMInt32protocol);

Corresponds to X/Open "socket" in<sys/socket.h>.

CVMInt32 CVMnetSetSockOpt(CVMInt32fd, CVMInt32 type, CVMInt32 dir,const void *arg, CVMInt32 argSize);

Corresponds to X/Open "setsockopt" in<sys/socket.h>.

20 of 27

HPI Reference

Page 61: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMInt32 CVMnetGetSockOpt(CVMInt32fd, CVMInt32 proto, CVMInt32 flag,void *in_addr, CVMInt32 *inSize);

Corresponds to X/Open "getsockopt" in<sys/socket.h>.

CVMInt32 CVMnetGetSockName(CVMInt32fd, struct sockaddr *lclAddr,CVMInt32 *lclSize);

Corresponds to X/Open "getsockname" in<sys/socket.h>.

CVMInt32 CVMnetGetHostName(char*hostname, CVMInt32 maxlen);

Corresponds to X/Open "gethostname" in<sys/socket.h>.

CVMInt32 CVMnetBind(CVMInt32 fd,struct sockaddr *bindAddr, CVMInt32size);

Corresponds to X/Open "bind" in<sys/socket.h>.

path.h

The file src/share/javavm/include/porting/path.h specifies the following definitionrequirements.

Macros

Declaration Description

CVM_PATH_CLASSFILEEXT Usually "class".

CVM_PATH_CLASSPATH_SEPARATOR Usually ":".

CVM_PATH_CURDIR Usually ".".

CVM_PATH_LOCAL_DIR_SEPARATOR Usually "/".

CVM_PATH_MAXLEN Usually the same as PATH_MAX.

Function

Declaration Description

extern int CVMcanonicalize(char*

path, const char* out, int len);

Changes path to its canonical or simplestexplicit form, and places the result in out. Forexample, this function replaces notation such as"../" in the path name with the explicit path.You can use this function to standardize twopaths before comparing them.

sync.h

The file src/share/javavm/include/porting/sync.h specifies the following definition

21 of 27

HPI Reference

Page 62: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

requirements.

Defines

The platform defines the CVM_MICROLOCK_TYPE variable to be one of the followingvalues:

CVM_MICROLOCK_DEFAULT = -1 CVM_MICROLOCK_SCHEDLOCK = 1

The platform defines the CVM_FASTLOCK_TYPE variable to be one of the following:

CVM_FASTLOCK_NONE = -1 CVM_FASTLOCK_ATOMICOPS = 1 CVM_FASTLOCK_MICROLOCK = 3

The platform must provide definitions for the following opaque structures:

struct CVMMutex struct CVMCondVar

Functions

Declaration Description

extern void CVMmutexSetOwner(CVMThreadID

*self, CVMMutex* m, CVMThreadID *ti);

Locks and unlocks the mutex on behalfof another thread. The result is identicalto the thread having calledCVMmutexLock itself.

extern void CVMschedLock(void); Locks the scheduler. The current threadwill remain running and no other threadsin this VM instance can become runnableuntil the scheduler lock is released.

extern void CVMschedUnlock(void); Releases the scheduler lock acquired byCVMschedLock. Normal threadscheduling will resume.

CVMBool CVMmutexInit(CVMMutex *m); Initializes the given CVMMutex,allocating additional resources ifnecessary.

void CVMmutexDestroy(CVMMutex *m); Destroys the given CVMMutex,releasing any resources that werepreviously allocated by CVMMutexInit.

CVMBool CVMmutexTryLock(CVMMutex *m); Attempts to acquire a lock for the givenmutex. This call must return immediately

22 of 27

HPI Reference

Page 63: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

and never block. CVM_TRUE isreturned if the lock was acquired,Otherwise CVM_FALSE is returned.

void CVMmutLock(CVMMutex *m); Acquires a lock for the given mutex.This call may block. A thread will neverattempt to acquire the same mutex morethan once, so a counter to keep track ofrecursive entry is not required.

void CVMmutexUnlock(CVMMutex *m); Releases a lock previously acquired byCVMMutexLock.

void CVMmutexSetOwner(CVMThreadId *self,CVMMutex *m, CVMThreadID *ti);

Locks an unlocked mutex on behalf ofanother thread. The result will beidentical to the thread having calledCVMMutexLock itself.

CVMBool CVMcondvarInit(CVMCondVar *c,CVMMutex *m);

Initializes the given CVMCondVar,allocating additional resources ifnecessary. The CVMMutex that will beused by any future calls toCVMcondvarWait is also provided, forthose platforms that require the mutexfor proper condition variableinitialization.

void CVMcondvarDestroy(CVMCondVar *c); Destroys the given CVMCondVar,releasing any resources that werepreviously allocated byCVMcondvarInit.

CVMBool CVMcondvarWait(CVMCondVar* c,CVMMutex *m, CVMJavaLong millis);

Performs a timed wait on a conditionvariable. The mutex is unlocked whilethe thread blocks and locked again whenit wakes up. CVM_FALSE is returned ifthe operation is interrupted byCVMthreadInterruptWait. This functionis used to implement Object.wait,therefore the atomicity of unlocking thelock and checking for notification or aninterrupt must follow the rules describedby Object.wait. A timeout of 0 ms istreated as infinity, or "wait forever".

void CVMcondvarNotify(CVMCondVar *c); Wakes up a thread waiting on the givenCVMCondVar, as defined by thesemantics of Object.notify.

void CVMcondvarNotifyAll(CVMCondVar *c); Wakes up all threads waiting on the

23 of 27

HPI Reference

Page 64: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

given CVMCondVar, as defined by thesemantics of Object.notifyAll.

Advanced Functions

See "Advanced Platform Features" for information on when it is necessary to implement thefollowing functions.

Declaration Description

void CVMschedLock(void); Locks the scheduler. The currentthread will remain running and noother threads in this VM instancecan become runnable until thescheduler lock is released.

void CVMschedUnlock(void); Releases the scheduler lockacquired by CVMschedLock.Normal thread scheduling willresume.

CVMint32 CVMatomicCompareAndSwap(volatileCVMUint32 *addr, CVMUint32 new, CVMUint32old);

Sets a word (conditionally) inmemory, returning the previousvalue. The new value "new" iswritten to address "addr" only ifthe current value matches the valuegiven by "old".

CVMint32 CVMatomicSwap(volatile CVMUint32*addr, CVMUint32 new);

Atomically sets a word in memory,returning the previous value.

CVMUint32 CVMatomicIncrement(CVMUint32*addr);

Atomically increments a word inmemory, returning the new value.

CVMUint32 CVMatomicDecrement(CVMUint32*addr);

Atomically decrements a word inmemory, returning the new value.

system.h

The file src/share/javavm/include/porting/system.h specifies the following definitionrequirement.

24 of 27

HPI Reference

Page 65: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

void CVMhalt(CVMInt32status);

Forcibly terminate the VM with the given status, asdefined by java.lang.Runtime.halt(). The functionshould never return.

void CVMSystemPanic(constchar *msg);

Something bad has happened, even in a non-debugVM. Prints the specified msg on an appropriate consoleand halts the computation in a system-dependentmanner. It may cause either a core dump or asuspended thread. If CVM_DEBUG is defined, thencall CVMassertHookfirst for ease of debuging.

threads.h

A reference implementation of thread functions, based on the POSIX threads library, isprovided in src/porting/posix/posix_threads_md.c.

The file src/share/javavm/include/porting/threads.h specifies the followingdefinition requirements.

Macros

The platform must provide definitions for the following opaque structure:

struct CVMThreadID -- Uniquely identifies a thread.

Functions

Declaration Description

CVMInt32 CVMthreadCreate(CVMSizestackSize, CVMInt16 priority, void(*func)(void *), void *arg);

Creates a new, runnable thread withthe given Java language priority and Cstack size. The new thread must callfunc(arg) upon creation and clean upafter itself and exit when func()returns.

void CVMthreadYield(void); Yields to other threads, as defined byThread.yield().

void CVMthreadSetPriority(CVMThreadID*thread, CVMInt32 prio);

Sets the priority of a thread to thegiven value, mapping the Javalanguage priority to an appropriatevalue.

25 of 27

HPI Reference

Page 66: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

void CVMthreadSuspend(CVMThreadID*thread);

Suspends a thread, according to thesemantics of Thread.suspend()(which has been deprecated) orJVMDI SuspendThread().

void CVMthreadResume(CVMThreadID *thread); Resumes a suspended thread,according to the semantics ofThread.resume() (which has beendeprecated) or JVMDISuspendThread().

void CVMthreadAttach(CVMThreadID *self); Associates a CVMThreadID pointerwith the current thread.

void CVMthreadDetach(CVMThreadID *self); Removes the CVMThreadID pointerfrom the current thread.

CVMThreadID * CVMthreadSelf(void); Returns the CVMThreadID pointerpreviously associated with the currentthread by CVMthreadAttach, orNULL if CVMthreadAttach has notbeen called yet or CVMthreadDetachhas been called.

void CVMthreadInterruptWait(CVMThreadID*thread);

Breaks the given thread out of aCVMcondvarWait call, causing that callto return CVM_FALSE, signaling thatthe wait was interrupted. If the giventhread is not currently inCVMcondvarWait, the request isremembered until CVMcondvarWait iscalled, which immediately returnCVM_FALSE.

CVMBool CVMthreadIsInterrupted(CVMThreadID*thread, CVMBool clearInterrupted);

Returns the current interrupted statefor the thread. If clearInterruptedis true, cancel any previous interruptrequests made byCVMthreadInterruptWait. Note: Currently, we only setclearInterrupted when thread isthe current thread.

CVMBool CVMthreadStackCheck(CVMThreadID*self, CVMUint32 redZone);

Checks for a stack overflow. ReturnsCVM_TRUE if the stack of thecurrent thread has at least redZonebytes free, CVM_FALSE otherwise.

time.h

26 of 27

HPI Reference

Page 67: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The file src/share/javavm/include/porting/time.h specifies the following definitionrequirement.

Declaration Description

CVMInt64 CVMtimeMillis(void); Returns the current time in milliseconds, as defined bySystem.currentTimeMillis.

vm-defs.h

The file src/share/javavm/include/porting/vm-defs.h specifies the followingdefinition requirements.

The following macros are defined for convenience:

#define CVM_STRUCT_TYPEDEF(structName) typedef struct structName structName #define CVM_UNION_TYPEDEF(structName) typedef union structName structName #define CVM_ENUM_TYPEDEF(structName) typedef enum structName structName

The following are C types corresponding to Java types:

typedef CVMInt8 CVMJavaByte; typedef CVMInt16 CVMJavaShort; typedef CVMUint16 CVMJavaChar; typedef CVMUint8 CVMJavaBoolean; typedef CVMInt32 CVMJavaInt; typedef CVMfloat32 CVMJavaFloat; typedef CVMInt64 CVMJavaLong; typedef CVMfloat64 CVMJavaDouble;

Forward declarations defined by the porting layer:

CVM_STRUCT_TYPEDEF(CVMMutex); CVM_STRUCT_TYPEDEF(CVMCondVar); CVM_STRUCT_TYPEDEF(CVMThreadID); CVM_STRUCT_TYPEDEF(CVMTargetGlobalState);

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

27 of 27

HPI Reference

Page 68: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

C Stack CheckThis chapter describes how the system robustness against a tight C stack situation can be achieved byperforming static analysis of C stack usage and introducing dynamic stack checks in CVM.

Contents

Introduction Calculating C Stack Redzones in CVM

C Stack Redzone Check in CVM C Stack Redzone Values

Worst Cases of Stack Usage Chains Worst C Stack Usage Chain in Interpreter Loop Worst C Stack Usage Chain in CVMimplementsInterface Routine Worst C Stack Usage Chain in Class Loader at Class Lookup Worst C Stack Usage Chain in Class Link Worst C Stack Usage Chain in Formatting a String from the PC for a Console Print Out Worst C Stack Usage Chain in Formatting a String of Object from a Class and Hash Value Worst C Stack Usage Chain in Class Verifier Worst C Stack Usage Chain in Signaling an Exception Routine

IntroductionBecause CVM is targeted for devices that have less memory available and for OSs that donot have MMU support, the C stack usage in CVM is taken into account to avoid a stackoverrun caused by recursive operations, such as the bytecode interpreter loop, class loading,and class verifier.

To avoid this problem, CVM cannot take the same approach as the JDK, in which largememory area is reserved for the C stack. To ensure system robustness against C stackoverflow situations caused by tight C stacks, an extensive static analysis of the C codes inCVM and the supporting libraries is performed. A dynamic C stack check is introduced atthe points where recursive function calls can happen.

As a result, CVM guarantees that a C stack overflow failure is detected so that aStackOverflowError is thrown when a C stack check notifies that insufficient C stack spaceis available and a potential memory corruption caused by C stack overflow is eliminated.

CVM C codes are statically analyzed to identify where recursive call cycles occur, eliminatecall cycles as much as possible, and sum up stack use in any given call cycles. As a result, the

1 of 30

C Stack Check

Page 69: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

worst case of stack usage required by the recursive function calls is used by a redzone checkin the C stack check routine. The worst case of stack usage is called "stack redzone" and theC stack check routine is called CVMCstackCheckSize. The C stack check codes on a cycledetermine whether another invocation of the cycle can continue execution with sufficient Cstack size left. This redzone (worst case of stack usage) size is used to find out the availablestack size for next function invocation in the cycle at execution time. When the C stack isinsufficient to continue execution, CVM throws a StackOverflowError.

Calculating C Stack Redzones in CVMThe CVM stack usage is statically analyzed to identify the recursive functions and calculatethe worst case C stack redzone values for each recursive function. All CVM programswritten in C are first compiled into platform-specific assembly codes by the GNU Ccompiler. All indirect function calls, such as JNI function invocation through the functionpointers and other function invocations through function pointers in CVM programs, areresolved and mapped into direct function calls to assist the static stack analysis. The mappinginformation that maps an indirect function call to a direct function call in CVM programs canbe found in Appendix A and the mapping information that maps an indirect function call to aJNI function call can be found in Appendix B.

Note: In stublist, a function named CVM_worst_case_psuedo_method is a link betweenCVMjniInvokeNative and all of the JNI functions in the JNI vector table and the JVMDIvector table. It is also a link between ansiJavaMain and all of the JNI functions defined inthe JNI vector table for the code outside the VM calling into JNI functions. The worse casestack usage for a JNI call cycle from calling CVM_worst_case_psuedo_method to a JNI callis assumed to be 3K bytes, and the same is true for all call cycles that end with OS and Clibrary functions.

There are nine functions that have recursive invocation paths:

(1) CVMgcUnsafeExecuteJavaMethod (2) CVMimplementsInterface (3) classlookup:CVMclassLookupFromClassLoader (4) CVMclassLink (5) utils:CVMCstackDummy2CVMformatStringVaList (6) utils:CVMCstackDummy2CVMconsolePrintf (7) utils:CVMCstackDummy2CVMobjectGetHashSafe (8) verifycode:CVMCstackDummy2merge_fullinfo_types (9) CVMsignalErrorVaLisT

Three recursions occurring in the function CVMformatStringVaList from file utils.cdetected by the static stack analysis have at most one-level deep recursion which terminatesitself at the second invocation of CVMformatStringVaList. To obtain an accurate stack sizerequired to invoke CVMformatStringVaList another time, a dummy function is temporarilycreated for each recursion and is called at the place that needs to check stack overflowbefore going into the loop to terminate itself. Once the stack requirement is obtained by thestatic stack analysis, each dummy function invocation is removed and a runtime C stackcheck is added in the place that invokes the dummy function. There is only one C stackcheck for detecting the available stack size before callingutils:CVMCstackDummy2CVMconsolePrintf andutils:CVMCstackDummy2CVMobjectGetHashSafe. The three dummy functions are

2 of 30

C Stack Check

Page 70: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

statically defined in utils.c and are invoked in CVMformatStringVaList as below:

(1) utils:CVMCstackDummy2CVMformatStringVaList (2) utils:CVMCstackDummy2CVMconsolePrintf (3) utils:CVMCstackDummy2CVMobjectGetHashSafe

The self recursive invocation of merge_fullinfo_types in file verifycode.c has at mostone-level deep recursion. A dummy function calledCVMCstackDummy2merge_fullinfo_types is temporarily created and invoked at the placethat needs to check stack overflow before entering the loop and terminating itself in that callpath so that the stack redzone can be calculated accurately. Once the stack requirement isobtained by the static stack analysis, this dummy function invocation is removed and aruntime C stack check is added in the place that invokes the dummy function. The dummyfunction is statically defined in file verifycode.c and is invoked in merge_fullinfo_types asbelow:

(1) verifycode:CVMCstackDummy2merge_fullinfo_types

C Stack Redzone Checks in CVM

Once the nine recursive functions are identified by the stack analysis, eight stack redzonevalues are calculated based on the given function call path of each recursion that consumesthe most stack usage. The C stack redzone values are used by the C stack check routines inCVM to detect a C stack overflow failure before making a recursive function invocation.The following table shows each C stack redzone macro used by the C stack check in itscorresponding recursive function.

CVM-Function C-Stack-Redzone-Macro------------------------------------------------------------------------------------CVMgcUnsafeExecuteJavaMethod CVM_REDZONE_ILOOPCVMimplementsInterface CVM_REDZONE_CVMimplementsInterfaceCVMformatStringVaList CVM_REDZONE_CVMCstackCVMpc2stringCVMformatStringVaList CVM_REDZONE_CVMCstackCVMID_objectGetClassAndHashSafe CVMclassLookupFromClassLoader CVM_REDZONE_CVMclassLookupFromClassLoader CVMclassLink CVM_REDZONE_CVMclassLink merge_fullinfo_to_types CVM_REDZONE_CVMCstackmerge_fullinfo_to_types

The following macros are used in C stack check codes for various recursive functions.

3 of 30

C Stack Check

Page 71: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Declaration Description

CVM_REDZONE_ILOOP Stack space required for interpreter loopin CVMgcUnsafeExecuteJavaMethod().

CVM_REDZONE_CVMclassLookupFromClassLoader Stack space required for class loading ina deep class lookup hierarchy inCVMclassLookupFromClassLoader().

CVM_REDZONE_CVMclassLink Stack space required for class linking inCVMclassLink().

CVM_REDZONE_CVMclassScan Stack space required for traversing thescannable state of one class by thegarbage collector in CVMclassScan().

CVM_REDZONE_CVMimplementsInterface Stack space required for checkingwhether a non-array class is an interfacetype class inCVMimplementsInterface().

CVM_REDZONE_CVMCstackCVMpc2string Stack space required for building aformatted string %P format of PCinformation for console I/O inCVMformatStringVaList().

CVM_REDZONE_CVMCstackCVMID_ objectGetClassAndHashSafe

Stack space required for building aformatted string %I format of class nameinformation for console I/O inCVMformatStringVaList().

CVM_REDZONE_CVMCstackmerge_ fullinfo_to_types

Stack space required for class verifier todo type merging between two objecttypes or two arrays of object types inmerge_fullinfo_types().

CVM_REDZONE_CVMsignalErrorVaList Stack space required for signaling anexception in CVMsignalErrorVaList().

Recursive functions

Recursive functions that have a C stack check are listed below:

CVMgcUnsafeExecuteJavaMethod CVMclassLookupFromClassLoader CVMclassLink CVMclassScan CVMimplementsInterface CVMformatStringVaList

4 of 30

C Stack Check

Page 72: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMsignalErrorVaList merge_fullinfo_types

C Stack Redzone Values

There are eight stack redzones used by the stack check routines in CVM as below:

C-Stack-Redzone-Macro Stack-Redzone-Value----------------------------------------------------------------------------CVM_REDZONE_ILOOP 11592 (11.32K bytes)CVM_REDZONE_CVMimplementsInterface 4752 ( 5.14K bytes)CVM_REDZONE_CVMCstackCVMpc2string 4752 ( 5.14K bytes)CVM_REDZONE_CVMCstackCVMID_objectGetClassAndHashSafe 5392 ( 5.27K bytes)CVM_REDZONE_CVMclassLookupFromClassLoader 13500 (13.18K bytes)CVM_REDZONE_CVMclassLink 7456 ( 7.28K bytes)CVM_REDZONE_CVMCstackmerge_fullinfo_to_types 5800 ( 5.66K bytes)CVM_REDZONE_CVMsignalErrorVaList 8400 ( 8.20K bytes)

Worst Cases of Stack Usage ChainsThe worst cases of stack usage chains that are used to calculate the stack redzones can varygreatly on different platforms. SPARC, a RISC platform, uses a minimum 112 bytes of frameallocation in a frame even if no local variables are declared (in some special case, codeoptimizer can make this 0). Whereas, many CISC platforms would only use less stack spacein this case. Therefore, stack usage calculated based on SPARC code tend to be larger thanCISC platforms.

The worst stack usage chain that contains the stack size of each function and theaccumulated stack size of the call path is not necessarily one of the recursive paths. It can bea stack trace of calling a recursive function and terminating at an OS or C library function, astack trace of calling a recursive function and terminating at a CVM function that ends itself,or a stack trace of calling a self-recursive function. The static stack analysis checks all thecall paths and comes out with the worst stack usage of each recursive function call cycle. Allthe worst C stack usage call chains provided in this documentation terminate at a libraryfunction strncpy.

The static stack analysis looks into the worst case of the stack usage chain of each recursivefunction cycle and identifies several functions that use more stack frame space than otherfunctions occurring in the stack usage chain. The functions that consume a large chunk ofstack space are optimized by replacing the static allocation of locals with a dynamicallyallocated and shared buffer to reduce the stack usage of the frame allocation. Otheroptimizations summarized by the static stack analysis include removing a recursion or apotentially infinite recursion out of the recursive functions to reduce the stack space usage.

Listed below are the worst stack usage chains. They trace the function call paths that mostconsume the stack in each recursive function. In the lists, the first number is the accumulatedstack usage in bytes to execute functions from the bottom up to the point that excludes thestack size of the current function specified in the same line. The second number is the stackframe size of the function following the second colon.

5 of 30

C Stack Check

Page 73: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The worst stack usage chains are: Interpreter Loop Implement Interface Class Lookup in Class Loader Class Link Format String from PC Format String from Object Class Verifier Signal Exception Message

Worst C Stack Usage Chain in Interpreter Loop

Some worst cases of stack consumption occurring in the interpreter loop that have a call path fromCVMgcUnsafeExecuteJavaMethod to a C library function such as strncpy are given below.

> stacktrace CVMgcUnsafeExecuteJavaMethod strncpy 8848 : 328 : CVMgcUnsafeExecuteJavaMethod 8520 : 112 : CVMjniInvokeNative 8408 : 3072 : CVM_worst_case_psuedo_method 5336 : 128 : CVMjniToReflectedMethod 5208 : 112 : CVMreflectMethodBlockToNewJavaMethod 5096 : 224 : CVMreflectNewJavaLangReflectMethod 4872 : 376 : CVMnewStringUTF 4496 : 144 : CVMnewString 4352 : 136 : CVMgcAllocNewInstance 4216 : 128 : CVMjniCallStaticVoidMethod 4088 : 184 : jni_impl:CVMjniInvoke 3904 : 136 : CVMjniExceptionDescribe 3768 : 112 : CVMjniGetMethodID 3656 : 136 : jni_impl:CVMjniGetXMethodID 3520 : 112 : CVMclassInit 3408 : 128 : classinitialize:CVMprivateClassInit 3280 : 128 : CVMjniCallVoidMethod 3152 : 184 : jni_impl:CVMjniInvoke 2968 : 136 : CVMjniExceptionDescribe 2832 : 112 : CVMjniGetMethodID 2720 : 136 : jni_impl:CVMjniGetXMethodID 2584 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2456 : 240 : typeid:referenceMethodSignature 2216 : 144 : typeid:referenceFieldSignature 2072 : 120 : typeid:referenceClassName 1952 : 144 : typeid:lookupClass 1808 : 120 : typeid:findFreeScalarEntry 1688 : 136 : typeid:findFreeTableEntry 1552 : 120 : typeid:unlockThrowOutOfMemoryError 1432 : 112 : CVMsysMutexUnlock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace CVMgcUnsafeExecuteJavaMethod .umul 8744 : 328 : CVMgcUnsafeExecuteJavaMethod 8416 : 112 : CVMjniInvokeNative

6 of 30

C Stack Check

Page 74: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

8304 : 3072 : CVM_worst_case_psuedo_method 5232 : 128 : CVMjniToReflectedMethod 5104 : 112 : CVMreflectMethodBlockToNewJavaMethod 4992 : 224 : CVMreflectNewJavaLangReflectMethod 4768 : 376 : CVMnewStringUTF 4392 : 144 : CVMnewString 4248 : 136 : CVMgcAllocNewInstance 4112 : 128 : CVMjniCallStaticVoidMethod 3984 : 184 : jni_impl:CVMjniInvoke 3800 : 136 : CVMjniExceptionDescribe 3664 : 112 : CVMjniGetMethodID 3552 : 136 : jni_impl:CVMjniGetXMethodID 3416 : 112 : CVMclassInit 3304 : 128 : classinitialize:CVMprivateClassInit 3176 : 128 : CVMjniCallVoidMethod 3048 : 184 : jni_impl:CVMjniInvoke 2864 : 136 : CVMjniExceptionDescribe 2728 : 112 : CVMjniGetMethodID 2616 : 136 : jni_impl:CVMjniGetXMethodID 2480 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2352 : 240 : typeid:referenceMethodSignature 2112 : 144 : typeid:referenceFieldSignature 1968 : 120 : typeid:referenceClassName 1848 : 144 : typeid:lookupClass 1704 : 120 : typeid:findFreeScalarEntry 1584 : 136 : typeid:findFreeTableEntry 1448 : 120 : typeid:unlockThrowOutOfMemoryError 1328 : 112 : CVMsysMutexUnlock 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace CVMgcUnsafeExecuteJavaMethod strlen 8728 : 328 : CVMgcUnsafeExecuteJavaMethod 8400 : 112 : CVMjniInvokeNative 8288 : 3072 : CVM_worst_case_psuedo_method 5216 : 128 : CVMjniToReflectedMethod 5088 : 112 : CVMreflectMethodBlockToNewJavaMethod 4976 : 224 : CVMreflectNewJavaLangReflectMethod 4752 : 376 : CVMnewStringUTF 4376 : 144 : CVMnewString 4232 : 136 : CVMgcAllocNewInstance 4096 : 128 : CVMjniCallStaticVoidMethod 3968 : 184 : jni_impl:CVMjniInvoke 3784 : 136 : CVMjniExceptionDescribe 3648 : 112 : CVMjniGetMethodID 3536 : 136 : jni_impl:CVMjniGetXMethodID 3400 : 112 : CVMclassInit 3288 : 128 : classinitialize:CVMprivateClassInit 3160 : 128 : CVMjniCallVoidMethod 3032 : 184 : jni_impl:CVMjniInvoke 2848 : 136 : CVMjniExceptionDescribe 2712 : 112 : CVMjniGetMethodID 2600 : 136 : jni_impl:CVMjniGetXMethodID 2464 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2336 : 240 : typeid:referenceMethodSignature 2096 : 144 : typeid:referenceFieldSignature 1952 : 120 : typeid:referenceClassName 1832 : 144 : typeid:lookupClass

7 of 30

C Stack Check

Page 75: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

1688 : 120 : typeid:findFreeScalarEntry 1568 : 136 : typeid:findFreeTableEntry 1432 : 120 : typeid:unlockThrowOutOfMemoryError 1312 : 112 : CVMsysMutexUnlock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace CVMgcUnsafeExecuteJavaMethod free 8320 : 328 : CVMgcUnsafeExecuteJavaMethod 7992 : 112 : CVMjniInvokeNative 7880 : 3072 : CVM_worst_case_psuedo_method 4808 : 128 : CVMjniToReflectedMethod 4680 : 112 : CVMreflectMethodBlockToNewJavaMethod 4568 : 224 : CVMreflectNewJavaLangReflectMethod 4344 : 376 : CVMnewStringUTF 3968 : 144 : CVMnewString 3824 : 136 : CVMgcAllocNewInstance 3688 : 128 : CVMjniCallStaticVoidMethod 3560 : 184 : jni_impl:CVMjniInvoke 3376 : 136 : CVMjniExceptionDescribe 3240 : 112 : CVMjniGetMethodID 3128 : 136 : jni_impl:CVMjniGetXMethodID 2992 : 112 : CVMclassInit 2880 : 128 : classinitialize:CVMprivateClassInit 2752 : 128 : CVMjniCallVoidMethod 2624 : 184 : jni_impl:CVMjniInvoke 2440 : 136 : CVMjniExceptionDescribe 2304 : 112 : CVMjniGetMethodID 2192 : 136 : jni_impl:CVMjniGetXMethodID 2056 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1928 : 240 : typeid:referenceMethodSignature 1688 : 144 : typeid:referenceFieldSignature 1544 : 120 : typeid:referenceClassName 1424 : 144 : typeid:lookupClass 1280 : 120 : typeid:findFreeScalarEntry 1160 : 136 : typeid:findFreeTableEntry 1024 : 120 : typeid:unlockThrowOutOfMemoryError 904 : 112 : CVMsysMutexUnlock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace CVMgcUnsafeExecuteJavaMethod sprintf 8208 : 328 : CVMgcUnsafeExecuteJavaMethod 7880 : 112 : CVMjniInvokeNative 7768 : 3072 : CVM_worst_case_psuedo_method 4696 : 128 : CVMjniToReflectedMethod 4568 : 112 : CVMreflectMethodBlockToNewJavaMethod 4456 : 224 : CVMreflectNewJavaLangReflectMethod 4232 : 376 : CVMnewStringUTF 3856 : 144 : CVMnewString 3712 : 136 : CVMgcAllocNewInstance 3576 : 128 : CVMjniCallStaticVoidMethod 3448 : 184 : jni_impl:CVMjniInvoke 3264 : 136 : CVMjniExceptionDescribe 3128 : 112 : CVMjniGetMethodID

8 of 30

C Stack Check

Page 76: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3016 : 136 : jni_impl:CVMjniGetXMethodID 2880 : 112 : CVMclassInit 2768 : 128 : classinitialize:CVMprivateClassInit 2640 : 128 : CVMjniCallVoidMethod 2512 : 184 : jni_impl:CVMjniInvoke 2328 : 136 : CVMjniExceptionDescribe 2192 : 112 : CVMjniGetMethodID 2080 : 136 : jni_impl:CVMjniGetXMethodID 1944 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1816 : 240 : typeid:referenceMethodSignature 1576 : 144 : typeid:referenceFieldSignature 1432 : 120 : typeid:referenceClassName 1312 : 144 : typeid:lookupClass 1168 : 120 : typeid:findFreeScalarEntry 1048 : 136 : typeid:findFreeTableEntry 912 : 120 : typeid:unlockThrowOutOfMemoryError 792 : 112 : CVMsysMutexUnlock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace CVMgcUnsafeExecuteJavaMethod fflush 7904 : 328 : CVMgcUnsafeExecuteJavaMethod 7576 : 112 : CVMjniInvokeNative 7464 : 3072 : CVM_worst_case_psuedo_method 4392 : 128 : CVMjniToReflectedMethod

4264 : 112 : CVMreflectMethodBlockToNewJavaMethod 4152 : 224 : CVMreflectNewJavaLangReflectMethod

3928 : 376 : CVMnewStringUTF 3552 : 144 : CVMnewString 3408 : 136 : CVMgcAllocNewInstance 3272 : 128 : CVMjniCallStaticVoidMethod 3144 : 184 : jni_impl:CVMjniInvoke 2960 : 136 : CVMjniExceptionDescribe 2824 : 112 : CVMjniGetMethodID 2712 : 136 : jni_impl:CVMjniGetXMethodID 2576 : 112 : CVMclassInit 2464 : 128 : classinitialize:CVMprivateClassInit 2336 : 128 : CVMjniCallVoidMethod 2208 : 184 : jni_impl:CVMjniInvoke 2024 : 136 : CVMjniExceptionDescribe 1888 : 112 : CVMjniGetMethodID 1776 : 136 : jni_impl:CVMjniGetXMethodID

1640 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1512 : 240 : typeid:referenceMethodSignature 1272 : 144 : typeid:referenceFieldSignature 1128 : 120 : typeid:referenceClassName 1008 : 144 : typeid:lookupClass 864 : 120 : typeid:findFreeScalarEntry 744 : 136 : typeid:findFreeTableEntry 608 : 120 : typeid:unlockThrowOutOfMemoryError 488 : 112 : CVMsysMutexUnlock 376 : 376 : CVMconsolePrintf 0 : ?(0) : fflush

> stacktrace CVMgcUnsafeExecuteJavaMethod .rem 7424 : 328 : CVMgcUnsafeExecuteJavaMethod 7096 : 112 : CVMjniInvokeNative 6984 : 3072 : CVM_worst_case_psuedo_method

9 of 30

C Stack Check

Page 77: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3912 : 128 : CVMjniToReflectedMethod 3784 : 112 : CVMreflectMethodBlockToNewJavaMethod 3672 : 224 : CVMreflectNewJavaLangReflectMethod 3448 : 376 : CVMnewStringUTF 3072 : 144 : CVMnewString 2928 : 136 : CVMgcAllocNewInstance 2792 : 128 : CVMjniCallStaticVoidMethod 2664 : 184 : jni_impl:CVMjniInvoke 2480 : 136 : CVMjniExceptionDescribe 2344 : 112 : CVMjniGetMethodID 2232 : 136 : jni_impl:CVMjniGetXMethodID 2096 : 112 : CVMclassInit 1984 : 128 : classinitialize:CVMprivateClassInit 1856 : 128 : CVMjniCallVoidMethod 1728 : 184 : jni_impl:CVMjniInvoke 1544 : 136 : CVMjniExceptionDescribe 1408 : 128 : CVMjniGetObjectClass 1280 : 120 : CVMjniNewLocalRef 1160 : 144 : CVMjniCreateLocalRef 1016 : 112 : CVMjniFatalError 904 : 120 : CVMdumpStack 784 : 128 : stacks:CVMdumpFrames 656 : 392 : CVMdumpFrame 264 : 128 : CVMpc2string 136 : 136 : interpreter:CVMadddec 0 : ?(0) : .rem

Worst C Stack Usage Chain in CVMimplementsInterface Routine

Some worst cases of stack consumption occurring in the routine that compares each subclass class blockin the class hierarchy to the interface class block have a call path from CVMimplementsInterface to a Clibrary function such as strncpy.

> stacktrace CVMimplementsInterface strncpy

1800 : 120 : CVMimplementsInterface 1680 : 112 : CVMCstackCheckSize 1568 : 136 : CVMcsRendezvous 1432 : 112 : CVMsysMutexLock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace CVMimplementsInterface .umul 1696 : 120 : CVMimplementsInterface 1576 : 112 : CVMCstackCheckSize 1464 : 136 : CVMcsRendezvous 1328 : 112 : CVMsysMutexLock 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

10 of 30

C Stack Check

Page 78: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

> stacktrace CVMimplementsInterface strlen 1680 : 120 : CVMimplementsInterface 1560 : 112 : CVMCstackCheckSize 1448 : 136 : CVMcsRendezvous 1312 : 112 : CVMsysMutexLock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace CVMimplementsInterface free 1272 : 120 : CVMimplementsInterface 1152 : 112 : CVMCstackCheckSize 1040 : 136 : CVMcsRendezvous 904 : 112 : CVMsysMutexLock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace CVMimplementsInterface sprintf 1160 : 120 : CVMimplementsInterface 1040 : 112 : CVMCstackCheckSize 928 : 136 : CVMcsRendezvous 792 : 112 : CVMsysMutexLock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace CVMimplementsInterface pthread_cond_wait 936 : 120 : CVMimplementsInterface 816 : 112 : CVMCstackCheckSize 704 : 136 : CVMcsRendezvous 568 : 128 : CVMsysMutexWait 440 : 128 : CVMreentrantMutexWait 312 : 144 : CVMcondvarWait 168 : 168 : POSIXcondvarWait 0 : ?(0) : pthread_cond_wait

Worst C Stack Usage Chain in Class Loader at Class Lookup

Some worst cases of stack consumption occurs in class loader that have a call path fromCVMclassLookupFromClassLoader to a C library function such as strncpy are given below.

> stacktrace classlookup:CVMclassLookupFromClassLoader strncpy 5968 : 152 : classlookup:CVMclassLookupFromClassLoader 5816 : 136 : CVMclassLoadClass 5680 : 136 : classload:CVMclassLoadSystemClass 5544 : 144 : classload:CVMclassLoadFromFile 5400 : 672 : CVMclassCreateInternalClass 4728 : 168 : classcreate:CVMreadConstantPool 4560 : 376 : CVMinternUTF 4184 : 136 : CVMgcAllocNewInstance 4048 : 136 : CVMgcimplAllocObject 3912 : 120 : CVMgcStopTheWorldAndGC

11 of 30

C Stack Check

Page 79: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3792 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3664 : 144 : CVMgcimplDoGC 3520 : 112 : gen_semispace:CVMgenSemispaceCollect 3408 : 144 : gen_semispace:CVMgenSemispaceCollectFull 3264 : 112 : CVMgcProcessSpecialWithLivenessInfo 3152 : 136 : CVMweakrefProcessNonStrong 3016 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2888 : 120 : weakrefs:CVMweakrefIterateQueue 2768 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2632 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 2504 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 2392 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 2256 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 2136 : 168 : gen_semispace:scanObjectsInRangeFull 1968 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1816 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1704 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1584 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 1448 : 128 : gen_semispace:CVMgenSemispacePromoteInto 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace classlookup:CVMclassLookupFromClassLoader .umul 5864 : 152 : classlookup:CVMclassLookupFromClassLoader 5712 : 136 : CVMclassLoadClass 5576 : 136 : classload:CVMclassLoadSystemClass 5440 : 144 : classload:CVMclassLoadFromFile 5296 : 672 : CVMclassCreateInternalClass 4624 : 168 : classcreate:CVMreadConstantPool 4456 : 376 : CVMinternUTF 4080 : 136 : CVMgcAllocNewInstance 3944 : 136 : CVMgcimplAllocObject 3808 : 120 : CVMgcStopTheWorldAndGC 3688 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3560 : 144 : CVMgcimplDoGC 3416 : 112 : gen_semispace:CVMgenSemispaceCollect 3304 : 144 : gen_semispace:CVMgenSemispaceCollectFull 3160 : 112 : CVMgcProcessSpecialWithLivenessInfo 3048 : 136 : CVMweakrefProcessNonStrong 2912 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2784 : 120 : weakrefs:CVMweakrefIterateQueue 2664 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2528 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 2400 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 2288 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 2152 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 2032 : 168 : gen_semispace:scanObjectsInRangeFull 1864 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1712 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1600 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1480 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 1344 : 128 : gen_semispace:CVMgenSemispacePromoteInto 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator

12 of 30

C Stack Check

Page 80: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace classlookup:CVMclassLookupFromClassLoader strlen 5848 : 152 : classlookup:CVMclassLookupFromClassLoader 5696 : 136 : CVMclassLoadClass 5560 : 136 : classload:CVMclassLoadSystemClass 5424 : 144 : classload:CVMclassLoadFromFile 5280 : 672 : CVMclassCreateInternalClass 4608 : 168 : classcreate:CVMreadConstantPool 4440 : 376 : CVMinternUTF 4064 : 136 : CVMgcAllocNewInstance 3928 : 136 : CVMgcimplAllocObject 3792 : 120 : CVMgcStopTheWorldAndGC 3672 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3544 : 144 : CVMgcimplDoGC 3400 : 112 : gen_semispace:CVMgenSemispaceCollect 3288 : 144 : gen_semispace:CVMgenSemispaceCollectFull 3144 : 112 : CVMgcProcessSpecialWithLivenessInfo 3032 : 136 : CVMweakrefProcessNonStrong 2896 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2768 : 120 : weakrefs:CVMweakrefIterateQueue 2648 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2512 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 2384 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 2272 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 2136 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 2016 : 168 : gen_semispace:scanObjectsInRangeFull 1848 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1696 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1584 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1464 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 1328 : 128 : gen_semispace:CVMgenSemispacePromoteInto 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace classlookup:CVMclassLookupFromClassLoader adler32 5568 : 152 : classlookup:CVMclassLookupFromClassLoader 5416 : 136 : CVMclassLoadClass 5280 : 136 : classload:CVMclassLoadSystemClass 5144 : 136 : classload:CVMclassLoadFromZipFile 5008 : 128 : CVMziputilReadEntry 4880 : 4280 : CVMzutilInflateFully 600 : 120 : CVMzlibInflate 480 : 192 : CVMzlibInflate_blocks 288 : 160 : CVMzlibInflate_codes 128 : 128 : CVMzlibInflate_flush 0 : ?(0) : adler32

> stacktrace classlookup:CVMclassLookupFromClassLoader pthread_getspecific 5560 : 152 : classlookup:CVMclassLookupFromClassLoader 5408 : 136 : CVMclassLoadClass 5272 : 136 : classload:CVMclassLoadSystemClass 5136 : 144 : classload:CVMclassLoadFromFile 4992 : 672 : CVMclassCreateInternalClass 4320 : 168 : classcreate:CVMreadConstantPool

13 of 30

C Stack Check

Page 81: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

4152 : 376 : CVMinternUTF 3776 : 136 : CVMgcAllocNewInstance 3640 : 136 : CVMgcimplAllocObject 3504 : 120 : CVMgcStopTheWorldAndGC 3384 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3256 : 144 : CVMgcimplDoGC 3112 : 112 : gen_semispace:CVMgenSemispaceCollect 3000 : 144 : gen_semispace:CVMgenSemispaceCollectFull 2856 : 112 : CVMgcProcessSpecialWithLivenessInfo 2744 : 136 : CVMweakrefProcessNonStrong 2608 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2480 : 120 : weakrefs:CVMweakrefIterateQueue 2360 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2224 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 2096 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 1984 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 1848 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 1728 : 168 : gen_semispace:scanObjectsInRangeFull 1560 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1408 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1296 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1176 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 1040 : 128 : gen_semispace:CVMgenSemispacePromoteInto 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

> stacktrace classlookup:CVMclassLookupFromClassLoader zcfree 5528 : 152 : classlookup:CVMclassLookupFromClassLoader 5376 : 136 : CVMclassLoadClass 5240 : 136 : classload:CVMclassLoadSystemClass 5104 : 136 : classload:CVMclassLoadFromZipFile 4968 : 128 : CVMziputilReadEntry 4840 : 4280 : CVMzutilInflateFully 560 : 112 : CVMzlibInflateInit2_ 448 : 112 : CVMzlibInflateEnd 336 : 112 : CVMzlibInflate_blocks_free 224 : 112 : CVMzlibInflate_blocks_reset 112 : 112 : CVMzlibInflate_codes_free 0 : ?(0) : zcfree

> stacktrace classlookup:CVMclassLookupFromClassLoader free 5440 : 152 : classlookup:CVMclassLookupFromClassLoader 5288 : 136 : CVMclassLoadClass 5152 : 136 : classload:CVMclassLoadSystemClass 5016 : 144 : classload:CVMclassLoadFromFile 4872 : 672 : CVMclassCreateInternalClass 4200 : 168 : classcreate:CVMreadConstantPool 4032 : 376 : CVMinternUTF 3656 : 136 : CVMgcAllocNewInstance 3520 : 136 : CVMgcimplAllocObject 3384 : 120 : CVMgcStopTheWorldAndGC 3264 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3136 : 144 : CVMgcimplDoGC 2992 : 112 : gen_semispace:CVMgenSemispaceCollect 2880 : 144 : gen_semispace:CVMgenSemispaceCollectFull 2736 : 112 : CVMgcProcessSpecialWithLivenessInfo 2624 : 136 : CVMweakrefProcessNonStrong 2488 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2360 : 120 : weakrefs:CVMweakrefIterateQueue

14 of 30

C Stack Check

Page 82: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

2240 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2104 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 1976 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 1864 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 1728 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 1608 : 168 : gen_semispace:scanObjectsInRangeFull 1440 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1288 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1176 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1056 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 920 : 128 : gen_semispace:CVMgenSemispacePromoteInto 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace classlookup:CVMclassLookupFromClassLoader strchr 5440 : 152 : classlookup:CVMclassLookupFromClassLoader 5288 : 136 : CVMclassLoadClass 5152 : 136 : classload:CVMclassLoadSystemClass 5016 : 144 : classload:CVMclassLoadFromFile 4872 : 672 : CVMclassCreateInternalClass 4200 : 168 : classcreate:CVMreadConstantPool 4032 : 376 : CVMinternUTF 3656 : 136 : CVMgcAllocNewInstance 3520 : 136 : CVMgcimplAllocObject 3384 : 120 : CVMgcStopTheWorldAndGC 3264 : 128 : gc_common:CVMgcStopTheWorldAndGCSafe 3136 : 144 : CVMgcimplDoGC 2992 : 112 : gen_semispace:CVMgenSemispaceCollect 2880 : 144 : gen_semispace:CVMgenSemispaceCollectFull 2736 : 112 : CVMgcProcessSpecialWithLivenessInfo 2624 : 136 : CVMweakrefProcessNonStrong 2488 : 128 : weakrefs:CVMweakrefHandlePendingQueue 2360 : 120 : weakrefs:CVMweakrefIterateQueue 2240 : 136 : weakrefs:CVMweakrefDiscoveredQueueCallback 2104 : 128 : gen_semispace:CVMgenSemispaceScanTransitively 1976 : 112 : gen_semispace:CVMgenSemispaceFollowRootsFull 1864 : 136 : gen_semispace:CVMgenSemispaceFollowRootsWithBlackener 1728 : 120 : gen_semispace:CVMgenSemispaceScanPromotedPointers 1608 : 168 : gen_semispace:scanObjectsInRangeFull 1440 : 152 : gen_semispace:CVMgenSemispaceBlackenObjectFull 1288 : 112 : gen_semispace:CVMgenSemispaceFilteredGrayObject 1176 : 120 : gen_semispace:CVMgenSemispaceGrayObject 1056 : 136 : gen_semispace:CVMgenSemispaceForwardOrPromoteObject 920 : 128 : gen_semispace:CVMgenSemispacePromoteInto 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCstrchrStub 0 : ?(0) : strchr

Worst C Stack Usage Chain in Class Link

Some worst cases of stack consumption occurring in class linking that have a call path fromCVMclassLink to a C library function such as strncpy are given below.

> stacktrace CVMclassLink strncpy 4512 : 128 : CVMclassLink 4384 : 376 : CVMclassVerify 4008 : 144 : VerifyClass 3864 : 160 : verifycode:verify_method

15 of 30

C Stack Check

Page 83: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3704 : 184 : verifycode:run_dataflow 3520 : 200 : verifycode:merge_into_successors

3320 : 264 : verifycode:merge_into_one_successor 3056 : 216 : verifycode:merge_registers 2840 : 112 : verifycode:isAssignableTo 2728 : 144 : verifycode:merge_fullinfo_types 2584 : 128 : CVMjniGetSuperclass 2456 : 120 : CVMjniNewLocalRef 2336 : 144 : CVMjniCreateLocalRef 2192 : 112 : CVMjniFatalError 2080 : 120 : CVMdumpStack 1960 : 128 : stacks:CVMdumpFrames 1832 : 392 : CVMdumpFrame 1440 : 120 : stacks:CVMdumpData 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace CVMclassLink .umul 4408 : 128 : CVMclassLink 4280 : 376 : CVMclassVerify 3904 : 144 : VerifyClass 3760 : 160 : verifycode:verify_method 3600 : 184 : verifycode:run_dataflow 3416 : 200 : verifycode:merge_into_successors 3216 : 264 : verifycode:merge_into_one_successor 2952 : 216 : verifycode:merge_registers 2736 : 112 : verifycode:isAssignableTo 2624 : 144 : verifycode:merge_fullinfo_types 2480 : 128 : CVMjniGetSuperclass 2352 : 120 : CVMjniNewLocalRef 2232 : 144 : CVMjniCreateLocalRef 2088 : 112 : CVMjniFatalError 1976 : 120 : CVMdumpStack 1856 : 128 : stacks:CVMdumpFrames 1728 : 392 : CVMdumpFrame 1336 : 120 : stacks:CVMdumpData 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace CVMclassLink strlen 4392 : 128 : CVMclassLink 4264 : 376 : CVMclassVerify 3888 : 144 : VerifyClass 3744 : 160 : verifycode:verify_method 3584 : 184 : verifycode:run_dataflow 3400 : 200 : verifycode:merge_into_successors 3200 : 264 : verifycode:merge_into_one_successor 2936 : 216 : verifycode:merge_registers 2720 : 112 : verifycode:isAssignableTo 2608 : 144 : verifycode:merge_fullinfo_types

16 of 30

C Stack Check

Page 84: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

2464 : 128 : CVMjniGetSuperclass 2336 : 120 : CVMjniNewLocalRef 2216 : 144 : CVMjniCreateLocalRef 2072 : 112 : CVMjniFatalError 1960 : 120 : CVMdumpStack 1840 : 128 : stacks:CVMdumpFrames 1712 : 392 : CVMdumpFrame 1320 : 120 : stacks:CVMdumpData 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace CVMclassLink free 3984 : 128 : CVMclassLink 3856 : 376 : CVMclassVerify 3480 : 144 : VerifyClass 3336 : 160 : verifycode:verify_method 3176 : 184 : verifycode:run_dataflow 2992 : 200 : verifycode:merge_into_successors 2792 : 264 : verifycode:merge_into_one_successor 2528 : 216 : verifycode:merge_registers 2312 : 112 : verifycode:isAssignableTo 2200 : 144 : verifycode:merge_fullinfo_types 2056 : 128 : CVMjniGetSuperclass 1928 : 120 : CVMjniNewLocalRef 1808 : 144 : CVMjniCreateLocalRef 1664 : 112 : CVMjniFatalError 1552 : 120 : CVMdumpStack 1432 : 128 : stacks:CVMdumpFrames 1304 : 392 : CVMdumpFrame 912 : 120 : stacks:CVMdumpData 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace CVMclassLink sprintf 3872 : 128 : CVMclassLink 3744 : 376 : CVMclassVerify 3368 : 144 : VerifyClass 3224 : 160 : verifycode:verify_method 3064 : 184 : verifycode:run_dataflow 2880 : 200 : verifycode:merge_into_successors 2680 : 264 : verifycode:merge_into_one_successor 2416 : 216 : verifycode:merge_registers 2200 : 112 : verifycode:isAssignableTo 2088 : 144 : verifycode:merge_fullinfo_types 1944 : 128 : CVMjniGetSuperclass 1816 : 120 : CVMjniNewLocalRef 1696 : 144 : CVMjniCreateLocalRef 1552 : 112 : CVMjniFatalError 1440 : 120 : CVMdumpStack 1320 : 128 : stacks:CVMdumpFrames 1192 : 392 : CVMdumpFrame 800 : 120 : stacks:CVMdumpData 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

17 of 30

C Stack Check

Page 85: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

> stacktrace CVMclassLink fflush 3568 : 128 : CVMclassLink 3440 : 376 : CVMclassVerify 3064 : 144 : VerifyClass 2920 : 160 : verifycode:verify_method 2760 : 184 : verifycode:run_dataflow 2576 : 200 : verifycode:merge_into_successors 2376 : 264 : verifycode:merge_into_one_successor 2112 : 216 : verifycode:merge_registers 1896 : 112 : verifycode:isAssignableTo 1784 : 144 : verifycode:merge_fullinfo_types 1640 : 128 : CVMjniGetSuperclass 1512 : 120 : CVMjniNewLocalRef 1392 : 144 : CVMjniCreateLocalRef 1248 : 112 : CVMjniFatalError 1136 : 120 : CVMdumpStack 1016 : 128 : stacks:CVMdumpFrames 888 : 392 : CVMdumpFrame 496 : 120 : stacks:CVMdumpData 376 : 376 : CVMconsolePrintf 0 : ?(0) : fflush

> stacktrace CVMclassLink pthread_cond_wait 3504 : 128 : CVMclassLink 3376 : 376 : CVMclassVerify 3000 : 144 : VerifyClass 2856 : 160 : verifycode:verify_method 2696 : 184 : verifycode:run_dataflow 2512 : 200 : verifycode:merge_into_successors 2312 : 264 : verifycode:merge_into_one_successor 2048 : 216 : verifycode:merge_registers 1832 : 112 : verifycode:isAssignableTo 1720 : 144 : verifycode:merge_fullinfo_types 1576 : 112 : verifycode:CVMCstackDummy2object_fullinfo_to_classclass 1464 : 136 : verifycode:object_fullinfo_to_classclass 1328 : 120 : CVMjniNewGlobalRef 1208 : 112 : CVMID_getGlobalRoot 1096 : 120 : globalroots:CVMIDprivate_getGlobalRoot 976 : 136 : globalroots:CVMIDprivate_getGlobalRootNoLock 840 : 136 : CVMexpandStack 704 : 136 : CVMcsRendezvous 568 : 128 : CVMsysMutexWait 440 : 128 : CVMreentrantMutexWait 312 : 144 : CVMcondvarWait 168 : 168 : POSIXcondvarWait 0 : ?(0) : pthread_cond_wait

> stacktrace CVMclassLink pthread_mutex_unlock 3448 : 128 : CVMclassLink 3320 : 376 : CVMclassVerify 2944 : 144 : VerifyClass 2800 : 160 : verifycode:verify_method 2640 : 184 : verifycode:run_dataflow 2456 : 200 : verifycode:merge_into_successors 2256 : 264 : verifycode:merge_into_one_successor 1992 : 216 : verifycode:merge_registers 1776 : 112 : verifycode:isAssignableTo 1664 : 144 : verifycode:merge_fullinfo_types 1520 : 112 : verifycode:CVMCstackDummy2object_fullinfo_to_classclass 1408 : 136 : verifycode:object_fullinfo_to_classclass

18 of 30

C Stack Check

Page 86: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

1272 : 120 : CVMjniNewGlobalRef 1152 : 112 : CVMID_getGlobalRoot 1040 : 120 : globalroots:CVMIDprivate_getGlobalRoot 920 : 136 : globalroots:CVMIDprivate_getGlobalRootNoLock 784 : 136 : CVMexpandStack 648 : 136 : CVMcsRendezvous 512 : 128 : CVMsysMutexWait 384 : 128 : CVMreentrantMutexWait 256 : 144 : CVMcondvarWait 112 : 112 : POSIXmutexUnlock 0 : ?(0) : pthread_mutex_unlock

Worst C Stack Usage Chain in Formatting a String from the PCfor a Console Print Out

Some worst cases of stack consumption occurring in the console print out routine that have a call pathfrom CVMCstackDummy2CVMformatStringVaList to a C library function such as strncpy are givenbelow.

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList strncpy 1792 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1680 : 112 : CVMCstackCheckSize 1568 : 136 : CVMcsRendezvous 1432 : 112 : CVMsysMutexLock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList .umul 1688 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1576 : 112 : CVMCstackCheckSize 1464 : 136 : CVMcsRendezvous 1328 : 112 : CVMsysMutexLock 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList strlen 1672 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1560 : 112 : CVMCstackCheckSize 1448 : 136 : CVMcsRendezvous 1312 : 112 : CVMsysMutexLock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

19 of 30

C Stack Check

Page 87: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList pthread_getspecific 1384 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1272 : 112 : CVMCstackCheckSize 1160 : 136 : CVMcsRendezvous 1024 : 112 : CVMsysMutexLock 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList free 1264 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1152 : 112 : CVMCstackCheckSize 1040 : 136 : CVMcsRendezvous 904 : 112 : CVMsysMutexLock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace utils:CVMCstackDummy2CVMformatStringVaList sprintf 1152 : 112 : utils:CVMCstackDummy2CVMformatStringVaList 1040 : 112 : CVMCstackCheckSize 928 : 136 : CVMcsRendezvous 792 : 112 : CVMsysMutexLock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

Worst C Stack Usage Chain in Formatting a String of Objectfrom a Class and Hash Value

Some worst cases of stack consumption occurring in the console print out routine which displays a stringof object from its class block or a hashed value have a call path fromCVMCstackDummy2CVMconsolePrintf to a C library function such as strncpy.

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf strncpy 1800 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1680 : 112 : CVMCstackCheckSize 1568 : 136 : CVMcsRendezvous 1432 : 112 : CVMsysMutexLock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf .umul 1696 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1576 : 112 : CVMCstackCheckSize 1464 : 136 : CVMcsRendezvous 1328 : 112 : CVMsysMutexLock 1216 : 376 : CVMconsolePrintf

20 of 30

C Stack Check

Page 88: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf strlen 1680 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1560 : 112 : CVMCstackCheckSize 1448 : 136 : CVMcsRendezvous 1312 : 112 : CVMsysMutexLock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf pthread_getspecific 1392 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1272 : 112 : CVMCstackCheckSize 1160 : 136 : CVMcsRendezvous 1024 : 112 : CVMsysMutexLock 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf free 1272 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1152 : 112 : CVMCstackCheckSize 1040 : 136 : CVMcsRendezvous 904 : 112 : CVMsysMutexLock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf sprintf 1160 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 1040 : 112 : CVMCstackCheckSize 928 : 136 : CVMcsRendezvous 792 : 112 : CVMsysMutexLock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace utils:CVMCstackDummy2CVMconsolePrintf pthread_cond_wait 936 : 120 : utils:CVMCstackDummy2CVMconsolePrintf 816 : 112 : CVMCstackCheckSize 704 : 136 : CVMcsRendezvous 568 : 128 : CVMsysMutexWait 440 : 128 : CVMreentrantMutexWait 312 : 144 : CVMcondvarWait 168 : 168 : POSIXcondvarWait 0 : ?(0) : pthread_cond_wait

21 of 30

C Stack Check

Page 89: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe strncpy 2056 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1944 : 120 : CVMobjectGetHashSafe 1824 : 120 : objsync:CVMobjectComputeHash 1704 : 136 : objsync:CVMobjectSetHashCode 1568 : 136 : CVMcsRendezvous 1432 : 112 : CVMsysMutexLock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub

0 : ?(0) : strncpy

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe .umul 1952 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1840 : 120 : CVMobjectGetHashSafe 1720 : 120 : objsync:CVMobjectComputeHash 1600 : 136 : objsync:CVMobjectSetHashCode 1464 : 136 : CVMcsRendezvous 1328 : 112 : CVMsysMutexLock 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe strlen 1936 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1824 : 120 : CVMobjectGetHashSafe 1704 : 120 : objsync:CVMobjectComputeHash 1584 : 136 : objsync:CVMobjectSetHashCode 1448 : 136 : CVMcsRendezvous 1312 : 112 : CVMsysMutexLock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe pthread_getspecific 1648 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1536 : 120 : CVMobjectGetHashSafe 1416 : 120 : objsync:CVMobjectComputeHash 1296 : 136 : objsync:CVMobjectSetHashCode 1160 : 136 : CVMcsRendezvous 1024 : 112 : CVMsysMutexLock 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

22 of 30

C Stack Check

Page 90: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe free 1528 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1416 : 120 : CVMobjectGetHashSafe 1296 : 120 : objsync:CVMobjectComputeHash 1176 : 136 : objsync:CVMobjectSetHashCode 1040 : 136 : CVMcsRendezvous 904 : 112 : CVMsysMutexLock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe sprintf 1416 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1304 : 120 : CVMobjectGetHashSafe 1184 : 120 : objsync:CVMobjectComputeHash 1064 : 136 : objsync:CVMobjectSetHashCode 928 : 136 : CVMcsRendezvous 792 : 112 : CVMsysMutexLock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace utils:CVMCstackDummy2CVMobjectGetHashSafe pthread_cond_wait 1192 : 112 : utils:CVMCstackDummy2CVMobjectGetHashSafe 1080 : 120 : CVMobjectGetHashSafe 960 : 120 : objsync:CVMobjectComputeHash 840 : 136 : objsync:CVMobjectSetHashCode 704 : 136 : CVMcsRendezvous 568 : 128 : CVMsysMutexWait 440 : 128 : CVMreentrantMutexWait 312 : 144 : CVMcondvarWait 168 : 168 : POSIXcondvarWait 0 : ?(0) : pthread_cond_wait

Worst C Stack Usage Chain in Class Verifier

Some worst cases of stack consumption occurring in class verifier that merges types of two array objectshave a call path from CVMCstackDummy2merge_fullinfo_types to a C library function such asstrncpy.

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types strncpy 2848 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2728 : 144 : verifycode:merge_fullinfo_types 2584 : 128 : CVMjniGetSuperclass 2456 : 120 : CVMjniNewLocalRef 2336 : 144 : CVMjniCreateLocalRef 2192 : 112 : CVMjniFatalError 2080 : 120 : CVMdumpStack 1960 : 128 : stacks:CVMdumpFrames 1832 : 392 : CVMdumpFrame 1440 : 120 : stacks:CVMdumpData 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring

23 of 30

C Stack Check

Page 91: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types .umul 2744 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2624 : 144 : verifycode:merge_fullinfo_types 2480 : 128 : CVMjniGetSuperclass 2352 : 120 : CVMjniNewLocalRef 2232 : 144 : CVMjniCreateLocalRef 2088 : 112 : CVMjniFatalError 1976 : 120 : CVMdumpStack 1856 : 128 : stacks:CVMdumpFrames 1728 : 392 : CVMdumpFrame 1336 : 120 : stacks:CVMdumpData 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString

368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types strlen 2728 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2608 : 144 : verifycode:merge_fullinfo_types 2464 : 128 : CVMjniGetSuperclass 2336 : 120 : CVMjniNewLocalRef 2216 : 144 : CVMjniCreateLocalRef 2072 : 112 : CVMjniFatalError 1960 : 120 : CVMdumpStack 1840 : 128 : stacks:CVMdumpFrames 1712 : 392 : CVMdumpFrame 1320 : 120 : stacks:CVMdumpData 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types pthread_getspecific 2440 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2320 : 144 : verifycode:merge_fullinfo_types 2176 : 128 : CVMjniGetSuperclass 2048 : 120 : CVMjniNewLocalRef 1928 : 144 : CVMjniCreateLocalRef 1784 : 112 : CVMjniFatalError 1672 : 120 : CVMdumpStack 1552 : 128 : stacks:CVMdumpFrames 1424 : 392 : CVMdumpFrame 1032 : 120 : stacks:CVMdumpData 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types free

24 of 30

C Stack Check

Page 92: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

2320 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2200 : 144 : verifycode:merge_fullinfo_types 2056 : 128 : CVMjniGetSuperclass 1928 : 120 : CVMjniNewLocalRef 1808 : 144 : CVMjniCreateLocalRef 1664 : 112 : CVMjniFatalError 1552 : 120 : CVMdumpStack 1432 : 128 : stacks:CVMdumpFrames 1304 : 392 : CVMdumpFrame 912 : 120 : stacks:CVMdumpData 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList 112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types sprintf 2208 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 2088 : 144 : verifycode:merge_fullinfo_types 1944 : 128 : CVMjniGetSuperclass 1816 : 120 : CVMjniNewLocalRef 1696 : 144 : CVMjniCreateLocalRef 1552 : 112 : CVMjniFatalError 1440 : 120 : CVMdumpStack 1320 : 128 : stacks:CVMdumpFrames 1192 : 392 : CVMdumpFrame 800 : 120 : stacks:CVMdumpData 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types fflush 1904 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 1784 : 144 : verifycode:merge_fullinfo_types 1640 : 128 : CVMjniGetSuperclass 1512 : 120 : CVMjniNewLocalRef 1392 : 144 : CVMjniCreateLocalRef 1248 : 112 : CVMjniFatalError 1136 : 120 : CVMdumpStack 1016 : 128 : stacks:CVMdumpFrames 888 : 392 : CVMdumpFrame 496 : 120 : stacks:CVMdumpData 376 : 376 : CVMconsolePrintf 0 : ?(0) : fflush

> stacktrace verifycode:CVMCstackDummy2merge_fullinfo_types pthread_cond_wait 1840 : 120 : verifycode:CVMCstackDummy2merge_fullinfo_types 1720 : 144 : verifycode:merge_fullinfo_types 1576 : 112 : verifycode:CVMCstackDummy2object_fullinfo_to_classclass 1464 : 136 : verifycode:object_fullinfo_to_classclass 1328 : 120 : CVMjniNewGlobalRef 1208 : 112 : CVMID_getGlobalRoot 1096 : 120 : globalroots:CVMIDprivate_getGlobalRoot 976 : 136 : globalroots:CVMIDprivate_getGlobalRootNoLock 840 : 136 : CVMexpandStack 704 : 136 : CVMcsRendezvous 568 : 128 : CVMsysMutexWait 440 : 128 : CVMreentrantMutexWait 312 : 144 : CVMcondvarWait 168 : 168 : POSIXcondvarWait 0 : ?(0) : pthread_cond_wait

25 of 30

C Stack Check

Page 93: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Worst C Stack Usage Chain in Signaling an Exception Routine

Some worst cases of stack consumption occurring in function that signals a thrown exception have a callpath from CVMsignalErrorVaList to a C library function such as strncpy.

> stacktrace CVMsignalErrorVaList strncpy 5448 : 120 : CVMsignalErrorVaList 5328 : 144 : interpreter:CVMgcSafeSignalError 5184 : 112 : CVMfillInStackTrace 5072 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4872 : 376 : CVMnewStringUTF 4496 : 144 : CVMnewString 4352 : 136 : CVMgcAllocNewInstance 4216 : 128 : CVMjniCallStaticVoidMethod 4088 : 184 : jni_impl:CVMjniInvoke 3904 : 136 : CVMjniExceptionDescribe 3768 : 112 : CVMjniGetMethodID 3656 : 136 : jni_impl:CVMjniGetXMethodID 3520 : 112 : CVMclassInit

3408 : 128 : classinitialize:CVMprivateClassInit 3280 : 128 : CVMjniCallVoidMethod 3152 : 184 : jni_impl:CVMjniInvoke 2968 : 136 : CVMjniExceptionDescribe

2832 : 112 : CVMjniGetMethodID 2720 : 136 : jni_impl:CVMjniGetXMethodID 2584 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2456 : 240 : typeid:referenceMethodSignature 2216 : 144 : typeid:referenceFieldSignature 2072 : 120 : typeid:referenceClassName 1952 : 144 : typeid:lookupClass 1808 : 120 : typeid:findFreeScalarEntry 1688 : 136 : typeid:findFreeTableEntry 1552 : 120 : typeid:unlockThrowOutOfMemoryError 1432 : 112 : CVMsysMutexUnlock 1320 : 376 : CVMconsolePrintf 944 : 304 : CVMformatStringVaList 640 : 168 : CVMtypeidMethodTypeToCString 472 : 112 : CVMtypeidFieldTypeToCString 360 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 232 : 120 : typeid:conditionalPutstring 112 : 112 : CVMCstrncpyStub 0 : ?(0) : strncpy

> stacktrace CVMsignalErrorVaList .umul 5344 : 120 : CVMsignalErrorVaList 5224 : 144 : interpreter:CVMgcSafeSignalError 5080 : 112 : CVMfillInStackTrace 4968 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4768 : 376 : CVMnewStringUTF 4392 : 144 : CVMnewString 4248 : 136 : CVMgcAllocNewInstance 4112 : 128 : CVMjniCallStaticVoidMethod 3984 : 184 : jni_impl:CVMjniInvoke 3800 : 136 : CVMjniExceptionDescribe 3664 : 112 : CVMjniGetMethodID 3552 : 136 : jni_impl:CVMjniGetXMethodID 3416 : 112 : CVMclassInit 3304 : 128 : classinitialize:CVMprivateClassInit

26 of 30

C Stack Check

Page 94: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

3176 : 128 : CVMjniCallVoidMethod 3048 : 184 : jni_impl:CVMjniInvoke 2864 : 136 : CVMjniExceptionDescribe 2728 : 112 : CVMjniGetMethodID 2616 : 136 : jni_impl:CVMjniGetXMethodID 2480 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2352 : 240 : typeid:referenceMethodSignature 2112 : 144 : typeid:referenceFieldSignature 1968 : 120 : typeid:referenceClassName 1848 : 144 : typeid:lookupClass 1704 : 120 : typeid:findFreeScalarEntry 1584 : 136 : typeid:findFreeTableEntry 1448 : 120 : typeid:unlockThrowOutOfMemoryError 1328 : 112 : CVMsysMutexUnlock 1216 : 376 : CVMconsolePrintf 840 : 304 : CVMformatStringVaList 536 : 168 : CVMtypeidMethodTypeToCString 368 : 128 : CVMtypeidGetSignatureIterator 240 : 120 : CVMtypeidGetTerseSignatureIterator 120 : 120 : typeid:indexSegmentedTable 0 : ?(0) : .umul

> stacktrace CVMsignalErrorVaList strlen 5328 : 120 : CVMsignalErrorVaList 5208 : 144 : interpreter:CVMgcSafeSignalError 5064 : 112 : CVMfillInStackTrace 4952 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4752 : 376 : CVMnewStringUTF 4376 : 144 : CVMnewString 4232 : 136 : CVMgcAllocNewInstance 4096 : 128 : CVMjniCallStaticVoidMethod 3968 : 184 : jni_impl:CVMjniInvoke 3784 : 136 : CVMjniExceptionDescribe 3648 : 112 : CVMjniGetMethodID 3536 : 136 : jni_impl:CVMjniGetXMethodID 3400 : 112 : CVMclassInit 3288 : 128 : classinitialize:CVMprivateClassInit 3160 : 128 : CVMjniCallVoidMethod 3032 : 184 : jni_impl:CVMjniInvoke 2848 : 136 : CVMjniExceptionDescribe 2712 : 112 : CVMjniGetMethodID 2600 : 136 : jni_impl:CVMjniGetXMethodID 2464 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2336 : 240 : typeid:referenceMethodSignature 2096 : 144 : typeid:referenceFieldSignature 1952 : 120 : typeid:referenceClassName 1832 : 144 : typeid:lookupClass 1688 : 120 : typeid:findFreeScalarEntry 1568 : 136 : typeid:findFreeTableEntry 1432 : 120 : typeid:unlockThrowOutOfMemoryError 1312 : 112 : CVMsysMutexUnlock 1200 : 376 : CVMconsolePrintf 824 : 304 : CVMformatStringVaList 520 : 168 : CVMtypeidMethodTypeToCString 352 : 112 : CVMtypeidFieldTypeToCString 240 : 128 : typeid:CVMtypeidPrivateFieldTypeToCString 112 : 112 : CVMCstrlenStub 0 : ?(0) : strlen

> stacktrace CVMsignalErrorVaList pthread_getspecific 5040 : 120 : CVMsignalErrorVaList 4920 : 144 : interpreter:CVMgcSafeSignalError

27 of 30

C Stack Check

Page 95: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

4776 : 112 : CVMfillInStackTrace 4664 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4464 : 376 : CVMnewStringUTF 4088 : 144 : CVMnewString 3944 : 136 : CVMgcAllocNewInstance 3808 : 128 : CVMjniCallStaticVoidMethod 3680 : 184 : jni_impl:CVMjniInvoke 3496 : 136 : CVMjniExceptionDescribe 3360 : 112 : CVMjniGetMethodID 3248 : 136 : jni_impl:CVMjniGetXMethodID 3112 : 112 : CVMclassInit 3000 : 128 : classinitialize:CVMprivateClassInit 2872 : 128 : CVMjniCallVoidMethod 2744 : 184 : jni_impl:CVMjniInvoke 2560 : 136 : CVMjniExceptionDescribe 2424 : 112 : CVMjniGetMethodID 2312 : 136 : jni_impl:CVMjniGetXMethodID 2176 : 128 : CVMtypeidNewMethodIDFromNameAndSig 2048 : 240 : typeid:referenceMethodSignature 1808 : 144 : typeid:referenceFieldSignature 1664 : 120 : typeid:referenceClassName 1544 : 144 : typeid:lookupClass 1400 : 120 : typeid:findFreeScalarEntry 1280 : 136 : typeid:findFreeTableEntry 1144 : 120 : typeid:unlockThrowOutOfMemoryError 1024 : 112 : CVMsysMutexUnlock 912 : 376 : CVMconsolePrintf 536 : 304 : CVMformatStringVaList 232 : 120 : CVMgetEE 112 : 112 : POSIXthreadGetSelf 0 : ?(0) : pthread_getspecific

> stacktrace CVMsignalErrorVaList free 4920 : 120 : CVMsignalErrorVaList 4800 : 144 : interpreter:CVMgcSafeSignalError 4656 : 112 : CVMfillInStackTrace 4544 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4344 : 376 : CVMnewStringUTF 3968 : 144 : CVMnewString 3824 : 136 : CVMgcAllocNewInstance 3688 : 128 : CVMjniCallStaticVoidMethod 3560 : 184 : jni_impl:CVMjniInvoke 3376 : 136 : CVMjniExceptionDescribe 3240 : 112 : CVMjniGetMethodID 3128 : 136 : jni_impl:CVMjniGetXMethodID 2992 : 112 : CVMclassInit 2880 : 128 : classinitialize:CVMprivateClassInit 2752 : 128 : CVMjniCallVoidMethod 2624 : 184 : jni_impl:CVMjniInvoke 2440 : 136 : CVMjniExceptionDescribe 2304 : 112 : CVMjniGetMethodID 2192 : 136 : jni_impl:CVMjniGetXMethodID 2056 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1928 : 240 : typeid:referenceMethodSignature 1688 : 144 : typeid:referenceFieldSignature 1544 : 120 : typeid:referenceClassName 1424 : 144 : typeid:lookupClass 1280 : 120 : typeid:findFreeScalarEntry 1160 : 136 : typeid:findFreeTableEntry 1024 : 120 : typeid:unlockThrowOutOfMemoryError 904 : 112 : CVMsysMutexUnlock 792 : 376 : CVMconsolePrintf 416 : 304 : CVMformatStringVaList

28 of 30

C Stack Check

Page 96: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

112 : 112 : CVMCfreeStub 0 : ?(0) : free

> stacktrace CVMsignalErrorVaList sprintf 4808 : 120 : CVMsignalErrorVaList 4688 : 144 : interpreter:CVMgcSafeSignalError 4544 : 112 : CVMfillInStackTrace 4432 : 200 : jvm:CVMgcUnsafeFillInStackTrace 4232 : 376 : CVMnewStringUTF 3856 : 144 : CVMnewString 3712 : 136 : CVMgcAllocNewInstance 3576 : 128 : CVMjniCallStaticVoidMethod 3448 : 184 : jni_impl:CVMjniInvoke 3264 : 136 : CVMjniExceptionDescribe 3128 : 112 : CVMjniGetMethodID 3016 : 136 : jni_impl:CVMjniGetXMethodID 2880 : 112 : CVMclassInit 2768 : 128 : classinitialize:CVMprivateClassInit 2640 : 128 : CVMjniCallVoidMethod 2512 : 184 : jni_impl:CVMjniInvoke 2328 : 136 : CVMjniExceptionDescribe 2192 : 112 : CVMjniGetMethodID 2080 : 136 : jni_impl:CVMjniGetXMethodID 1944 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1816 : 240 : typeid:referenceMethodSignature 1576 : 144 : typeid:referenceFieldSignature 1432 : 120 : typeid:referenceClassName 1312 : 144 : typeid:lookupClass 1168 : 120 : typeid:findFreeScalarEntry 1048 : 136 : typeid:findFreeTableEntry 912 : 120 : typeid:unlockThrowOutOfMemoryError 792 : 112 : CVMsysMutexUnlock 680 : 376 : CVMconsolePrintf 304 : 304 : CVMformatStringVaList 0 : ?(0) : sprintf

> stacktrace CVMsignalErrorVaList fflush 4504 : 120 : CVMsignalErrorVaList 4384 : 144 : interpreter:CVMgcSafeSignalError 4240 : 112 : CVMfillInStackTrace 4128 : 200 : jvm:CVMgcUnsafeFillInStackTrace 3928 : 376 : CVMnewStringUTF 3552 : 144 : CVMnewString 3408 : 136 : CVMgcAllocNewInstance 3272 : 128 : CVMjniCallStaticVoidMethod 3144 : 184 : jni_impl:CVMjniInvoke 2960 : 136 : CVMjniExceptionDescribe 2824 : 112 : CVMjniGetMethodID 2712 : 136 : jni_impl:CVMjniGetXMethodID 2576 : 112 : CVMclassInit 2464 : 128 : classinitialize:CVMprivateClassInit 2336 : 128 : CVMjniCallVoidMethod 2208 : 184 : jni_impl:CVMjniInvoke 2024 : 136 : CVMjniExceptionDescribe 1888 : 112 : CVMjniGetMethodID 1776 : 136 : jni_impl:CVMjniGetXMethodID 1640 : 128 : CVMtypeidNewMethodIDFromNameAndSig 1512 : 240 : typeid:referenceMethodSignature 1272 : 144 : typeid:referenceFieldSignature 1128 : 120 : typeid:referenceClassName 1008 : 144 : typeid:lookupClass 864 : 120 : typeid:findFreeScalarEntry

29 of 30

C Stack Check

Page 97: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

744 : 136 : typeid:findFreeTableEntry 608 : 120 : typeid:unlockThrowOutOfMemoryError 488 : 112 : CVMsysMutexUnlock 376 : 376 : CVMconsolePrintf 0 : ?(0) : fflush

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

30 of 30

C Stack Check

Page 98: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

C Debugging with GDBThis chapter contains tips for debugging CVM under GDB. It does not attempt to explain any generalGDB debugging techniques.

Contents

Signal Handlers Using CVMconsolePrintf() Dumping the Java Stack The CVMExecEnv Structure Converting Between CVMExecEnv* and JNIEnv* Threads Displaying Opcode Information Displaying the PC Offset Turning on Trace Output Dumping the Loaded Classes Dumping the Java Heap Displaying Object Information Converting from JNI Types to CVM Types Converting from java.lang.Class to CVMClassBlock* GDB and GC Safety Debugging Crashes on Linux

Signal HandlersThere are a number of signals that are raised by CVM that GDB must be made aware of so itcan pass them on. You need to execute the following three handle commands to avoidhaving GDB stop execution unnecessarily:

handle SIGUSR1 nostop noprint passhandle SIGUSR2 nostop noprint passhandle SIGSTOP nostop noprint pass

Using CVMconsolePrintf()CVMconsolePrintf() can be called from GDB to help provide information about classes,methods, fields, objects, and Java stack frames. CVMconsolePrintf() supports 6 specialconversion characters in addition to those normally supported by printf(), plus themeaning of 3 of the characters can be modified with the '!' character. The conversion

1 of 14

C Debugging with GDB

Page 99: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

characters include:

%C and %!C - prints a class name%M and %!M - prints a method name%F and %!F - prints a field name%O and %I - prints out an object's class name and hash%P - prints out java stack frame information

The argument required for each of the above conversion characters is as follows:

%C - CVMClassBlock*%M - CVMMethodBlock*%F - CVMFieldBlock*%!C - CVMClassTypeID%!M - CVMMethodTypeID%!F - CVMFieldTypeID%O - CVMObject*%I - CVMObjectICell*%P - CVMInterpreterFrame* (only supported in CVM_DEBUG=true builds)

You must be GC safe when using %I. See GDB and GC Safety below. %O will not print theobject hash if it has not been calculated yet.

Some examples follow:

(gdb) call CVMconsolePrintf("%C.%M\n", cb, mb)java.lang.Class.runStaticInitializers()V

(gdb) call CVMconsolePrintf("%O\n", directObj)java.lang.Class@0

(gdb) call CVMconsolePrintf("%P\n", frame)java.lang.Class.runStaticInitializers()V(Class.java:1446)

Dumping the Java StackThere are two functions that you can call from GDB to dump out Java stack information.They are only included if you build with CVM_DEBUG_DUMPSTACK=true, which is the defaultif you build with CVM_DEBUG=true. If you also want source file and line number informationincluded in the stack dump, then you need to also build with CVM_DEBUG_CLASSINFO=trueand CVM_JAVAC_DEBUG=true, both of which also default to true if CVM_DEBUG=true.

extern voidCVMdumpStack(CVMStack* s, CVMBool verbose, CVMBool includeData, CVMInt32 frameLimit);

extern CVMStackChunk*CVMdumpFrame(CVMFrame* frame, CVMStackChunk* startChunk, CVMBool verbose, CVMBool includeData);

(gdb) call CVMdumpStack(&ee->interpreterStack,0,0,0) Java Frame Test.testSunMiscGC()V(Test.java:158) Java Frame Test.main([Ljava/lang/String;)V(Test.java:123) Transition Frame Test.main([Ljava/lang/String;)V(Transition Method) Free List Frame (JNI Local Frame)

If you pass 1 for verbose, you will see more details for each frame. If you also pass 1 for

2 of 14

C Debugging with GDB

Page 100: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

includeData, then the stack contents for each frame are also displayed. Alternatively, youcan use the special combination of verbose==0 and includeData==1 to get the minimalinformation for each frame plus the arguments needed to call CVMdumpFrame() for moreinformation on each of the respective frames. For example:

(gdb) call CVMdumpStack(&ee->interpreterStack,0,1,0) Java Frame Test.testSunMiscGC()V(Test.java:158)call CVMdumpFrame(0x387878, 0x3877d8, 1, 1) Java Frame Test.main([Ljava/lang/String;)V(Test.java:123)call CVMdumpFrame(0x38784c, 0x3877d8, 1, 1) Transition Frame Test.main([Ljava/lang/String;)V(Transition Method)call CVMdumpFrame(0x38781c, 0x3877d8, 1, 1) Free List Frame (JNI Local Frame)call CVMdumpFrame(0x3877e4, 0x3877d8, 1, 1)

The advantage of this output is that arguments needed to call CVMdumpFrame() areautomatically included for you, so you don't need to look at the verbose output ofCVMdumpStack() to figure out which arguments to pass to CVMdumpFrame(), and you don'tneed to deal with a stack dump that include the stack data for every frame. For example:

(gdb) call CVMdumpFrame(0x387878, 0x3877d8, 1, 1) Frame: 0x387878 prev: 0x38784c Scanner: 0xaf70c Tos: 0x387898 Type: Java Frame Name: Test.testSunMiscGC()V(Test.java:158) NextPC: 0x8be023 special: 0 Contents: Chunk 0x3877d8 (0x3877e4-0x3887e4)

The CVMExecEnv StructureAll Java threads in CVM are represented by a CVMExecEnv structure. If you look at the Cbacktrace for almost any running thread, you will probably see a CVMExecEnv* passed as anargument to just about every function in the backtrace. You can use the CVMExecEnv* tolocate information about the thread, such as the Java stack being used by the interpreterloop. For example, if your C backtrace is as follows:

#0 CVMgcUnsafeExecuteJavaMethod (ee=0x37d2c0, mb=0x267590, isStatic=0, isVirtual=0) at ../../src/share/javavm/runtime/executejava.c:1636#1 0xe4b2c in CVMjniInvoke (env=0x37d2e8, obj=0x387810, methodID=0x8bd124, pushArguments=0xe3638 <CVMjniPushArgumentsVararg>, args=0xffbef5b4, info=770, retValue=0x0) at ../../src/share/javavm/runtime/jni_impl.c:2412#2 0xe727c in CVMjniCallStaticVoidMethod (env=0x37d2e8, clazz=0x387810, methodID=0x8bd124) at ../../src/share/javavm/runtime/jni_impl.c:2587#3 0x19a644 in ansiJavaMain (argc=3, argv=0xffbef754) at ../../src/porting/ansi_c/ansi_java_md.c:223#4 0x199cc4 in main (argc=3, argv=0xffbef754) at ../../src/solaris/bin/java_md.c:16

The ee argument passed to CVMgcUnsafeExecuteJavaMethod() can be used to dump theJava stack:

(gdb) call CVMdumpStack(&ee->interpreterStack,0,0,0)

3 of 14

C Debugging with GDB

Page 101: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

You can also always get the CVMExecEnv* for the current thread by calling CVMgetEE().

Converting Between CVMExecEnv* andJNIEnv*

Every CVMExecEnv has a corresponding JNIEnv. You can manually convert between thetwo, but usually you can avoid having to do this conversion by looking elsewhere on the Cstack. For example, if you are in CVMgcUnsafeExecuteJavaMethod() and need a JNIEnv*,going up one or two C frames will usually put you in one of the JNI API's, and you can getthe JNIEnv* there.

Converting from CVMExecEnv* to JNIEnv*:

(gdb) p &(&(ee)->jniEnv)->vector$86 = (JNIEnv *) 0x37d2e8

Converting from JNIEnv* to CVMExecEnv*:

(gdb) p (CVMExecEnv*)((char*)env - (CVMUint32)&(((CVMExecEnv*)0)->jniEnv)->vector)$87 = (CVMExecEnv *) 0x37d2c0

Yes, now would be a good time to define some macros:

define ee2env p &(($arg0)->jniEnv)->vectorend

define env2ee ee2env((CVMExecEnv*)0) p (CVMExecEnv*)((char*)$arg0 - (CVMUint32)($))end

ThreadsInformation about one or all of the Java threads can be dumped by using the followingfunctions, which are only available when CVM is built using CVM_DEBUG=true:

extern voidCVMdumpThread(JNIEnv* env)

extern voidCVMdumpAllThreads()

extern voidCVMprintThreadName(JNIEnv* env, CVMObjectICell* threadICell)

You must be GC safe when calling these functions. See GDB and GC Safety below.

Displaying Opcode InformationThere are three ways to locate the current PC for a frame:

4 of 14

C Debugging with GDB

Page 102: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

1. Use CVMdumpStack() or CVMdumpFrame() and pass verbose==1. The address of thecurrent program counter (pc) will be included in the output in the NextPC field.

(gdb) call CVMdumpFrame(0x387878, 0x3877d8, 1, 1) Frame: 0x387878 prev: 0x38784c Scanner: 0xaf70c Tos: 0x387898 Type: Java Frame Name: Test.testSunMiscGC()V(Test.java:158) NextPC: 0x8be023 special: 0 Contents: Chunk 0x3877d8 (0x3877e4-0x3887e4)

2. Locate the CVMFrame* for the frame and display its contents. The current pc should bein the pcX field.

(gdb) p *(CVMInterpreterFrame*) frame$46 = { frameX = { prevX = 0x38797c, scanner = 0xaf70c <CVMjavaFrameScanner>, topOfStack = 0x38798c, mb = 0x2bbb6c }, pcX = 0x3879c8 "", cpX = 0x2bbc58, localsX = 0x38799c}

You can do this with any Java frame, but not for JNI frames, which don't have a pc.

NOTE: if the scanner field is not set to <CVMjavaFrameScanner>, then you are notlooking at a Java frame.

NOTE: frame->pcX may not be correct for the topmost frame on the stack, since itmay be cached in a local variable. Use the pc local variable inCVMgcUnsafeExecuteJavaMethod() instead.

3. Go to the CVMgcUnsafeExecuteJavaMethod() C frame and display the pc variable:

(gdb) p pc$47 = (CVMUint8 *) 0x2bb74e "±"

Once you have a pc, you can display the opcode at the pc:

(gdb) p (CVMOpcode)*(CVMUint8*)0x2bb74e$48 = opc_return

Displaying the PC OffsetGiven a bytecode address (such as the pc local variable) you can find the offset from the startof the method. You will also need the CVMMethodBlock* (which can be retrieved from theframe) of the method in order to do this:

5 of 14

C Debugging with GDB

Page 103: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

(gdb) p *(CVMInterpreterFrame*)frame$61 = { frameX = { prevX = 0x387950, scanner = 0xaf70c <CVMjavaFrameScanner>, topOfStack = 0x38799c, mb = 0x2bbb5c }, pcX = 0x2bb6fb "ß\013\003±", cpX = 0x2bbc58, localsX = 0x387970}(gdb) p $61->pcX - (CVMUint8*)($61->frameX.mb->codeX.jmd+1)$62 = 7

You can define a macro pcOffset(frame) to print out the current offset of the pc from thestart of the method:

define pcOffset p ((CVMInterpreterFrame*)$arg0)->pcX - (CVMUint8*)(((CVMInterpreterFrame*)$arg0)->frameX.mb->codeX.jmd+1)end

Turning on Trace OutputIf CVM is built with CVM_DEBUG=true, then the support for debug tracing will be compiledin. There are three ways to turn on trace flags.

1. Use the -Xtrace command line argument:

cvm -Xtrace:0xc40000 -Djava.class.path=../testclasses HelloWorld

2. Turn the flags on or off manually in GDB:

(gdb) set var CVMglobals.debugFlags = 0xc40000

3. Turn flags on and off from Java source code:

You must first import sun.misc.CVM. You can then use the following APIs:

/* * Methods for checking, setting, and clearing the state of debug * flags. All of the following methods return the previous state of * the flags. * * You can pass in more than one flag at a time to any of the methods. */ public native static int checkDebugFlags(int flags); public native static int setDebugFlags(int flags); public native static int clearDebugFlags(int flags); public native static int restoreDebugFlags(int flags, int oldvalue);

See src/share/javavm/test/Test.java for an example on using the above APIs.

The supported trace flags can be found in src/share/classes/sun/misc/CVM.java or seeRunning CVM for a documented list. To turn on more than one flag at the same time, use alogical OR of their values:

6 of 14

C Debugging with GDB

Page 104: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

public static final int DEBUGFLAG_TRACE_OPCODE = 0x00000001; public static final int DEBUGFLAG_TRACE_METHOD = 0x00000002; public static final int DEBUGFLAG_TRACE_STATUS = 0x00000004; public static final int DEBUGFLAG_TRACE_FASTLOCK = 0x00000008; public static final int DEBUGFLAG_TRACE_DETLOCK = 0x00000010; public static final int DEBUGFLAG_TRACE_MUTEX = 0x00000020; public static final int DEBUGFLAG_TRACE_CS = 0x00000040; public static final int DEBUGFLAG_TRACE_GCSTARTSTOP = 0x00000080; public static final int DEBUGFLAG_TRACE_GCSCAN = 0x00000100; public static final int DEBUGFLAG_TRACE_GCSCANOBJ = 0x00000200; public static final int DEBUGFLAG_TRACE_GCALLOC = 0x00000400; public static final int DEBUGFLAG_TRACE_GCCOLLECT = 0x00000800; public static final int DEBUGFLAG_TRACE_GCSAFETY = 0x00001000; public static final int DEBUGFLAG_TRACE_CLINIT = 0x00002000; public static final int DEBUGFLAG_TRACE_EXCEPTIONS = 0x00004000; public static final int DEBUGFLAG_TRACE_MISC = 0x00008000; public static final int DEBUGFLAG_TRACE_BARRIERS = 0x00010000; public static final int DEBUGFLAG_TRACE_STACKMAPS = 0x00020000; public static final int DEBUGFLAG_TRACE_CLASSLOADING= 0x00040000; public static final int DEBUGFLAG_TRACE_CLASSLOOKUP = 0x00080000; public static final int DEBUGFLAG_TRACE_TYPEID = 0x00100000; public static final int DEBUGFLAG_TRACE_VERIFIER = 0x00200000; public static final int DEBUGFLAG_TRACE_WEAKREFS = 0x00400000; public static final int DEBUGFLAG_TRACE_CLASSUNLOAD = 0x00800000; public static final int DEBUGFLAG_TRACE_CLASSLINK = 0x01000000;

OPCODE will trace each opcode being execute. METHOD will trace each method as it is entered, exited, and returned to. GCSTARTSTOP will provide information each time GC starts and completes. EXCEPTIONS will do a full backtrace of the Java thread whenever an exception is thrown, andalso provide information when an exception is caught. CLASSLOADING will provide information about classes being loaded. CLASSLOOKUP will provide information about class lookups (mostly loader cache relatedinformation). CLASSUNLOAD will provide information each time a class is unloaded. CLASSLINK will provide information when a class is linked.

The rest of the flags are less commonly used.

Dumping the Loaded ClassesYou can dump the set of loaded classes using the CVMclassTableDump() function. Youmust first enable CLASSLOOKUP tracing or no output will be displayed. You must alsocompile with CVM_DEBUG=true.

(gdb) set var CVMglobals.debugFlags = 0x80000(gdb) call CVMclassTableDump(ee)CT: 0x8d5db8: sun.misc.GC$1CT: 0x8d53a8: sun.misc.GC$DaemonCT: 0x8d4900: java.util.TreeMap$EntryCT: 0x8d3f18: java.util.TreeMap$1CT: 0x8d7b40: java.util.TreeMapCT: 0x8d3190: java.util.TreeSetCT: 0x8d0ed8: sun.misc.GC$LatencyRequestCT: 0x8cfa18: sun.misc.GC$LatencyLockCT: 0x8ce568: sun.misc.GC

7 of 14

C Debugging with GDB

Page 105: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The addresses listed are for the CVMClassBlock* of each class. You can use aCVMClassBlock* address as follows to get more information for any individual class:

(gdb) p *(CVMClassBlock*)0x8d5db8$64 = { gcMapX = { map = 0, bigmap = 0x0 }, classNameX = 978, superclassX = { superclassCb = 0x244b2c, superclassTypeID = 2378540, mirandaMethodCountX = 0 '\000' }, cpX = { constantpoolX = 0x8d5e20, arrayInfoX = 0x8d5e20 }, ...}

You can also dump out the loader cache using CVMloaderCacheDump(). Once again,CLASSLOOKUP tracing must be turned on and you must compile with CVM_DEBUG=true.

(gdb) call CVMloaderCacheDump(ee)LC: #887 0x8a8fc0: <0x38a0a4,[LTest;>LC: #890 0x8a8e00: <0x38a0a4,[LC;>LC: #895 0x8ccb88: <0x38a0a4,[Lcvmtest.TypeidRefcountHelper;>LC: #978 0x8d5db8: <0x0,sun.misc.GC$1>LC: #979 0x8cfa18: <0x0,sun.misc.GC$LatencyLock>LC: #980 0x8d53a8: <0x0,sun.misc.GC$Daemon>LC: #981 0x8d3190: <0x0,java.util.TreeSet>LC: #982 0x8d7b40: <0x0,java.util.TreeMap>LC: #983 0x8d4900: <0x0,java.util.TreeMap$Entry>LC: #984 0x8d3f18: <0x0,java.util.TreeMap$1>LC: #1007 0x8a2cf0: <0x38a0a4,[[LTest;>

The first address given is the CVMClassBlock*. The 2nd is the CVMObjectICell* of theClassLoader instance. 0x0 represents the NULL class loader (a.k.a. the bootclasspath loaderor bootstrap loader).

Dumping the Java HeapThere are three functions that can be used for dumping out the contents of the Java heap. Allof these functions can be useful in detecting leaks in the Java heap. They are only available ifyou build CVM with CVM_DEBUG=true.

extern voidCVMgcDumpHeapSimple()

extern voidCVMgcDumpHeapStats()

extern voidCVMgcDumpHeapVerbose()

8 of 14

C Debugging with GDB

Page 106: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMgcDumpHeapSimple() dumps the total number of objects in the heap. For example:

(gdb) call CVMgcDumpHeapSimple()Counted 3702 objects

CVMgcDumpHeapStats() displays the number of instances (NI) allocated for each class andthe total space (TS) in bytes that the instances occupy in the heap. For example:

(gdb) call CVMgcDumpHeapStats()TS=89396 NI=986 CL=[CTS=47172 NI=167 CL=[BTS=14292 NI=397 CL=[Ljava.lang.Object;TS=14020 NI=701 CL=java.lang.StringTS=9056 NI=126 CL=[ITS=8096 NI=2 CL=[STS=3700 NI=185 CL=java.lang.ClassTS=3480 NI=174 CL=java.lang.StringBufferTS=2256 NI=94 CL=java.util.Hashtable$EntryTS=2040 NI=18 CL=[Ljava.util.Hashtable$Entry;TS=1400 NI=116 CL=[Ljava.lang.Class;...TS=8 NI=1 CL=java.util.Hashtable$EmptyEnumeratorTS=8 NI=1 CL=java.net.UnknownContentHandlerTS=8 NI=1 CL=java.security.Security$1TS=8 NI=1 CL=java.util.Hashtable$EmptyIterator

CVMgcDumpHeapVerbose() dumps out the address and size of every object in the heap. Forexample:

(gdb) call CVMgcDumpHeapVerbose()...Addr: 0x3bd0a8 Size: 44 Class: CloneableObjectAddr: 0x3bd0d4 Size: 8 Class: java.lang.ObjectAddr: 0x3bd0dc Size: 44 Class: CloneableObjectAddr: 0x3bd108 Size: 24 Class: [Ljava.lang.Object;Addr: 0x3bd120 Size: 24 Class: [Ljava.lang.Object;Addr: 0x3bd138 Size: 12 Class: NonCloneableObjectAddr: 0x3bd144 Size: 16 Class: java.lang.CloneNotSupportedException...

The next section describes how you can dump the contents of these objects.

Displaying Object InformationObjects have an 8 byte header, followed by the contents of the object.

(gdb) x /4wx 0x3bd1440x3bd144: 0x002ebffc 0x00000002 0x003bd1a0 0x003bd154(gdb) p *(CVMObject*) 0x3bd144$74 = { hdr = { clas = 0x2ebffc, various32 = 2 }, ...}

The clas field contains the CVMClassBlock* that the object is an instance of. The lower two

9 of 14

C Debugging with GDB

Page 107: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

bits of this field have special meaning and should be masked off if set before attempting touse it as a CVMClassBlock*.

(gdb) p ((CVMObject*)0x3bd144)->hdr.clas$76 = (CVMClassBlock *) 0x2ebffc(gdb) call CVMconsolePrintf("%C\n", $76)java.lang.CloneNotSupportedException

Array objects have the same header as above, with the addition of a length field. Below is anarray of length one.

(gdb) x /4wx 0x3bd7d80x3bd7d8: 0x008a8ce0 0x00000002 0x00000001 0x00000000(gdb) p *((CVMArrayOfAnyType*)0x3bd7d8)$77 = { hdr = { clas = 0x8a8ce0, various32 = 2 }, length = 1, ...}

Converting from JNI Types to CVM TypesThe following are mappings of JNI types to internal CVM types:

jclass == CVMClassICell* == java.lang.Class instancejmethodID == CVMMethodBlock*jfieldID == CVMFieldBlock*jobject == CVMObject*

You can pass a variable of type jmethodID as the %M argument to CVMconsolePrintf().Likewise for jfieldID and %F. Even though these types have "ID" in their names, they arenot the same as CVMMethodTypeID and CVMFieldTypeID.

To print the type that a jclass represent, see the next section on converting from ajava.lang.Class to CVMClassBlock*.

Converting from java.lang.Class toCVMClassBlock*

All java.lang.Class instances contain a pointer to the CVMClassBlock* that theyrepresent, and all CVMClassBlocks have an indirect pointer to their java.lang.Classinstance. This makes it possible to convert between the two by using the following two APIs:

extern CVMClassBlock*CVMgcSafeClassRef2ClassBlock(CVMExecEnv* ee, CVMClassICell *clazz)

extern CVMClassBlock *CVMgcUnsafeClassRef2ClassBlock(CVMExecEnv *ee, CVMClassICell *clazz)

(gdb) call CVMgcSafeClassRef2ClassBlock(ee, clazz)

10 of 14

C Debugging with GDB

Page 108: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

$80 = (CVMClassBlock *) 0x26d4d4

If clas is a jclass or CVMClassICell*, then you can do the following to print the classname:

(gdb) call CVMconsolePrintf("%C\n", CVMgcSafeClassRef2ClassBlock(ee, clas))java.lang.Runtime

If you are not GC safe then you can use CVMgcUnsafeClassRef2ClassBlock() instead.

GDB and GC SafetyThere are some things you can't do in the debugger while GC unsafe, such as callingCVMdumpThread(). Examine ee->tcstate.isConsistent. It must be 1. If it is not, thenyou can try switching to a thread that is. If this isn't possible, you can always try thefollowing:

(gdb) set var ee->tcstate.isConsistent = 1(gdb) call CVMdumpAllThreads()

However, there is a very small risk of a deadlock or a crash if you do this. Don't forget to setthe isConsistent flag back to 0 if you wish to continue execution. You are always GC safewhen executing in a JNI method and are usually GC safe when executing in a JNI API or anyclass loading or unloading related code. You are usually always GC unsafe when executingin the interpreter loop (CVMgcUnsafeExecuteJavaMethod()). For more information aboutGC safety, see the chapter How to be GC-safe in CVM.

Debugging Crashes on LinuxLinux unfortunately implements threads on top of processes. When there is a crash, the corefile produced is almost never for the thread (process) that actually crashed. CVM installs asignal handler on Linux that will catch the signal raised because of a crash and suspend theprocess. This allows you to then attach GDB to the process, rather than having to deal witha useless core file.

When CVM crashes on Linux, you will see the following:

Process received signal 11, suspending

When you see this, ctrl-z the process to temporarily stop it. You can then use ps to see alist of all the current CVM processes:

[bin]$ ps

31576 ttyp3 00:00:00 bash21912 ttyp3 00:00:00 cvm21913 ttyp3 00:00:00 cvm21914 ttyp3 00:00:00 cvm21915 ttyp3 00:00:00 cvm22447 ttyp3 00:00:00 cvm22448 ttyp3 00:00:00 cvm22449 ttyp3 00:00:00 cvm

11 of 14

C Debugging with GDB

Page 109: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

22450 ttyp3 00:00:00 cvm22451 ttyp3 00:00:00 cvm22452 ttyp3 00:00:00 cvm22453 ttyp3 00:00:00 cvm22454 ttyp3 00:00:00 cvm22455 ttyp3 00:00:00 cvm22456 ttyp3 00:00:00 cvm22457 ttyp3 00:00:23 cvm24310 ttyp3 00:00:00 ps

The first process in the list is the main process and is the one you want to attach to in GDB.After executing ps, type bg to continue execution in the background. Otherwise GDB willhang waiting for the process to be started again. Next launch GDB and specify the CVMbinary that was running when the crash occurred.

[bin]$ gdb cvmCurrent directory is /home/cjp/spir/ws/cvm/build/linux/bin/GNU gdb 19991004Copyright 1998 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of it under certain conditions.Type "show copying" to see the conditions.There is absolutely no warranty for GDB. Type "show warranty" for details.This GDB was configured as "i386-redhat-linux"...Starting up GDB configuration fileDone interpreting GDB configuration file

Attach to the first cvm process in the ps list:

(gdb) attach 21912Attaching to program: /home/cjp/spir/ws/cvm/build/linux/bin/cvm, Pid 21912Reading symbols from /lib/libpthread.so.0...done.Reading symbols from /lib/libm.so.6...done.Reading symbols from /lib/libnsl.so.1...done.Reading symbols from /lib/libdl.so.2...done.Reading symbols from /lib/libc.so.6...done.Reading symbols from /lib/ld-linux.so.2...done.Reading symbols from /lib/libnss_files.so.2...done.Reading symbols from /usr/lib/gconv/ISO8859-1.so...done.0x40083e0b in __sigsuspend (set=0xbffff50c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:4848 ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory.

info threads will give you a list of all the threads:

(gdb) info threads 15 Thread 22457 0x40083e0b in __sigsuspend (set=0xbdfff008) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 14 Thread 22456 0x40083e0b in __sigsuspend (set=0xbe1ff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 13 Thread 22455 0x40083e0b in __sigsuspend (set=0xbe3ff498) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 12 Thread 22454 0x40083e0b in __sigsuspend (set=0xbe5ff498) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 11 Thread 22453 0x40083e0b in __sigsuspend (set=0xbe7ff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 10 Thread 22452 0x40083d61 in __kill () from /lib/libc.so.6 9 Thread 22451 0x40083e0b in __sigsuspend (set=0xbebff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 8 Thread 22450 0x40083e0b in __sigsuspend (set=0xbedff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 7 Thread 22449 0x40083e0b in __sigsuspend (set=0xbefff62c)

12 of 14

C Debugging with GDB

Page 110: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 6 Thread 22447 0x40083e0b in __sigsuspend (set=0xbf1ff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 5 Thread 22448 0x40083e0b in __sigsuspend (set=0xbf3ff62c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 4 Thread 21915 0x40083e0b in __sigsuspend (set=0xbf5ff52c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 3 Thread 21914 0x40083e0b in __sigsuspend (set=0xbf7ff52c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48* 2 Thread 21912 (initial thread) 0x40083e0b in __sigsuspend (set=0xbffff50c) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 1 Thread 21913 (manager thread) 0x40110fe0 in __poll (fds=0x8386d08, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:45

The thread that crashed will be in the __kill() function. Switch to it to debug the crash:

(gdb) thread 10[Switching to thread 10 (Thread 22452)]#0 0x40083d61 in __kill () from /lib/libc.so.6(gdb) bt#0 0x40083d61 in __kill () from /lib/libc.so.6#1 0x817543d in crash (sig=11) at ../../src/linux/javavm/runtime/sync_md.c:388#2 0x40022582 in pthread_sighandler (signo=11, ctx={gs = 0, __gsh = 0, fs = 0, __fsh = 0, es = 43, __esh = 0, ds = 43, __dsh = 0, edi = 25, esi = 1081082928, ebp = 3198154408, esp = 3198154336, ebx = 1075139692, edx = 32, ecx = 1081081904, eax = 1081081912, trapno = 14, err = 6, eip = 1074521900, cs = 35, __csh = 0, eflags = 66118, esp_at_signal = 3198154336, ss = 43, __ssh = 0, fpstate = 0xbe9ff5e0, oldmask = 2147483648, cr2 = 33}) at signals.c:96#3 0x40083c88 in __restore () at ../sysdeps/unix/sysv/linux/i386/sigaction.c:127#4 0x400bfec4 in __libc_calloc (n=1, elem_size=28) at malloc.c:3707#5 0x8147bb4 in CVMCcallocStub (nelem=1, elsize=28) at ../../src/share/javavm/runtime/porting_debug.c:127#6 0x8114951 in CVMreplenishLockRecordUnsafe (ee=0xbe9ffc40) at ../../src/share/javavm/runtime/objsync.c:366#7 0x8116f59 in CVMdetLock (ee=0xbe9ffc40, indirectObj=0x83d2aec) at ../../src/share/javavm/runtime/objsync.c:1116#8 0x80cc668 in CVMgcUnsafeExecuteJavaMethod (ee=0xbe9ffc40, mb=0x836a8e4, isStatic=0, isVirtual=1) at ../../src/share/javavm/runtime/executejava.c:2932#9 0x80fad05 in CVMjniInvoke (env=0xbe9ffc68, obj=0x83d2954, methodID=0x83696e4, pushArguments=0x80fa0d8 <CVMjniPushArgumentsVararg>, args=0xbe9ffbdc, info=258, retValue=0x0) at ../../src/share/javavm/runtime/jni_impl.c:2412#10 0x80fc3e1 in CVMjniCallVoidMethod (env=0xbe9ffc68, obj=0x83d2954, methodID=0x83696e4) at ../../src/share/javavm/runtime/jni_impl.c:2587#11 0x8108830 in start_func (arg=0x409cfc80) at ../../src/share/javavm/runtime/jvm.c:1505#12 0x8173183 in start_func (a=0x409cfc98) at ../../src/porting/posix/posix_threads_md.c:30#13 0x4001fbb5 in pthread_start_thread (arg=0xbe9ffe40) at manager.c:241

The frame that actually crashed is not included in the backtrace. However, all the registers,including the pc (eip register) are passed as arguments to the signal handler,pthread_sighandler(). You can disassemble the value passed in eip to find out where thecrash actually occurred.

In the above backtrace, frames #0 through #3 are all part of the signal handling. The crashactually occurred in a function called from __libc_calloc(). If you disassemble the valuepassed in the eip argument to pthread_sighandler(), you can see that __libc_calloc()

13 of 14

C Debugging with GDB

Page 111: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

called chunk_alloc(), and that is where the crash occured. (This crash was the result of amemory corruption that caused a call to calloc() to crash).

(gdb) x /4i 10745219000x400be72c <chunk_alloc+84>: mov %ecx,0x8(%edi)0x400be72f <chunk_alloc+87>: mov 0xfffffff4(%ebp),%edi0x400be732 <chunk_alloc+90>: orb $0x1,0x4(%edi,%esi,1)0x400be737 <chunk_alloc+95>: jmp 0x400bef93 <chunk_alloc+2235>

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

14 of 14

C Debugging with GDB

Page 112: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Java Debugging with JDBThis chapter describes the procedures for using the debugger JDB with the CVM.

Contents

Introduction Building and Running the JDWP Agent Invoking JDB Using JDB

IntroductionJDB is a Java debugger for debugging Java programming language code. This chapterdescribes one method of running JDB with the CVM on both Linux and VxWorks. To runJDB with CVM, CVM must first be built with the build time option CVM_JVMDI=true. Forexample, for Linux:

> cd build/linux> make CVM_JVMDI=true J2ME_CLASSLIB=foundation

For VxWorks:

> cd build/vxworks> make CVM_JVMDI=true J2ME_CLASSLIB=foundation

For the purpose of simplicity, the following sections assume that the CVM bundle is installedin the directory /cvm.

Building and Running the JDWP AgentThis procedure describes how to invoke the JDWP agent on both Linux and VxWorks.When you have completed this procedure, the CVM should come up and hang. That isproper behavior because it is now waiting for the debugger front-end to connect beforeexecuting any Java bytecodes.

JDB communicates with CVM through the JDWP agent. The JDWP agent is dynamicallylinked into CVM to interface with the VM through the JVMDI interface. For moreinformation on JDWP and JVMDI, see the JavaTM Platform Debugger Architecturespecification.

1 of 5

Java Debugging with JDB

Page 113: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

On Linux, JDWP comes in the form of libjdwp.so. On VxWorks, JDWP comes in the form of libjdwp.o.

To build the agent, cd to /cvm/ext/jpda/build/<platform>, and run 'make'. This buildsthe needed library in /cvm/jdk_build/<platform>/lib/<arch>, where <platform> is'linux' or 'vxworks', and <arch> is 'i386' or 'PENTIUM'.

To run the JDWP agent with CVM on Linux, cd to /cvm/build/linux/bin and invoke

cvm -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000 -Dsun.boot.library.path=../../../jdk_build/linux/lib/i386 -Djava.class.path=your_class_path your_main_class

-Xdebug tells CVM to run in debugger mode. -Xrunjdwp tells CVM to load libjdwp.so and it expects to find the JDWP agent inthis shared library. :transport=dt_socket,server=y,address=8000 is a parameter list to be passed tothe JDWP agent. transport=dt_socket means to connect to the JDB front-end using a socketimplementation. server=y means that CVM will serve as a debugging server. This means that CVMwill start up and wait for a debugger front-end to connect to it. In this specific case,the connection will be via a socket on port 8000. address=8000 means that CVM will be listening on port 8000 for a connection from adebugger front-end. If you're already using port 8000 for something else, feel free topick another unused port number. Just make sure that your debugger front-end tries toattach to the same port number (see Invoking JDB below). -Dsun.boot.library.path=../../../jdk_build/linux/lib/i386 tells CVMwhere to find libjdwp.so. If you're invoking CVM from /cvm/build/linux/bin,this path will be correct. You won't have to change it. If you're invoking CVM fromsome where else, make sure that -Dsun.boot.library.path= points to/cvm/jdk_build/linux/lib/i386. -Djava.class.path=your_class_path tells CVM where to find your Javaapplication. If your classpath is simply . (as in the current directory), you still need tospecify it. your_main_class is the name of your Java application.

To run the JDWP agent with CVM on VxWorks, cd to /cvm/build/vxworks/bin andinvoke

runJavaJdb "-Djava.class.path=your_class_path your_main_class"

runJavaJdb() sets up the -Xdebug, -Xrunjdwp, -Dsun.boot.library.path argumentsfor you, and appends your classpath and main class before passing it to runJava(). Thedefault setting for -Xrunjdwp is :transport=dt_socket, server=y, address=8000 andthe default setting for -Dsun.boot.library.path is../../../jdk_build/vxworks/lib/PENTIUM. If you need to change either of theseparameters, edit the file /cvm/src/vxworks/bin/vxworks_java_md.c and alter therunJavaJdb() function as necessary. Rebuild your CVM and VxWorks image and updateyour target.

2 of 5

Java Debugging with JDB

Page 114: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Invoking JDBNow that you have CVM up and running (if you don't, see Building and Running the JDWPAgent), you can invoke JDB and have it connect to your currently running instance of CVM.When you have completed this procedure, you will be ready to use other JDB commands andcommence with your debugging activities.

To start JDB and connect it to your running CVM:

1. You will need the Java 2 Platform, Standard Edition SDK v1.3 installed (typically in/usr/local/java/jdk1.3/linux/bin). If the Java 2 Platform, Standard EditionSDK v1.3 is not installed, you can get it at http://java.sun.com/j2se/1.3. Of course, ifyour CVM is running on VxWorks, then your JDB will need to be running on aremote host that has JDK1.3 installed.

2. In another terminal window (to keep the stdin/out for JDB separate from that ofCVM), cd to the root directory where your Java source is stored. This is neededbecause JDB will look for the source in the directory from which it is invoked. If youdon't do this, JDB will still run, but you won't be able to see the source code as youstep through your debug cycle.

Alternatively, you may choose to specify a source path from which JDB will load thesource file of the classes being debugged. See the -sourcepath option below forinformation on how to do this. If you specify a source path, you won't have to cd tothe root directory of your Java source. JDB will search the specified source path forthe Java source files it is expecting.

NOTE: It is the debugger front-end (JDB) that needs and sets the source path. Theback-end (CVM) does not need the source path. However, if the back-end is runningcode that is not compiled from the source code that the front-end is referring to, youmight get an erroneous correlation between code being executed in the back-end andthe source you're viewing in the front-end. So make sure your source (.java file) andexecutable (.class file) being debugged are synchronized.

3. Next, invoke

jdb -attach your_server_machine:8000 -sourcepath your_sourcepath

jdb is the Java debugger that comes in the form of a Java application packagedwith the JDK. If you have /usr/local/java/jdk1.3/linux/bin in your path,you should have no problem invoking it. -attach your_server_machine:8000 tells JDB to connect to port 8000 onthe specified server machine. Be sure to specify the same machine as the onewhere you are running the CVM back-end. If you're running on the samemachine where CVM is running, you can choose to omit theyour_server_machine: part. JDB will look on the local host for the specifiedport by default if you don't explicitly specify the server. If you specified adifferent port when you invoked CVM, then make sure to specify the same port

3 of 5

Java Debugging with JDB

Page 115: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

number here. -sourcepath your_sourcepath tells JDB where to look for the Java sourcefiles that correspond to the Java class files being debugged. The sourcepath isanalogous to the Java classpath except that it is for finding the .java files asopposed to the .class files. The sourcepath is structured as directory pathsseparated by colons.

For example, the following illustrates the invocation of JDB on a host machine named acornto connect with a CVM instance running JDWP with the HelloWorld class (from thetestclasses.zip that comes with CVM) on port 8000 of a server machine named peanut:

acorn> jdb -attach peanut:8000 -sourcepath /cvm/src/share/javavm/test

Note: To find out about other JDB options, you can invoke jdb -help for a list of thesupported JDB options. JDB will come up running (after a slight pause to load the JDK VMwhich it runs on). You should see the following:

Initializing jdb...

VM Started: No frames on the current call stack

main[1] main[1]

Note: If you get here, all is well, you have set up the debugging session correctly. If not, goback and double check that you have entered everything correctly. Some possible reasons forJDB not working are:

CVM couldn't find the Java application class because you didn't specify the correctclasspath (see -Djava.class.path=...). CVM couldn't find libjdwp.so because you didn't specify the correct native lib path(see -Dsun.boot.library.path=...). Any other thing that you thought you did right but didn't. Go back and double check.

Note: main[1] is a prompt where you can start entering JDB commands. Upon enteringJDB for the first time, type list to see a listing of the method you're currently in. You'll geta message like this:

main[1] list No frames on the current call stack main[1]

This is because the VM has not entered any methods yet. To enter the very first method,type step and you will see a message like this:

main[1] step main[1] Step completed: thread="main", HelloWorld.main(), line=14, bci=0 14 if (args != null && args.length >= 1 && args[0].equals("-kgh")) { main[1]

The source code line displayed is the next line of code you will execute if you step thedebugger (by typing step at the JDB command prompt). Now, if you type list at the command prompt, you will see a partial listing of the sourcecode like this:

4 of 5

Java Debugging with JDB

Page 116: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

main[1] list 10 11 public class HelloWorld { 12 13 public static void main(String args[]) { 14 => if (args != null && args.length >= 1 ** args[0].equals("-kgh")) { 15 System.out.println("Hullo from the E-spot VM!"); 16 } else { 17 System.out.println("Hello World."); 18 } 19 } main[1]

Using JDBYou can get a complete list of the available commands by typing help at the JDB commandprompt.

Now that you have JDB up and running, you can perform typical debugger actions with it.For example:

classes Lists all classes that have been loaded. However, note that all ROMIZED classes(because they are PRE-LOADED ... keyword being LOADED) will be listed whetherthey are in use or not. help Lists the available JDB commands. list Lists the current source code. It also shows where in the code you are currentlyexecuting. This only works if you invoked JDB from the root of your source directoryof if you have specified the appropriate source path. run Runs until the next breakpoint is encountered or until the program ends. step Executes a single step. step up Executes until the VM exits the current method. quit Exits JDB.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

5 of 5

Java Debugging with JDB

Page 117: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Creating a Garbage CollectorThis chapter outlines the memory system architecture of CVM. It also provides a reference for its APIsand acts as a guide to a garbage collector author to assist in writing a new object allocator and newgarbage collector (GC) for CVM.

Note: This chapter assumes basic knowledge of tracing garbage collection (GC) algorithms, such asmark-and-sweep and copying collection, as well as related GC concepts, such as read and write barriers.

Contents

Introduction Exactness

Global GC Requests Pluggable GC

Separate Memory System Entry Points to GC Code Shared Memory System Code GC-specific Memory System Code GC Execution Flow

Writing a New GC Source Organization Data Types What to Implement

Basic Execution Read and Write Barriers Moving Arrays

What to Call Initiating a GC Root Scans Special Root Scans Object Walking Per-object Data

Example GC

IntroductionCVM greatly improves on the PersonalJava virtual machine in the memory system area. TheCVM memory system possesses the following new features:

1 of 24

Creating a Garbage Collector

Page 118: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Exactness: CVM ensures that the GC knows about all pointers at GC time; there is no need forconservative scans of the heap. Pluggable GC: CVM has a memory interface that allows a GC author to write a new GC forCVM without changing the VM source.

CVM has a generational garbage collector as its default, resulting in much reduced average GCpause times and much reduced total time spent on GC. CVM incorporates an implementation ofgenerational GC as its default GC. Generational GC is based on the observation that most objectsare short lived. In other words, "young objects die young". So the heap is separated into a smallyoung objects area and a large old objects area. Objects are allocated in the young area, and if theysurvive enough GCs, they are promoted to the old area. Since most objects die young, young spacecollections collect most of the garbage with relatively little effort and short running time, withoccasional longer-running, old space collections to collect the whole heap. In CVM, young spacecollections are performed using a "semispace copying" GC algorithm, whereas old spacecollections are performed using a "mark-compact" GC algorithm.

Further details of CVM's generational GC are beyond the scope of this document. This documentinstead focuses on aspects of the CVM memory system architecture that apply to any GC writtenfor CVM.

ExactnessCVM is built with the goal of exactness in mind. An exact VM knows about all pointers tothe Java heap, both from the VM code and native methods. Exactness has numerousadvantages:

Allows for lower per-object overhead through the elimination of handles Makes full heap compaction possible on every GC Eliminates unnecessary object retention due to conservative guesses Allows the implementation of the widest range of GC algorithms

CVM implements exactness by using GC-safe points (or GC points, for short) for GC. GC cannotoccur at arbitrary points in the execution of a program, but only when all threads can tolerate GC.Furthermore, threads only make their states explicit at well-known intervals, but not all the time.

Each thread in CVM can be in a GC-unsafe state or a GC-safe state. A thread in a GC-unsafe stateis free to point to heap objects directly and can do any GC-unsafe pointer manipulations it likes.However, such a thread cannot tolerate GC, as the collector cannot obtain its precise set ofpointers. A thread in a GC-safe state must make all its pointers known to the GC. In order toprevent pointers from becoming invisible to the GC through C compiler optimizations on VMcode, a thread is not allowed to point to objects directly, but only through an extra level ofindirection. Also, a thread registers with the GC any pointers that the GC needs to scan. Therefore,threads can tolerate GC.

The GC can only proceed when all threads are GC-safe. CVM makes precise pointer informationavailable to the GC when all threads are GC-safe.

For a guide to writing GC-safe code in CVM and details on CVM internal APIs with regards to

2 of 24

Creating a Garbage Collector

Page 119: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

GC-safe and GC-unsafe modes, please refer to the chapter How to be GC-safe in CVM.

Global GC Requests

A typical exact GC cycle in CVM is initiated by a thread requesting a GC. At this point, CVM mustbring all other threads to GC points before the GC can proceed: Each thread polls for a global GC request at GC points. Upon detecting a global GC request, a thread at a GC point saves its GC-observable state andsuspends itself. The GC requester waits for all GC-unsafe threads to become GC-safe and suspend themselves. When all threads are GC-safe, the GC can proceed and scan the exact state of each thread.

GC points fall on certain byte codes to ensure that each thread can suspend itself in bounded time ifthere is a global GC request.

Valid GC points in the CVM interpreter are: Method invocation points Backwards branches Class loading and constant resolution points JNI implementation heap access points Memory allocation points

Method Invocation Points Method invocation points are used as GC points because of the state of the interpreter stack whena GC occurs. Since each frame on the stack refers to a method that has stopped, naturally, at amethod invocation point, it makes sense to use invocation sites as GC points. So when the GCwalks the interpreter stack frames looking for roots, it can readily find frame pointers into the heap.

Backwards Branches Backwards branches are used as GC points in the interpreter to ensure that the currently executingmethod of each thread is guaranteed to become GC-safe within a bounded amount of time: eachmethod will either loop by a backwards branch or hit a method invocation within a boundedamount of time.

Class Loading and Constant Resolution Points CVM code outside of the interpreter, such as the system class loader and verifier, runs mostlyGC-safe, in contrast to the byte code interpreter. This allows GC to occur alongside class loading,for example.

JNI Implementation And finally, CVM's implementation of the Java Native Interface (JNI) allows all native methods torun GC-safe, except when they access the Java heap. So native methods can tolerate GC until theycall JNI functions that access the heap. At such heap access points, the CVM JNI implementationmakes the caller thread temporarily GC-unsafe while it accesses the heap.

Memory Allocation Points Heap allocation points are used as GC points in the interpreter to make sure that if an allocation

3 of 24

Creating a Garbage Collector

Page 120: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

causes a GC, the state of the thread that initiated the GC is scannable.

Pluggable GCCVM is designed to allow a GC author to write a new GC without changing a line of theVM code itself. This section describes the internal organization of the CVM, including thefollowing features: Memory system related functions are separate from the rest of the VM, with the interfacesbetween the memory system and the VM clearly defined. Entry points to the memory system from the VM are clearly defined. This abstracts away thedetails of many common GC tasks from the GC author and is available as a set of routinesfor the GC author to use. GC-algorithm-independent code is separate from the GC-algorithm-dependent code.GC-algorithm-independent code is designed to be an interface that needs to be implementedby a GC author to provide GC functionality. GC execution flow, including object allocation, is defined.

Separate Memory System

The separation of the VM from the memory interface is achieved by extensive use of internalinterfaces that are built hierarchically.

The VM needs to access the heap:

Directly for GC-unsafe code Indirectly for GC-safe code Indirectly for native method code

Direct heap access is achieved by using the direct memory interface. Indirect heap access isachieved using the indirect memory interface, which is built on top of the direct memory interface.Native method heap access is achieved through a JNI implementation that is built on top of theindirect memory interface. Consequently, all heap access in the system is guaranteed to eventuallygo through the direct memory interface.

To achieve a memory interface that can accommodate as many GC algorithms as possible, CVMallows the implementation of read and write barriers. Barriers are used to ensure consistencybetween a running program and the GC, especially when the GC does not handle the whole heapon every GC call. Examples of such GCs are generational, incremental, and concurrent GCs.Barrier use varies widely between GC algorithms.

A read or write barrier of the data type <T> is a GC-supplied callback to be invoked on every reador write of a heap location of type <T>.

CVM implements support for read and write barriers below the direct memory interfaceimplementation, so that they are not visible to the VM author. The read and write barriers arecalled implicitly and automatically by the implementation of the direct memory interface, and are,therefore, incurred on all heap access in the system.

4 of 24

Creating a Garbage Collector

Page 121: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Entry Points to GC Code

Besides accessing the heap, the VM also needs to:

Initialize the heap on VM startup Call the object allocator Destroy the heap on VM teardown

Heap initialization/teardown and object allocation are the most commonly used entry points to GCcode from the VM. All allocation and GC activity in the system is triggered by a call from the VMor a native method into the object allocator. The object allocator encapsulates GC policy and isresponsible for initiating GC when it is required.

There are other entry points that the VM uses to pass control to the GC. However, these areusually triggered by a matching native call to request GC action as described below:

The sun.misc.GC class (responsible for asynchronous, background GC) calls into the GC to figureout the time stamp of the last major GC in the system. The library method Runtime.gc() causes a GC to occur. The library methods Runtime.freeMemory() and Runtime.totalMemory() obtain informationfrom the GC regarding free and total memory sizes in the heap.

Shared Memory System Code

There are certain activities that all GCs will have to perform, regardless of algorithm. CVMseparates those routines into the shared GC interface called gc_common. Such common GCactivities include:

Making threads stop at GC-safe points Finding and scanning exact roots of the system Finding and scanning references in heap objects and arrays Handling special scans for

Weak references and finalization String interning Java language synchronization data structures Class unloading

The details of such activities are abstracted in the implementation of the gc_common interface, andare available as GC services for the GC author to use. These routines and macros are described indetail in the section Writing a New GC.

GC-specific Memory System Code

There are certain activities that are GC-algorithm specific. CVM separates those routinesinto a GC-implementation specific GC interface gcimpl. The routines and macros in thisinterface need to be implemented by the GC author. Such GC calls are responsible for:

5 of 24

Creating a Garbage Collector

Page 122: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Allocating and initializing the heap and its associated data structures Allocating new objects Performing the object reclamation functions of the GC Implementing read and write barriers.

The gcimpl routines will be called by the VM at appropriate points to ensure the correct GCexecution flow. These routines and macros are described in detail in the section Writing a New GC.

GC Execution Flow

Object allocation, and subsequent possible GC action, is initiated by the VM by calling intothe gcimpl object allocation routine and is performed by switching back and forth betweenshared and GC-implementation specific code.

1. CVM allocates memory using the shared routine CVMgcAllocNewInstance(). 2. CVMgcAllocNewInstance() does some processing and calls the GC-specific

CVMgcimplAllocObject() to allocate the actual space for the object. 3. CVMgcimplAllocObject() performs the GC and calls the shared routine

CVMgcStopTheWorldAndGC() to stop all threads at GC-safe points. 4. CVMgcStopTheWorldAndGC() ensures that all threads rendezvous at GC-safe points. When that is

done, it calls the GC implementation CVMgcimplDoGC() to perform the GC action. 5. CVMgcimplDoGC() may call shared GC service routines to scan GC state: For example,

CVMgcScanRoots() to scan all roots or CVMobjectWalkRefs() to scan the pointers in a givenobject or array.

6. When CVMgcimplDoGC() returns, all threads that were stopped at GC points resume execution.Eventually, CVMgcAllocNewInstance() returns and the thread that originally initiated GC resumesexecution.

Writing a New GCTo write a new garbage collector for CVM, the GC author implements the gcimpl interface.This section outlines the GC and relevant CVM source organization, describes the CVMdata types that the GC author needs to know about, and describes the gcimpl routines thatneed to be implemented. This section also describes the shared GC routines available to theGC author.

Source Organization

The important directories and files relevant to implementing GCs on CVM are:

src/share/javavm/include/gc_common.h The shared GC interface. src/share/javavm/include/gc/gc_impl.h The gcimpl GC interface that has to be implemented for each GC. src/share/javavm/include/gc/<gcname>/gc_config.h

6 of 24

Creating a Garbage Collector

Page 123: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The configuration file for a specific GC. src/share/javavm/runtime/gc/<gcname>/gc_impl.c The implementation file for a specific GC.

Data Types

GC code has direct access to all objects on the heap. The GC code can also assume that it issingle-threaded if it is being executed as part of a CVMgcimplDoGC(), which guarantees thatno GC-unsafe threads exist. Therefore, GC code can refer to an object directly using the typeCVMObject*. A CVMObject is defined as:

struct CVMjava_lang_Object { CVMObjectHeader hdr; CVMJavaVal32 fields[1];};...typedef CVMjava_lang_Object CVMObject;

where the object header CVMObjectHeader is defined as:

struct CVMObjectHeader { CVMClassBlock *clas; volatile CVMUint32 various32; /* A multi-purpose field */};

Array types are a subclass of object types, in the sense that an array reference in CVM canbe cast to a CVMObject*. The header of a Java language array contains the same structure,with an additional 32-bit length field.

Array types differ for each element type. Array elements are tightly packed in that anindividual sub-word element of an array, such as a short, is not widened to int width. Asample array declaration with name <arrName>and element type <elem_type> looks like:

struct CVMArrayOf<arrName> { CVMObjectHeader hdr; CVMJavaInt length; <elem_type> elems[1];};typedef struct CVMArrayOf<arrName> CVMArrayOf<arrName>;

The CVM array types are:

7 of 24

Creating a Garbage Collector

Page 124: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Array type Element type

CVMArrayOfByte CVMJavaByte

CVMArrayOfShort CVMJavaShort

CVMArrayOfChar CVMJavaChar

CVMArrayOfBoolean CVMJavaBoolean

CVMArrayOfInt CVMJavaInt

CVMArrayOfRef CVMObjectICell

CVMArrayOfFloat CVMJavaFloat

CVMArrayOfLong CVMTwoJavaWords

CVMArrayOfDouble CVMTwoJavaWords

The element type of CVMTwoJavaWords for the long and double cases is defined as:

typedef CVMJavaVal32 CVMTwoJavaWords[2];

Any array can be cast to CVMArrayOfAnyType if the aim is to access array header elementsonly.

Because the GC can assume single-threaded execution, it is free to override the second wordof an object header, assuming that it reconstructs it before threads are resumed. The secondheader word frequently has a trivial, well known default value. This word can be tested fortriviality to determine if an overriding GC routine needs to save away the original contents ofthe word:

/* The default trivial contents of the various32 word */ constant CVMUint32 CVM_OBJECT_DEFAULT_VARIOUS_WORD

/* Is a various32 word trivial? * (i.e. can just be set to CVM_OBJECT_DEFAULT_VARIOUS_WORD after * GC) CVMBool CVMobjectTrivialClassWord(CVMUint32 word)

The complete set of operations on an object the GC author can call are given below in thesection Per-object Data.

For more information about CVM-internal data structures, see the header files included insrc/share/javavm/include. Especially important are: objects.h: Object format, basic Java language synchronization operations classes.h: CVM internal representations of Java language classes gc_common.h: Shared GC data structures sync.h: Lock structures

Also note that the basic data types defined by the platform and the VM basic data types thatare exported to the porting layer are described in the chapter Host Programming Interface(HPI) Reference:

8 of 24

Creating a Garbage Collector

Page 125: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The defs.h section describes the data types defined by the platform. The vm-defs.h section describes data types that are exported to the porting layer.

What to Implement

As described previously, a new GC is written by implementing a set of gcimpl functions.This section describes them, detailing how to get basic GC execution, including the functionsand macros that must be implemented, the read and write barriers to use, and how to movearrays.

Basic Execution

For basic GC execution, and for interfacing with the VM, the GC implementation mustimplement the following data types and functions.

To start out with, define in src/share/javavm/include/gc/<gcname>/gc_config.h:

struct CVMGCGlobalState { .... };

This should include any global state the GC would like to maintain which non-GC codemight wish to access. In the current state of CVM, there are no such details that may becommunicated through CVMGCGlobalState. This may change in the future.

Now the GC author should implement the following functions.

1. For heap initialization:

/* Initialize GC global state if required */ CVMUint32 CVMgcimplInitGlobalState(CVMGCGlobalState* globalState)

/* Initialize the heap, with a given minimum and maximum heap size in bytes. Return CVM_TRUE on success, CVM_FALSE otherwise. */ CVMBool CVMgcimplInitHeap(CVMGCGlobalState* globalState, CVMUint32 minBytes, CVMUint32 maxBytes)

2. For allocation and GC:

/* * Allocate uninitialized heap object of size numBytes * This is called by the VM code on every allocation. */ CVMObject* CVMgcimplAllocObject(CVMExecEnv* ee, CVMUint32 numBytes)

/* * Perform GC. * * This routine is called by the common GC code after all locks are * obtained, and threads are stopped at GC-safe points. It's the GC * routine that needs a snapshot of the world while all threads are * stopped (typically at least a root scan). * * The goal to free is 'numBytes' bytes.

9 of 24

Creating a Garbage Collector

Page 126: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

*/ void CVMgcimplDoGC(CVMExecEnv* ee, CVMUint32 numBytes)

3. For teardown and VM exit:

/* Teardown routines */

/* * Destroy GC global state */ void CVMgcimplDestroyGlobalState(CVMGCGlobalState* globalState);

/* * Destroy heap. CVM_TRUE on success, CVM_FALSE otherwise. */ CVMBool CVMgcimplDestroyHeap(CVMGCGlobalState* globalState);

4. Miscellaneous routines:

/* * Return the number of bytes free in the heap.

*/ CVMUint32 CVMgcimplFreeMemory(CVMExecEnv* ee)

/* * Return the amount of total memory in the heap, in bytes. */ CVMUint32 CVMgcimplTotalMemory(CVMExecEnv* ee)

/* The time stamp of the last full GC of the heap, in order to * support the implementation of sun.misc.GC.maxObjectInspectionAge(). * This should return the value of CVMtimeMillis() obtained on the last * GC performed. */ CVMInt64 CVMgcimplTimeOfLastMajorGC();

5. Debug-only routines (when CVM_DEBUG=true at build-time)

/* Heap iteration support */

/* * Per-object callback to call during iteration */ typedef void (*CVMObjectCallbackFunc)(CVMObject* obj, CVMClassBlock* cb, CVMUint32 objSize, void* data);

/* * CVMgcimplIterateHeap should traverse all objects on the heap and * call 'cback' on each object, with its class, size and generic * 'data'. * * If the heap consists of contiguous range(s), use CVMgcScanObjectRange() */ void CVMgcimplIterateHeap(CVMExecEnv* ee, CVMObjectCallbackFunc cback, void* data)

/* * A per-object callback function, to be called during heap dumps */ typedef void (*CVMObjectCallbackFunc)(CVMObject* obj, CVMClassBlock* cb,

10 of 24

Creating a Garbage Collector

Page 127: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMUint32 objSize, void* data);

/* * Heap dump support: Iterate over a contiguous-allocated * range of objects. */ void CVMgcScanObjectRange(CVMExecEnv* ee, CVMUint32* base, CVMUint32* top, CVMObjectCallbackFunc callback, void* callbackData);

Read and Write Barriers

CVM allows a GC author to define read and write barriers as required by a given GCalgorithm. This is done by including a series of #define's insrc/share/javavm/include/gc/<gcname>/gc_config.h. The implementation of thebarrier for a data type <T> is called implicitly by the appropriate direct memory layer macrocorresponding to <T>; the barriers are not visible to VM authors.

Note that in all the barriers listed below, the type Ref refers to any reference type, includingobjects of all classes and arrays. Appropriate type checking of assignments is done by therest of the VM; all reference types are equal by the time they trickle down to the barrierlayer.

The default implementation of a barrier is empty. Therefore, the GC author should only#define the barriers that he/she needs.

The read and write barriers are separated according to data type. The names are selfexplanatory. The code for a read or write barrier is executed right before the actual read orwrite takes place.

All barriers take as argument a pointer to the head of the object being written, as well as theaddress of the slot being written to. Write barriers take an additional argument that is thevalue that is being written.

Read Barriers

The read barrier for reference typed array or object slots:

void CVMgcimplReadBarrierRef( CVMObject* objRef, CVMJavaObject** fieldLoc)

The read barriers for non-reference types, size 32-bits or less:

void CVMgcimplReadBarrierByte( CVMObject* objRef, CVMJavaByte* fieldLoc) void CVMgcimplReadBarrierBoolean( CVMObject* objRef, CVMJavaBoolean* fieldLoc) void CVMgcimplReadBarrierShort( CVMObject* objRef, CVMJavaShort* fieldLoc) void CVMgcimplReadBarrierChar( CVMObject* objRef, CVMJavaChar* fieldLoc) void CVMgcimplReadBarrierInt( CVMObject* objRef, CVMJavaInt* fieldLoc) void CVMgcimplReadBarrierFloat(

11 of 24

Creating a Garbage Collector

Page 128: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMObject* objRef, CVMJavaFloat* fieldLoc)

The read barrier for 64-bit slots, for Java language long and double.

void CVMgcimplReadBarrier64( CVMObject* objRef, CVMJava32* fieldLoc)

Write Barriers

The write barrier for reference typed array or object slots:

void CVMgcimplWriteBarrierRef( CVMObject* objRef, CVMObject** fieldLoc, CVMObject* rhs)

The write barriers for non-reference types, size 32-bits or less:

void CVMgcimplWriteBarrierByte( CVMObject* objRef, CVMJavaByte* fieldLoc, CVMJavaByte rhs) void CVMgcimplWriteBarrierBoolean( CVMObject* objRef, CVMJavaBoolean* fieldLoc, CVMJavaBoolean rhs) void CVMgcimplWriteBarrierShort( CVMObject* objRef, CVMJavaShort* fieldLoc, CVMJavaShort rhs) void CVMgcimplWriteBarrierChar( CVMObject* objRef, CVMJavaChar* fieldLoc, CVMJavaChar rhs) void CVMgcimplWriteBarrierInt( CVMObject* objRef, CVMJavaInt* fieldLoc, CVMJavaInt rhs) void CVMgcimplWriteBarrierFloat( CVMObject* objRef, CVMJavaFloat* fieldLoc, CVMJavaFloat rhs)

The write barrier for 64-bit slots, for Java language long and double.

void CVMgcimplWriteBarrier64( CVMObject* objRef, CVMJava64* fieldLoc, CVMJava64 rhsPtr)

Important notes: In the 64-bit cases of read and write barriers, the fieldLoc argument of a read or writebarrier is a pointer to a CVMJavaVal32 corresponding to the first 32-bit word of a 64-bitvalue. Likewise, in the 64-bit write barrier, rhsPtr is a pointer to a CVMJavaVal32corresponding to the first 32-bit word of the 64-bit value being written. The byte, char and short data types are widened to int width in regular Java objects (notin arrays), so barriers for those data types are CVMgcimpReadBarrierInt() andCVMgcimplWriteBarrierInt(), and not the shorter variants.

Moving Arrays

The barriers described above are defined on a slot-by-slot basis. On some GCs, this mayprove to be inefficient when arrays need to be moved. For array moves, optional blockreaders and block writers may be defined. These would have to perform the read or writeand batch the barriers. If a GC chooses not to override these, the memory system invokes theelement-wise barriers for each element of the array move.

Any of the block operations in these sections may be overridden:

12 of 24

Creating a Garbage Collector

Page 129: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

To read from a Java language array into a C array To write to a Java language array from a C array To copy the contents of one Java language array to another Java language array of the sametype

To read from a Java language array into a C array Each of these will read len elements of the appropriate type from Java language array arr,starting from index start. The elements will be written into the C buffer buf. The actionperformed below should include any block barrier action required, and also the block copyitself, which is the equivalent of

memmove(&buf[0], arr->elems[start], len * sizeof(<jType>))

where jType is the appropriate Java language type (e.g. CVMJavaInt or CVMJavaLong).

void CVMgcimplArrayReadBodyByte( CVMJavaByte* buf, CVMArrayOfByte* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyBoolean( CVMJavaBoolean* buf, CVMArrayOfBoolean* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyShort( CVMJavaShort* buf, CVMArrayOfShort* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyChar( CVMJavaChar* buf, CVMArrayOfChar* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyInt( CVMJavaInt* buf, CVMArrayOfInt* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyFloat( CVMJavaFloat* buf, CVMArrayOfFloat* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyRef( CVMJavaObject** buf, CVMArrayOfRef* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyLong( CVMJavaVal32* buf, CVMArrayOfLong* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayReadBodyDouble( CVMJavaVal32* buf, CVMArrayOfDouble* arr, CVMUint32 start, CVMUint32 len)

To write to a Java language array from a C array Each of these will write len elements of the appropriate type to a Java language array arr,starting from index start. The elements will be read from the C buffer buf. The actionperformed below should include any block barrier action required, and also the block copyitself, which is the equivalent of

memmove(arr->elems[start], &buf[0], len * sizeof(<jType>))

where jType is the appropriate Java language type (e.g. CVMJavaInt or CVMJavaLong).

void CVMgcimplArrayWriteBodyByte( CVMJavaByte* buf, CVMArrayOfByte* arr, CVMUint32 start, CVMUint32 len)

13 of 24

Creating a Garbage Collector

Page 130: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

void CVMgcimplArrayWriteBodyBoolean( CVMJavaBoolean* buf, CVMArrayOfBoolean* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyShort( CVMJavaShort* buf, CVMArrayOfShort* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyChar( CVMJavaChar* buf, CVMArrayOfChar* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyInt( CVMJavaInt* buf, CVMArrayOfInt* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyFloat( CVMJavaFloat* buf, CVMArrayOfFloat* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyRef( CVMJavaObject** buf, CVMArrayOfRef* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyLong( CVMJavaVal32* buf, CVMArrayOfLong* arr, CVMUint32 start, CVMUint32 len) void CVMgcimplArrayWriteBodyDouble( CVMJavaVal32* buf, CVMArrayOfDouble* arr, CVMUint32 start, CVMUint32 len)

To copy the contents of one Java language array to another Java language array of thesame type Each of these will copy len elements of the appropriate type from srcArr[srcIdx,srcIdx+len) to dstArr[dstIdx, dstIdx+len). The action performed below shouldinclude any block barrier action required, and also the block copy between the arrays itself,which is the equivalent of

memmove(dstArr->elems[dstIdx], srcArr->elems[srcIdx], len * sizeof(<jType>))

where jType is the appropriate Java language type (e.g., CVMJavaInt or CVMJavaLong).

void CVMgcimplArrayCopyByte( CVMArrayOfByte* srcArr, CVMUint32 srcIdx, CVMArrayOfByte* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyBoolean( CVMArrayOfBoolean* srcArr, CVMUint32 srcIdx, CVMArrayOfBoolean* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyShort( CVMArrayOfShort* srcArr, CVMUint32 srcIdx, CVMArrayOfShort* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyChar( CVMArrayOfChar* srcArr, CVMUint32 srcIdx, CVMArrayOfChar* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyInt( CVMArrayOfInt* srcArr, CVMUint32 srcIdx, CVMArrayOfInt* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyFloat( CVMArrayOfFloat* srcArr, CVMUint32 srcIdx, CVMArrayOfFloat* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyRef( CVMArrayOfRef* srcArr, CVMUint32 srcIdx, CVMArrayOfRef* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyLong( CVMArrayOfLong* srcArr, CVMUint32 srcIdx,

14 of 24

Creating a Garbage Collector

Page 131: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMArrayOfLong* dstArr, CVMUint32 dstIdx, CVMUint32 len) void CVMgcimplArrayCopyDouble( CVMArrayOfDouble* srcArr, CVMUint32 srcIdx, CVMArrayOfDouble* dstArr, CVMUint32 dstIdx, CVMUint32 len)

What to Call

In the section Shared Memory System Code we have mentioned the gc_common interface.This section outlines the various components of the gc_common interface available to the GCauthor, including how to initiate a GC, how GC roots are scanned, how special root scansare performed, how object walking is performed, and a list of the macros for accessing thedata on an object. You can find the interface insrc/share/javavm/include/gc_common.h.

Initiating a GC

When an object allocator decides to GC (most probably due to an allocation failure), it has tomake sure that the system is stopped in a GC-safe way. In CVM, this is accomplished byusing CVMgcStopTheWorldAndGC():

/* * Initiate a GC. Acquire all GC locks, stop all threads, and then * call back to the particular GC to do the work. When the particular * GC is done, resume. * * Returns CVM_TRUE on success, CVM_FALSE if GC could not be run. */ CVMBool CVMgcStopTheWorldAndGC(CVMExecEnv* ee, CVMUint32 numBytes)

This function stops the system in a GC-consistent way by acquiring all system locks, andbringing all threads to GC-safe points. Then it calls the entry point to the GCimplementation, CVMgcimplDoGC() to do the actual work. If GC work could not beperformed because of a problem such as an out of memory situation,CVMgcStopTheWorldAndGC() returns CVM_FALSE.

Root Scans

When all threads are stopped at GC-safe points, the GC will need to scan all GC roots. Thisis accomplished by using CVMgcScanRoots(), and a GC-specific callback function:

/* * Scan the root set of collection */ void CVMgcScanRoots(CVMExecEnv* ee, CVMGCOptions* gcOpts, CVMRefCallbackFunc callback, void* data)

where the callback function type is defined as:

/* * A 'ref callback' called on each *non-NULL* discovered root */ typedef void (*CVMRefCallbackFunc)(CVMObject** refAddr, void* data)

So the GC author defines a callback function that takes the address of a reference containing

15 of 24

Creating a Garbage Collector

Page 132: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

slot as argument, along with an opaque data argument. CVMgcScanRoots(ee, gcOpts,refCallback, refCallbackData) calls (*refCallback)(refPtr, refCallbackData)on every discovered root address refPtr.

The memory system guarantees that both the following conditions hold when the callbackroutine is called:

refPtr != NULL *refPtr != NULL

The roots scanned are JNI local and global references, Java language stack locations, Javalanguage local variables, Java language static variables, and CVM-internal data structures.The details are abstracted from the GC author.

Weak references are only discovered and queued up if gcOpts.discoverWeakReferencesis CVM_TRUE before a call to CVMgcScanRoots(). So the GC author typically calls the firstroot scan with weak references discovery enabled, and then disable weak referencesdiscovery by setting gcOpts.discoverWeakReferences to CVM_FALSE.

The root scanning operation may be performed multiple times on each GC cycle. However,note that each root scan cycle including the first one should be preceded by a call toCVMgcClearClassMarks():

/* * Clear the class marks for dynamically loaded classes. */ void CVMgcClearClassMarks(CVMExecEnv* ee, CVMGCOptions* gcOpts);

This function is responsible for clearing the mark bits on dynamically loaded classes. Themark bits are used to prevent infinite recursion and redundant work on class scanning. If theyare not cleared between successive root scans, the GC might end up skipping important classroots like Java language statics.

Note that CVMgcClearClassMarks() is a separate function since a root scan cycle mayinclude more than just calling CVMgcScanRoots(). For example, a generational GC may callCVMgcScanRoots() to discover system roots, CVMgcScanSpecial() to discover specialobject roots, and then scan pointers recorded by a write barrier. SoCVMgcClearClassMarks() should be called before each such list of root scans, duringwhich class scanning state should be kept.

Special Root Scans

The Java 2 Platform language and libraries have features that require special scanningsupport from CVM. In particular, the following requires special handling:

Weak references and finalization Java 2 Platform has three flavors of public weak reference classes in the java.lang.ref package,a fourth package-private java.lang.ref weak reference flavor for implementing finalization, anda JNI weak reference flavor for native method use. The GC needs to be aware of all these. String interning

16 of 24

Creating a Garbage Collector

Page 133: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

The CVM classloader interns Java language strings that it finds in newly loaded class files. Also, anapplication can intern strings using String.intern(). Some special treatment is necessary toenable unloading of these strings when they are not in application use. Java language synchronization data structures The CVM runtime uses various data structures to support Java language synchronization, whichcontain embedded pointers to objects. These data structures should be collectible when the objectsthey refer to become garbage. Class unloading According to Java 2 Platform semantics, a class C can be unloaded if and only if its classloader CLis garbage-collected. The CVM memory system should implement this behavior.

The CVM memory system hides the GC-scanning details of these special features from the GCauthor by the use of a narrow interface consisting of two functions. If the GC author calls thesetwo functions at the right points in GC code, all special scanning is performed automatically.

The idea with special scanning is to garbage collect entries from out-of-heap tables pointing intothe heap. If we declared the tables as GC roots, they would automatically be kept alive and theirentries would never be collected. Instead, we do the special objects scanning in conjunction withinformation from the GC to figure out which entries of the special objects may be discarded andwhich entries need to be kept.

Where to insert special root scan APIs

From the CVM point of view, GC involves two conceptual points where special root scan APIsshould be inserted:

1. A point at which object liveness detection is possible. 2. A point at which object pointer update is possible, from a pre-GC pointer to a post-GC pointer.

As illustrated below, when the GC calls CVMgcProcessSpecialWithLivenessInfo(), eachspecial object slot will be checked by (*isLive)() to see if the GC determined it to be live in thepreceding reachability scan. Dead entries will automatically be removed from the special objecttables. Later on, the GC will call CVMgcScanSpecial(), which will cause all remaining live entriesin the special object tables to be updated with new pointers.

1. A point at which object liveness detection is possible. For a mark-sweep-compact type collector, this would be right after a recursive mark has beenperformed, but before the addresses of any objects have changed. So to detect liveness, themark-sweep collector would simply inspect the mark of an object. For a copying collector, thiswould be right after all live data has been copied. So to detect liveness, the copying collectorwould check whether an object reference is to a forwarded old-space object, or a new-space object.

For this point, the appropriate special scan routine isCVMgcProcessSpecialWithLivenessInfo().

The full API for point #1:

/*

17 of 24

Creating a Garbage Collector

Page 134: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

* Process special objects with liveness info from a particular GC * implementation. This covers special scans like string intern table, * weak references and monitor structures. * * isLive - a predicate that returns true if an object is strongly * referenced * * transitiveScanner - a callback that marks an object * and all its children */ void CVMgcProcessSpecialWithLivenessInfo(CVMExecEnv* ee, CVMGCOptions* gcOpts, CVMRefLivenessQueryFunc isLive, void* isLiveData, CVMRefCallbackFunc transitiveScanner, void* transitiveScannerData);

The transitiveScanner callback function type CVMRefCallbackFunc is defined in Root Scans.The transitiveScanner should mark its parameter object reference and all its children. Thenon-NULL CVMRefCallbackFunc argument semantics hold for transitiveScanner (seeguarantee).

The liveness test is done using a predicate isLive of type:

/* * A predicate to test liveness of a given reference */ typedef CVMBool (*CVMRefLivenessQueryFunc)(CVMObject** refAddr, void* data)

Here also, the non-NULL argument semantics hold for isLive (see guarantee).

2. A point at which object pointer update is possible, from a pre-GC pointer to a post-GCpointer. This varies widely for each algorithm. For a copying type algorithm, objects typically include theirforwarding addresses. So pointer updating for an old space pointer is simply obtaining itsforwarding address. Pointer updating for a new space pointer is not necessary.

For this point, the appropriate special scan routine is CVMgcScanSpecial().

The full API for point #2:

/* * Scan and optionally update special objects. This covers special * scans like string intern table, weak references and monitor * structures. */ void CVMgcScanSpecial(CVMExecEnv* ee, CVMGCOptions* gcOpts, CVMRefCallbackFunc updateRefCallback, void* data);

The updateRefCallback function type CVMRefCallbackFunc is defined in Root Scans. It is calledfor each location that needs to be updated to a new address. The non-NULLCVMRefCallbackFunc argument semantics hold for updateRefCallback (see guarantee).

Object Walking

Given an object reference, the GC must be able to find all pointers embedded in the object

18 of 24

Creating a Garbage Collector

Page 135: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

and perform an action on each pointer. This operation is very common in all tracing GCs.

In CVM, object walking is performed using a macro, for maximum efficiency. The objectwalker uniformly and automatically handles arrays of references and objects. When itencounters an object of class C, it scans class C as well. It also discovers weak references,and acts accordingly.

macro void CVMobjectWalkRefsWithSpecialHandling( CVMExecEnv* ee, CVMGCOptions* gcOpts, CVMObject* obj, CVMUint32 firstHeaderWord, C-statement refAction, CVMRefCallbackFunc callback, void* data)

So given an ee and a gcOpts, CVMobjectWalkRefsWithSpecialHandling() scans objectobj with the first header word firstHeaderWord. It executes (more like "substitutes", giventhat this is a macro) the statement refAction on every embedded object reference. refPtris a special variable within the body of refAction, pointing to the object slot being scanned.The object slot may contain NULL, so refAction must be prepared to deal with that.

CVMobjectWalkRefsWithSpecialHandling() also calls (*callback)(refPtr, data) onthe address refPtr of every reference-typed slot in the class data. The non-NULLCVMRefCallbackFunc argument semantics hold for callback (see guarantee)

Note that refAction is a macro, whereas callback is a function. This asymmetry isintentional for efficiency reasons: refActionis going to be called for each slot of eachobject, whereas callback is going to be called for each slot of each class. The former istypically orders of magnitude more frequent than the latter.

Per-object Data

The following set of macros are responsible for accessing the information on an object givena direct object reference. The set of operations are separated into a few distinct categories.Arrays and objects automatically receive separate treatment.

Object size support, given an object or array reference

/* Get the size of an object or array instance */ CVMUint32 CVMobjectSize(CVMObject* obj) /* Get the size of an object or array instance given its class*/ CVMUint32 CVMobjectSizeGivenClass(CVMObject* obj, CVMClassBlock* cb)

Object class support

/* Get the first word of the object header as integer */ CVMUint32 CVMobjectGetClassWord(CVMObject* obj) /* Set the first word of the object header as integer */ void CVMobjectSetClassWord(CVMObject* obj, CVMUint32 word) /* Get the class of a given object */ void CVMobjectGetClass(CVMObject* obj)

ROMized object support

19 of 24

Creating a Garbage Collector

Page 136: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

/* CVM_TRUE if an object is read-only and not on the heap */ CVMBool CVMobjectIsInROM(CVMObject* obj)

Object marking support

/* CVM_TRUE if an object is "marked". */ CVMBool CVMobjectMarked(CVMObject* obj) /* Clear mark on an object */ void CVMobjectClearMarked(CVMObject* obj) /* Set mark on an object */ void CVMobjectSetMarked(CVMObject* obj)

Example GC

This section outlines a very simple allocator and garbage collector written for CVM calledmarkcompact, for a mark-sweep-compact collector. The outline here only pertains toimplementation for the GC interface, so there is no detail about the actual compactionprocess.

To begin, there should be a gc_config.h file describing the GC:

src/share/javavm/include/gc/markcompact/gc_config.h:

#ifndef _INCLUDED_MARKCOMPACT_GC_CONFIG_H #define _INCLUDED_MARKCOMPACT_GC_CONFIG_H

#include "javavm/include/gc/gc_impl.h" /* * The following header could include any mark-compact specific * declarations. */ #include "javavm/include/gc/markcompact/markcompact.h"

/* * Barriers in this implementation */

#define CVMgcimplWriteBarrierRef(directObj, slotAddr,

rhsValue) \

/* \ * Do nothing. Just an

example. \

*/ \

/* * Global state specific to GC */ struct CVMGCGlobalState {

20 of 24

Creating a Garbage Collector

Page 137: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

/* Nothing here */ };

#endif /* _INCLUDED_MARKCOMPACT_GC_CONFIG_H */

Next, there should be a gc_impl.c file implementing the garbage collector. Note that settingthe build option CVM_GCCHOICE=markcompact would build this garbage collectorautomatically.

src/share/javavm/runtime/gc/markcompact/gc_impl.c: #include "javavm/include/defs.h" #include "javavm/include/objects.h" #include "javavm/include/classes.h" #include "javavm/include/directmem.h"

/* * This file is generated from the GC choice given at build time. */ #include "generated/javavm/include/gc_config.h"

/* The shared GC interface */ #include "javavm/include/gc_common.h" /* And the specific GC interface */ #include "javavm/include/gc/gc_impl.h"

/* * The main allocation entry point */

/* * Allocate uninitialized heap object of size numBytes. * GC "policy" encapsulated here. */ CVMObject* CVMgcimplAllocObject(CVMExecEnv* ee, CVMUint32 numBytes) { CVMObject* allocatedObj; /* Actual allocation detail hidden here */ allocatedObj = tryAlloc(numBytes); if (allocatedObj == NULL) { /* GC and re-try allocation */ if (CVMgcStopTheWorldAndGC(ee, numBytes)) { /* re-try if GC occurred */ allocatedObj = tryAlloc(numBytes); } } return allocatedObj; }

21 of 24

Creating a Garbage Collector

Page 138: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

/* * The main GC point, which CVM calls after ensuring GC-safety of all

* threads. * * This is a mark-sweep-compact GC, with most details of the sweep

and * compaction hidden. * * The GC uses three callback functions. These are detailed below, * after CVMgcimplDoGC(). */ void CVMgcimplDoGC(CVMExecEnv* ee, CVMUint32 numBytes) { CVMGCOptions gcOpts;

/* Set default GC options */ gcOpts.fullGC = CVM_TRUE; gcOpts.allClassesAreRoots = CVM_FALSE;

/* The mark phase includes discovering weak references */ gcOpts.discoverWeakReferences = CVM_TRUE;

/* * Scan all roots. markTransitively will mark a root and all its * "children". Its 'data' argument is the GC options. A more * complicated callback could pass a pointer to a struct into * the callback function. */ CVMgcScanRoots(ee, &gcOpts, markTransitively, &gcOpts);

/* * Don't discover any more weak references. */ gcOpts.discoverWeakReferences = CVM_FALSE;

/* * At this point, we know which objects are live and which are

not. * Do the special objects processing. */ CVMgcProcessSpecialWithLivenessInfo(ee, &gcOpts, isLive, NULL, markTransitively, &gcOpts);

/* The sweep phase. This phase computes the new addresses of each

object and writes them on the side. Details hidden. */ sweep();

22 of 24

Creating a Garbage Collector

Page 139: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

/* Update the roots again, by writing out looking up old -> new address translations. */ CVMgcScanRoots(ee, &gcOpts, updateRoot, NULL); CVMgcScanSpecial(ee, gcOpts, updateRoot, NULL);

/* And update all interior pointers. Details hidden */ scanObjectsInHeap(ee, gcOpts, updateRoot, NULL);

/* Finally we can move objects, and reset object marks.

Compaction details hidden. */ compact(); }

/* * The liveness predicate, for use in special objects scanning. */ static CVMBool isLive(CVMObject** refPtr, void* data) { CVMObject* ref;

CVMassert(refPtr != NULL);

ref = *refPtr; CVMassert(ref != NULL);

/* * ROM objects are always live */ if (CVMobjectIsInROM(ref)) { return CVM_TRUE; }

/* Is object marked? It's live then. */ return CVMobjectMarked(ref); }

/* * The transitive object marker. Marks a given object and all its * "children". * This is recursive, for simplicity. A production GC should really * not be recursive. */ static void markTransitively(CVMObject** refPointer, void* data) { CVMGCOptions* gcOpts = (CVMGCOptions*)data; CVMObject* ref = *refPointer;

23 of 24

Creating a Garbage Collector

Page 140: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMClassBlock* refCb = CVMobjectGetClass(ref);

/* * ROM objects are always live */ if (CVMobjectIsInROM(ref)) { return; }

CVMobjectSetMarked(ref);

/* * Now handle all the "children". */ CVMobjectWalkRefsWithSpecialHandling(CVMgetEE(), gcOpts, ref,

refCb, { CVMObject* thisRef = *refPtr; if (thisRef != NULL) { if (!CVMobjectMarked(thisRef)) { markTransitively(refPtr); } } }, markTransitively, data); }

/* * Update a root with the new address of an object */ static void CVMgenMarkCompactFilteredUpdateRoot(CVMObject** refPtr, void* data) { CVMObject* ref = *refPtr; /* * ROM objects are not on the heap */ if (CVMobjectIsInROM(ref)) { return; } *refPtr = lookupNewAddress(ref); /* Details hidden. Update root.

*/ }

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

24 of 24

Creating a Garbage Collector

Page 141: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

How to be GC-safe in CVMThis chapter describes how to safely address garbage collection (GC) issues in the CVM.

Contents

Introduction Living with ICells

ICell Types Explicitly Registered Roots

Declaring and Using Local Roots Declaring and Using Global Roots

GC-safety of Threads GC-atomic Blocks Offering a GC-safe Point

IntroductionIn CVM, GC may be running at any time during program execution, searching for program state orchanging object addresses. Therefore, you should be very careful whenever you want to access andchange Java objects from native code.

The indirect memory interface allows you to safely manipulate objects from native code. The calls thatmake up the indirect memory interface operate on pointers to ICells (indirection cells), which arenon-moving locations in memory holding object references. ICells must be registered with the garbagecollector (GC), so they can be found and updated when a GC occurs. Registered ICells may be localroots, or global roots.

The implementation of the indirect memory interface makes use of a per-thread GC-safety flag. Eachindirect memory call on an ICell marks the caller thread as GC-unsafe, manipulates the Java objectencapsulated by the ICell, and marks the thread as GC-safe again. Threads that are marked GC-unsafecannot tolerate GC until they are marked GC-safe again. GC is only allowed to proceed if all threads areGC-safe. Use of the indirect interface in conjunction with registered ICells makes your C code safe fromgarbage collection, and makes the GC aware of your Java object use.

Please refer to the chapters Direct Memory Interface Reference and Indirect Memory Interface Referencefor reference.

Living with ICells

1 of 13

How to be GC-safe in CVM

Page 142: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

ICells and the indirect memory interface form the foundation of the exactness architecture of CVM.Therefore, it is critical to understand the various ways these calls can be used to ensure GC-safety.

Working on an exact system is different than working on a conservative system. In a conservative system,the GC scans the native stacks and native registers, searching for values that look like pointers. So inorder to keep a heap object alive, it is sufficient to keep around references to it in registers or stacklocations for the GC to find them.

In an exact system, all locations holding pointers to heap objects must be known to the GC. There aretwo types of such known locations:

1. Implicitly registered locations: The GC has a default root scan, and certain well-known VM datastructures are considered to be default roots. Among this group are class statics, string interntables, JNI tables holding global references, and others. All the references in these data structuresare considered implicitly registered with GC.

2. Explicitly registered locations: Any ICells that are not included in the default root scan of GCmust be explicitly registered, either by the local roots mechanism or the global roots mechanism.

ICell Types

ICells encapsulate direct heap object references. Heap objects may be regular Java objects or arrays.There are different ICell types to express each. ICells for all non-array object types are declared asCVMObjectICell. Arrays of different Java types have corresponding ICell types. For basic type <T>, theright ICell type is CVMArrayOf<T>ICell. Other ICell types are:

CVMObjectICell ocell; /* for CVMObject references */

CVMArrayOfByteICell acellb; /* for CVMArrayOfByte references */CVMArrayOfShortICell acells; /* for CVMArrayOfShort references */CVMArrayOfCharICell acellc; /* for CVMArrayOfChar references */CVMArrayOfBooleanICell acellz; /* for CVMArrayOfBoolean references */CVMArrayOfIntICell acelli; /* for CVMArrayOfInt references */CVMArrayOfRefICell acellr; /* for CVMArrayOfRef references */CVMArrayOfFloatICell acellf; /* for CVMArrayOfFloat references */CVMArrayOfLongICell acelll; /* for CVMArrayOfLong references */CVMArrayOfDoubleICell acelld; /* for CVMArrayOfDouble references */

Because ICells contain references that may be manipulated by GC, their referents should be set, nulled,and assigned to one another using calls from the indirect memory interface (see ICell Manipulations fromthe chapter Indirect Memory Interface Reference). Their values should only be passed around as ICell*to ensure GC-safety. So given ocell1 and ocell2 of type CVMObjectICell:

CVMObjectICell* ocell1; CVMObjectICell* ocell2; CVMExecEnv* ee = CVMgetEE(); CVMBool res;

<... make sure ocell1 and ocell2 point to registered ICells. They could be local roots or global roots, for example. See below ...>

CVMID_icellSetNull(ee, ocell1); CVMID_icellSetNull(ee, ocell2);

2 of 13

How to be GC-safe in CVM

Page 143: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMassignDirectReferenceTo(ee, ocell1); CVMID_icellIsNull(ee, ocell1, res); if (!res) { /* Assign the referent of ocell1 to the referent of ocell2 */ CVMID_icellAssign(ee, ocell2, ocell1); }

In the example above, the only values passed around are pointers to ICells. Any assignment to theencapsulated direct object reference of an ICell (as assignDirectReferenceTo() does) must happen ina GC-unsafe region, created in the body of the implementation of CVMID_icellAssign(). GC-unsaferegions are explained in the section on GC-safety of Threads.

Explicitly Registered RootsHeap object references that are not part of the default root scan of garbage collection need to beexplicitly registered with the collector. There are two separate mechanisms for explicit registration:

Local roots: These are short-lived values, like local variables. They are allocated and deallocatedin a stack-like fashion. The interface for using them is geared towards fast allocation anddeallocation, and does not allow out-of-order deallocation. Global roots: These are long-lived values, like global variables. The program can obtain registeredglobal root locations through the global roots API. Global roots may be created and destroyedout-of-order.

Declaring and Using Local Roots

Local roots are an efficient way of declaring, registering and unregistering ICells of local scope. They aretypically used to hold relatively short-lived values; think of them as GC-registered local variables. Alsonote that local roots are thread-local; they are created, used and discarded in the same thread.

The use pattern is the following:

// // Start a local root block, passing in the current 'ee' // (execution environment), which contains per-thread information. // CVMID_localrootBegin(ee); { CVMID_localrootDeclare(Type1ICell, var1); CVMID_localrootDeclare(Type2ICell, var2); // // use var1 and var2 as Type1ICell* and Type2ICell* // respectively // // do NOT leave the block without executing // CVMID_localrootEnd()! // } CVMID_localrootEnd();

Since local roots occur more often (dynamically) than global roots, the interface for using local roots isoptimized for allowing stack-like fast allocation and deallocation. Conceptually:

1. CVMID_localrootBegin() marks the beginning of a scope containing a list ofCVMID_localrootDeclare() calls.

3 of 13

How to be GC-safe in CVM

Page 144: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

2. The implementation keeps track of CVMID_localrootDeclare() calls. For each, it allocates andregisters a local ICell and declares an ICell pointer to that registered ICell.

3. When the programmer is done with the local roots in the scope, he/she callsCVMID_localrootEnd(), which discards all allocated local roots in that scope.

Note that it is important to call CVMID_localrootEnd() when leaving a local root scope; this calldiscards all registered local roots declared since the last CVMID_localrootBegin(). Also note thatCVMID_localrootBegin() and CVMID_localrootEnd() may nest arbitrarily.

The following example illustrates local root use:

Example:

You want to call an allocating operation that is possibly a few functions deep. Therefore youwant the caller to declare a local root, and pass its corresponding ICell* as a resultargument to the operation. This keeps the allocated object safe from garbage collection themoment it is stored in the result argument. When the operation is complete, the caller canunregister the local root.

The following creates a Java string from a Utf8 string. It is an inlined (fast) version of theString constructor. It uses two local roots for temporary values, and discards them after aString has been successfully created and assigned to a result ICell.

void CVMmakeStringFromUtf8(CVMUtf8* chars, CVMObjectICell* result) { CVMID_localrootBegin(); { // Two local roots to be used as temporaries CVMID_localRootDeclare(CVMObjectICell, string); CVMID_localRootDeclare(CVMArrayOfCharICell, theChars);

CVMJavaInt length;

// Make the string object CVMID_objectNewInstance (CVMjavaLangStringClassblock, string);

// .. . and the chars array // Pass the local root in to receive the resulting char[] CVMmkArrayOfCharFromUtf8 (chars, theChars); CVMID_arrayGetLength (theChars, length);

// // Assign the values of the string // CVMID_fieldWriteRef(string, CVM_offsetOf_java_lang_String_value, theChars);

CVMID_fieldWriteInt(string, CVM_offsetOf_java_lang_String_length, length);

CVMID_fieldWriteInt(string, CVM_offsetOf_java_lang_String_offset, 0);

// We write the result back to the result ICell. CVMID_icellAssign (result, string);

4 of 13

How to be GC-safe in CVM

Page 145: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

// We can now discard the local roots, assuming 'result' was // a pointer to a registered ICell. } CVMID_localrootEnd();

A possible caller of this may be the constant resolution code, resolving a constant pool entryof type CONSTANT_String. The result ICell may be the actual constant pool slot, which isupdatable by the GC when it scans class information. (In other words, the constant pool slotfor a String constant is an implicitly registered ICell).

So the call would be something like:

void CVMresolveStringConstant(CVMConstantPool* cp, CVMJavaShort strIdx, CVMJavaShort utf8Idx) { CVM_CLASS_RESOLUTION_LOCK(); CVMID_icellSetNull(&cp.entries[strIdx].str); // // Mark it as being resolved. This way, no thread can // yet use this c.p. entry; however GC can scan it // if necessary. // CVMcpSetBeingResolved(cp, strIdx); CVMmakeStringFromUtf8(cp.entries[utf8Idx], &cp.entries[strIdx].str); CVMcpSetResolved(cp, strIdx); CVM_CLASS_RESOLUTION_UNLOCK(); }

Declaring and Using Global Roots

Global root registration allows for declaring, registering and unregistering ICells of global scope. Globalroots are typically used to hold long-lived values that are to be included in the GC root scan; think ofthem as GC-registered global variables.

The use pattern is the following:

// // Part of CVMglobals // struct CVMGlobalState { .... CVMObjectICell* globalRoot1; CVMObjectICell* globalRoot2; .... } ... void CVMinitThisModule() { CVMglobals.globalRoot1 = CVMID_getGlobalRoot(); CVMglobals.globalRoot2 = CVMID_getGlobalRoot(); ... } ... void CVMuseThisModule() { // globalRoot1 and globalRoot2 may safely be used as // ICell* arguments to CVMID_ operations.

5 of 13

How to be GC-safe in CVM

Page 146: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMID_objectNewInstance(CVMclassJavaLangStringClassblock, CVMglobals.globalRoot2); CVMID_icellAssign(CVMglobals.globalRoot1, CVMglobals.globalRoot2); } ... void CVMexitThisModule() { CVMID_freeGlobalRoot(CVMglobals.globalRoot1); CVMID_freeGlobalRoot(CVMglobals.globalRoot2); }

Any long-lived ICell declaration should be registered as a global root. These include C structure fieldsand global variables.

The following examples show how to register an ICell referred to by a C struct, a C struct that contains aJava pointer, and how to register a well-known value:

Example 1:

This example shows registering an ICell referred to by a C struct. There may be long-lived Cstructures in the system with heap object references, like a C hash table with a Java array asthe list of values. Such a table existed in JavaOSTM. The declaration for that hash table inCVM would be:

typedef struct CVMStrIDhash { < ... Other hashtable fields ...> CVMArrayOfRefICell* params; /* param table, if needed */} CVMStrIDhash;

where the params array is declared as an ICell* holding an array of references. We wouldallocate these StrIDhash nodes as follows:

/* Create a hash table of the specified size */static CVMStrIDhash *CVMcreateHash(int sizeInBytes){ CVMStrIDhash *h; h = (StrIDhash *)CVMCcalloc(1, sizeInBytes); if (h != NULL) { CVMinitNode(h); // // Register and null out the value // h->params = CVMID_getGlobalRoot(); } return h;}

After registration, h->params may be used as a registered ICell* parameter to otherCVMID_ operations. So to allocate the params array:

CVMBoolCVMmkParams(CVMStrIDhash* hash, int size){ CVMArrayOfRefICell* params = hash->params; CVMID_newArrayOfRef(CVMjavaLangObjectClassblock, size, params); if (CVMID_icellIsNull(params)) { return CVM_FALSE; // Allocation failed } else {

6 of 13

How to be GC-safe in CVM

Page 147: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

return CVM_TRUE; }}

Example 2:

This example shows a C structure that contains a Java pointer. This declaration is from theCVMClassblock structure. Whenever a new CVMClassblock is allocated, the ICell* typedfields are initialized to point to fresh global roots:

struct CVMClassblock { ... CVMObjectICell* classLoader; ... }; typedef struct CVMClassblock CVMClassblock;

... CVMClassblock* class =(CVMClassblock*)CVMCcalloc(1, sizeof(CVMClassblock));

// // Get a new, nulled global root to hold a classloader // reference // class->classLoader = CVMID_getGlobalRoot();

// // Make a new ClassLoader instance, and assign it to its // location in class 'class'. // CVMID_objectNewInstance(CVMglobals.javaLangClassLoaderClassblock, class->classLoader);

When the CVMClassblock is freed, all its registered global roots must be freed first:

void CVMclassUnload(CVMClassblock* class){ // // Free all class-related data structures // ... // // Now get rid of the global roots // CVMID_freeGlobalRoot(class->classLoader);

// And finally the Classblock itself CVMCfree(class);}

Example 3:

This example shows how to register well-known values. Let's assume that we want to have

7 of 13

How to be GC-safe in CVM

Page 148: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

global instances of the java.lang.Class versions of some Java classes. Note that CVMwould not necessarily do this, since Classblocks are not allocated on the heap, but it is agood example for global roots.

// // Part of CVMglobals // struct CVMGlobalState { .... CVMObjectICell* classJavaLangObject; CVMObjectICell* classJavaLangString; .... } ... CVMinitVM() { /* Allocate and null out global roots */ CVMglobals.classJavaLangObject = CVMID_getGlobalRoot(); CVMglobals.classJavaLangString = CVMID_getGlobalRoot();

// ... and they lived happily ever after CVMfindSystemClass("java/lang/Object", CVMglobals.classJavaLangObject); CVMfindSystemClass("java/lang/String", CVMglobals.classJavaLangString); }

GC-safety of ThreadsEach thread in CVM has a flag called the GC-safety flag. Whenever a thread performs an operation thatmanipulates heap objects directly, it is marked as GC-unsafe. If another thread initiates a GC at this time,all threads must be rolled to GC-safe points in order for GC to proceed safely.

The byte code interpreter typically works in a GC-unsafe manner to allow for efficient direct access toheap objects. To bound the time the thread remains GC-unsafe, backwards branches, method calls, andmethod returns are designated as GC-safe points. At those points each thread polls for GC. If there is aGC request, the thread suspends itself to rendezvous with all the other threads rolling forward to theirGC points. Execution continues after GC.

The implementation of the indirect memory interface marks the caller thread GC-unsafe while it ismanipulating object references directly. These are typically very simple operations, and result in only asmall window of GC-unsafety.

CVM also allows arbitrary sets of operations to proceed in GC-unsafe regions. These operations shouldbe bounded in execution time and are not allowed to block.

For the full set of GC-safety operations, see GC-safety of Threads in the chapter Direct MemoryInterface Reference.

GC-atomic Blocks

If you want GC disallowed while executing a certain set of operations, use:

CVMD_gcUnsafeExec(ee, <... gc-unsafe code ...>

8 of 13

How to be GC-safe in CVM

Page 149: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

)

where ee is a pointer to the execution environment (CVMExecEnv) of the current thread.

The GC-unsafe code may not block, perform I/O, or otherwise take too long to execute, in order to keepthe time the GC is disabled to a minimum.

When writing GC-unsafe code, extreme care must be taken to avoid calls to arbitrary library routines.These may take too long to execute, or grab platform locks that might end up blocking. The example ofmalloc() comes to mind. So make sure you become GC-safe before making such a call (see Offering aGC-safe Point below).

Direct pointers to objects may be used within the unsafe block; however, you should make sure that alldirect values are written back into registered ICells before exiting the gcunsafe block.

Example 1:

Let's say that you want to use two direct memory accesses consecutively without theoverhead of being GC-unsafe around each. Here's how you would do that:

CVMObjectICell* cell1;CVMObjectICell* cell2;CVMJavaInt val1, val2;

...< Assume cell1 and cell2 point to registered ICells >...CVMD_gcUnsafeExec(ee, { CVMObject* o1 = CVMID_icellDirect(cell1); CVMObject* o2 = CVMID_icellDirect(cell2);

// Read the third integer field of // each object. CVMD_fieldReadInt(o1, 2, val1); CVMD_fieldReadInt(o2, 2, val2);} ); // End of gcunsafe region

Example 2:

Setting the referent of an ICell. The example below takes an ICell* for a char[] array,allocates a string, starts a GC-unsafe region, and calls out to initialize the string's fields. TheICell pointed to by resultString gets a reference to the allocated string before theGC-unsafe region is exited.

Note that this sort of long GC-unsafe region is intended as an example only; this style shouldonly be used in performance critical points, where direct accesses help make the code faster.

void CVMmakeString(CVMArrayOfCharICell* theChars, CVMObjectICell* resultString) { CVMID_localrootBegin(ee); { CVMID_localrootDeclare(CVMObjectICell, tempString); // Allocate a String CVMID_objectNewInstance(CVMjavaLangStringClassblock, tempString);

CVMD_gcUnsafeExec(ee, { CVMObject* str = CVMID_icellDirect(tempString);

9 of 13

How to be GC-safe in CVM

Page 150: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

CVMArrayOfChar* chars = CVMID_icellDirect(theChars); CVMJavaInt a_len;

CVMD_arrayGetLength(chars, a_len); CVMinitializeDirectStringRef(str, chars, a_len, 0);

// Set the referent of the ICell that resultString points to CVMID_icellSetDirect(resultString, str); } ); } CVMID_localrootEnd();}

Example 3:

Performing an operation that modifies a data structure that is a default GC root. In theexample below CVMicellList[] is a thread-local list of free ICells and is a default GC root.CVMgetICell() allocates ICells from the list. All assigned ICells from the list are scanned bythe GC during the root scan. The operation needs to disable the GC; otherwise a GC scanmight find the ICell list in an inconsistent state.

CVMObjectICell CVMicellList[];CVMUint32 CVMicellListPtr;

CVMObjectICell* CVMgetICell(){ CVMObjectICell* ret; CVMD_gcUnsafeExec(ee, { ret = &CVMicellList[icellListPtr++]; *((CVMUint32*)ret) = 0; } ); return ret;}

If a GC were to happen after the increment and before the initialization, garbage valuesmight be erroneously scanned by GC, potentially causing a crash. Therefore, to prevent raceconditions, CVMD_gcUnsafeExec() keeps GC disabled between these two operations.

Offering a GC-safe Point

Code that is GC-unsafe for long segments must periodically offer a GC-safe point. For example, theinterpreter runs in a GC-unsafe way, manipulating direct pointers, etc., but at backwards branches, atmethod calls, and maybe other points, it must offer to be GC-safe to bound the time from a GC request toa GC cycle start. Also, long running operations like data structure expansions or lengthy computationsmust offer to be GC-safe occasionally. And finally, the VM must offer GC-safe points before doingpotentially blocking OS calls like dynamic linker resolution for natives, acquiring locks, or I/O in order tomake sure there are no blocked, GC-unsafe threads in the system.

The standard pattern of doing this is to use the CVMD_gcSafeExec() or the CVMD_gcSafeCheckPoint()macros. For details, refer to GC-safety of Threads in the chapter Direct Memory Interface Reference.

CVMD_gcSafeCheckPoint() is used to offer a GC-safe point for operations that will definitely not block:

CVMD_gcSafeCheckPoint( ee, { <Save your state for possible GC>

10 of 13

How to be GC-safe in CVM

Page 151: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

}, { <Restore your state after possible GC> } );

CVMD_gcSafeExec() is used to offer a GC-safe point for operations that might block.

CVMD_gcSafeExec( ee, { <Do potentially blocking operation> } );

At the end of one of these macros, the executing thread is once again GC-unsafe.

Example 1:

The interpreter becomes GC-safe on a backwards branch.

<...> case opc_goto: { CVMJavaShort skip = CVMgetJavaShort(currentPc + 1); if (skip <= 0) { CVMD_gcSafeCheckPoint(ee, { CVM_DECACHE_INTERPRETER_STATE(currentFrame, currentPc, currentSp); }, { // No reconstruction needed since Java code // will not execute in this thread // between DECACHE_... and GC. } ); } CVMexecuteNextInstructionAtOffset(skip); } <...>

In effect, the CVMD_gcSafeCheckPoint() operation polls a global variable to see if a GC isrequested. If it is requested, then the state save operation occurs, GC is run, and the state isreconstructed. If no GC was requested, we go on. This is a very efficient way to createpolling-based GC-safe points.

Example 2:

Blocking operations need to become GC-safe. Here's a tricky example: a two-partmonitorenter operation. The first one gets access to the object, and checks to see ifblocking is needed. If no blocking needed, there is no need to become GC-safe. If blocking isneeded, we save our state, become GC-safe and block.

.... case opc_monitorenter: { CVMObject* lockedObject; vmResult result;

11 of 13

How to be GC-safe in CVM

Page 152: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

lockedObject = STACK_OBJECT(-1); CHECK_NULL(lockedObject); result = CVMobjectTryLock(lockedObject); // Try to lock if (result == VM_LOCKED_WITHOUT_BLOCKING) { // // The uncontended case // We have already succeeded locking // } else { // // May now block. // Save interpreter state, stash away locked object // as a GC-root, and use monitorEnterMayblock() with // the ICell version. // CVM_DECACHE_INTERPRETER_STATE(currentFrame, currentPc, currentSpCached);

CVMD_gcSafeExec( ee, { // Pass in the stack slot as the ICell* CVMmonitorEnterMayblock(&STACK_OBJECT(-1)); } ) } if (CVMcheckForException() == VM_NO_POSTED_EXCEPTION) { UPDATE_PC_AND_TOS_AND_CONTINUE(1, -1); } else { CVMhandleException(); } }

Example 3:

VM becomes GC-safe before making a call that might allocate from the C heap. This routinemay end up taking a long time execute, or even worse, block on an OS lock. Therefore theVM needs to become GC-safe before making the call, in a way that allows blocking.

Here's an excerpt from the stack expansion code that becomes GC-safe before attempting toallocate from the C heap.

CVMStackVal32* CVMexpandStack(CVMStack* obj, CVMUint32 capacity) { .... * Must allocate new chunk. Take excess capacity into account. */ size = sizeof(CVMStackChunk) + sizeof(CVMStackVal32) * (capacity - CVM_MIN_STACKCHUNK_SIZE);

newStackSize = s->stackSize + capacity; if (newStackSize > CVM_MAX_STACK_SIZE) { ... throw exception ... } CVMD_gcSafeExec(ee, {next = (CVMStackChunk*)CVMCmalloc(size);} ); .... }

12 of 13

How to be GC-safe in CVM

Page 153: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

February 28, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

13 of 13

How to be GC-Safe in CVM

Page 154: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Direct Memory Interface ReferenceThis chapter contains the references for the direct memory layer functions, which are used by the garbagecollector (GC).

Contents

Introduction Object Field Accesses

Accessing Fields of 32-bit Width Accessing Fields of 64-bit Width

Array Accesses Accessing Elements of 32-bit Width and Below Accessing Elements of 64-bit Width Miscellaneous Array Operations

GC-safety of Threads GC-unsafe Blocks GC-safe Blocks: Requesting a GC-safe Point

IntroductionThese functions are used for accessing object and array fields and also handle GC-safe points. Please referto the chapter How to be GC-safe in CVM for context and examples.

WARNING: The use of the direct heap access operations is GC-unsafe. Therefore, these operationsshould be used with extreme care in a few selected places, and only within GC-unsafe regions. VM codeshould use the indirect memory layer almost all the time when outside the interpreter.

Object Field AccessesThe following macros access object fields. The result-producing ones take an l-value as the last argumentand assign to it.

Accessing Fields of 32-bit Width

In these macros, the first parameter is a direct object reference, the second is an offset in number ofwords from the beginning of the object counting the first header word as 0, and the third is an l-value toread into or a value to write.

1 of 5

Direct Memory Interface Reference

Page 155: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Note that the implementation of GC read and write barriers are hidden beneath the Ref typed accessors.

Weakly-typed 32-bit read and write:

macro void CVMD_fieldRead32( CVMObject* o, CVMUint32 off, CVMJavaVal32 res) macro void CVMD_fieldWrite32(CVMObject* o, CVMUint32 off, CVMJavaVal32 res)

Strongly-typed 32-bit read and write:

macro void CVMD_fieldReadRef( CVMObject* o, CVMUint32 off, CVMObject* item) macro void CVMD_fieldWriteRef( CVMObject* o, CVMUint32 off, CVMObject* item)

macro void CVMD_fieldReadInt( CVMObject* o, CVMUint32 off, CVMJavaInt item) macro void CVMD_fieldWriteInt( CVMObject* o, CVMUint32 off, CVMJavaInt item)

macro void CVMD_fieldReadFloat( CVMObject* o, CVMUint32 off, CVMJavaFloat item) macro void CVMD_fieldWriteFloat( CVMObject* o, CVMUint32 off, CVMJavaFloat item)

Accessing Fields of 64-bit Width

In these macros, the first parameter is a direct object reference, the second is an offset in number ofwords from the beginning of the object counting the first header word as 0, and the third is an l-value oftype CVMJavaVal64 to read into or a value to write.

The weakly-typed versions read from and write into a word-aligned, two-word area pointed to bylocation.

Weakly-typed 64-bit read and write:

macro void CVMD_fieldRead64( CVMObject* o, CVMUint32 off, CVMJavaVal32* location) macro void CVMD_fieldWrite64( CVMObject* o, CVMUint32 off, CVMJavaVal32* location)

Strongly-typed 64-bit read and write:

macro void CVMD_fieldReadLong( CVMObject* o, CVMUint32 off, CVMJavaVal64 val64) macro void CVMD_fieldWriteLong( CVMObject* o, CVMUint32 off, CVMJavaVal64 val64)

macro void CVMD_fieldReadDouble( CVMObject* o, CVMUint32 off, CVMJavaVal64 val64) macro void CVMD_fieldWriteDouble(CVMObject* o, CVMUint32 off, CVMJavaVal64 val64)

Array AccessesThe following macros access object fields. The result producing ones take an l-value as the last argumentand assign to it.

Accessing Elements of 32-bit Width and Below

2 of 5

Direct Memory Interface Reference

Page 156: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

In these macros, the first parameter is a direct array reference, the second is the array index where thefirst array element is at index 0, and the third is an l-value to read into or a value to write.

These macros are all strongly typed. All the Java language basic types are represented.

Note that the implementation of GC read and write barriers are hidden beneath the Ref typed accessors.

macro void CVMD_arrayReadRef( CVMArrayOfRef* arr, CVMUint32 index, CVMObject* item) macro void CVMD_arrayWriteRef( CVMArrayOfRef* arr, CVMUint32 index, CVMObject* item)

macro void CVMD_arrayReadInt( CVMArrayOfInt* arr, CVMUint32 index, CVMJavaInt item) macro void CVMD_arrayWriteInt( CVMArrayOfInt* arr, CVMUint32 index, CVMJavaInt item)

macro void CVMD_arrayReadByte( CVMArrayOfByte* arr, CVMUint32 index, CVMJavaByte item) macro void CVMD_arrayWriteByte( CVMArrayOfByte* arr, CVMUint32 index, CVMJavaByte item)

macro void CVMD_arrayReadBool( CVMArrayOfBool* arr, CVMUint32 index, CVMJavaBool item) macro void CVMD_arrayWriteBool( CVMArrayOfBool* arr, CVMUint32 index, CVMJavaBool item)

macro void CVMD_arrayReadShort( CVMArrayOfShort* arr, CVMUint32 index, CVMJavaShort item) macro void CVMD_arrayWriteShort( CVMArrayOfShort* arr, CVMUint32 index, CVMJavaShort item)

macro void CVMD_arrayReadChar( CVMArrayOfChar* arr, CVMUint32 index, CVMJavaChar item) macro void CVMD_arrayWriteChar( CVMArrayOfChar* arr, CVMUint32 index, CVMJavaChar item)

macro void CVMD_arrayReadFloat( CVMArrayOfFloat* arr, CVMUint32 index, CVMJavaFloat item) macro void CVMD_arrayWriteFloat( CVMArrayOfFloat* arr, CVMUint32 index, CVMJavaFloat item)

Accessing Elements of 64-bit Width

In these macros, the first parameter is a direct array reference, the second is the array index where thefirst array element is at index 0, and the third is an l-value of type CVMJavaVal64 to read into or a valueto write.

The weakly-typed versions read from and write to a word-aligned, two-word area pointed to bylocation:

macro void CVMD_arrayRead64( <CVMArrayOf64>* o, CVMUint32 off, CVMJavaVal32* location) macro void CVMD_arrayWrite64( <CVMArrayOf64>* o, CVMUint32 off, CVMJavaVal32* location)

where <CVMArrayOf64> is either CVMArrayOfLong or CVMArrayOfDouble.

Strongly-typed versions:

macro void CVMD_arrayReadLong( <CVMArrayOf64>* o, CVMUint32 index, CVMJavaVal64 val64) macro void CVMD_arrayWriteLong( <CVMArrayOf64>* o, CVMUint32 index, CVMJavaVal64 val64)

macro void CVMD_arrayReadDouble( <CVMArrayOf64>* o, CVMUint32 index, CVMJavaVal64 val64)

3 of 5

Direct Memory Interface Reference

Page 157: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

macro void CVMD_arrayWriteDouble(<CVMArrayOf64>* o, CVMUint32 index, CVMJavaVal64 val64)

where <CVMArrayOf64> is either CVMArrayOfLong or CVMArrayOfDouble.

Miscellaneous Array Operations

All generic object operations apply to arrays as well. In particular, the header of an array object starts outwith an object header that has an additional length entry, so any operation on the header of an object maybe performed on an array header.

Below are array-specific operations.

Getting the length of an array:

macro CVMJavaInt32 CVMD_arrayGetLength(<CVMArrayOfAny>* o)

where <CVMArrayOfAny> is any direct array reference.

GC-safety of ThreadsEach thread has a GC-safety state associated with it. Threads that cannot tolerate GC are marked asGC-unsafe. A thread whose state can be scanned by the GC is marked GC-safe. GC can occur only whenall threads in the system are GC-safe. When a thread requests GC, all threads that are currentlyGC-unsafe are rolled forward to their next GC-safe point.

The following operations show how to create a GC-unsafe window of operation and how to request aGC-safe point.

GC-unsafe Blocks

When a GC-safe thread wants to perform a GC-unsafe operation, it marks itself as unable to tolerate GC,performs the GC-unsafe operation, and then marks itself again as GC-safe. Use CVMD_gcUnsafeExec()to create such a window of GC-unsafety. At the end of the GC-unsafe window, the thread callingCVMD_gcUnsafeExec() polls for a GC request. If there is one, the thread suspends itself to rendezvouswith all the other threads rolling forward to their GC points. Execution continues after GC.

macro void CVMD_gcUnsafeExec(CVMExecEnv* ee, code gcUnsafeAction)

where ee is a pointer to the current thread's execution environment and gcUnsafeAction is a segment ofGC-unsafe code.

GC-safe Blocks: Requesting a GC-safe Point

GC-unsafe code must occasionally offer to become GC-safe to bound the time from a GC request to thebeginning of GC. CVMD_gcSafeExec and CVMD_gcSafeCheckPoint are the two macros that allow that.

The CVMD_gcSafeCheckPointmacro is used for code that will not block. The assumption here is thatthere is some cached state in the GC-unsafe code that needs to be saved if GC is needed.

4 of 5

Direct Memory Interface Reference

Page 158: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

macro void CVMD_gcSafeCheckPoint(CVMExecEnv* ee, code saveAction, code restoreAction)

The thread calling CVMD_gcSafeCheckPoint() checks whether there is a GC request. If there is, thethread executes saveAction to save state necessary for GC, marks itself as GC-safe, and suspends itselfto rendezvous with all the other threads rolling forward to their GC points. After GC completes, thethread is resumed, marks itself as GC-unsafe again, and executes restoreAction to do any cachingoperations necessary to continue execution.

The CVMD_gcSafeExec macro is used for code that may potentially block. In this case, whatever cachedstate the GC-unsafe code has must be saved before calling the macro.

macro void CVMD_gcSafeExec(CVMExecEnv* ee, code safeAction)

The thread calling CVMD_gcSafeExec()marks itself GC-safe and checks to see if there is a GC-request. Ifthere is one, the thread suspends itself to rendezvous with all the other threads rolling forward to theirGC points. After GC is over, the thread is resumed, still in a GC-safe state. The thread then executessafeAction, potentially blocking. After waking up from the blocking action, the thread marks itself asGC-unsafe and continues with GC-unsafe execution.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

5 of 5

Direct Memory Interface Reference

Page 159: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Indirect Memory Interface ReferenceThis chapter contains the references for the indirect memory layer functions, which are used by thegarbage collector (GC).

Contents

Introduction ICell Manipulations Registered Indirection Cells

Local Roots Global Roots

Object Field Accesses Accessing Fields of 32-bit Width Accessing Fields of 64-bit Width

Array Accesses Accessing Elements of 32-bit Width and Below Accessing Elements of 64-bit Width Miscellaneous Array Operations

GC-unsafe Operations

IntroductionThese functions are used for accessing the garbage-collected heap indirectly using pointers to ICells.Please refer to the chapter How to be GC-safe in CVM for context and examples.

Note that the indirect memory interface is GC-safe and is appropriate for use in VM code outside of theinterpreter, like the class loader or JNI implementation.

ICell ManipulationsThe referent of an ICell is the direct object reference encapsulated by the ICell. The indirect memoryinterface allows GC-safe assignments and comparisons between referents of ICells using the followingmacros:

Assign the referent of srcICellPtr to be the referent of dstICellPtr:

macro void CVMID_icellAssign(CVMExecEnv* ee, CVMObjectICell* destICellPtr, CVMObjectICell* srcICellPtr)

1 of 6

Indirect Memory Interface Reference

Page 160: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Null out the referent of icellPtr:

macro void CVMID_icellSetNull(CVMExecEnv* ee, CVMObjectICell* icellPtr)

Test whether the referent of icellPtr is null. The result is in res:

macro void CVMID_icellIsNull(CVMExecEnv* ee, CVMObjectICell* icellPtr, CVMBool res)

Test whether the referent of icellPtr1 is the same object reference as icellPtr2. The result is in res:

macro void CVMID_icellSameObject(CVMExecEnv* ee, CVMObjectICell* icellPtr1, CVMObjectICell* icellPtr2, CVMBool res)

Registered Indirection CellsAn indirection cell must be registered with GC to be scanned as a root. A registered indirection cell iseither a local root or global root. In both cases, the client code is handed a pointer to an ICell that is partof the root set of GC.

Local Roots

Local roots are allocated within local root blocks. At the end of a local root block, all allocated localroots within the block are destroyed. Note that local root blocks may be nested arbitrarily.

To begin a local root block, with respect to the current thread's execution environment, ee:

macro CVMID_localrootBegin(CVMExecEnv* ee)

To allocate a local root and return a pointer to it:

macro CVMID_localrootDeclare(<ICell>, var)

Here <ICell> may be any legal object or array ICell type. CVMID_localrootDeclare allocates a newlocal root, nulls out its referent, declares a <ICell>* var, and makes var point to the new local root.var is visible within the scope of the local root block.

To end the local root block and to discard all local roots allocated within the block:

macro CVMID_localrootEnd()

Global Roots

Global roots are not bound to any one thread, but are shared between all threads. They are analogous toJNI global refs. Note that unlike local roots, global roots may be allocated out-of-order (i.e. the globalroots are not guaranteed to be allocated sequentially in memory).

To allocate a new global root, null out its referent and return a pointer to it:

CVMObjectICell* CVMID_getGlobalRoot()

To free the global root pointed to by globalRoot:

2 of 6

Indirect Memory Interface Reference

Page 161: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

void CVMID_freeGlobalRoot(CVMObjectICell* globalRoot)

Object Field AccessesThe following macros access object fields. The result-producing ones take an l-value as the last argumentand assign to it.

Accessing Fields of 32-bit Width

In these macros, the first parameter is a pointer to the execution environment (CVMExecEnv) of thecurrent thread, the second parameter is a registered indirect object reference (CVMObjectICell*), thethird is an offset in number of words from the beginning of the object, counting the first header word as0, and the fourth is an l-value to read into or a value to write.

Note that the implementation of GC read and write barriers are hidden beneath the Ref typed accessors.

Weakly-typed 32-bit read and write:

macro void CVMID_fieldRead32( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal32 res)macro void CVMID_fieldWrite32(CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal32 res)

Strongly-typed 32-bit read and write:

macro void CVMID_fieldReadRef( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMObjectICell* item) macro void CVMID_fieldWriteRef( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMObjectICell* item)

macro void CVMID_fieldReadInt( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaInt item) macro void CVMID_fieldWriteInt( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaInt item)

macro void CVMID_fieldReadFloat( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaFloat item) macro void CVMID_fieldWriteFloat(CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaFloat item)

Accessing Fields of 64-bit Width

In these macros, the first parameter is a pointer to the execution environment (CVMExecEnv) of thecurrent thread, the second parameter is a registered indirect object reference (CVMObjectICell*), thethird is an offset in number of words from the beginning of the object counting the first header word as 0,and the fourth is an l-value of type CVMJavaVal64 to read into or a value to write.

The weakly-typed versions read from and write into a word-aligned, two-word area pointed to bylocation.

Weakly-typed 64-bit read and write:

macro void CVMID_fieldRead64( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal32* location)

macro void CVMID_fieldWrite64( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal32* location)

Strongly-typed 64-bit read and write:

3 of 6

Indirect Memory Interface Reference

Page 162: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

macro void CVMID_fieldReadLong( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal64 val64) macro void CVMID_fieldWriteLong( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal64 val64)

macro void CVMID_fieldReadDouble( CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal64 val64) macro void CVMID_fieldWriteDouble(CVMExecEnv* ee, CVMObjectICell* o, CVMUint32 off, CVMJavaVal64 val64)

Array AccessesThe following macros access object fields. The result-producing ones take an l-value as the last argument,and assign to it.

Accessing Elements of 32-bit Width and Below

In these macros, the first parameter is a pointer to the execution environment (CVMExecEnv) of thecurrent thread, the second parameter is a registered indirect array reference (CVMArrayOf<T>ICell*), thethird is the array index where the first array element is at index 0, and the fourth is an l-value to read intoor a value to write.

These macros are all strongly typed. All the Java language basic types are represented.

Note that the implementation of GC read and write barriers are hidden beneath the Ref typed accessors.

macro void CVMID_arrayReadRef( CVMExecEnv* ee, CVMArrayOfRefICell* arr, CVMUint32 index, CVMObjectICell* item) macro void CVMID_arrayWriteRef( CVMExecEnv* ee, CVMArrayOfRefICell* arr, CVMUint32 index, CVMObjectICell* item)

macro void CVMID_arrayReadInt( CVMExecEnv* ee, CVMArrayOfIntICell* arr, CVMUint32 index, CVMJavaInt item) macro void CVMID_arrayWriteInt( CVMExecEnv* ee, CVMArrayOfIntICell* arr, CVMUint32 index, CVMJavaInt item)

macro void CVMID_arrayReadByte( CVMExecEnv* ee, CVMArrayOfByteICell* arr, CVMUint32 index, CVMJavaByte item) macro void CVMID_arrayWriteByte( CVMExecEnv* ee, CVMArrayOfByteICell* arr, CVMUint32 index, CVMJavaByte item)

macro void CVMID_arrayReadBool( CVMExecEnv* ee, CVMArrayOfBoolICell* arr, CVMUint32 index, CVMJavaBool item) macro void CVMID_arrayWriteBool( CVMExecEnv* ee, CVMArrayOfBoolICell* arr, CVMUint32 index, CVMJavaBool item)

macro void CVMID_arrayReadShort( CVMExecEnv* ee, CVMArrayOfShortICell* arr, CVMUint32 index, CVMJavaShort item) macro void CVMID_arrayWriteShort( CVMExecEnv* ee, CVMArrayOfShortICell* arr, CVMUint32 index, CVMJavaShort item)

4 of 6

Indirect Memory Interface Reference

Page 163: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

macro void CVMID_arrayReadChar( CVMExecEnv* ee, CVMArrayOfCharICell* arr, CVMUint32 index, CVMJavaChar item) macro void CVMID_arrayWriteChar( CVMExecEnv* ee, CVMArrayOfCharICell* arr, CVMUint32 index, CVMJavaChar item)

macro void CVMID_arrayReadFloat( CVMExecEnv* ee, CVMArrayOfFloatICell* arr, CVMUint32 index, CVMJavaFloat item) macro void CVMID_arrayWriteFloat( CVMExecEnv* ee, CVMArrayOfFloatICell* arr, CVMUint32 index, CVMJavaFloat item)

Accessing Elements of 64-bit Width

In these macros, the first parameter is a pointer to the execution environment (CVMExecEnv) of thecurrent thread, the second parameter is a registered indirect array reference (CVMArrayOf<T>ICell*), thethird is the array index where the first array element is at index 0, and the fourth is an l-value of typeCVMJavaVal64 to read into or a value to write.

The weakly-typed versions read from and write to a word-aligned two-word area pointed to bylocation:

macro void CVMID_arrayRead64( CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 off, CVMJavaVal32* location) macro void CVMID_arrayWrite64( CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 off, CVMJavaVal32* location)

where <CVMArrayOf64ICell> is either CVMArrayOfLongICell or CVMArrayOfDoubleICell.

Strongly-typed versions:

macro void CVMID_arrayReadLong( CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 index, CVMJavaVal64 val64) macro void CVMID_arrayWriteLong( CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 index, CVMJavaVal64 val64)

macro void CVMID_arrayReadDouble( CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 index, CVMJavaVal64 val64) macro void CVMID_arrayWriteDouble(CVMExecEnv* ee, <CVMArrayOf64ICell>* o, CVMUint32 index, CVMJavaVal64 val64)

where <CVMArrayOf64ICell> is either CVMArrayOfLongICell or CVMArrayOfDoubleICell.

Miscellaneous Array Operations

All generic object operations apply to arrays as well. In particular, the header of an array object starts outwith an object header, with an additional length entry, so any operation on the header of an object may beperformed on an array header.

Below are array-specific operations.

5 of 6

Indirect Memory Interface Reference

Page 164: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Getting the length of an array:

macro void CVMID_arrayGetLength(<CVMArrayOfAnyICell>* o, CVMJavaInt32 len)

where <CVMArrayOfAnyICell>* is a registered indirect array reference, and len is an l-value of typeCVMJavaInt32 to store the length result in.

GC-unsafe Operations

The remaining two operations allow setting and getting the referent of an ICell.

WARNING: The use of the ICell referent operations is GC-unsafe. Therefore, these operations shouldbe used with extreme care in a few selected places and only within GC-unsafe regions.

Get the referent of icellPtr:

macro CVMObject* CVMID_icellDirect(CVMObjectICell* icellPtr)

Set the referent of icellPtr to be the direct object reference directObj:

macro void CVMID_icellSetDirect(CVMObjectICell* icellPtr, CVMObject* directObj)

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

6 of 6

Indirect Memory Interface Reference

Page 165: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

JavaMemberDependjava [ Java options ] JavaMemberDepend [ options ]

Description

JavaMemberDepend generates lists of dependencies at the class member level.

Options

-classpath classpath Sets the path to search for classes. Path entries are separated by the character specified byjava.io.File.pathSeparatorChar, usually a colon (:). Multiple classpath options arecumulative, and are searched left to right.

-listSignatureDepend Lists dependencies drawn from return types and arguments lists.

-loadClass class Load the specified class for which to analyze the dependencies for transitive closure at the classmember level.

-showAll Used with -loadClass to show the transitive closure dependencies at the member level of the classspecified with the -loadClass option.

-showClassList Used with -loadClass to show the list of classes required for transitive closure at the member levelof the class specified with the -loadClass option. The list is based on member-level dependenciesbut only includes class names.

-showDirect class Shows the direct or immediate dependencies of the given class at the member level. This optiondoes not provide dependencies of dependencies.

-wholeClass class If any member of the given class is required, then all members of the class are considered to berequired. If the last component of the classname is *, then its prefix is taken as a package name. Inthat case, the -wholeClass option is applied to all classes in the package.

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

1 of 1

JavaMemberDepend

Page 166: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

JavaCodeCompact for CVMjava [ Java options ] JavaCodeCompact [ options ] filename ...

Description

JavaCodeCompact combines one or more Java class files and produces a target system-dependent C filethat contains the given classes in a preloaded format that can be compiled and linked with the Java virtualmachine. It also provides a way to ensure that certain, necessary classes are present and fully linked. Thisexpedites the CVM's startup and error handling procedures.

Linking Java Programs

Here is an outline of the conventional mechanism for class loading:

Use javac to compile Java source files into Java class files. Load the class files into a Java system, either individually or as part of jar archive files. Upon demand, the class loading mechanism resolves references to other class definitions.

JavaCodeCompact provides an alternate means of program linking and symbol resolution, one thatprovides a less flexible model of program building, but which helps reduce the VM's resourceconsumption.

JavaCodeCompact will:

combine multiple input files, by combining much of their symbolic information into shared datastructures, and concatenating other parts of the classes' definitions; determine an object instance's layout and size; determine the layout of an object's method table; change the representation of certain of the Java bytecodes to their "quick" forms; create header files for use by native code;

Note: It is a good idea to increase the maximum heap size by using the -mx Java option. For example,-mx20m increases the maximum heap size to 20MB.

Options

filename Designates the name of a file to be used as input, the contents of which should be included in theoutput. File names are not modified by any pathname calculus. File names with a .class suffix areread as single class files. File names with .jar or .zip suffixes are read as Zip files. Class filescontained as elements of these files are read and included. Other elements are silently ignored.

1 of 4

JavaCodeCompact for CVM

Page 167: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-maxSegmentSize num_classes Specifies the maximum number of classes to be represented in any one output file. Requires use ofthe -o option to specify output file name. See the section on Output.

-o outfilename Provides a template for the name of the output files to to be produced. See the section on Output.

-qlossless Preserves more information about the original program in the output file for use of the debuggingusing the JVMDI debugger interface. See the section on Opcode Transformations for a descriptionof the "quickening" process, which is modified by the option. This has a small performance impacton the running system.

-c Cumulative linking. Classes unresolved by the linking of class files explicitly listed as linkerarguments are searched for using the -classpath option, and linked as they are found.

-classpath path Specifies the path JavaCodeCompact uses to look up classes. Directories and Zip files areseparated by the delimiter defined by java.io.File.pathSeparatorChar, which is generally acolon. Multiple classpath options are cumulative, and are searched left-to-right. This option is onlyused in conjunction with the -c cumulative-linking option.

-nativesTypenative_type classes Indicates the calling convention to be used for native methods of the listed classes. The CNI nativetype is for use only by classes intimately involved with the virtual machine implementation. Allother classes must use the JNI convention. The option sequence "-nativesType JNI -*" informsJavaCodeCompact of the default type.

-headersDir header_typetarget_directory Controls the location of C-language header files generated by JavaCodeCompact. Header files forclasses of the indicated header_type are written in the indicated target directory. Existing headerfiles unchanged remain untouched. A header_type is either a native_type, as described with the-nativesType option above, or an extra_header_type, as described below.

-extraHeadersextra_header_type classes Governs the generation of additional headers for the named classes. The extra_header_type ofCVMOffsets is for use only by classes intimately involved with the virtual machine implementation.

-v Turns up the verbosity of the linking process. This option is cumulative. Currently up to threelevels of verbosity are understood. This option is really only of interest as a debugging aid.

-g Enables writing of data information that can facilitate Java debugging, if the information is availablein the input data: line-number tables, local variable table and source file names. These tables are notwritten by default. This option also suppresses the code inlining optimization.

-imageAttribute noPureCode Make all bytecodes writeable. By default they are declared as const. They must be writable tosupport breakpointing using the JVMDI debugger interface.

-f filename Open the named file and read options from it. They are processed just as if they were substituted inthe place of this option.

Opcode Transformations

Many Java bytecode instructions refer to symbolic quantities such as the offset of a field or of a method,or to a Java class. Normally, the Java Virtual Machine resolves such a reference upon first executing the

2 of 4

JavaCodeCompact for CVM

Page 168: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

instruction, and re-writes the instruction in place. The transformed instruction opcode is referred to as a"quickened" instruction, as subsequent executions of it do not need to see if resolution has taken place,but can proceed assuming it has. This yields non-ROMable Java code.

JavaCodeCompact determines the offset of every instance field and the method table offset of eachnon-static method for each class in the generated file. It requires that the complete inheritance hierarchyfor each class be present in the set of classes linked. Thus it is able to quicken opcodes referring to thosequantities, as well as those referencing other classes in the set being processed.

The usual quickening process makes it harder to re-construct source code information from the binaryprogram. For example, it is harder to discover name and type information for a class member given onlyits offset. When retention of this information is important (such as debugging using JVMDI), an alternateset of quickened instructions can be used. They can be more easily interpreted at runtime, but aresomewhat slower to execute.

Java bytecodes resolved and quickened at link time are read-only and thus ROMable. Instructionsreferring to symbols not resolved remain un-quick, and thus writable.

A few other transformations take place during linking, including the simple inlining of very shortmethods.

Output

The main product of the program is a body of initialize data structures, in C, representing the classes ofthe input files, and their ancillary data structures, such as Strings, the String intern table, the type table,primitive type classes and many of the array type classes referenced in the input. In addition to one ormore .c files, a .h file is produced, giving forward declarations, and for use only by the other source filesproduced by JavaCodeCompact. It will be referred to hereafter as the forward file.

Due to the limitations of many C compilers, it is often necessary to break this output into multiple files.When the -maxSegmentSize option is given, multiple .c files are produced: one to hold shared datastructures such as strings and types, and as many others as necessary, each containing no more thannum_classes classes.

The names of the files produced are computed using a combination of variables and options.

-maxSegmentSize not specified If the -o option is given, its argument is used as the name of thesingle compilable output file. Conventionally, this name ends with .c for C language output, butthis is not important to the operation of the program. In the absence of this option, a file isproduced with a name based on that of the first input file, stripped of pathname prefix and anysuffix, to which a ".c" suffix is appended. The resulting name, with ".h" appended, is used for theforward file. -maxSegmentSize is specified The -o option must be given in this case. It is used to form this setof file names: outfilenameList

An ASCII file naming all the C source programs produced. outfilenameAux.c

A C file holding data structures not tied to any specific class, such as Strings, String interntable, and the type tables.

3 of 4

JavaCodeCompact for CVM

Page 169: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

outfilenamev.c For 0 <= v < (number of classes) / num_classes. The C files holding per-class data structures.

outfilename.h The forward file name.

See Also

java - the Java Application Launcher javah - C Header and Stub File Generator jar - JAR Archive Tool

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

4 of 4

JavaCodeCompact for CVM

Page 170: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Appendix AThis appendix lists mapping information that maps an indirect function call to a direct function call in CVM programs. For more information, see the chapter C Stack Check.

-implicitref SecurityManager:check,CVMjniFindClass -implicitref SecurityManager:check,CVMjniExceptionClear -implicitref SecurityManager:check,CVMjniGetFieldID -implicitref SecurityManager:check,CVMjniGetBooleanField -implicitref SecurityManager:check,CVMjniFindClass -implicitref SecurityManager:check,CVMjniThrowNew

-implicitref Java_java_util_zip_CRC32_updateBytes,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_util_zip_CRC32_updateBytes,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_lang_Class_forName0,CVMjniGetStringUTFLength -implicitref Java_java_lang_Class_forName0,CVMjniGetStringUTFRegion -implicitref Java_java_lang_Class_forName0,CVMjniGetStringLength -implicitref Java_java_lang_Class_isInstance,CVMjniIsInstanceOf -implicitref Java_java_lang_Class_isAssignableFrom,CVMjniIsAssignableFrom -implicitref Java_java_lang_Class_getPrimitiveClass,CVMjniGetStringUTFChars -implicitref Java_java_lang_Class_getPrimitiveClass,CVMjniReleaseStringUTFChars -implicitref Java_java_lang_Class_getSuperclass,CVMjniGetSuperclass -implicitref Java_java_lang_ClassLoader_defineClass0,CVMjniGetByteArrayRegion -implicitref Java_java_lang_ClassLoader_defineClass0,CVMjniExceptionOccurred -implicitref Java_java_lang_ClassLoader_defineClass0,CVMjniGetStringUTFLength -implicitref Java_java_lang_ClassLoader_defineClass0,CVMjniGetStringLength -implicitref Java_java_lang_ClassLoader_defineClass0,CVMjniGetStringUTFRegion -implicitref Java_java_lang_ClassLoader_defineClass0,jni_impl:CVMjniDefineClass -implicitref Java_java_lang_ClassLoader_findBootstrapClass,CVMjniGetStringUTFLength -implicitref Java_java_lang_ClassLoader_findBootstrapClass,CVMjniGetStringLength -implicitref Java_java_lang_ClassLoader_findBootstrapClass,CVMjniGetStringUTFRegion -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_initIDs,CVMjniGetFieldID -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_initIDs,CVMjniGetFieldID -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_load,CVMjniGetJavaVM -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_load,CVMjniExceptionOccurred -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_load,CVMjniSetIntField -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_load,CVMjniSetLongField -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_load,CVMjniExceptionClear -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_unload,CVMjniGetLongField -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_unload,CVMjniGetJavaVM -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_find,CVMjniGetLongField -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_find,CVMjniGetStringUTFChars -implicitref Java_java_lang_ClassLoader_00024NativeLibrary_find,CVMjniReleaseStringUTFChars

1 of 19

Appendix A

Page 171: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_lang_Compiler_registerNatives,CVMjniRegisterNatives -implicitref Java_java_net_DatagramPacket_init,CVMjniGetFieldID -implicitref Java_java_io_FileDescriptor_initIDs,CVMjniGetFieldID -implicitref Java_java_io_FileDescriptor_sync,CVMjniGetIntField -implicitref Java_java_io_FileInputStream_initIDs,CVMjniGetFieldID -implicitref Java_java_io_FileInputStream_close,CVMjniGetIntField -implicitref Java_java_io_FileInputStream_close,CVMjniGetObjectField -implicitref Java_java_io_FileInputStream_close,CVMjniSetIntField -implicitref Java_java_io_FileInputStream_skip,CVMjniGetIntField -implicitref Java_java_io_FileInputStream_skip,CVMjniGetObjectField -implicitref Java_java_io_FileInputStream_available,CVMjniGetIntField -implicitref Java_java_io_FileInputStream_available,CVMjniGetObjectField -implicitref Java_java_io_FileOutputStream_initIDs,CVMjniGetFieldID -implicitref Java_java_io_FileOutputStream_close,CVMjniGetIntField -implicitref Java_java_io_FileOutputStream_close,CVMjniGetObjectField -implicitref Java_java_io_FileOutputStream_close,CVMjniSetIntField -implicitref Java_java_lang_ref_Finalizer_invokeFinalizeMethod,CVMjniGetObjectClass -implicitref Java_java_lang_ref_Finalizer_invokeFinalizeMethod,CVMjniGetMethodID -implicitref Java_java_lang_ref_Finalizer_invokeFinalizeMethod,CVMjniCallVoidMethod -implicitref Java_java_net_InetAddress_init,CVMjniGetFieldID -implicitref Java_java_net_InetAddressImpl_getLocalHostName,CVMjniNewStringUTF -implicitref Java_java_net_InetAddressImpl_makeAnyLocalAddress,CVMjniSetIntField -implicitref Java_java_net_InetAddressImpl_lookupAllHostAddr,CVMjniFindClass -implicitref Java_java_net_InetAddressImpl_lookupAllHostAddr,CVMjniNewObjectArray -implicitref Java_java_net_InetAddressImpl_lookupAllHostAddr,CVMjniNewByteArray -implicitref Java_java_net_InetAddressImpl_lookupAllHostAddr,CVMjniSetByteArrayRegion -implicitref Java_java_net_InetAddressImpl_lookupAllHostAddr,CVMjniSetObjectArrayElement -implicitref Java_java_net_InetAddressImpl_getHostByAddr,CVMjniNewStringUTF -implicitref Java_java_util_zip_Inflater_initIDs,CVMjniGetFieldID -implicitref Java_java_util_zip_Inflater_setDictionary,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_util_zip_Inflater_setDictionary,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniGetLongField -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniGetObjectField -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniGetIntField -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniSetBooleanField -implicitref Java_java_util_zip_Inflater_inflateBytes,CVMjniSetIntField -implicitref Java_java_lang_Object_registerNatives,CVMjniRegisterNatives -implicitref Java_java_lang_Object_getClass,CVMjniGetObjectClass -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniGetArrayLength -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniGetLongArrayElements -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniGetArrayLength -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniGetCharArrayElements -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniGetByteArrayElements -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetBooleanField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetByteField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetCharField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetShortField

2 of 19

Appendix A

Page 172: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetIntField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetFloatField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetLongField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniSetDoubleField -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniReleaseLongArrayElements -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniReleaseCharArrayElements -implicitref Java_java_io_ObjectInputStream_setPrimitiveFieldValues,CVMjniReleaseByteArrayElements -implicitref Java_java_io_ObjectInputStream_setObjectFieldValue,CVMjniIsInstanceOf -implicitref Java_java_io_ObjectInputStream_setObjectFieldValue,CVMjniSetObjectField -implicitref Java_java_io_ObjectInputStream_bytesToFloats,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_io_ObjectInputStream_bytesToFloats,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_io_ObjectInputStream_bytesToDoubles,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_io_ObjectInputStream_bytesToDoubles,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetArrayLength -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetLongArrayElements -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetArrayLength -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetCharArrayElements -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetByteArrayElements -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniSetBooleanField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetByteField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetCharField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetShortField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetIntField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetFloatField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetLongField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniGetDoubleField -implicitref Java_java_io_ObjectOutputStream_getPrimitiveFieldValues,CVMjniReleaseLongArrayElements -implicitref Java_java_io_ObjectOutputStream_getObjectFieldValue,CVMjniGetObjectField -implicitref Java_java_io_ObjectOutputStream_floatsToBytes,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_floatsToBytes,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_doublesToBytes,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_doublesToBytes,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_doublesToBytes,CVMjniGetPrimitiveArrayCritical -implicitref Java_java_io_ObjectOutputStream_doublesToBytes,CVMjniReleasePrimitiveArrayCritical -implicitref Java_java_io_ObjectStreamClass_initNative,CVMjniFindClass -implicitref Java_java_io_ObjectStreamClass_initNative,CVMjniGetFieldID -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniGetArrayLength -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniGetObjectArrayElement -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniGetObjectField -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniFromReflectedField -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniGetCharField -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniGetLongArrayElements -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniDeleteLocalRef -implicitref Java_java_io_ObjectStreamClass_getFieldIDs,CVMjniReleaseLongArrayElements -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniGetStaticMethodID -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniExceptionOccurred -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniExceptionClear -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniGetSuperclass -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniExceptionOccurred

3 of 19

Appendix A

Page 173: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniGetStaticMethodID -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniExceptionOccurred -implicitref Java_java_io_ObjectStreamClass_hasStaticInitializer,CVMjniExceptionClear -implicitref Java_java_net_PlainDatagramSocketImpl_init,CVMjniGetFieldID -implicitref Java_java_net_PlainDatagramSocketImpl_bind,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_bind,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_bind,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_bind,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_send,CVMjniGetByteArrayRegion -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_peek,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniFindClass -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniGetMethodID -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniNewObject -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniSetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_receive,CVMjniSetByteArrayRegion -implicitref Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_datagramSocketClose,CVMjniSetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_datagramSocketClose,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_datagramSocketClose,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniFindClass -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniFindClass -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniFindClass

4 of 19

Appendix A

Page 174: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainDatagramSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_socketGetOption,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_socketGetOption,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_setTimeToLive,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_setTimeToLive,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_getTimeToLive,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_getTimeToLive,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_join,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_join,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_join,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_leave,CVMjniGetObjectField -implicitref Java_java_net_PlainDatagramSocketImpl_leave,CVMjniGetIntField -implicitref Java_java_net_PlainDatagramSocketImpl_leave,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_initProto,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_initProto,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_initProto,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_initProto,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_initProto,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_socketCreate,CVMjniFindClass -implicitref Java_java_net_PlainSocketImpl_socketCreate,CVMjniNewGlobalRef -implicitref Java_java_net_PlainSocketImpl_socketCreate,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketCreate,CVMjniThrowNew -implicitref Java_java_net_PlainSocketImpl_socketCreate,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniSetObjectField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketConnect,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniSetObjectField -implicitref Java_java_net_PlainSocketImpl_socketBind,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketListen,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketListen,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniExceptionOccurred -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniFindClass -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniIsSameObject -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniExceptionClear -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketAccept,CVMjniGetObjectClass -implicitref Java_java_net_PlainSocketImpl_socketAvailable,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketAvailable,CVMjniGetIntField

5 of 19

Appendix A

Page 175: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_net_PlainSocketImpl_socketClose,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketClose,CVMjniSetIntField -implicitref Java_java_net_PlainSocketImpl_socketShutdown,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketShutdown,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniFindClass -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniFindClass -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniFindClass -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetFieldID -implicitref Java_java_net_PlainSocketImpl_socketSetOption,CVMjniGetIntField -implicitref Java_java_net_PlainSocketImpl_socketGetOption,CVMjniGetObjectField -implicitref Java_java_net_PlainSocketImpl_socketGetOption,CVMjniGetIntField -implicitref Java_java_lang_reflect_Proxy_defineClass0,CVMjniGetByteArrayRegion -implicitref Java_java_lang_reflect_Proxy_defineClass0,CVMjniGetStringUTFLength -implicitref Java_java_lang_reflect_Proxy_defineClass0,CVMjniGetStringUTFRegion -implicitref Java_java_lang_reflect_Proxy_defineClass0,jni_impl:CVMjniDefineClass -implicitref Java_java_lang_reflect_Proxy_defineClass0,CVMjniGetStringLength -implicitref Java_java_lang_reflect_Proxy_defineClass0,CVMjniExceptionOccurred -implicitref Java_java_io_RandomAccessFile_initIDs,CVMjniGetFieldID -implicitref Java_java_io_RandomAccessFile_getFilePointer,CVMjniGetIntField -implicitref Java_java_io_RandomAccessFile_getFilePointer,CVMjniGetObjectField -implicitref Java_java_io_RandomAccessFile_length,CVMjniGetIntField -implicitref Java_java_io_RandomAccessFile_length,CVMjniGetObjectField -implicitref Java_java_io_RandomAccessFile_seek,CVMjniGetIntField -implicitref Java_java_io_RandomAccessFile_seek,CVMjniGetObjectField -implicitref Java_java_io_RandomAccessFile_setLength,CVMjniGetIntField -implicitref Java_java_io_RandomAccessFile_setLength,CVMjniGetObjectField -implicitref Java_java_io_RandomAccessFile_close,CVMjniGetIntField -implicitref Java_java_io_RandomAccessFile_close,CVMjniGetObjectField -implicitref Java_java_io_RandomAccessFile_close,CVMjniSetIntField -implicitref Java_java_lang_Runtime_runFinalization0,CVMjniFindClass -implicitref Java_java_lang_Runtime_runFinalization0,CVMjniGetStaticMethodID -implicitref Java_java_lang_Runtime_runFinalization0,CVMjniCallStaticVoidMethod -implicitref Java_java_lang_Runtime_execInternal,CVMjniGetArrayLength -implicitref Java_java_lang_Shutdown_runAllFinalizers,CVMjniFindClass -implicitref Java_java_lang_Shutdown_runAllFinalizers,CVMjniGetStaticMethodID -implicitref Java_java_lang_Shutdown_runAllFinalizers,CVMjniCallStaticVoidMethod -implicitref Java_sun_misc_Signal_findSignal,CVMjniGetStringUTFChars -implicitref Java_sun_misc_Signal_findSignal,CVMjniReleaseStringUTFChars -implicitref Java_java_net_SocketInputStream_init,CVMjniFindClass -implicitref Java_java_net_SocketInputStream_init,CVMjniGetFieldID -implicitref Java_java_net_SocketInputStream_socketRead,CVMjniGetObjectField -implicitref Java_java_net_SocketInputStream_socketRead,CVMjniGetIntField -implicitref Java_java_net_SocketInputStream_socketRead,CVMjniGetArrayLength

6 of 19

Appendix A

Page 176: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_net_SocketInputStream_socketRead,CVMjniSetByteArrayRegion -implicitref Java_java_net_SocketOutputStream_init,CVMjniFindClass -implicitref Java_java_net_SocketOutputStream_init,CVMjniGetFieldID -implicitref Java_java_net_SocketOutputStream_socketWrite,CVMjniGetObjectField -implicitref Java_java_net_SocketOutputStream_socketWrite,CVMjniGetIntField -implicitref Java_java_net_SocketOutputStream_socketWrite,CVMjniGetArrayLength -implicitref Java_java_net_SocketOutputStream_socketWrite,CVMjniGetByteArrayRegion -implicitref Java_java_lang_System_registerNatives,CVMjniRegisterNatives -implicitref Java_java_lang_System_initProperties,CVMjniGetMethodID -implicitref Java_java_lang_System_initProperties,CVMjniGetObjectClass -implicitref Java_java_lang_System_setIn0,CVMjniGetStaticFieldID -implicitref Java_java_lang_System_setIn0,CVMjniSetStaticObjectField -implicitref Java_java_lang_System_setOut0,CVMjniGetStaticFieldID -implicitref Java_java_lang_System_setOut0,CVMjniSetStaticObjectField -implicitref Java_java_lang_System_setErr0,CVMjniGetStaticFieldID -implicitref Java_java_lang_System_setErr0,CVMjniSetStaticObjectField -implicitref Java_java_lang_System_mapLibraryName,CVMjniGetStringLength -implicitref Java_java_lang_System_mapLibraryName,CVMjniGetStringRegion -implicitref Java_java_lang_System_mapLibraryName,CVMjniNewString -implicitref Java_java_lang_Thread_registerNatives,CVMjniRegisterNatives -implicitref Java_java_lang_UNIXProcess_initLockObject,CVMjniNewGlobalRef -implicitref Java_java_lang_UNIXProcess_run,CVMjniMonitorEnter -implicitref Java_java_lang_UNIXProcess_run,CVMjniMonitorExit -implicitref Java_java_lang_UNIXProcess_run,CVMjniMonitorEnter -implicitref Java_java_lang_UNIXProcess_run,CVMjniExceptionOccurred -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniFindClass -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniGetFieldID -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniGetArrayLength -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniGetObjectArrayElement -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniDeleteLocalRef -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniGetArrayLength -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniGetObjectArrayElement -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniMonitorEnter -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniMonitorExit -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniExceptionOccurred -implicitref Java_java_lang_UNIXProcess_forkAndExec,CVMjniSetIntField -implicitref Java_java_io_UnixFileSystem_initIDs,CVMjniFindClass -implicitref Java_java_io_UnixFileSystem_initIDs,CVMjniGetFieldID -implicitref UnixFileSystem_md:statMode,dlsym -implicitref Java_java_io_UnixFileSystem_getBooleanAttributes0,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_checkAccess,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_getLastModifiedTime,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_getLastModifiedTime,dlsym -implicitref Java_java_io_UnixFileSystem_getLength,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_getLength,dlsym -implicitref Java_java_io_UnixFileSystem_delete,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_deleteOnExit,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_list,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_list,CVMjniNewObjectArray

7 of 19

Appendix A

Page 177: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_io_UnixFileSystem_list,CVMjniNewObjectArray -implicitref Java_java_io_UnixFileSystem_list,CVMjniDeleteLocalRef -implicitref Java_java_io_UnixFileSystem_list,CVMjniSetObjectArrayElement -implicitref Java_java_io_UnixFileSystem_list,CVMjniDeleteLocalRef -implicitref Java_java_io_UnixFileSystem_list,CVMjniNewObjectArray -implicitref Java_java_io_UnixFileSystem_createDirectory,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_rename,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_rename,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_setLastModifiedTime,CVMjniGetObjectField -implicitref Java_java_io_UnixFileSystem_setLastModifiedTime,dlsym -implicitref Java_java_io_UnixFileSystem_setReadOnly,CVMjniGetObjectField -implicitref Java_java_util_zip_ZipEntry_initIDs,CVMjniGetFieldID -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniGetObjectField -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniNewStringUTF -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniSetObjectField -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniSetLongField -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniSetIntField -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniNewByteArray -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniSetByteArrayRegion -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniSetObjectField -implicitref Java_java_util_zip_ZipEntry_initFields,CVMjniNewStringUTF -implicitref Java_java_util_zip_ZipFile_initIDs,CVMjniGetFieldID -implicitref Java_java_util_zip_ZipFile_getEntry,CVMjniGetStringLength -implicitref Java_java_util_zip_ZipFile_getEntry,CVMjniGetStringUTFLength -implicitref Java_java_util_zip_ZipFile_getEntry,CVMjniGetStringUTFRegion -implicitref Java_java_util_zip_ZipFile_read,CVMjniSetByteArrayRegion -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniGetLongField -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniFindClass -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniNewObjectArray -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniNewStringUTF -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniSetObjectArrayElement -implicitref Java_java_util_jar_JarFile_getMetaInfEntryNames,CVMjniDeleteLocalRef -implicitref ansiJavaMain,CVMjniGetStaticMethodID -implicitref ansiJavaMain,CVMjniCallStaticObjectMethod -implicitref ansiJavaMain,CVMjniGetStringUTFChars -implicitref ansiJavaMain,CVMjniDeleteLocalRef -implicitref ansiJavaMain,CVMjniFindClass -implicitref ansiJavaMain,CVMjniReleaseStringUTFChars -implicitref ansiJavaMain,CVMjniGetStaticMethodID -implicitref ansiJavaMain,CVMjniCallStaticVoidMethod -implicitref ansiJavaMain,CVMjniExceptionOccurred -implicitref ansiJavaMain,CVMjniExceptionDescribe -implicitref ansiJavaMain,CVMjniDeleteLocalRef -implicitref ansiJavaMain,jni_impl:CVMjniDetachCurrentThread -implicitref ansiJavaMain,jni_impl:CVMjniDestroyJavaVM -implicitref classcreate:CVMclassAddToLoadedClasses,CVMjniCallVoidMethod -implicitref classcreate:CVMclassFreeClassLoaderRoot,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref classcreate:CVMclassFreeClassLoaderRoot,gen_semispace:CVMgenSemispaceRefIsLive -implicitref CVMclassScanStatics,gen_markcompact:CVMgenMarkCompactScanTransitively

8 of 19

Appendix A

Page 178: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMclassScanStatics,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMclassScanStatics,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMclassScan,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMclassScan,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMclassScan,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref classinitialize:CVMprivateClassInit,CVMjniCallVoidMethod -implicitref classload:CVMclassLoadClassWithClassLoader,CVMjniNewStringUTF -implicitref classload:CVMclassLoadClassWithClassLoader,CVMjniCallObjectMethod -implicitref CVMclassBootClassPathInit,CVMjniGetStaticMethodID -implicitref CVMclassBootClassPathInit,CVMjniNewStringUTF -implicitref CVMclassBootClassPathInit,CVMjniCallStaticObjectMethod -implicitref CVMclassBootClassPathInit,CVMjniDeleteLocalRef -implicitref CVMclassBootClassPathInit,CVMjniGetStringUTFChars -implicitref CVMclassBootClassPathInit,CVMjniReleaseStringUTFChars -implicitref CVMclassBootClassPathInit,CVMjniDeleteLocalRef -implicitref classtable:CVMclassTableMarkerCallback,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref classtable:CVMclassTableIteratorCallback,gc_impl:CVMgenScanClassPointersInGeneration -implicitref classtable:CVMclassTableIteratorCallback,gc_common:CVMclassScanSystemClassCallback -implicitref CVMclassTableStackIterate,classtable:CVMclassTableIteratorCallback -implicitref CVMclassTableStackIterate,classes:CVMclassFreeCallback -implicitref CVMclassVerify,CVMjniPushLocalFrame -implicitref CVMclassVerify,CVMjniPopLocalFrame -implicitref CVMzlibDeflateInit2_,zcalloc -implicitref CVMzlibDeflate,deflate_stored -implicitref CVMzlibDeflate,deflate_fast -implicitref CVMzlibDeflate,deflate_slow -implicitref CVMzlibDeflateEnd,zcfree -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMfastTryLock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMdetTryLock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMfastLock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMdetLock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMfastTryUnlock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMdetTryUnlock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMfastUnlock -implicitref CVMgcUnsafeExecuteJavaMethod,objsync:CVMdetUnlock -implicitref CVMgcUnsafeExecuteJavaMethod,interpreter:CVMfindBuiltinEntry -implicitref CVMgcAllocNewInstance,CVMjniPushLocalFrame -implicitref CVMgcAllocNewInstance,CVMjniCallStaticVoidMethod -implicitref gc_common:CVMgcStopTheWorldAndGCSafe,objsync:CVMfastLock -implicitref gc_common:CVMgcStopTheWorldAndGCSafe,objsync:CVMdetLock -implicitref gc_common:CVMgcStopTheWorldAndGCSafe,objsync:CVMfastNotifyAll -implicitref gc_common:CVMgcStopTheWorldAndGCSafe,objsync:CVMdetNotifyAll -implicitref gc_impl:scanAndSummarizeObjectsOnCard,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref gc_impl:scanAndSummarizeObjectsOnCard,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref gc_impl:scanAndSummarizeObjectsOnCard,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref gc_impl:callbackIfNeeded,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref gc_impl:callbackIfNeeded,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref gc_impl:callbackIfNeeded,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref gc_impl:CVMgenScanClassPointersInGeneration,gen_semispace:CVMgenSemispaceFilteredHandleRoot

9 of 19

Appendix A

Page 179: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref gc_impl:CVMgenScanClassPointersInGeneration,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref gc_impl:CVMgenScanClassPointersInGeneration,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMgcimplFreeMemory,gen_semispace:CVMgenSemispaceFreeMemory -implicitref CVMgcimplFreeMemory,gen_markcompact:CVMgenMarkCompactFreeMemory -implicitref CVMgcimplTotalMemory,gen_semispace:CVMgenSemispaceTotalMemory -implicitref CVMgcimplTotalMemory,gen_markcompact:CVMgenMarkCompactTotalMemory -implicitref CVMgenScanAllRoots,gen_semispace:CVMgenSemispaceScanOlderToYoungerPointers -implicitref CVMgenScanAllRoots,gen_markcompact:CVMgenMarkCompactScanOlderToYoungerPointers -implicitref CVMgenScanAllRoots,gen_semispace:CVMgenSemispaceScanPromotedPointers -implicitref CVMgenScanAllRoots,gen_markcompact:CVMgenMarkCompactScanPromotedPointers -implicitref CVMgenScanAllRoots,gen_semispace:CVMgenSemispaceScanYoungerToOlderPointers -implicitref CVMgenScanAllRoots,gen_markcompact:CVMgenMarkCompactScanYoungerToOlderPointers -implicitref CVMgcimplDoGC,gen_semispace:CVMgenSemispaceStartGC -implicitref CVMgcimplDoGC,gen_markcompact:CVMgenMarkCompactStartGC -implicitref CVMgcimplDoGC,gen_semispace:CVMgenSemispaceCollect -implicitref CVMgcimplDoGC,gen_markcompact:CVMgenMarkCompactCollect -implicitref CVMgcimplDoGC,gen_semispace:CVMgenSemispaceEndGC -implicitref CVMgcimplDoGC,gen_markcompact:CVMgenMarkCompactEndGC -implicitref gen_markcompact:scanObjectsInRangePartial,gen_markcompact:CVMgenMarkCompactUpdateTableForObjectSlot -implicitref gen_markcompact:scanObjectsInRange,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref gen_markcompact:scanObjectsInRange,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref gen_markcompact:scanObjectsInRangeSkipUnmarked,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref gen_markcompact:CVMgenMarkCompactCollect,gen_semispace:CVMgenSemispaceGetExtraSpace -implicitref gen_semispace:scanObjectsInRangePartial,gen_semispace:CVMgenSemispaceUpdateTableForObjectSlot -implicitref gen_semispace:scanObjectsInRangeFull,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref gen_semispace:scanObjectsInRangeFull,gen_semispace:CVMgenSemispaceBlackenObjectFull -implicitref gen_semispace:CVMgenSemispaceForwardOrPromoteObject,gen_semispace:CVMgenSemispacePromoteInto -implicitref gen_semispace:CVMgenSemispaceForwardOrPromoteObject,gen_markcompact:CVMgenMarkCompactPromoteInto -implicitref gen_semispace:CVMgenSemispaceFollowRootsWithBlackener,gen_semispace:CVMgenSemispaceScanPromotedPointers -implicitref CVMglobalrootFrameScanner,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMglobalrootFrameScanner,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMglobalrootFrameScanner,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMweakrefUpdate,CVMglobalrootFrameScanner -implicitref CVMgcScanSpecial,CVMglobalrootFrameScanner -implicitref CVMgcScanRoots,CVMglobalrootFrameScanner -implicitref CVMtransitionFrameScanner,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMtransitionFrameScanner,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMtransitionFrameScanner,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMgcScanRoots,CVMtransitionFrameScanner -implicitref CVMgcScanRoots,CVMfreelistFrameScanner -implicitref CVMgcScanRoots,CVMjavaFrameScanner -implicitref interpreter:CVMinterpreterIterateRefArguments,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref interpreter:CVMinterpreterIterateRefArguments,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref interpreter:CVMinterpreterIterateRefArguments,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMzlibInflate_blocks_reset,zcfree -implicitref CVMzlibInflate_blocks_reset,alder32 -implicitref CVMzlibInflate_blocks_new,zcalloc -implicitref CVMzlibInflate_blocks_new,zcfree -implicitref CVMzlibInflate_blocks,zcalloc

10 of 19

Appendix A

Page 180: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMzlibInflate_blocks,zcfree -implicitref CVMzlibInflate_blocks_free,zcalloc -implicitref CVMzlibInflate_codes_new,zcalloc -implicitref CVMzlibInflate_codes_free,zcfree -implicitref CVMzlibInflateEnd,zcfree -implicitref CVMzlibInflateInit2_,zcalloc -implicitref CVMzlibInflate_trees_bits,zcalloc -implicitref CVMzlibInflate_trees_bits,zcfree -implicitref CVMzlibInflate_trees_dynamic,zcalloc -implicitref CVMzlibInflate_trees_dynamic,zcfree -implicitref CVMzlibInflate_flush,adler32 -implicitref CVMgcScanRoots,CVMjavaFrameScanner -implicitref CVMjavaFrameScanner,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMjavaFrameScanner,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMjavaFrameScanner,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMgcScanRoots,CVMfreelistFrameScanner -implicitref CVMfreelistFrameScanner,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMfreelistFrameScanner,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMfreelistFrameScanner,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMgcUnsafeHandleException,objsync:CVMfastUnlock -implicitref CVMgcUnsafeHandleException,objsync:CVMdetUnlock -implicitref interpreter:CVMclassLoaderFindNative,CVMjniPushLocalFrame -implicitref interpreter:CVMclassLoaderFindNative,CVMjniNewStringUTF -implicitref interpreter:CVMclassLoaderFindNative,CVMjniCallStaticLongMethod -implicitref interpreter:CVMclassLoaderFindNative,CVMjniPopLocalFrame -implicitref CVMprepareToExit,io_util:deleteOnExitHook -implicitref CVMexit,exit -implicitref CVMsafeExit,CVMjniDestroyJavaVM -implicitref CVMsafeExit,ansi_java_md:safeExit -implicitref CVMabort,abort -implicitref CVMioutilReadSingle,CVMjniGetIntField -implicitref CVMioutilReadSingle,CVMjniGetObjectField -implicitref CVMioutilReadBytes,CVMjniGetArrayLength -implicitref CVMioutilReadBytes,CVMjniSetByteArrayRegion -implicitref CVMioutilReadBytes,CVMjniGetIntField -implicitref CVMioutilReadBytes,CVMjniGetObjectField -implicitref CVMioutilWriteSingle,CVMjniGetIntField -implicitref CVMioutilWriteSingle,CVMjniGetObjectField -implicitref CVMioutilWriteBytes,CVMjniGetArrayLength -implicitref CVMioutilWriteBytes,CVMjniGetIntField -implicitref CVMioutilWriteBytes,CVMjniGetObjectField -implicitref CVMioutilWriteBytes,CVMjniGetByteArrayRegion -implicitref CVMioutilWriteBytes,CVMjniExceptionOccurred -implicitref io_util:throwFileNotFoundException,CVMjniThrow -implicitref io_util:throwFileNotFoundException,CVMjniDeleteLocalRef -implicitref CVMioutilFileOpen,CVMjniSetIntField -implicitref CVMioutilFileOpen,CVMjniGetObjectField -implicitref CVMjniFindClass,CVMjniCallStaticObjectMethod -implicitref CVMjniFindClass,CVMjniCallStaticObjectMethod

11 of 19

Appendix A

Page 181: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniExceptionDescribe,CVMjniNewLocalRef -implicitref CVMjniExceptionDescribe,CVMjniNewLocalRef -implicitref jni_impl:CVMjniInvoke,jni_impl:CVMjniPushArgumentsVararg -implicitref jni_impl:CVMjniInvoke,jni_impl:CVMjniPushArgumentsArray -implicitref CVMjniMonitorEnter,objsync:CVMfastLock -implicitref CVMjniMonitorEnter,objsync:CVMdetLock -implicitref jni_impl:handleXrunArgument,CVMjniFindClass -implicitref jni_impl:handleXrunArgument,CVMjniFindClass -implicitref jni_impl:handleXrunArgument,CVMjniGetStaticMethodID -implicitref jni_impl:handleXrunArgument,CVMjniGetMethodID -implicitref jni_impl:handleXrunArgument,CVMjniNewStringUTF -implicitref jni_impl:handleXrunArgument,CVMjniNewStringUTF -implicitref jni_impl:handleXrunArgument,CVMjniCallStaticObjectMethod -implicitref jni_impl:handleXrunArgument,CVMjniNewStringUTF -implicitref jni_impl:handleXrunArgument,CVMjniCallLongMethod -implicitref jni_impl:handleXrunArgument,CVMjniGetJavaVM -implicitref jni_impl:handleXrunArgument,CVMlong2VoidPtr -implicitref JNI_CreateJavaVM,CVMjniExceptionCheck -implicitref JNI_CreateJavaVM,CVMjniGetStaticMethodID -implicitref JNI_CreateJavaVM,CVMjniCallStaticVoidMethod -implicitref JNI_CreateJavaVM,CVMjniExceptionCheck -implicitref JNI_CreateJavaVM,CVMjniExceptionDescribe -implicitref JNI_CreateJavaVM,CVMjniNewObjectArray -implicitref JNI_CreateJavaVM,CVMjniNewStringUTF -implicitref JNI_CreateJavaVM,CVMjniSetObjectArrayElement -implicitref JNI_CreateJavaVM,CVMjniDeleteLocalRef -implicitref JNI_CreateJavaVM,CVMjniNewStringUTF -implicitref JNI_CreateJavaVM,CVMjniGetStaticMethodID -implicitref JNI_CreateJavaVM,CVMjniCallStaticBooleanMethod -implicitref JNI_CreateJavaVM,CVMjniExceptionCheck -implicitref JNI_CreateJavaVM,CVMjniExceptionCheck -implicitref JNI_CreateJavaVM,CVMjniExceptionDescribe -implicitref JNI_CreateJavaVM,CVMjniDeleteLocalRef -implicitref JNI_CreateJavaVM,CVMjniDeleteLocalRef -implicitref JNI_CreateJavaVM,CVMjniExceptionCheck -implicitref JNI_CreateJavaVM,CVMjniExceptionDescribe -implicitref jni_impl:CVMjniDestroyJavaVM,jni_impl:CVMjniAttachCurrentThread -implicitref JNU_ThrowByName,CVMjniFindClass -implicitref JNU_ThrowByName,CVMjniThrowNew -implicitref JNU_ThrowByName,CVMjniDeleteLocalRef -implicitref JNU_ThrowByNameWithLastError,CVMjniThrow -implicitref JNU_ThrowByNameWithLastError,CVMjniDeleteLocalRef -implicitref JNU_ThrowByNameWithLastError,CVMjniDeleteLocalRef -implicitref JNU_CallStaticMethodByName,CVMjniEnsureLocalCapacity -implicitref JNU_CallStaticMethodByName,CVMjniFindClass -implicitref JNU_CallStaticMethodByName,CVMjniGetStaticMethodID -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticVoidMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticObjectMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticBooleanMethodV

12 of 19

Appendix A

Page 182: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref JNU_CallStaticMethodByName,CVMjniCallStaticByteMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticCharMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticShortMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticIntMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticLongMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticFloatMethodV -implicitref JNU_CallStaticMethodByName,CVMjniCallStaticDoubleMethodV -implicitref JNU_CallStaticMethodByName,CVMjniFatalError -implicitref JNU_CallStaticMethodByName,CVMjniDeleteLocalRef -implicitref JNU_CallStaticMethodByName,CVMjniExceptionCheck -implicitref JNU_CallMethodByNameV,CVMjniEnsureLocalCapacity -implicitref JNU_CallMethodByNameV,CVMjniGetObjectClass -implicitref JNU_CallMethodByNameV,CVMjniGetMethodID -implicitref JNU_CallMethodByNameV,CVMjniCallVoidMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallObjectMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallBooleanMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallByteMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallCharMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallShortMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallIntMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallLongMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallFloatMethodV -implicitref JNU_CallMethodByNameV,CVMjniCallDoubleMethodV -implicitref JNU_CallMethodByNameV,CVMjniFatalError -implicitref JNU_CallMethodByNameV,CVMjniDeleteLocalRef -implicitref JNU_CallMethodByNameV,CVMjniExceptionCheck -implicitref JNU_NewObjectByName,CVMjniEnsureLocalCapacity -implicitref JNU_NewObjectByName,CVMjniFindClass -implicitref JNU_NewObjectByName,CVMjniGetMethodID -implicitref JNU_NewObjectByName,CVMjniNewObjectV -implicitref JNU_NewObjectByName,CVMjniDeleteLocalRef -implicitref jni_util:newString8859_1,CVMjniNewString -implicitref jni_util:getString8859_1Chars,CVMjniGetStringLength -implicitref jni_util:getString8859_1Chars,CVMjniGetStringChars -implicitref jni_util:getString8859_1Chars,CVMjniReleaseStringChars -implicitref jni_util:getString8859_1Chars,CVMjniReleaseStringChars -implicitref jni_util:newStringCp1252,CVMjniNewString -implicitref jni_util:getStringCp1252Chars,CVMjniGetStringLength -implicitref jni_util:getStringCp1252Chars,CVMjniGetStringChars -implicitref jni_util:getStringCp1252Chars,CVMjniReleaseStringChars -implicitref jni_util:getStringCp1252Chars,CVMjniReleaseStringChars -implicitref jni_util:initializeEncoding,CVMjniEnsureLocalCapacity -implicitref jni_util:initializeEncoding,CVMjniNewStringUTF -implicitref jni_util:initializeEncoding,CVMjniGetStringUTFChars -implicitref jni_util:initializeEncoding,CVMjniReleaseStringUTFChars -implicitref jni_util:initializeEncoding,CVMjniExceptionClear -implicitref jni_util:initializeEncoding,CVMjniExceptionClear -implicitref jni_util:initializeEncoding,CVMjniDeleteLocalRef -implicitref jni_util:initializeEncoding,CVMjniDeleteLocalRef

13 of 19

Appendix A

Page 183: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref jni_util:initializeEncoding,CVMjniGetMethodID -implicitref jni_util:initializeEncoding,CVMjniGetMethodID -implicitref JNU_NewStringPlatform,CVMjniEnsureLocalCapacity -implicitref JNU_NewStringPlatform,CVMjniNewByteArray -implicitref JNU_NewStringPlatform,CVMjniSetByteArrayRegion -implicitref JNU_NewStringPlatform,CVMjniNewObject -implicitref JNU_NewStringPlatform,CVMjniDeleteLocalRef -implicitref JNU_GetStringPlatformChars,CVMjniEnsureLocalCapacity -implicitref JNU_GetStringPlatformChars,CVMjniCallObjectMethod -implicitref JNU_GetStringPlatformChars,CVMjniExceptionCheck -implicitref JNU_GetStringPlatformChars,CVMjniGetArrayLength -implicitref JNU_GetStringPlatformChars,CVMjniDeleteLocalRef -implicitref JNU_GetStringPlatformChars,CVMjniGetByteArrayRegion -implicitref JNU_GetStringPlatformChars,CVMjniDeleteLocalRef -implicitref JNU_CopyObjectArray,CVMjniEnsureLocalCapacity -implicitref JNU_CopyObjectArray,CVMjniGetObjectArrayElement -implicitref JNU_CopyObjectArray,CVMjniSetObjectArrayElement -implicitref JNU_CopyObjectArray,CVMjniDeleteLocalRef -implicitref JNU_GetEnv,CVMjniGetEnv -implicitref JNU_IsInstanceOfByName,CVMjniEnsureLocalCapacity -implicitref JNU_IsInstanceOfByName,CVMjniFindClass -implicitref JNU_IsInstanceOfByName,CVMjniIsInstanceOf -implicitref JNU_IsInstanceOfByName,CVMjniDeleteLocalRef -implicitref JNU_Equals,CVMjniGetMethodID -implicitref JNU_Equals,CVMjniCallBooleanMethod -implicitref JNU_MonitorWait,CVMjniGetMethodID -implicitref JNU_MonitorWait,CVMjniCallVoidMethod -implicitref JNU_Notify,CVMjniGetMethodID -implicitref JNU_Notify,CVMjniCallVoidMethod -implicitref JNU_NotifyAll,CVMjniGetMethodID -implicitref JNU_NotifyAll,CVMjniCallVoidMethod -implicitref JNU_PrintClass,CVMjniGetObjectClass -implicitref JNU_PrintClass,CVMjniDeleteLocalRef -implicitref JNU_PrintClass,CVMjniDeleteLocalRef -implicitref JNU_ToString,CVMjniNewStringUTF -implicitref JNU_GetFieldByName,CVMjniEnsureLocalCapacity -implicitref JNU_GetFieldByName,CVMjniGetObjectClass -implicitref JNU_GetFieldByName,CVMjniGetFieldID -implicitref JNU_GetFieldByName,CVMjniGetObjectField -implicitref JNU_GetFieldByName,CVMjniGetBooleanField -implicitref JNU_GetFieldByName,CVMjniGetByteField -implicitref JNU_GetFieldByName,CVMjniGetCharField -implicitref JNU_GetFieldByName,CVMjniGetShortField -implicitref JNU_GetFieldByName,CVMjniGetIntField -implicitref JNU_GetFieldByName,CVMjniGetLongField -implicitref JNU_GetFieldByName,CVMjniGetFloatField -implicitref JNU_GetFieldByName,CVMjniGetDoubleField -implicitref JNU_GetFieldByName,CVMjniFatalError -implicitref JNU_GetFieldByName,CVMjniDeleteLocalRef

14 of 19

Appendix A

Page 184: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref JNU_GetFieldByName,CVMjniExceptionCheck -implicitref JNU_SetFieldByName,CVMjniEnsureLocalCapacity -implicitref JNU_SetFieldByName,CVMjniGetObjectClass -implicitref JNU_SetFieldByName,CVMjniGetFieldID -implicitref JNU_SetFieldByName,CVMjniSetObjectField -implicitref JNU_SetFieldByName,CVMjniSetBooleanField -implicitref JNU_SetFieldByName,CVMjniSetByteField -implicitref JNU_SetFieldByName,CVMjniSetCharField -implicitref JNU_SetFieldByName,CVMjniSetShortField -implicitref JNU_SetFieldByName,CVMjniSetIntField -implicitref JNU_SetFieldByName,CVMjniSetLongField -implicitref JNU_SetFieldByName,CVMjniSetFloatField -implicitref JNU_SetFieldByName,CVMjniSetDoubleField -implicitref JNU_SetFieldByName,CVMjniFatalError -implicitref JNU_SetFieldByName,CVMjniDeleteLocalRef -implicitref JNU_SetFieldByName,CVMjniExceptionCheck -implicitref JNU_GetStaticFieldByName,CVMjniEnsureLocalCapacity -implicitref JNU_GetStaticFieldByName,CVMjniFindClass -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticFieldID -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticObjectField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticBooleanField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticByteField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticCharField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticShortField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticIntField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticLongField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticFloatField -implicitref JNU_GetStaticFieldByName,CVMjniGetStaticDoubleField -implicitref JNU_GetStaticFieldByName,CVMjniFatalError -implicitref JNU_GetStaticFieldByName,CVMjniDeleteLocalRef -implicitref JNU_GetStaticFieldByName,CVMjniExceptionCheck -implicitref JNU_SetStaticFieldByName,CVMjniEnsureLocalCapacity -implicitref JNU_SetStaticFieldByName,CVMjniFindClass -implicitref JNU_SetStaticFieldByName,CVMjniGetStaticFieldID -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticObjectField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticBooleanField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticByteField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticCharField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticShortField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticIntField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticLongField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticFloatField -implicitref JNU_SetStaticFieldByName,CVMjniSetStaticDoubleField -implicitref JNU_SetStaticFieldByName,CVMjniFatalError -implicitref JNU_SetStaticFieldByName,CVMjniDeleteLocalRef -implicitref JNU_SetStaticFieldByName,CVMjniExceptionCheck -implicitref JVM_FindPrimitiveClass,CVMjniFindClass -implicitref JVM_FindClassFromClassLoader,CVMjniNewLocalRef -implicitref Java_java_lang_Class_getName,CVMjniNewLocalRef

15 of 19

Appendix A

Page 185: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref Java_java_lang_Class_getName,CVMjniNewStringUTF -implicitref Java_java_lang_Class_getClassLoader0,CVMjniNewLocalRef -implicitref Java_java_lang_Class_getProtectionDomain0,CVMjniNewLocalRef -implicitref Java_java_lang_Class_getComponentType,CVMjniNewLocalRef -implicitref Java_java_lang_Class_getField0,CVMjniGetStringUTFChars -implicitref Java_java_lang_Class_getField0,CVMjniDeleteLocalRef -implicitref Java_java_lang_Class_getField0,CVMjniReleaseStringUTFChars -implicitref Java_java_lang_Class_getMethod0,CVMjniGetStringUTFChars -implicitref Java_java_lang_Class_getMethod0,CVMjniDeleteLocalRef -implicitref Java_java_lang_Class_getMethod0,CVMjniReleaseStringUTFChars -implicitref Java_java_lang_Class_getDeclaringClass,CVMjniNewLocalRef -implicitref JVM_GetCallerClass,CVMjniNewLocalRef -implicitref CVMprintStackTrace,CVMjniGetStaticObjectField -implicitref CVMprintStackTrace,CVMjniCallVoidMethod -implicitref CVMprintStackTrace,CVMjniExceptionCheck -implicitref Java_java_lang_Object_clone,CVMjniNewLocalRef -implicitref jvm:start_func,CVMjniGetMethodID -implicitref jvm:start_func,CVMjniCallVoidMethod -implicitref jvm:start_func,CVMjniExceptionCheck -implicitref Java_java_lang_Thread_currentThread,CVMjniNewLocalRef -implicitref JVM_CurrentLoadedClass,CVMjniNewLocalRef -implicitref JVM_CurrentClassLoader,CVMjniNewLocalRef -implicitref JVM_GetClassContext,CVMjniNewLocalRef -implicitref JVM_AllocateNewObject,CVMjniDeleteLocalRef -implicitref JVM_AllocateNewObject,CVMjniCallVoidMethod -implicitref JVM_AllocateNewArray,CVMjniDeleteLocalRef -implicitref JVM_GetArrayElement,CVMjniDeleteLocalRef -implicitref JVM_GetArrayElement,CVMjniDeleteLocalRef -implicitref JVM_GetArrayElement,CVMjniDeleteLocalRef -implicitref JVM_NewArray,CVMjniNewLocalRef -implicitref JVM_NewArray,CVMjniDeleteLocalRef -implicitref JVM_NewMultiArray,CVMjniDeleteLocalRef -implicitref JVM_FindLoadedClass,CVMjniGetStringLength -implicitref JVM_FindLoadedClass,CVMjniGetStringUTFLength -implicitref JVM_FindLoadedClass,CVMjniGetStringUTFRegion -implicitref JVM_InitProperties,CVMjniGetMethodID -implicitref JVM_InitProperties,CVMjniNewLocalRef -implicitref JVM_InitProperties,CVMjniGetObjectClass -implicitref CVMloaderConstraintsMarkUnscannedClassesAndLoaders,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref CVMloaderConstraintsMarkUnscannedClassesAndLoaders,gen_semispace:CVMgenSemispaceRefIsLive -implicitref CVMloaderCacheMarkUnscannedClassesAndLoaders,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref CVMloaderCacheMarkUnscannedClassesAndLoaders,gen_semispace:CVMgenSemispaceRefIsLive -implicitref CVMgcScanRoots,CVMlocalrootFrameScanner -implicitref CVMlocalrootFrameScanner,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMlocalrootFrameScanner,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMlocalrootFrameScanner,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMnetutilGetFileDescriptorID,CVMjniFindClass -implicitref CVMnetutilGetFileDescriptorID,CVMjniGetFieldID -implicitref objsync:deleteUnreferencedBound,gen_markcompact:CVMgenMarkCompactRefIsLive

16 of 19

Appendix A

Page 186: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref objsync:deleteUnreferencedBound,gen_semispace:CVMgenSemispaceRefIsLive -implicitref objsync:deleteUnreferencedFast,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref objsync:deleteUnreferencedFast,gen_semispace:CVMgenSemispaceRefIsLive -implicitref objsync:scanListBound,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref objsync:scanListBound,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref objsync:scanListBound,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref objsync:scanListFast,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref objsync:scanListFast,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref objsync:scanListFast,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMgcSafeObjectLock,objsync:CVMdetLock -implicitref CVMgcSafeObjectLock,objsync:CVMfastLock -implicitref CVMgcSafeObjectUnlock,objsync:CVMfastUnlock -implicitref CVMgcSafeObjectUnlock,objsync:CVMdetUnlock -implicitref CVMgcSafeObjectWait,objsync:CVMfastWait -implicitref CVMgcSafeObjectWait,objsync:CVMdetWait -implicitref CVMgcSafeObjectNotify,objsync:CVMfastNotify -implicitref CVMgcSafeObjectNotify,objsync:CVMdetNotify -implicitref CVMgcSafeObjectNotifyAll,objsync:CVMfastNotifyAll -implicitref CVMgcSafeObjectNotifyAll,objsync:CVMdetNotifyAll -implicitref JVM_GetSystemPackage,CVMjniGetStringUTFChars -implicitref JVM_GetSystemPackage,CVMjniReleaseStringUTFChars -implicitref JVM_GetSystemPackages,CVMjniNewObjectArray -implicitref JVM_GetSystemPackages,CVMjniExceptionCheck -implicitref JVM_GetSystemPackages,CVMjniNewStringUTF -implicitref JVM_GetSystemPackages,CVMjniSetObjectArrayElement -implicitref JVM_GetSystemPackages,CVMjniDeleteLocalRef -implicitref JVM_GetSystemPackages,CVMjniExceptionCheck -implicitref posix_threads_md:start_func,jvm:start_func -implicitref stackmaps:CVMstackmapDoForeachGCPointInBB,stackmaps:CVMstackmapCountAllocBytes -implicitref stackmaps:CVMstackmapDoForeachGCPointInBB,stackmaps:CVMstackmapEmitMapForPC -implicitref string:internInner,string:internJavaCompare -implicitref string:internInner,string:internUTFCompare -implicitref string:internInner,string:internJavaProduce -implicitref string:internInner,string:internUTFProduce -implicitref CVMscanInternedStrings,gen_semispace:CVMgenSemispaceFilteredHandleRoot -implicitref CVMscanInternedStrings,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref CVMscanInternedStrings,gen_markcompact:CVMgenMarkCompactFilteredUpdateRoot -implicitref CVMdeleteUnreferencedStrings,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref CVMdeleteUnreferencedStrings,gen_semispace:CVMgenSemispaceRefIsLive -implicitref typeid:processTableSegment,typeid:destroySignature -implicitref typeid:processTableSegment,typeid:destroyScalarEntry -implicitref typeid:processTableSegment,typeid:destroyMemberName -implicitref typeid:processSegmentedTable,typeid:destroySegment -implicitref typeid:checkReferenceMap,typeid:deadName -implicitref typeid:checkReferenceMap,typeid:deadScalar -implicitref typeid:checkSegmentedTable,typeid:liveName -implicitref typeid:checkSegmentedTable,typeid:liveMethod -implicitref typeid:checkSegmentedTable,typeid:liveScalar -implicitref typeid:findDiffsInSegmentedTable,typeid:memberDiffs

17 of 19

Appendix A

Page 187: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref typeid:findDiffsInSegmentedTable,typeid:fieldDiffs -implicitref typeid:findDiffsInSegmentedTable,typeid:methodDiffs -implicitref CVMprintThreadName,CVMjniGetCharArrayElements -implicitref CVMprintThreadName,CVMjniNewString -implicitref CVMprintThreadName,CVMjniGetStringUTFChars -implicitref CVMprintThreadName,CVMjniReleaseStringUTFChars -implicitref CVMprintThreadName,CVMjniReleaseCharArrayElements -implicitref CVMprintThreadName,CVMjniGetArrayLength -implicitref CVMputProp,CVMjniNewStringUTF -implicitref CVMputProp,CVMjniExceptionOccurred -implicitref CVMputProp,CVMjniNewStringUTF -implicitref CVMputProp,CVMjniExceptionOccurred -implicitref CVMputProp,CVMjniCallObjectMethod -implicitref CVMputProp,CVMjniExceptionOccurred -implicitref CVMputProp,CVMjniDeleteLocalRef -implicitref CVMputProp,CVMjniDeleteLocalRef -implicitref CVMputProp,CVMjniDeleteLocalRef -implicitref CVMputPropForPlatformCString,CVMjniExceptionOccurred -implicitref CVMputPropForPlatformCString,CVMjniExceptionOccurred -implicitref CVMputPropForPlatformCString,CVMjniCallObjectMethod -implicitref CVMputPropForPlatformCString,CVMjniExceptionOccurred -implicitref CVMputPropForPlatformCString,CVMjniDeleteLocalRef -implicitref CVMputPropForPlatformCString,CVMjniDeleteLocalRef -implicitref CVMputPropForPlatformCString,CVMjniDeleteLocalRef -implicitref verifycode:finalize_class_hash,CVMjniDeleteGlobalRef -implicitref verifycode:make_class_info,CVMjniNewGlobalRef -implicitref VerifyClass,CVMjniGetSuperclass -implicitref VerifyClass,CVMjniGetSuperclass -implicitref VerifyClass,CVMjniDeleteLocalRef -implicitref VerifyClass,CVMjniDeleteLocalRef -implicitref VerifyClass,CVMjniGetSuperclass -implicitref VerifyClass,CVMjniGetSuperclass -implicitref VerifyClass,CVMjniDeleteLocalRef -implicitref VerifyClass,CVMjniDeleteLocalRef -implicitref verifycode:verify_opcode_operands,CVMjniGetSuperclass -implicitref verifycode:verify_opcode_operands,CVMjniGetSuperclass -implicitref verifycode:verify_opcode_operands,CVMjniDeleteLocalRef -implicitref verifycode:verify_opcode_operands,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniIsSameObject -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniIsSameObject -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef

18 of 19

Appendix A

Page 188: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref verifycode:merge_fullinfo_types,CVMjniIsSameObject -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniNewLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniNewLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniIsSameObject -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniGetSuperclass -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:merge_fullinfo_types,CVMjniDeleteLocalRef -implicitref verifycode:object_fullinfo_to_classclass,CVMjniNewGlobalRef -implicitref verifycode:object_fullinfo_to_classclass,CVMjniDeleteLocalRef -implicitref verifycode:object_fullinfo_to_classclass,CVMjniDeleteLocalRef -implicitref weakrefs:CVMweakrefIterateQueue,weakrefs:CVMweakrefDiscoveredQueueCallback -implicitref weakrefs:CVMweakrefIterateQueue,weakrefs:CVMweakrefUpdateCallback -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,gen_semispace:CVMgenSemispaceRefIsLive -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,gen_semispace:CVMgenSemispaceScanTransitively -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,weakrefs:CVMweakrefClearConditional -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,weakrefs:CVMweakrefClearUnconditional -implicitref weakrefs:CVMweakrefDiscoveredQueueCallback,weakrefs:CVMweakrefReferentKeep -implicitref weakrefs:CVMweakrefHandleJNIWeakRef,gen_markcompact:CVMgenMarkCompactRefIsLive -implicitref weakrefs:CVMweakrefHandleJNIWeakRef,gen_semispace:CVMgenSemispaceScanTransitively -implicitref weakrefs:CVMweakrefUpdateCallback,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref weakrefs:CVMweakrefUpdateCallback,gen_semispace:CVMgenSemispaceScanTransitively -implicitref weakrefs:CVMweakrefHandlePendingQueue,gen_markcompact:CVMgenMarkCompactScanTransitively -implicitref weakrefs:CVMweakrefHandlePendingQueue,gen_semispace:CVMgenSemispaceScanTransitively

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

19 of 19

Appendix A

Page 189: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

Porting Guide for the

CDC and the Foundation Profile

Appendix BThis appendix lists mapping information that maps an indirect function call to a JNI function call. Formore information, see the chapter C Stack Check.

-implicitref CVMjniInvokeNative,CVM_worst_case_psuedo_method -implicitref ansiJavaMain,CVM_worst_case_psuedo_method

-implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_get -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getBoolean -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getByte -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getChar -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getDouble -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getFloat -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getInt -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getLength -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getLong -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_getShort -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_multiNewArray -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_newArray -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_set -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setBoolean -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setByte -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setChar -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setDouble -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setFloat -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setInt -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setLong -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Array_setShort -implicitref CVMjniInvokeNative,Java_java_util_zip_CRC32_update -implicitref CVMjniInvokeNative,Java_java_util_zip_CRC32_updateBytes -implicitref CVMjniInvokeNative,Java_java_lang_Class_checkErrorFlag -implicitref CVMjniInvokeNative,Java_java_lang_Class_checkInitializedFlag -implicitref CVMjniInvokeNative,Java_java_lang_Class_checkInitializingFlag -implicitref CVMjniInvokeNative,Java_java_lang_Class_clearInitializingFlag -implicitref CVMjniInvokeNative,Java_java_lang_Class_forName0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getPrimitiveClass -implicitref CVMjniInvokeNative,Java_java_lang_Class_getSuperclass -implicitref CVMjniInvokeNative,Java_java_lang_Class_isAssignableFrom -implicitref CVMjniInvokeNative,Java_java_lang_Class_isInstance -implicitref CVMjniInvokeNative,Java_java_lang_Class_registerNatives -implicitref CVMjniInvokeNative,Java_java_lang_Class_setErrorFlag -implicitref CVMjniInvokeNative,Java_java_lang_Class_setInitializedFlag

1 of 14

Appendix B

Page 190: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniInvokeNative,Java_java_lang_Class_setInitializingFlag -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_00024NativeLibrary_find -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_00024NativeLibrary_initIDs -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_00024NativeLibrary_load -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_00024NativeLibrary_unload -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_defineClass0 -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_findBootstrapClass -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_findLoadedClass -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_getCallerClassLoader -implicitref CVMjniInvokeNative,Java_java_lang_ClassLoader_resolveClass0 -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_registerNatives -implicitref CVMjniInvokeNative,Java_java_net_DatagramPacket_init -implicitref CVMjniInvokeNative,Java_java_lang_Double_doubleToLongBits -implicitref CVMjniInvokeNative,Java_java_lang_Double_doubleToRawLongBits -implicitref CVMjniInvokeNative,Java_java_lang_Double_longBitsToDouble -implicitref CVMjniInvokeNative,Java_java_io_FileDescriptor_initIDs -implicitref CVMjniInvokeNative,Java_java_io_FileDescriptor_sync -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_available -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_close -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_initIDs -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_open -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_read -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_readBytes -implicitref CVMjniInvokeNative,Java_java_io_FileInputStream_skip -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_close -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_initIDs -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_open -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_openAppend -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_write -implicitref CVMjniInvokeNative,Java_java_io_FileOutputStream_writeBytes -implicitref CVMjniInvokeNative,Java_java_io_FileSystem_getFileSystem -implicitref CVMjniInvokeNative,Java_java_lang_ref_Finalizer_invokeFinalizeMethod -implicitref CVMjniInvokeNative,Java_java_lang_Float_floatToIntBits -implicitref CVMjniInvokeNative,Java_java_lang_Float_floatToRawIntBits -implicitref CVMjniInvokeNative,Java_java_lang_Float_intBitsToFloat -implicitref CVMjniInvokeNative,Java_sun_misc_GC_maxObjectInspectionAge -implicitref CVMjniInvokeNative,Java_java_net_InetAddress_init -implicitref CVMjniInvokeNative,Java_java_net_InetAddressImpl_getHostByAddr -implicitref CVMjniInvokeNative,Java_java_net_InetAddressImpl_getInetFamily -implicitref CVMjniInvokeNative,Java_java_net_InetAddressImpl_getLocalHostName -implicitref CVMjniInvokeNative,Java_java_net_InetAddressImpl_lookupAllHostAddr -implicitref CVMjniInvokeNative,Java_java_net_InetAddressImpl_makeAnyLocalAddress -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_end -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_getAdler -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_getTotalIn -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_getTotalOut -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_inflateBytes -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_init -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_initIDs

2 of 14

Appendix B

Page 191: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_reset -implicitref CVMjniInvokeNative,Java_java_util_zip_Inflater_setDictionary -implicitref CVMjniInvokeNative,Java_sun_misc_NativeSignalHandler_handle0 -implicitref CVMjniInvokeNative,Java_java_lang_Object_getClass -implicitref CVMjniInvokeNative,Java_java_lang_Object_registerNatives -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_allocateNewArray -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_allocateNewObject -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_bytesToDoubles -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_bytesToFloats -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_latestUserDefinedLoader -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_setObjectFieldValue -implicitref CVMjniInvokeNative,Java_java_io_ObjectInputStream_setPrimitiveFieldValues -implicitref CVMjniInvokeNative,Java_java_io_ObjectOutputStream_doublesToBytes -implicitref CVMjniInvokeNative,Java_java_io_ObjectOutputStream_floatsToBytes -implicitref CVMjniInvokeNative,Java_java_io_ObjectOutputStream_getObjectFieldValue -implicitref CVMjniInvokeNative,Java_java_io_ObjectOutputStream_getPrimitiveFieldValues -implicitref CVMjniInvokeNative,Java_java_io_ObjectStreamClass_getFieldIDs -implicitref CVMjniInvokeNative,Java_java_io_ObjectStreamClass_hasStaticInitializer -implicitref CVMjniInvokeNative,Java_java_io_ObjectStreamClass_initNative -implicitref CVMjniInvokeNative,Java_java_lang_Package_getSystemPackage0 -implicitref CVMjniInvokeNative,Java_java_lang_Package_getSystemPackages0 -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_bind -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_datagramSocketClose -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_getTTL -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_getTimeToLive -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_init -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_join -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_leave -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_peek -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_receive -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_send -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_setTTL -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_setTimeToLive -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_socketGetOption -implicitref CVMjniInvokeNative,Java_java_net_PlainDatagramSocketImpl_socketSetOption -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_initProto -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketAccept -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketAvailable -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketBind -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketClose -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketConnect -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketCreate -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketGetOption -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketListen -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketSetOption -implicitref CVMjniInvokeNative,Java_java_net_PlainSocketImpl_socketShutdown -implicitref CVMjniInvokeNative,Java_java_lang_reflect_Proxy_defineClass0 -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_close

3 of 14

Appendix B

Page 192: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_getFilePointer -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_initIDs -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_length -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_open -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_read -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_readBytes -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_seek -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_setLength -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_write -implicitref CVMjniInvokeNative,Java_java_io_RandomAccessFile_writeBytes -implicitref CVMjniInvokeNative,Java_java_util_ResourceBundle_getClassContext -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_freeMemory -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_gc -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_runFinalization0 -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_safeExit -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_totalMemory -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_traceInstructions -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_traceMethodCalls -implicitref CVMjniInvokeNative,Java_java_lang_Runtime_execInternal -implicitref CVMjniInvokeNative,Java_java_lang_SecurityManager_classDepth -implicitref CVMjniInvokeNative,Java_java_lang_SecurityManager_classLoaderDepth0 -implicitref CVMjniInvokeNative,Java_java_lang_SecurityManager_currentClassLoader0 -implicitref CVMjniInvokeNative,Java_java_lang_SecurityManager_currentLoadedClass0 -implicitref CVMjniInvokeNative,Java_java_lang_SecurityManager_getClassContext -implicitref CVMjniInvokeNative,Java_java_lang_Shutdown_halt -implicitref CVMjniInvokeNative,Java_java_lang_Shutdown_runAllFinalizers -implicitref CVMjniInvokeNative,Java_sun_misc_Signal_findSignal -implicitref CVMjniInvokeNative,Java_sun_misc_Signal_handle0 -implicitref CVMjniInvokeNative,Java_sun_misc_Signal_raise0 -implicitref CVMjniInvokeNative,Java_java_net_SocketInputStream_init -implicitref CVMjniInvokeNative,Java_java_net_SocketInputStream_socketRead -implicitref CVMjniInvokeNative,Java_java_net_SocketOutputStream_init -implicitref CVMjniInvokeNative,Java_java_net_SocketOutputStream_socketWrite -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_IEEEremainder -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_acos -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_asin -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_atan -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_atan2 -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_ceil -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_cos -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_exp -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_floor -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_log -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_pow -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_rint -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_sin -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_sqrt -implicitref CVMjniInvokeNative,Java_java_lang_StrictMath_tan -implicitref CVMjniInvokeNative,Java_java_lang_String_intern

4 of 14

Appendix B

Page 193: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniInvokeNative,Java_java_lang_System_getCallerClass -implicitref CVMjniInvokeNative,Java_java_lang_System_identityHashCode -implicitref CVMjniInvokeNative,Java_java_lang_System_initProperties -implicitref CVMjniInvokeNative,Java_java_lang_System_mapLibraryName -implicitref CVMjniInvokeNative,Java_java_lang_System_registerNatives -implicitref CVMjniInvokeNative,Java_java_lang_System_setErr0 -implicitref CVMjniInvokeNative,Java_java_lang_System_setIn0 -implicitref CVMjniInvokeNative,Java_java_lang_System_setOut0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_clearInterrupted -implicitref CVMjniInvokeNative,Java_java_lang_Thread_registerNatives -implicitref CVMjniInvokeNative,Java_java_lang_Thread_setCurrentThread -implicitref CVMjniInvokeNative,Java_java_lang_Throwable_fillInStackTrace -implicitref CVMjniInvokeNative,Java_java_lang_Throwable_printStackTrace0 -implicitref CVMjniInvokeNative,Java_java_util_TimeZone_getSystemTimeZoneID -implicitref CVMjniInvokeNative,findJavaTZ_md -implicitref CVMjniInvokeNative,Java_java_lang_UNIXProcess_destroy -implicitref CVMjniInvokeNative,Java_java_lang_UNIXProcess_forkAndExec -implicitref CVMjniInvokeNative,Java_java_lang_UNIXProcess_initLockObject -implicitref CVMjniInvokeNative,Java_java_lang_UNIXProcess_run -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_canonicalize -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_checkAccess -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_createDirectory -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_createFileExclusively -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_delete -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_deleteOnExit -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_getBooleanAttributes0 -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_getLastModifiedTime -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_getLength -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_initIDs -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_list -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_rename -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_setLastModifiedTime -implicitref CVMjniInvokeNative,Java_java_io_UnixFileSystem_setReadOnly -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipEntry_initFields -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipEntry_initIDs -implicitref CVMjniInvokeNative,Java_java_util_jar_JarFile_getMetaInfEntryNames -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_close -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_freeEntry -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getCSize -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getEntry -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getMethod -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getNextEntry -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getSize -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_getTotal -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_initIDs -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_open -implicitref CVMjniInvokeNative,Java_java_util_zip_ZipFile_read -implicitref CVMjniInvokeNative,Java_java_lang_Class_getClassLoader0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getComponentType

5 of 14

Appendix B

Page 194: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMjniInvokeNative,Java_java_lang_Class_getConstructor0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getConstructors0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getDeclaredClasses0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getDeclaringClass -implicitref CVMjniInvokeNative,Java_java_lang_Class_getField0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getFields0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getInterfaces -implicitref CVMjniInvokeNative,Java_java_lang_Class_getMethod0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getMethods0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getModifiers -implicitref CVMjniInvokeNative,Java_java_lang_Class_getName -implicitref CVMjniInvokeNative,Java_java_lang_Class_getProtectionDomain0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_getSigners -implicitref CVMjniInvokeNative,Java_java_lang_Class_isArray -implicitref CVMjniInvokeNative,Java_java_lang_Class_isPrimitive -implicitref CVMjniInvokeNative,Java_java_lang_Class_setProtectionDomain0 -implicitref CVMjniInvokeNative,Java_java_lang_Class_setSigners -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_command -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_compileClass -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_compileClasses -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_disable -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_enable -implicitref CVMjniInvokeNative,Java_java_lang_Compiler_initialize -implicitref CVMjniInvokeNative,Java_java_lang_Object_clone -implicitref CVMjniInvokeNative,Java_java_lang_Object_hashCode -implicitref CVMjniInvokeNative,Java_java_lang_Object_notify -implicitref CVMjniInvokeNative,Java_java_lang_Object_notifyAll -implicitref CVMjniInvokeNative,Java_java_lang_Object_wait -implicitref CVMjniInvokeNative,Java_java_lang_System_arraycopy -implicitref CVMjniInvokeNative,Java_java_lang_System_currentTimeMillis -implicitref CVMjniInvokeNative,Java_java_lang_Thread_countStackFrames -implicitref CVMjniInvokeNative,Java_java_lang_Thread_currentThread -implicitref CVMjniInvokeNative,Java_java_lang_Thread_interrupt0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_resume0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_runNative -implicitref CVMjniInvokeNative,Java_java_lang_Thread_setPriority0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_sleep0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_start0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_suspend0 -implicitref CVMjniInvokeNative,Java_java_lang_Thread_yield

-implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_security_AccessController_computeContext -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_security_AccessController_fillInContext -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_security_AccessController_getInheritedAccessControlContext -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_security_AccessController_popContext -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_security_AccessController_pushContext -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_checkDebugFlags -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_clearDebugFlags -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_disableRemoteExceptions

6 of 14

Appendix B

Page 195: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_enableRemoteExceptions -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_executeClinit -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_freeClinit -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_restoreDebugFlags -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_setDebugFlags -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_throwLocalException -implicitref CVMgcUnsafeExecuteJavaMethod,CNIsun_misc_CVM_throwRemoteException -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Constructor_allocateUninitializedObject -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Constructor_invokeConstructor -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_get -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getBoolean -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getByte -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getChar -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getDouble -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getFloat -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getInt -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getLong -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_getShort -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_set -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setBoolean -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setByte -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setChar -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setDouble -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setFloat -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setInt -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setLong -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Field_setShort -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeA -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeB -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeC -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeD -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeF -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeI -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeL -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeS -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeV -implicitref CVMgcUnsafeExecuteJavaMethod,CNIjava_lang_reflect_Method_invokeZ

-implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetEventHook -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetEventNotificationMode -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetThreadStatus -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetAllThreads -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SuspendThread -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_ResumeThread -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_StopThread -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_InterruptThread -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetThreadInfo -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetOwnedMonitorInfo

7 of 14

Appendix B

Page 196: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetCurrentContendedMonitor -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RunDebugThread -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetTopThreadGroups -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetThreadGroupInfo -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetThreadGroupChildren -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetFrameCount -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetCurrentFrame -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetCallerFrame -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetFrameLocation -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_NotifyFramePop -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalObject -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalInt -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalLong -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalFloat -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalDouble -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetLocalObject -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetLocalInt -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetLocalLong -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetLocalFloat -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetLocalDouble

-implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_CreateRawMonitor -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_DestroyRawMonitor -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RawMonitorEnter -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RawMonitorExit -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RawMonitorWait -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RawMonitorNotify -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RawMonitorNotifyAll

-implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetBreakpoint -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_ClearBreakpoint -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_ClearAllBreakpoints -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetFieldAccessWatch -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_ClearFieldAccessWatch -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetFieldModificationWatch -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_ClearFieldModificationWatch -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetAllocationHooks -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_Allocate -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_Deallocate -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassSignature -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassStatus -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetSourceFileName -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassModifiers -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassMethods -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassFields -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetImplementedInterfaces -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_IsInterface -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_IsArrayClass -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassLoader

8 of 14

Appendix B

Page 197: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetObjectHashCode -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMonitorInfo -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetFieldName -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetFieldDeclaringClass -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetFieldModifiers -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_IsFieldSynthetic -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMethodName -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMethodDeclaringClass -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMethodModifiers -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMaxStack -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMaxLocals -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetArgumentsSize -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLineNumberTable -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetMethodLocation -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLocalVariableTable -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetExceptionHandlerTable -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetThrownExceptions -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetBytecodes -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_IsMethodNative -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_IsMethodSynthetic -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetLoadedClasses -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassLoaderClasses -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_PopFrame -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetFrameLocation -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetOperandStack -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_SetOperandStack -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_AllInstances -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_References -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetClassDefinition -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_RedefineClasses -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetVersionNumber -implicitref CVM_worst_case_psuedo_method,jvmdi:jvmdi_GetCapabilities

-implicitref CVM_worst_case_psuedo_method,CVMjniAllocObject -implicitref CVM_worst_case_psuedo_method,CVMjniCallBooleanMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallBooleanMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallBooleanMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallByteMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallByteMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallByteMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallCharMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallCharMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallCharMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallDoubleMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallDoubleMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallDoubleMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallFloatMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallFloatMethodA

9 of 14

Appendix B

Page 198: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,CVMjniCallFloatMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallIntMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallIntMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallIntMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallLongMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallLongMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallLongMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualBooleanMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualBooleanMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualBooleanMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualByteMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualByteMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualByteMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualCharMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualCharMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualCharMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualDoubleMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualDoubleMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualDoubleMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualFloatMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualFloatMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualFloatMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualIntMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualIntMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualIntMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualLongMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualLongMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualLongMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualObjectMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualObjectMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualObjectMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualShortMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualShortMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualShortMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualVoidMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualVoidMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallNonvirtualVoidMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallObjectMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallObjectMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallObjectMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallShortMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallShortMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallShortMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticBooleanMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticBooleanMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticBooleanMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticByteMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticByteMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticByteMethodV

10 of 14

Appendix B

Page 199: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticCharMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticCharMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticCharMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticDoubleMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticDoubleMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticDoubleMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticFloatMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticFloatMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticFloatMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticIntMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticIntMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticIntMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticLongMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticLongMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticLongMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticObjectMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticObjectMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticObjectMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticShortMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticShortMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticShortMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticVoidMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticVoidMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallStaticVoidMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCallVoidMethod -implicitref CVM_worst_case_psuedo_method,CVMjniCallVoidMethodA -implicitref CVM_worst_case_psuedo_method,CVMjniCallVoidMethodV -implicitref CVM_worst_case_psuedo_method,CVMjniCreateLocalRef -implicitref CVM_worst_case_psuedo_method,CVMjniDeleteGlobalRef -implicitref CVM_worst_case_psuedo_method,CVMjniDeleteLocalRef -implicitref CVM_worst_case_psuedo_method,CVMjniEnsureLocalCapacity -implicitref CVM_worst_case_psuedo_method,CVMjniExceptionCheck -implicitref CVM_worst_case_psuedo_method,CVMjniExceptionClear -implicitref CVM_worst_case_psuedo_method,CVMjniExceptionDescribe -implicitref CVM_worst_case_psuedo_method,CVMjniExceptionOccurred -implicitref CVM_worst_case_psuedo_method,CVMjniFatalError -implicitref CVM_worst_case_psuedo_method,CVMjniFindClass -implicitref CVM_worst_case_psuedo_method,CVMjniFromReflectedField -implicitref CVM_worst_case_psuedo_method,CVMjniFromReflectedMethod -implicitref CVM_worst_case_psuedo_method,CVMjniGetArrayLength -implicitref CVM_worst_case_psuedo_method,CVMjniGetBooleanArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetBooleanArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetBooleanField -implicitref CVM_worst_case_psuedo_method,CVMjniGetByteArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetByteArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetByteField -implicitref CVM_worst_case_psuedo_method,CVMjniGetCharArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetCharArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetCharField

11 of 14

Appendix B

Page 200: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,CVMjniGetDoubleArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetDoubleArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetDoubleField -implicitref CVM_worst_case_psuedo_method,CVMjniGetFieldID -implicitref CVM_worst_case_psuedo_method,CVMjniGetFloatArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetFloatArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetFloatField -implicitref CVM_worst_case_psuedo_method,CVMjniGetInstrumentableJNINativeInterface -implicitref CVM_worst_case_psuedo_method,CVMjniGetIntArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetIntArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetIntField -implicitref CVM_worst_case_psuedo_method,CVMjniGetJavaVM -implicitref CVM_worst_case_psuedo_method,CVMjniGetLongArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetLongArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetLongField -implicitref CVM_worst_case_psuedo_method,CVMjniGetMethodID -implicitref CVM_worst_case_psuedo_method,CVMjniGetObjectArrayElement -implicitref CVM_worst_case_psuedo_method,CVMjniGetObjectClass -implicitref CVM_worst_case_psuedo_method,CVMjniGetObjectField -implicitref CVM_worst_case_psuedo_method,CVMjniGetPrimitiveArrayCritical -implicitref CVM_worst_case_psuedo_method,CVMjniGetShortArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniGetShortArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetShortField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticBooleanField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticByteField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticCharField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticDoubleField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticFieldID -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticFloatField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticIntField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticLongField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticMethodID -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticObjectField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStaticShortField -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringChars -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringLength -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringUTFChars -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringUTFLength -implicitref CVM_worst_case_psuedo_method,CVMjniGetStringUTFRegion -implicitref CVM_worst_case_psuedo_method,CVMjniGetSuperclass -implicitref CVM_worst_case_psuedo_method,CVMjniGetVersion -implicitref CVM_worst_case_psuedo_method,CVMjniIsAssignableFrom -implicitref CVM_worst_case_psuedo_method,CVMjniIsInstanceOf -implicitref CVM_worst_case_psuedo_method,CVMjniIsSameObject -implicitref CVM_worst_case_psuedo_method,CVMjniMonitorEnter -implicitref CVM_worst_case_psuedo_method,CVMjniMonitorExit -implicitref CVM_worst_case_psuedo_method,CVMjniNewBooleanArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewByteArray

12 of 14

Appendix B

Page 201: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,CVMjniNewCharArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewDoubleArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewFloatArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewGlobalRef -implicitref CVM_worst_case_psuedo_method,CVMjniNewIntArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewLocalRef -implicitref CVM_worst_case_psuedo_method,CVMjniNewLongArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewObject -implicitref CVM_worst_case_psuedo_method,CVMjniNewObjectA -implicitref CVM_worst_case_psuedo_method,CVMjniNewObjectArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewObjectV -implicitref CVM_worst_case_psuedo_method,CVMjniNewShortArray -implicitref CVM_worst_case_psuedo_method,CVMjniNewString -implicitref CVM_worst_case_psuedo_method,CVMjniNewStringUTF -implicitref CVM_worst_case_psuedo_method,CVMjniPopLocalFrame -implicitref CVM_worst_case_psuedo_method,CVMjniPushLocalFrame -implicitref CVM_worst_case_psuedo_method,CVMjniRegisterNatives -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseBooleanArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseByteArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseCharArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseDoubleArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseFloatArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseIntArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseLongArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleasePrimitiveArrayCritical -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseShortArrayElements -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseStringChars -implicitref CVM_worst_case_psuedo_method,CVMjniReleaseStringUTFChars -implicitref CVM_worst_case_psuedo_method,CVMjniSetBooleanArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetBooleanField -implicitref CVM_worst_case_psuedo_method,CVMjniSetByteArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetByteField -implicitref CVM_worst_case_psuedo_method,CVMjniSetCharArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetCharField -implicitref CVM_worst_case_psuedo_method,CVMjniSetDoubleArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetDoubleField -implicitref CVM_worst_case_psuedo_method,CVMjniSetFloatArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetFloatField -implicitref CVM_worst_case_psuedo_method,CVMjniSetIntArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetIntField -implicitref CVM_worst_case_psuedo_method,CVMjniSetLongArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetLongField -implicitref CVM_worst_case_psuedo_method,CVMjniSetObjectArrayElement -implicitref CVM_worst_case_psuedo_method,CVMjniSetObjectField -implicitref CVM_worst_case_psuedo_method,CVMjniSetShortArrayRegion -implicitref CVM_worst_case_psuedo_method,CVMjniSetShortField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticBooleanField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticByteField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticCharField

13 of 14

Appendix B

Page 202: read.pudn.comread.pudn.com/downloads203/doc/953664/cdc/CDCFoundation_Porti… · Related Documents API Specifications for these releases: Download the javadocs for these releases

-implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticDoubleField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticFloatField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticIntField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticLongField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticObjectField -implicitref CVM_worst_case_psuedo_method,CVMjniSetStaticShortField -implicitref CVM_worst_case_psuedo_method,CVMjniThrow -implicitref CVM_worst_case_psuedo_method,CVMjniThrowNew -implicitref CVM_worst_case_psuedo_method,CVMjniToReflectedField -implicitref CVM_worst_case_psuedo_method,CVMjniToReflectedMethod -implicitref CVM_worst_case_psuedo_method,CVMjniUnregisterNatives

February 26, 2001 Copyright © 2000, 2001 Sun Microsystems, Inc. All Rights Reserved.

14 of 14

Appendix B