35 define GenerateVarHandle
36
37 $1_Type := $2
38
39 $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
40
41 $1_ARGS += -KCAS
42
43 ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
44 $1_ARGS += -KAtomicAdd
45 endif
46
47 ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), )
48 $1_ARGS += -KBitwise
49 endif
50
51 ifneq ($$(findstring $$($1_Type), Byte Short Char), )
52 $1_ARGS += -KShorterThanInt
53 endif
54
55 $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
56 ifeq ($$($1_Type), Reference)
57 $$(eval $1_type := Object)
58 else
59 $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
60 endif
61 $$(call MakeDir, $$(@D))
62 $(RM) $$@
63 $(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
64 $$($1_ARGS) -i$$< -o$$@
65
66 GENSRC_VARHANDLES += $$($1_FILENAME)
67 endef
68
69 ################################################################################
70
71 ################################################################################
72 # Setup a rule for generating a VarHandleByteArray java class
73 # Param 1 - Variable declaration prefix
74 # Param 2 - Type with first letter capitalized
75 define GenerateVarHandleByteArray
76
77 $1_Type := $2
245 $1_RawBoxType := Long
246
247 $1_ARGS += -KCAS
248 $1_ARGS += -KfloatingPoint
249 endif
250
251 $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleSegmentView.java.template $(BUILD_TOOLS_JDK)
252 $$(call MakeDir, $$(@D))
253 $(RM) $$@
254 $(TOOL_SPP) -nel -K$$($1_type) \
255 -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
256 -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
257 $$($1_ARGS) -i$$< -o$$@
258
259 GENSRC_VARHANDLES += $$($1_FILENAME)
260 endef
261
262 ################################################################################
263
264 # List the types to generate source for, with capitalized first letter
265 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
266 $(foreach t, $(VARHANDLES_TYPES), \
267 $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
268
269 # List the types to generate source for, with capitalized first letter
270 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
271 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
272 $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
273
274 # List the types to generate source for, with capitalized first letter
275 VARHANDLES_MEMORY_SEGMENT_TYPES := Byte Short Char Int Long Float Double
276 $(foreach t, $(VARHANDLES_MEMORY_SEGMENT_TYPES), \
277 $(eval $(call GenerateVarHandleMemorySegment,VAR_HANDLE_MEMORY_SEGMENT_$t,$t)))
278
279 TARGETS += $(GENSRC_VARHANDLES)
|
35 define GenerateVarHandle
36
37 $1_Type := $2
38
39 $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
40
41 $1_ARGS += -KCAS
42
43 ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
44 $1_ARGS += -KAtomicAdd
45 endif
46
47 ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), )
48 $1_ARGS += -KBitwise
49 endif
50
51 ifneq ($$(findstring $$($1_Type), Byte Short Char), )
52 $1_ARGS += -KShorterThanInt
53 endif
54
55 ifeq ($$($1_Type), Reference)
56 $1_ARGS += -KReference
57 endif
58
59 ifeq ($$($1_Type), Value)
60 $1_ARGS += -KValue
61 endif
62
63 $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
64 ifeq ($$($1_Type), Reference)
65 $$(eval $1_type := Object)
66 else ifeq ($$($1_Type), Value)
67 $$(eval $1_type := Object)
68 else
69 $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
70 endif
71 $$(call MakeDir, $$(@D))
72 $(RM) $$@
73 $(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
74 $$($1_ARGS) -i$$< -o$$@
75
76 GENSRC_VARHANDLES += $$($1_FILENAME)
77 endef
78
79 ################################################################################
80
81 ################################################################################
82 # Setup a rule for generating a VarHandleByteArray java class
83 # Param 1 - Variable declaration prefix
84 # Param 2 - Type with first letter capitalized
85 define GenerateVarHandleByteArray
86
87 $1_Type := $2
255 $1_RawBoxType := Long
256
257 $1_ARGS += -KCAS
258 $1_ARGS += -KfloatingPoint
259 endif
260
261 $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleSegmentView.java.template $(BUILD_TOOLS_JDK)
262 $$(call MakeDir, $$(@D))
263 $(RM) $$@
264 $(TOOL_SPP) -nel -K$$($1_type) \
265 -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
266 -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
267 $$($1_ARGS) -i$$< -o$$@
268
269 GENSRC_VARHANDLES += $$($1_FILENAME)
270 endef
271
272 ################################################################################
273
274 # List the types to generate source for, with capitalized first letter
275 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference Value
276 $(foreach t, $(VARHANDLES_TYPES), \
277 $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
278
279 # List the types to generate source for, with capitalized first letter
280 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
281 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
282 $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
283
284 # List the types to generate source for, with capitalized first letter
285 VARHANDLES_MEMORY_SEGMENT_TYPES := Byte Short Char Int Long Float Double
286 $(foreach t, $(VARHANDLES_MEMORY_SEGMENT_TYPES), \
287 $(eval $(call GenerateVarHandleMemorySegment,VAR_HANDLE_MEMORY_SEGMENT_$t,$t)))
288
289 TARGETS += $(GENSRC_VARHANDLES)
|