annotate src/share/vm/shark/sharkType.hpp @ 17716:cdb71841f4bc

6498581: ThreadInterruptTest3 produces wrong output on Windows Summary: There is race condition between os::interrupt and os::is_interrupted on Windows. In JVM_Sleep(Thread.sleep), check if thread gets interrupted, it may see interrupted but not really interrupted so cause spurious waking up (early return from sleep). Fix by checking if interrupt event really gets set thus prevent false return. For intrinsic of _isInterrupted, on Windows, go fastpath only on bit not set. Reviewed-by: acorn, kvn Contributed-by: david.holmes@oracle.com, yumin.qi@oracle.com
author minqi
date Wed, 26 Feb 2014 15:20:41 -0800
parents 2cd5e15048e6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
3 * Copyright 2008, 2009 Red Hat, Inc.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
5 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
6 * This code is free software; you can redistribute it and/or modify it
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
7 * under the terms of the GNU General Public License version 2 only, as
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
8 * published by the Free Software Foundation.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
9 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
10 * This code is distributed in the hope that it will be useful, but WITHOUT
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
13 * version 2 for more details (a copy is included in the LICENSE file that
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
14 * accompanied this code).
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
15 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License version
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
17 * 2 along with this work; if not, write to the Free Software Foundation,
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
19 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
21 * or visit www.oracle.com if you need additional information or have any
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
22 * questions.
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
23 *
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
24 */
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
25
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
26 #ifndef SHARE_VM_SHARK_SHARKTYPE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
27 #define SHARE_VM_SHARK_SHARKTYPE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
28
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
29 #include "ci/ciType.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
30 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
31 #include "shark/llvmHeaders.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
32 #include "shark/sharkContext.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
33 #include "utilities/globalDefinitions.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
34
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
35 class SharkType : public AllStatic {
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
36 private:
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
37 static SharkContext& context() {
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
38 return SharkContext::current();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
39 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
40
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
41 // Basic types
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
42 public:
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
43 static llvm::Type* void_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
44 return context().void_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
45 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
46 static llvm::IntegerType* bit_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
47 return context().bit_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
48 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
49 static llvm::IntegerType* jbyte_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
50 return context().jbyte_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
51 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
52 static llvm::IntegerType* jshort_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
53 return context().jshort_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
54 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
55 static llvm::IntegerType* jint_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
56 return context().jint_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
57 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
58 static llvm::IntegerType* jlong_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
59 return context().jlong_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
60 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
61 static llvm::Type* jfloat_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
62 return context().jfloat_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
63 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
64 static llvm::Type* jdouble_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
65 return context().jdouble_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
66 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
67 static llvm::IntegerType* intptr_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
68 return context().intptr_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
69 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
70
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
71 // Compound types
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
72 public:
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
73 static llvm::PointerType* itableOffsetEntry_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
74 return context().itableOffsetEntry_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
75 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
76 static llvm::PointerType* jniEnv_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
77 return context().jniEnv_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
78 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
79 static llvm::PointerType* jniHandleBlock_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
80 return context().jniHandleBlock_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
81 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
82 static llvm::PointerType* Metadata_type() {
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
83 return context().Metadata_type();
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
84 }
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
85 static llvm::PointerType* klass_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
86 return context().klass_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
87 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
88 static llvm::PointerType* Method_type() {
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
89 return context().Method_type();
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
90 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
91 static llvm::ArrayType* monitor_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
92 return context().monitor_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
93 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
94 static llvm::PointerType* oop_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
95 return context().oop_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
96 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
97 static llvm::PointerType* thread_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
98 return context().thread_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
99 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
100 static llvm::PointerType* zeroStack_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
101 return context().zeroStack_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
102 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
103 static llvm::FunctionType* entry_point_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
104 return context().entry_point_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
105 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
106 static llvm::FunctionType* osr_entry_point_type() {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
107 return context().osr_entry_point_type();
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
108 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
109
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
110 // Mappings
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
111 public:
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
112 static llvm::Type* to_stackType(BasicType type) {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
113 return context().to_stackType(type);
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
114 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
115 static llvm::Type* to_stackType(ciType* type) {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
116 return to_stackType(type->basic_type());
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
117 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
118 static llvm::Type* to_arrayType(BasicType type) {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
119 return context().to_arrayType(type);
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
120 }
7195
2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM
twisti
parents: 6725
diff changeset
121 static llvm::Type* to_arrayType(ciType* type) {
1692
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
122 return to_arrayType(type->basic_type());
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
123 }
d2ede61b7a12 6976186: integrate Shark HotSpot changes
twisti
parents:
diff changeset
124 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
125
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1692
diff changeset
126 #endif // SHARE_VM_SHARK_SHARKTYPE_HPP