annotate src/share/vm/ci/ciConstant.hpp @ 6972:bd7a7ce2e264

6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 12 Nov 2012 14:03:53 -0800
parents f6f3bb0ee072
children edb5ab0f3fe5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
3939
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3899
diff changeset
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_CI_CICONSTANT_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_CI_CICONSTANT_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "ci/ciClassList.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "ci/ciNullObject.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // ciConstant
a61af66fc99e Initial load
duke
parents:
diff changeset
32 //
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // This class represents a constant value.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class ciConstant VALUE_OBJ_CLASS_SPEC {
3939
f6f3bb0ee072 7088955: add C2 IR support to the SA
never
parents: 3899
diff changeset
35 friend class VMStructs;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
36 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
37 friend class ciEnv;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 friend class ciField;
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 BasicType _type;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 union {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 jint _int;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 jlong _long;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 jint _long_half[2];
a61af66fc99e Initial load
duke
parents:
diff changeset
45 jfloat _float;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 jdouble _double;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 ciObject* _object;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 } _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 ciConstant() {
a61af66fc99e Initial load
duke
parents:
diff changeset
53 _type = T_ILLEGAL; _value._long = -1;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 }
a61af66fc99e Initial load
duke
parents:
diff changeset
55 ciConstant(BasicType type, jint value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 assert(type != T_LONG && type != T_DOUBLE && type != T_FLOAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 "using the wrong ciConstant constructor");
a61af66fc99e Initial load
duke
parents:
diff changeset
58 _type = type; _value._int = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60 ciConstant(jlong value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
61 _type = T_LONG; _value._long = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 }
a61af66fc99e Initial load
duke
parents:
diff changeset
63 ciConstant(jfloat value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 _type = T_FLOAT; _value._float = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ciConstant(jdouble value) {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 _type = T_DOUBLE; _value._double = value;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 }
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ciConstant(BasicType type, ciObject* p) {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 _type = type; _value._object = p;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 BasicType basic_type() const { return _type; }
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 jboolean as_boolean() {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 assert(basic_type() == T_BOOLEAN, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
77 return (jboolean)_value._int;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79 jchar as_char() {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 assert(basic_type() == T_CHAR, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
81 return (jchar)_value._int;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 jbyte as_byte() {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 assert(basic_type() == T_BYTE, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
85 return (jbyte)_value._int;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 }
a61af66fc99e Initial load
duke
parents:
diff changeset
87 jshort as_short() {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 assert(basic_type() == T_SHORT, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
89 return (jshort)_value._int;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 }
a61af66fc99e Initial load
duke
parents:
diff changeset
91 jint as_int() {
a61af66fc99e Initial load
duke
parents:
diff changeset
92 assert(basic_type() == T_BOOLEAN || basic_type() == T_CHAR ||
a61af66fc99e Initial load
duke
parents:
diff changeset
93 basic_type() == T_BYTE || basic_type() == T_SHORT ||
a61af66fc99e Initial load
duke
parents:
diff changeset
94 basic_type() == T_INT, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
95 return _value._int;
a61af66fc99e Initial load
duke
parents:
diff changeset
96 }
a61af66fc99e Initial load
duke
parents:
diff changeset
97 jlong as_long() {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 assert(basic_type() == T_LONG, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
99 return _value._long;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101 jfloat as_float() {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 assert(basic_type() == T_FLOAT, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
103 return _value._float;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105 jdouble as_double() {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 assert(basic_type() == T_DOUBLE, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
107 return _value._double;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 }
a61af66fc99e Initial load
duke
parents:
diff changeset
109 ciObject* as_object() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 assert(basic_type() == T_OBJECT || basic_type() == T_ARRAY, "wrong type");
a61af66fc99e Initial load
duke
parents:
diff changeset
111 return _value._object;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // Debugging output
a61af66fc99e Initial load
duke
parents:
diff changeset
115 void print();
a61af66fc99e Initial load
duke
parents:
diff changeset
116 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
117
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
118 #endif // SHARE_VM_CI_CICONSTANT_HPP