Skip to content

Commit caa2350

Browse files
committed
Preparations for use of ddrgen
In support of openj9#378 * correct references to getmacros script * add missing ddr_namespace annotations * use J9HASH_TABLE_AVL_TREE_TAG_BIT instead of hard-coded constant * ignore objs directory Signed-off-by: Keith W. Campbell <[email protected]>
1 parent 59522c8 commit caa2350

File tree

9 files changed

+38
-19
lines changed

9 files changed

+38
-19
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2014, 2017 IBM Corp. and others
2+
# Copyright (c) 2014, 2018 IBM Corp. and others
33
#
44
# This program and the accompanying materials are made available under
55
# the terms of the Eclipse Public License 2.0 which accompanies this
@@ -21,6 +21,7 @@
2121
###############################################################################
2222

2323
build/
24+
objs/
2425
CMakeFiles/
2526
CMakeCache.txt
2627
omrcfg.h

compiler/env/defines.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2017 IBM Corp. and others
2+
* Copyright (c) 2000, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -37,7 +37,6 @@
3737
pre-processor macros, it shouldn't contain anything else.
3838
*/
3939

40-
4140
/* Operating Systems */
4241
#ifndef OMR_LINUX
4342
# define OMR_LINUX 201
@@ -83,6 +82,8 @@
8382
# define COMPILER_CLANG 304
8483
#endif
8584

85+
/* @ddr_namespace: map_to_type=TRBuildFlags */
86+
8687
/*
8788
Standardize the OS macros Use HOST_OS instead of various different
8889
ways of checking for a particular host os. As a reference, see
@@ -169,6 +170,8 @@
169170
# define TR_HOST_ARM 1
170171
#endif
171172

173+
/* @ddr_namespace: default */
174+
172175
/* FIXME: we need to document what these ifdefs do
173176
If these are permanently enabled, the ifdefs should be removed
174177
and the guarded code permanently enabled */

ddr_artifacts.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2016, 2017 IBM Corp. and others
2+
# Copyright (c) 2016, 2018 IBM Corp. and others
33
#
44
# This program and the accompanying materials are made available under
55
# the terms of the Eclipse Public License 2.0 which accompanies this
@@ -30,10 +30,10 @@ top_srcdir = .
3030
include $(top_srcdir)/omrmakefiles/configure.mk
3131

