< prev index next >

make/gensrc/GensrcVarHandles.gmk

Print this page


   1 #
   2 # Copyright (c) 2015, 2018, 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


  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
  78 
  79   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandleByteArrayAs$$($1_Type)s.java
  80 
  81   ifeq ($$($1_Type), Short)
  82     $1_type := short
  83     $1_BoxType := $$($1_Type)
  84 


 131     $1_RawBoxType := Integer
 132 
 133     $1_ARGS += -KCAS
 134     $1_ARGS += -KfloatingPoint
 135   endif
 136 
 137   ifeq ($$($1_Type), Double)
 138     $1_type := double
 139     $1_BoxType := $$($1_Type)
 140 
 141     $1_rawType := long
 142     $1_RawType := Long
 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))
   1 #
   2 # Copyright (c) 2015, 2016, 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


  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         $(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
  63             $$($1_ARGS) < $$< > $$@
  64 
  65   GENSRC_VARHANDLES += $$($1_FILENAME)
  66 endef
  67 
  68 ################################################################################
  69 
  70 ################################################################################
  71 # Setup a rule for generating a VarHandleByteArray java class
  72 # Param 1 - Variable declaration prefix
  73 # Param 2 - Type with first letter capitalized
  74 define GenerateVarHandleByteArray
  75 
  76   $1_Type := $2
  77 
  78   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandleByteArrayAs$$($1_Type)s.java
  79 
  80   ifeq ($$($1_Type), Short)
  81     $1_type := short
  82     $1_BoxType := $$($1_Type)
  83 


 130     $1_RawBoxType := Integer
 131 
 132     $1_ARGS += -KCAS
 133     $1_ARGS += -KfloatingPoint
 134   endif
 135 
 136   ifeq ($$($1_Type), Double)
 137     $1_type := double
 138     $1_BoxType := $$($1_Type)
 139 
 140     $1_rawType := long
 141     $1_RawType := Long
 142     $1_RawBoxType := Long
 143 
 144     $1_ARGS += -KCAS
 145     $1_ARGS += -KfloatingPoint
 146   endif
 147 
 148   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandleByteArrayView.java.template $(BUILD_TOOLS_JDK)
 149         $$(call MakeDir, $$(@D))

 150         $(TOOL_SPP) -nel -K$$($1_type) \
 151             -Dtype=$$($1_type) -DType=$$($1_Type) -DBoxType=$$($1_BoxType) \
 152             -DrawType=$$($1_rawType) -DRawType=$$($1_RawType) -DRawBoxType=$$($1_RawBoxType) \
 153             $$($1_ARGS) < $$< > $$@
 154 
 155   GENSRC_VARHANDLES += $$($1_FILENAME)
 156 endef
 157 
 158 ################################################################################
 159 
 160 # List the types to generate source for, with capitalized first letter
 161 VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
 162 $(foreach t, $(VARHANDLES_TYPES), \
 163   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
 164 
 165 # List the types to generate source for, with capitalized first letter
 166 VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
 167 $(foreach t, $(VARHANDLES_BYTE_ARRAY_TYPES), \
 168   $(eval $(call GenerateVarHandleByteArray,VAR_HANDLE_BYTE_ARRAY_$t,$t)))
 169 
 170 GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
 171 
 172 # Include custom extension post hook
 173 $(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk))
< prev index next >