annotate truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/PrimitiveValueProfile.java @ 22501:a63bda98cfdb

Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
author Christian Humer <christian.humer@oracle.com>
date Wed, 16 Dec 2015 16:38:13 +0100
parents dc83cc1f94f2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
1 /*
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
4 *
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation. Oracle designates this
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
8 * particular file as subject to the "Classpath" exception as provided
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
9 * by Oracle in the LICENSE file that accompanied this code.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
10 *
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
11 * This code is distributed in the hope that it will be useful, but WITHOUT
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
14 * version 2 for more details (a copy is included in the LICENSE file that
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
15 * accompanied this code).
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
16 *
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License version
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
18 * 2 along with this work; if not, write to the Free Software Foundation,
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
20 *
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
22 * or visit www.oracle.com if you need additional information or have any
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
23 * questions.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
24 */
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
25 package com.oracle.truffle.api.utilities;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
26
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22123
diff changeset
27 import com.oracle.truffle.api.CompilerDirectives;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
28 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
22501
a63bda98cfdb Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
Christian Humer <christian.humer@oracle.com>
parents: 22157
diff changeset
29
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 22123
diff changeset
30 import java.util.Objects;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
31
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
32 /**
22501
a63bda98cfdb Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
Christian Humer <christian.humer@oracle.com>
parents: 22157
diff changeset
33 * @deprecated use {@link com.oracle.truffle.api.profiles.PrimitiveValueProfile} instead
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
34 */
22501
a63bda98cfdb Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
Christian Humer <christian.humer@oracle.com>
parents: 22157
diff changeset
35 @Deprecated
a63bda98cfdb Extract profiles into separate package. Add isProfilingEnabled in TruffleRuntime to disable profiling in the default runtime; Add low overhead profiles for primitives; Add LoopConditionProfile; Profile footprint/threadsafety improvements; Make toString implementations more consistent; Greatly enhanced javadoc documentation for profiles; Deprecate old profiles
Christian Humer <christian.humer@oracle.com>
parents: 22157
diff changeset
36 @SuppressWarnings("deprecation")
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
37 public class PrimitiveValueProfile extends ValueProfile {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
38
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
39 private static final Object UNINITIALIZED = new Object();
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
40 private static final Object GENERIC = new Object();
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
41
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
42 @CompilationFinal private Object cachedValue = UNINITIALIZED;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
43
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
44 PrimitiveValueProfile() {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
45 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
46
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
47 @SuppressWarnings("unchecked")
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
48 @Override
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
49 public <T> T profile(T v) {
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
50 Object value = v;
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
51 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
52 if (snapshot != GENERIC) {
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
53 if (snapshot instanceof Byte) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
54 if (value instanceof Byte && (byte) snapshot == (byte) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
55 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
56 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
57 } else if (snapshot instanceof Short) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
58 if (value instanceof Short && (short) snapshot == (short) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
59 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
60 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
61 } else if (snapshot instanceof Integer) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
62 if (value instanceof Integer && (int) snapshot == (int) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
63 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
64 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
65 } else if (snapshot instanceof Long) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
66 if (value instanceof Long && (long) snapshot == (long) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
67 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
68 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
69 } else if (snapshot instanceof Float) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
70 if (value instanceof Float && exactCompare((float) snapshot, (float) value)) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
71 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
72 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
73 } else if (snapshot instanceof Double) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
74 if (value instanceof Double && exactCompare((double) snapshot, (double) value)) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
75 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
76 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
77 } else if (snapshot instanceof Boolean) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
78 if (value instanceof Boolean && (boolean) snapshot == (boolean) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
79 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
80 }
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
81 } else if (snapshot instanceof Character) {
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
82 if (value instanceof Character && (char) snapshot == (char) value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
83 return (T) snapshot;
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
84 }
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
85 } else if (snapshot == value) {
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
86 return (T) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
87 }
20076
126ab00f859c refactor PrimitiveValueProfile to omit object equality comparison in the profiled case
Lukas Stadler <lukas.stadler@oracle.com>
parents: 19701
diff changeset
88 cacheMiss(value);
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
89 }
22123
329fe954f6f2 Can compile Truffle API with following javac lints: -Xlint:all,-auxiliaryclass,-try,-processing
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
90 return (T) value;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
91 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
92
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
93 public byte profile(byte value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
94 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
95 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
96 if (snapshot instanceof Byte && (byte) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
97 return (byte) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
98 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
99 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
100 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
101 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
102 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
103 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
104
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
105 public short profile(short value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
106 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
107 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
108 if (snapshot instanceof Short && (short) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
109 return (short) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
110 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
111 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
112 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
113 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
114 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
115 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
116
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
117 public int profile(int value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
118 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
119 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
120 if (snapshot instanceof Integer && (int) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
121 return (int) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
122 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
123 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
124 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
125 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
126 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
127 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
128
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
129 public long profile(long value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
130 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
131 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
132 if (snapshot instanceof Long && (long) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
133 return (long) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
134 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
135 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
136 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
137 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
138 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
139 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
140
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
141 public float profile(float value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
142 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
143 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
144 if (snapshot instanceof Float && exactCompare((float) snapshot, value)) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
145 return (float) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
146 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
147 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
148 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
149 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
150 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
151 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
152
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
153 public double profile(double value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
154 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
155 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
156 if (snapshot instanceof Double && exactCompare((double) snapshot, value)) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
157 return (double) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
158 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
159 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
160 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
161 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
162 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
163 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
165 public boolean profile(boolean value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
166 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
167 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
168 if (snapshot instanceof Boolean && (boolean) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
169 return (boolean) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
170 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
171 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
172 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
173 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
174 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
175 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
176
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
177 public char profile(char value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
178 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
179 if (snapshot != GENERIC) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
180 if (snapshot instanceof Character && (char) snapshot == value) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
181 return (char) snapshot;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
182 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
183 cacheMiss(value);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
184 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
185 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
186 return value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
187 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
188
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
189 public boolean isGeneric() {
19701
6755624bf03d PrimitiveValueProfile: directly use the field inside the class to highlight its usages.
Benoit Daloze <benoit.daloze@jku.at>
parents: 19592
diff changeset
190 return cachedValue == GENERIC;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
191 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
192
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
193 public boolean isUninitialized() {
19701
6755624bf03d PrimitiveValueProfile: directly use the field inside the class to highlight its usages.
Benoit Daloze <benoit.daloze@jku.at>
parents: 19592
diff changeset
194 return cachedValue == UNINITIALIZED;
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
195 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
196
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
197 public Object getCachedValue() {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
198 return cachedValue;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
199 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
200
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
201 @Override
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
202 public String toString() {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
203 return String.format("%s(%s)@%x", getClass().getSimpleName(), formatValue(), hashCode());
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
204 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
205
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
206 private void cacheMiss(Object value) {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
207 // TODO should we try to handle this more atomically?
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
208 CompilerDirectives.transferToInterpreterAndInvalidate();
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
209 if (cachedValue == UNINITIALIZED) {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
210 cachedValue = value;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
211 } else {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
212 cachedValue = GENERIC;
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
213 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
214 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
215
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
216 public static boolean exactCompare(float a, float b) {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
217 /*
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
218 * -0.0 == 0.0, but you can tell the difference through other means, so we need to
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
219 * differentiate.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
220 */
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
221 return Float.floatToRawIntBits(a) == Float.floatToRawIntBits(b);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
222 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
223
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
224 public static boolean exactCompare(double a, double b) {
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
225 /*
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
226 * -0.0 == 0.0, but you can tell the difference through other means, so we need to
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
227 * differentiate.
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
228 */
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
229 return Double.doubleToRawLongBits(a) == Double.doubleToRawLongBits(b);
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
230 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
231
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
232 private String formatValue() {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
233 Object snapshot = this.cachedValue;
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
234 if (snapshot == null) {
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
235 return "null";
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
236 } else if (snapshot == UNINITIALIZED) {
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
237 return "uninitialized";
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
238 } else if (snapshot == GENERIC) {
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
239 return "generic";
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
240 } else if (snapshot instanceof Byte || snapshot instanceof Short || snapshot instanceof Integer || snapshot instanceof Long || snapshot instanceof Float || snapshot instanceof Double ||
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
241 snapshot instanceof Boolean || snapshot instanceof Character) {
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
242 return String.format("%s=%s", snapshot.getClass().getSimpleName(), snapshot);
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
243 } else {
19592
bc3cd000d9c8 PrimitiveValueProfile: read from a snapshot to avoid races with multiple reads.
Benoit Daloze <benoit.daloze@jku.at>
parents: 18769
diff changeset
244 return String.format("%s@%x", snapshot.getClass().getSimpleName(), Objects.hash(snapshot));
18164
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
245 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
246 }
53afdc71b311 Truffle: added PrimitiveValueProfile.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff changeset
247 }