< prev index next >

make/gensrc/GensrcVarHandles.gmk

Print this page




  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


 143     $1_RawBoxType := Long
 144 
 145     $1_ARGS += -KCAS
 146     $1_ARGS += -KfloatingPoint
 147   endif
 148 
 149   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleByteArrayView.java.template $(BUILD_TOOLS_JDK)
 150         $$(call MakeDir, $$(@D))
 151         $(RM) $$@
 152         $(TOOL_SPP) -nel -K$$($1_type) \
 153             -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
 154             -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
 155             $$($1_ARGS) -i$$< -o$$@
 156 
 157   GENSRC_VARHANDLES += $$($1_FILENAME)
 158 endef
 159 
 160 ################################################################################
 161 
 162 # List the types to generate source for, with capitalized first letter
 163 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
 164 $(foreach t, $(VARHANDLES_TYPES), \
 165   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
 166 
 167 # List the types to generate source for, with capitalized first letter
 168 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
 169 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
 170   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
 171 
 172 GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
 173 
 174 # Include custom extension post hook
 175 $(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk))
 176 


  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


 153     $1_RawBoxType := Long
 154 
 155     $1_ARGS += -KCAS
 156     $1_ARGS += -KfloatingPoint
 157   endif
 158 
 159   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleByteArrayView.java.template $(BUILD_TOOLS_JDK)
 160         $$(call MakeDir, $$(@D))
 161         $(RM) $$@
 162         $(TOOL_SPP) -nel -K$$($1_type) \
 163             -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
 164             -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
 165             $$($1_ARGS) -i$$< -o$$@
 166 
 167   GENSRC_VARHANDLES += $$($1_FILENAME)
 168 endef
 169 
 170 ################################################################################
 171 
 172 # List the types to generate source for, with capitalized first letter
 173 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference Value
 174 $(foreach t, $(VARHANDLES_TYPES), \
 175   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
 176 
 177 # List the types to generate source for, with capitalized first letter
 178 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
 179 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
 180   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
 181 
 182 GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
 183 
 184 # Include custom extension post hook
 185 $(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk))
 186 
< prev index next >