3232
# Ensure the source tree path is canonically-formed and ends with /
33-
abs_srcroot = $(abspath $(TOP_SRCDIR))/
33+
abs_srcroot := $(subst //,/,$(abspath $(TOP_SRCDIR))/)
3434

3535
all: check-vars
36-
./tools/ddrgen/src/macros/getMacros.sh $(abs_srcroot)
36+
bash $(top_srcdir)/ddr/tools/getmacros $(abs_srcroot)
3737
$(exe_output_dir)/ddrgen --filelist $(DBG_FILE_LIST) --macrolist $(abs_srcroot)macroList
3838

3939
check-vars:

fvtest/omrtest.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2015, 2016 IBM Corp. and others
2+
# Copyright (c) 2015, 2018 IBM Corp. and others
33
#
44
# This program and the accompanying materials are made available under
55
# the terms of the Eclipse Public License 2.0 which accompanies this
@@ -45,8 +45,8 @@ omr_algotest:
4545
./omralgotest -avltest:fvtest/algotest/avltest.lst
4646

4747
omr_ddrtest:
48-
tools/ddrgen/src/macros/getMacros.sh "tools/ddrgen/test"
49-
./ddrgen ./ddrgentest --macrolist test/macroList
48+
bash $(top_srcdir)/ddr/tools/getmacros tools/ddrgen/test
49+
./ddrgen ddrgentest --macrolist test/macroList
5050

5151
omr_gctest:
5252
./omrgctest --gtest_filter="gcFunctionalTest*"

gc/base/segregated/RegionPoolSegregated.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 1991, 2015 IBM Corp. and others
2+
* Copyright (c) 1991, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -43,6 +43,8 @@ class MM_LockingHeapRegionQueue;
4343
#define PRIMARY_BUCKET 0
4444
#define SKIP_AVAILABLE_REGION_FOR_ALLOCATION 1
4545

46+
/* @ddr_namespace: map_to_type=MM_RegionPoolSegregated */
47+
4648
/*
4749
* Thresholds for dividing available list into buckets so that we tend to
4850
* defrag low occupancy regions and allocate into high occupancy ones.

include_core/omrcfg.h.in

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2015, 2017 IBM Corp. and others
2+
* Copyright (c) 2015, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -29,6 +29,8 @@
2929
#if !defined(OMRCFG_H_)
3030
#define OMRCFG_H_
3131

32+
/* @ddr_namespace: map_to_type=OmrBuildFlags */
33+
3234
#undef OMR_GC
3335
#undef OMR_JIT
3436
#undef OMR_JITBUILDER
@@ -58,7 +60,6 @@
5860
#undef OMR_GC_SEGREGATED_HEAP
5961
#undef OMR_GC_THREAD_LOCAL_HEAP
6062

61-
6263
/**
6364
* Tells if a platform has support for Semaphores.
6465
* ifRemoved: platform cannot use semaphore operations.

include_core/omrhashtable.h

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 1991, 2016 IBM Corp. and others
2+
* Copyright (c) 1991, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -31,16 +31,18 @@
3131
extern "C" {
3232
#endif
3333

34-
3534
/* DO NOT DIRECTLY INCLUDE THIS FILE! */
3635
/* Include hashtable_api.h instead */
3736

38-
3937
#include "omravl.h"
4038
#include "omrcomp.h"
4139
#include "omrport.h"
4240
#include "pool_api.h"
4341

42+
/*
43+
* @ddr_namespace: map_to_type=J9HashtableConstants
44+
*/
45+
4446
/**
4547
* Hash table flags
4648
*/
@@ -50,7 +52,11 @@ extern "C" {
5052
#define J9HASH_TABLE_ALLOW_SIZE_OPTIMIZATION 0x00000008 /*!< Allow space optimized hashTable, some functions not supported */
5153
#define J9HASH_TABLE_DO_NOT_REHASH 0x00000010 /*!< Do not rehash the table while set */
5254

53-
#define J9HASH_TABLE_AVL_TREE_TAG_BIT ((uintptr_t)0x00000001) /*!< Bit to indicate that hastable slot contains a pointer to an AVL tree */
55+
/*
56+
* This used to include a cast to uintptr_t, but ddrgen doesn't
57+
* handle casts; that cast has been moved to hashtable.c.
58+
*/
59+
#define J9HASH_TABLE_AVL_TREE_TAG_BIT 0x00000001 /*!< Bit to indicate that hastable slot contains a pointer to an AVL tree */
5460

5561
/**
5662
* Hash Table state constants for iteration
@@ -59,6 +65,10 @@ extern "C" {
5965
#define J9HASH_TABLE_ITERATE_STATE_TREE_NODES 1
6066
#define J9HASH_TABLE_ITERATE_STATE_FINISHED 2
6167

68+
/*
69+
* @ddr_namespace: default
70+
*/
71+
6272
/**
6373
* Macros for getting at data directly from AVLTreeNodes
6474
*/

omrcfg.CMakeTemplate.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017, 2017 IBM Corp. and others
2+
* Copyright (c) 2017, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -28,6 +28,8 @@
2828
#if !defined(OMRCFG_H_)
2929
#define OMRCFG_H_
3030

31+
/* @ddr_namespace: map_to_type=OmrBuildFlags */
32+
3133
#cmakedefine OMR_GC
3234
#cmakedefine OMR_JIT
3335
#cmakedefine OMR_JITBUILDER

util/hashtable/hashtable.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 1991, 2015 IBM Corp. and others
2+
* Copyright (c) 1991, 2018 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -62,7 +62,7 @@
6262
*/
6363
#define NEXT(p) *((void **)((uint8_t *)p + table->listNodeSize - sizeof(uintptr_t)))
6464

65-
#define AVL_TREE_TAG_BIT ((uintptr_t)0x00000001)
65+
#define AVL_TREE_TAG_BIT ((uintptr_t)J9HASH_TABLE_AVL_TREE_TAG_BIT)
6666
#define AVL_TREE_TAGGED(p) (((uintptr_t)(p)) & AVL_TREE_TAG_BIT)
6767
#define AVL_TREE_TAG(p) ((J9AVLTree *)(((uintptr_t)(p)) | AVL_TREE_TAG_BIT))
6868
#define AVL_TREE_UNTAG(p) ((J9AVLTree *)(((uintptr_t)(p)) & (~AVL_TREE_TAG_BIT)))

0 commit comments

Comments
 (0)