< prev index next >

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

Print this page
*** 37,37 ***
  # Setup a rule for generating a VarHandle java class
  # Param 1 - Variable declaration prefix
  # Param 2 - Type with first letter capitalized
  define GenerateVarHandle
  
!   $1_Type := $2
  
!   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_Type)s.java
  
    $1_ARGS += -KCAS
  
!   ifneq ($$(findstring $$($1_Type), Byte Short Char Int Long Float Double), )
      $1_ARGS += -KAtomicAdd
    endif
  
!   ifneq ($$(findstring $$($1_Type), Boolean Byte Short Char Int Long), )
      $1_ARGS += -KBitwise
    endif
  
!   ifneq ($$(findstring $$($1_Type), Byte Short Char), )
      $1_ARGS += -KShorterThanInt
    endif
  
    $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
!         ifeq ($$($1_Type), Reference)
  	  $$(eval $1_type := Object)
          else
! 	  $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
          endif
  	$$(call MakeDir, $$(@D))
  	$(RM) $$@
! 	$(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) \
  	    $$($1_ARGS) -i$$< -o$$@
  
    GENSRC_VARHANDLES += $$($1_FILENAME)
  endef
  
--- 37,81 ---
  # Setup a rule for generating a VarHandle java class
  # Param 1 - Variable declaration prefix
  # Param 2 - Type with first letter capitalized
  define GenerateVarHandle
  
!   $1_InputType := $2
  
!   $1_FILENAME := $(VARHANDLES_GENSRC_DIR)/VarHandle$$($1_InputType)s.java
  
    $1_ARGS += -KCAS
  
!   ifneq ($$(findstring $$($1_InputType), Byte Short Char Int Long Float Double), )
      $1_ARGS += -KAtomicAdd
+     $1_ARGS += -KNonPlainAccess
+     $1_ARGS += -KStatic
+     $1_ARGS += -KArray
+   endif
+ 
+   ifneq ($$(findstring $$($1_InputType), Byte Short Char Int Long), )
+     $1_ARGS += -KBitwise
    endif
  
!   ifeq ($$($1_InputType), Boolean)
      $1_ARGS += -KBitwise
+     $1_ARGS += -KNonPlainAccess
+     $1_ARGS += -KStatic
+     $1_ARGS += -KArray
    endif
  
!   ifneq ($$(findstring $$($1_InputType), Byte Short Char), )
      $1_ARGS += -KShorterThanInt
    endif
  
+   ifeq ($$($1_InputType), Reference)
+     $1_ARGS += -KReference
+     $1_ARGS += -KNonPlainAccess
+     $1_ARGS += -KStatic
+     $1_ARGS += -KArray
+   endif
+ 
+   ifeq ($$($1_InputType), NonAtomicReference)
+       $1_ARGS += -KReference
+       $1_ARGS += -KStatic
+       $1_Type := Reference
+       $1_ARGS += -KArray
+   endif
+ 
+   ifeq ($$($1_InputType), FlatValue)
+     $1_ARGS += -KFlatValue
+     $1_ARGS += -KNonPlainAccess
+   endif
+ 
+   ifeq ($$($1_InputType), NonAtomicFlatValue)
+     $1_ARGS += -KFlatValue
+   endif
+ 
    $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
!         ifeq ($$($1_InputType), Reference)
+ 	  $$(eval $1_type := Object)
+ 	  $$(eval $1_Type := Reference)
+         else ifeq ($$($1_InputType), NonAtomicReference)
+ 	  $$(eval $1_type := Object)
+ 	  $$(eval $1_Type := Reference)
+         else ifeq ($$($1_InputType), FlatValue)
+ 	  $$(eval $1_type := Object)
+ 	  $$(eval $1_Type := FlatValue)
+         else ifeq ($$($1_InputType), NonAtomicFlatValue)
  	  $$(eval $1_type := Object)
+ 	  $$(eval $1_Type := FlatValue)
          else
! 	  $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_InputType)))
+ 	  $$(eval $1_Type := $$$$($1_InputType))
          endif
  	$$(call MakeDir, $$(@D))
  	$(RM) $$@
! 	$(TOOL_SPP) -nel -K$$($1_type) -Dtype=$$($1_type) -DType=$$($1_Type) -DInputType=$$($1_InputType) \
  	    $$($1_ARGS) -i$$< -o$$@
  
    GENSRC_VARHANDLES += $$($1_FILENAME)
  endef
  

*** 282,11 ***
  endef
  
  ################################################################################
  
  # List the types to generate source for, with capitalized first letter
! VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
  $(foreach t, $(VARHANDLES_TYPES), \
    $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
  
  # List the types to generate source for, with capitalized first letter
  VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
--- 326,11 ---
  endef
  
  ################################################################################
  
  # List the types to generate source for, with capitalized first letter
! VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference FlatValue NonAtomicReference NonAtomicFlatValue
  $(foreach t, $(VARHANDLES_TYPES), \
    $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
  
  # List the types to generate source for, with capitalized first letter
  VARHANDLES_BYTE_ARRAY_TYPES := Short Char Int Long Float Double
< prev index next >