• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Export Word
    • Attachments
    • Page Information

    Loading...
  1. Dashboard
  2. HotSpot
  3. Main
  4. Compiler
  5. EscapeAnalysis

Page History

Versions Compared

Old Version 1

changes.mady.by.user John Rose

Saved on May 15, 2009

compared with

New Version 2

changes.mady.by.user J. Duke

Saved on May 15, 2009

  • Next Change: Difference between versions 2 and 3
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Escape Analysis

(To do: Format this nicely.)

...

From:

...

Vladimir

...

Kozlov

...


Date:

...

May

...

15,

...

2009

...

1:47:21

...

PM

...

PDT

...

_C2

...

implements the

...

flow-insensitive

...

escape

...

analysis

...

algorithm

...

described

...

in:

No Format

[Choi99] Jong-Deok Shoi, Manish Gupta, Mauricio Seffano,
         Vugranam C. Sreedhar, Sam Midkiff,
         "Escape Analysis for Java", Procedings of ACM SIGPLAN
         OOPSLA  Conference, November 1, 1999

The

...

analysis

...

requires

...

construction

...

of

...

a

...

"connection

...

graph"

...

(CG)

...

for

...

the

...

method

...

being

...

analyzed.

...

The

...

nodes

...

of

...

the

...

connection

...

graph

...

are:

No Format

    -  Java objects (JO)
    -  Local variables (LV)
    -  Fields of an object (OF),  these also include array elements

C2

...

does

...

not

...

have

...

local

...

variables.

...

However

...

for

...

the

...

purposes

...

of

...

constructing

...

the

...

connection

...

graph,

...

the

...

following

...

IR

...

nodes

...

are

...

treated

...

as

...

local

...

variables:

No Format


    Phi       (pointer values)
    LoadP, LoadN
    Proj#5    (value returned from call nodes including allocations)
    CheckCastPP, CastPP, EncodeP, DecodeN
    Return    (GlobalEscape)

The

...

LoadP,

...

Proj

...

and

...

CheckCastPP

...

behave

...

like

...

variables

...

assigned

...

to

...

only

...

once.

...

Only

...

a

...

Phi

...

can

...

have

...

multiple

...

assignments.

...

Each

...

input

...

to

...

a

...

Phi

...

is

...

treated

...

as

...

an

...

assignment

...

to

...

it.

...

The

...

following

...

node

...

types

...

are

...

JavaObject:

No Format

    top()
    Allocate
    AllocateArray
    Parm                  (for incoming object arguments, GlobalEscape)
    CastX2P               ("unsafe" operations, GlobalEscape)
    CreateEx              (GlobalEscape)
    ConP, ConN            (GlobalEscape except for null)
    LoadKlass, LoadNKlass (GlobalEscape)
    ThreadLocal           (ArgEscape)

AddP

...

nodes

...

are

...

fields.

...

After

...

building

...

the

...

graph,

...

a

...

pass

...

is

...

made

...

over

...

the

...

nodes,

...

deleting

...

deferred

...

nodes

...

and

...

copying

...

the

...

edges

...

from

...

the

...

target

...

of

...

the

...

deferred

...

edge

...

to

...

the

...

source.

...

This

...

results

...

in

...

a

...

graph

...

with

...

no

...

deferred

...

edges,

...

only:

No Format

   LV -P> JO
   OF -P> JO (the object whose oop is stored in the field)
   JO -F> OF

It makes a pass over the nodes and determines nodes escape state:

   GlobalEscape - An object escapes the method and thread
                  (stored into a static field or stored into
                   a field of an escaped object or returned
                   as the result of the current method).
   ArgEscape    - An object passed as argument or referenced by
                  argument but not globally escape during a call
                  (by analyzing the bytecode of called method).
   NoEscape     - A scalar replaceable object.

After escape analysis C2 eliminates scalar replaceable object
allocations and associated locks. C2 also eliminates locks for all
non globally escaping objects. C2 does NOT replace a heap allocation
with a stack allocation for non globally escaping objects.

After that escape analysis makes a pass over the nodes and determines nodes escape state:

  • GlobalEscape - An object escapes the method and thread (stored into a static field or stored into a field of an escaped object or returned as the result of the current method).
  • ArgEscape - An object passed as argument or referenced by argument but not globally escape during a call (by analyzing the bytecode of called method).
  • NoEscape - A scalar replaceable object.

After escape analysis C2 eliminates scalar replaceable object allocations and associated locks. C2 also eliminates locks for all non globally escaping objects. C2 does NOT replace a heap allocation with a stack allocation for non globally escaping objects.

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 212, "requestCorrelationId": "c6c3a2d88a7a3eab"}