author | psandoz |
Mon, 20 Jun 2016 17:57:19 +0200 | |
changeset 39471 | 6622892a347a |
parent 39470 | d6f8b4a85fb0 |
child 40732 | 2fd9cf42bb3c |
permissions | -rw-r--r-- |
36934 | 1 |
# |
2 |
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
GENSRC_VARHANDLES := |
|
27 |
||
28 |
VARHANDLES_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/invoke |
|
29 |
VARHANDLES_SRC_DIR := $(JDK_TOPDIR)/src/java.base/share/classes/java/lang/invoke |
|
30 |
||
31 |
################################################################################ |
|
32 |
# Setup a rule for generating a VarHandle java class |
|
33 |
# Param 1 - Variable declaration prefix |
|
34 |
# Param 2 - Type with first letter capitalized |
|
35 |
define GenerateVarHandle |
|
36 |
||
37 |
$1_Type := $2 |
|
38 |
||
39 |
$1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java |
|
40 |
||
39471
6622892a347a
8158039: VarHandle float/double field/array access should support CAS/set/add atomics
psandoz
parents:
39470
diff
changeset
|
41 |
$1_ARGS += -KCAS |
36934 | 42 |
|
39471
6622892a347a
8158039: VarHandle float/double field/array access should support CAS/set/add atomics
psandoz
parents:
39470
diff
changeset
|
43 |
ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), ) |
36934 | 44 |
$1_ARGS += -KAtomicAdd |
45 |
endif |
|
46 |
||
39470
d6f8b4a85fb0
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
36938
diff
changeset
|
47 |
ifneq ($$(findstring $$($1_Type), Byte Short Char), ) |
d6f8b4a85fb0
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
36938
diff
changeset
|
48 |
$1_ARGS += -KShorterThanInt |
d6f8b4a85fb0
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
36938
diff
changeset
|
49 |
endif |
d6f8b4a85fb0
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
36938
diff
changeset
|
50 |
|
36934 | 51 |
$$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK) |
52 |
ifeq ($$($1_Type), Object) |
|
53 |
$$(eval $1_type := $$($1_Type)) |
|
54 |
else |
|
36938
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
55 |
$$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type))) |
36934 | 56 |
endif |
36938
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
57 |
$$(call MakeDir, $$(@D)) |
36934 | 58 |
$(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \ |
59 |
$$($1_ARGS) < $$< > $$@ |
|
60 |
||
61 |
GENSRC_VARHANDLES += $$($1_FILENAME) |
|
62 |
endef |
|
63 |
||
64 |
################################################################################ |
|
65 |
||
66 |
################################################################################ |
|
67 |
# Setup a rule for generating a VarHandleByteArray java class |
|
68 |
# Param 1 - Variable declaration prefix |
|
69 |
# Param 2 - Type with first letter capitalized |
|
70 |
define GenerateVarHandleByteArray |
|
71 |
||
72 |
$1_Type := $2 |
|
73 |
||
74 |
$1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandleByteArrayAs$$($1_Type)s.java |
|
75 |
||
76 |
ifeq ($$($1_Type), Short) |
|
77 |
$1_type := short |
|
78 |
$1_BoxType := $$($1_Type) |
|
79 |
||
80 |
$1_rawType := $$($1_type) |
|
81 |
$1_RawType := $$($1_Type) |
|
82 |
$1_RawBoxType := $$($1_BoxType) |
|
83 |
endif |
|
84 |
||
85 |
ifeq ($$($1_Type), Char) |
|
86 |
$1_type := char |
|
87 |
$1_BoxType := Character |
|
88 |
||
89 |
$1_rawType := $$($1_type) |
|
90 |
$1_RawType := $$($1_Type) |
|
91 |
$1_RawBoxType := $$($1_BoxType) |
|
92 |
endif |
|
93 |
||
94 |
ifeq ($$($1_Type), Int) |
|
95 |
$1_type := int |
|
96 |
$1_BoxType := Integer |
|
97 |
||
98 |
$1_rawType := $$($1_type) |
|
99 |
$1_RawType := $$($1_Type) |
|
100 |
$1_RawBoxType := $$($1_BoxType) |
|
101 |
||
102 |
$1_ARGS += -KCAS |
|
103 |
$1_ARGS += -KAtomicAdd |
|
104 |
endif |
|
105 |
||
106 |
ifeq ($$($1_Type), Long) |
|
107 |
$1_type := long |
|
108 |
$1_BoxType := $$($1_Type) |
|
109 |
||
110 |
$1_rawType := $$($1_type) |
|
111 |
$1_RawType := $$($1_Type) |
|
112 |
$1_RawBoxType := $$($1_BoxType) |
|
113 |
||
114 |
$1_ARGS += -KCAS |
|
115 |
$1_ARGS += -KAtomicAdd |
|
116 |
endif |
|
117 |
||
118 |
ifeq ($$($1_Type), Float) |
|
119 |
$1_type := float |
|
120 |
$1_BoxType := $$($1_Type) |
|
121 |
||
122 |
$1_rawType := int |
|
123 |
$1_RawType := Int |
|
124 |
$1_RawBoxType := Integer |
|
125 |
||
126 |
$1_ARGS += -KCAS |
|
127 |
$1_ARGS += -KfloatingPoint |
|
128 |
endif |
|
129 |
||
130 |
ifeq ($$($1_Type), Double) |
|
131 |
$1_type := double |
|
132 |
$1_BoxType := $$($1_Type) |
|
133 |
||
134 |
$1_rawType := long |
|
135 |
$1_RawType := Long |
|
136 |
$1_RawBoxType := Long |
|
137 |
||
138 |
$1_ARGS += -KCAS |
|
139 |
$1_ARGS += -KfloatingPoint |
|
140 |
endif |
|
141 |
||
142 |
$$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleByteArrayView.java.template $(BUILD_TOOLS_JDK) |
|
36938
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
143 |
$$(call MakeDir, $$(@D)) |
36934 | 144 |
$(TOOL_SPP) -nel -K$$($1_type) \ |
145 |
-Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \ |
|
146 |
-DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \ |
|
147 |
$$($1_ARGS) < $$< > $$@ |
|
148 |
||
149 |
GENSRC_VARHANDLES += $$($1_FILENAME) |
|
150 |
endef |
|
151 |
||
152 |
################################################################################ |
|
153 |
||
154 |
# List the types to generate source for, with capitalized first letter |
|
155 |
VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Object |
|
36938
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
156 |
$(foreach t, $(VARHANDLES_TYPES), \ |
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
157 |
$(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t))) |
36934 | 158 |
|
159 |
# List the types to generate source for, with capitalized first letter |
|
160 |
VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double |
|
36938
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
161 |
$(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \ |
b43bd5279f4e
8152959: Build crashes in jdk9-hs-comp on Linux with gnumake 3.81
erikj
parents:
36934
diff
changeset
|
162 |
$(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t))) |
36934 | 163 |
|
164 |
GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES) |