< prev index next >

make/modules/java.base/gensrc/GensrcVarHandles.gmk

Print this page

 40 define GenerateVarHandle
 41 
 42   $1_Type := $2
 43 
 44   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
 45 
 46   $1_ARGS += -KCAS
 47 
 48   ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
 49     $1_ARGS += -KAtomicAdd
 50   endif
 51 
 52   ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), )
 53     $1_ARGS += -KBitwise
 54   endif
 55 
 56   ifneq ($$(findstring $$($1_Type), Byte Short Char), )
 57     $1_ARGS += -KShorterThanInt
 58   endif
 59 








 60   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
 61         ifeq ($$($1_Type), Reference)
 62 	  $$(eval $1_type := Object)


 63         else
 64 	  $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
 65         endif
 66 	$$(call MakeDir, $$(@D))
 67 	$(RM) $$@
 68 	$(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
 69 	    $$($1_ARGS) -i$$< -o$$@
 70 
 71   GENSRC_VARHANDLES += $$($1_FILENAME)
 72 endef
 73 
 74 ################################################################################
 75 
 76 ################################################################################
 77 # Setup a rule for generating a VarHandleByteArray java class
 78 # Param 1 - Variable declaration prefix
 79 # Param 2 - Type with first letter capitalized
 80 define GenerateVarHandleByteArray
 81 
 82   $1_Type := $2

267     $1_RawBoxType := Long
268 
269     $1_ARGS += -KCAS
270     $1_ARGS += -KfloatingPoint
271   endif
272 
273   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleSegmentView.java.template $(BUILD_TOOLS_JDK)
274 	$$(call MakeDir, $$(@D))
275 	$(RM) $$@
276 	$(TOOL_SPP) -nel -K$$($1_type) \
277 	    -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
278 	    -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
279 	    $$($1_ARGS) -i$$< -o$$@
280 
281   GENSRC_VARHANDLES += $$($1_FILENAME)
282 endef
283 
284 ################################################################################
285 
286 # List the types to generate source for, with capitalized first letter
287 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
288 $(foreach t, $(VARHANDLES_TYPES), \
289   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
290 
291 # List the types to generate source for, with capitalized first letter
292 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
293 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
294   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
295 
296 # List the types to generate source for, with capitalized first letter
297 VARHANDLES_MEMORY_SEGMENT_TYPES := Boolean Byte Short Char Int Long Float Double
298 $(foreach t, $(VARHANDLES_MEMORY_SEGMENT_TYPES), \
299   $(eval $(call GenerateVarHandleMemorySegment,VAR_HANDLE_MEMORY_SEGMENT_$t,$t)))
300 
301 TARGETS += $(GENSRC_VARHANDLES)
302 
303 ################################################################################
304 
305 endif # include guard
306 include MakeIncludeEnd.gmk

 40 define GenerateVarHandle
 41 
 42   $1_Type := $2
 43 
 44   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
 45 
 46   $1_ARGS += -KCAS
 47 
 48   ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
 49     $1_ARGS += -KAtomicAdd
 50   endif
 51 
 52   ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), )
 53     $1_ARGS += -KBitwise
 54   endif
 55 
 56   ifneq ($$(findstring $$($1_Type), Byte Short Char), )
 57     $1_ARGS += -KShorterThanInt
 58   endif
 59 
 60   ifeq ($$($1_Type), Reference)
 61     $1_ARGS += -KReference
 62   endif
 63 
 64   ifeq ($$($1_Type), FlatValue)
 65     $1_ARGS += -KFlatValue
 66   endif
 67 
 68   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
 69         ifeq ($$($1_Type), Reference)
 70 	  $$(eval $1_type := Object)
 71         else ifeq ($$($1_Type), FlatValue)
 72 	  $$(eval $1_type := Object)
 73         else
 74 	  $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
 75         endif
 76 	$$(call MakeDir, $$(@D))
 77 	$(RM) $$@
 78 	$(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
 79 	    $$($1_ARGS) -i$$< -o$$@
 80 
 81   GENSRC_VARHANDLES += $$($1_FILENAME)
 82 endef
 83 
 84 ################################################################################
 85 
 86 ################################################################################
 87 # Setup a rule for generating a VarHandleByteArray java class
 88 # Param 1 - Variable declaration prefix
 89 # Param 2 - Type with first letter capitalized
 90 define GenerateVarHandleByteArray
 91 
 92   $1_Type := $2

277     $1_RawBoxType := Long
278 
279     $1_ARGS += -KCAS
280     $1_ARGS += -KfloatingPoint
281   endif
282 
283   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleSegmentView.java.template $(BUILD_TOOLS_JDK)
284 	$$(call MakeDir, $$(@D))
285 	$(RM) $$@
286 	$(TOOL_SPP) -nel -K$$($1_type) \
287 	    -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
288 	    -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
289 	    $$($1_ARGS) -i$$< -o$$@
290 
291   GENSRC_VARHANDLES += $$($1_FILENAME)
292 endef
293 
294 ################################################################################
295 
296 # List the types to generate source for, with capitalized first letter
297 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference FlatValue
298 $(foreach t, $(VARHANDLES_TYPES), \
299   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
300 
301 # List the types to generate source for, with capitalized first letter
302 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
303 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
304   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
305 
306 # List the types to generate source for, with capitalized first letter
307 VARHANDLES_MEMORY_SEGMENT_TYPES := Boolean Byte Short Char Int Long Float Double
308 $(foreach t, $(VARHANDLES_MEMORY_SEGMENT_TYPES), \
309   $(eval $(call GenerateVarHandleMemorySegment,VAR_HANDLE_MEMORY_SEGMENT_$t,$t)))
310 
311 TARGETS += $(GENSRC_VARHANDLES)
312 
313 ################################################################################
314 
315 endif # include guard
316 include MakeIncludeEnd.gmk
< prev index next >