001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.mmtk.plan;
014    
015    import org.mmtk.policy.SegregatedFreeListSpace;
016    import org.vmmagic.pragma.*;
017    
018    /**
019     * This class and its subclasses communicate to the host VM/Runtime
020     * any features of the selected plan that it needs to know.  This is
021     * separate from the main Plan/PlanLocal class in order to bypass any
022     * issues with ordering of static initialization.
023     */
024    @Uninterruptible public abstract class PlanConstraints {
025      /** @return {@code true} if this Plan requires read barriers on java.lang.reference types. */
026      public boolean needsJavaLangReferenceReadBarrier() { return false; }
027    
028      /** @return {@code true} if this Plan requires write barriers on booleans. */
029      public boolean needsBooleanWriteBarrier() { return false; }
030    
031      /** @return {@code true} if this Plan requires read barriers on booleans. */
032      public boolean needsBooleanReadBarrier() { return false; }
033    
034      /** @return {@code true} if this Plan can perform bulk boolean arraycopy barriers. */
035      public boolean booleanBulkCopySupported() { return false; }
036    
037      /** @return {@code true} if this Plan requires write barriers on bytes. */
038      public boolean needsByteWriteBarrier() { return false; }
039    
040      /** @return {@code true} if this Plan requires read barriers on bytes. */
041      public boolean needsByteReadBarrier() { return false; }
042    
043      /** @return {@code true} if this Plan can perform bulk byte arraycopy barriers. */
044      public boolean byteBulkCopySupported() { return false; }
045    
046      /** @return {@code true} if this Plan requires write barriers on chars. */
047      public boolean needsCharWriteBarrier() { return false; }
048    
049      /** @return {@code true} if this Plan requires read barriers on chars. */
050      public boolean needsCharReadBarrier() { return false; }
051    
052      /** @return {@code true} if this Plan can perform bulk char arraycopy barriers. */
053      public boolean charBulkCopySupported() { return false; }
054    
055      /** @return {@code true} if this Plan requires write barriers on shorts. */
056      public boolean needsShortWriteBarrier() { return false; }
057    
058      /** @return {@code true} if this Plan requires read barriers on shorts. */
059      public boolean needsShortReadBarrier() { return false; }
060    
061      /** @return {@code true} if this Plan can perform bulk short arraycopy barriers. */
062      public boolean shortBulkCopySupported() { return false; }
063    
064      /** @return {@code true} if this Plan requires write barriers on ints. */
065      public boolean needsIntWriteBarrier() { return false; }
066    
067      /** @return {@code true} if this Plan requires read barriers on ints. */
068      public boolean needsIntReadBarrier() { return false; }
069    
070      /** @return {@code true} if this Plan can perform bulk int arraycopy barriers. */
071      public boolean intBulkCopySupported() { return false; }
072    
073      /** @return {@code true} if this Plan requires write barriers on longs. */
074      public boolean needsLongWriteBarrier() { return false; }
075    
076      /** @return {@code true} if this Plan requires read barriers on longs. */
077      public boolean needsLongReadBarrier() { return false; }
078    
079      /** @return {@code true} if this Plan can perform bulk long arraycopy barriers. */
080      public boolean longBulkCopySupported() { return false; }
081    
082      /** @return {@code true} if this Plan requires write barriers on floats. */
083      public boolean needsFloatWriteBarrier() { return false; }
084    
085      /** @return {@code true} if this Plan requires read barriers on floats. */
086      public boolean needsFloatReadBarrier() { return false; }
087    
088      /** @return {@code true} if this Plan can perform bulk float arraycopy barriers. */
089      public boolean floatBulkCopySupported() { return false; }
090    
091      /** @return {@code true} if this Plan requires write barriers on doubles. */
092      public boolean needsDoubleWriteBarrier() { return false; }
093    
094      /** @return {@code true} if this Plan requires read barriers on doubles. */
095      public boolean needsDoubleReadBarrier() { return false; }
096    
097      /** @return {@code true} if this Plan can perform bulk double arraycopy barriers. */
098      public boolean doubleBulkCopySupported() { return false; }
099    
100      /** @return {@code true} if this Plan requires write barriers on Words. */
101      public boolean needsWordWriteBarrier() { return false; }
102    
103      /** @return {@code true} if this Plan requires read barriers on Words. */
104      public boolean needsWordReadBarrier() { return false; }
105    
106      /** @return {@code true} if this Plan can perform bulk Word arraycopy barriers. */
107      public boolean wordBulkCopySupported() { return false; }
108    
109      /** @return {@code true} if this Plan requires write barriers on Address's. */
110      public boolean needsAddressWriteBarrier() { return false; }
111    
112      /** @return {@code true} if this Plan requires read barriers on Address's. */
113      public boolean needsAddressReadBarrier() { return false; }
114    
115      /** @return {@code true} if this Plan can perform bulk Address arraycopy barriers. */
116      public boolean addressBulkCopySupported() { return false; }
117    
118      /** @return {@code true} if this Plan requires write barriers on Extents. */
119      public boolean needsExtentWriteBarrier() { return false; }
120    
121      /** @return {@code true} if this Plan requires read barriers on Extents. */
122      public boolean needsExtentReadBarrier() { return false; }
123    
124      /** @return {@code true} if this Plan can perform bulk Extent arraycopy barriers. */
125      public boolean extentBulkCopySupported() { return false; }
126    
127      /** @return {@code true} if this Plan requires write barriers on Offsets. */
128      public boolean needsOffsetWriteBarrier() { return false; }
129    
130      /** @return {@code true} if this Plan requires read barriers on Offsets. */
131      public boolean needsOffsetReadBarrier() { return false; }
132    
133      /** @return {@code true} if this Plan can perform bulk Offset arraycopy barriers. */
134      public boolean offsetBulkCopySupported() { return false; }
135    
136      /** @return {@code true} if this Plan requires write barriers on object references. */
137      public boolean needsObjectReferenceWriteBarrier() { return false; }
138    
139      /** @return {@code true} if this Plan requires read barriers on object references. */
140      public boolean needsObjectReferenceReadBarrier() { return false; }
141    
142      /** @return {@code true} if this Plan requires non-heap write barriers on object references. */
143      public boolean needsObjectReferenceNonHeapWriteBarrier() { return false;}
144    
145      /** @return {@code true} if this Plan requires non-heap read barriers on object references. */
146      public boolean needsObjectReferenceNonHeapReadBarrier() { return false; }
147    
148      /** @return {@code true} if this Plan can perform bulk object arraycopy barriers. */
149      public boolean objectReferenceBulkCopySupported() { return false; }
150    
151      /** @return {@code true} if this Plan requires linear scanning. */
152      public boolean needsLinearScan() { return org.mmtk.utility.Constants.SUPPORT_CARD_SCANNING;}
153    
154      /** @return {@code true} if this Plan moves objects. */
155      public boolean movesObjects() { return false;}
156    
157      /** @return Size (in bytes) beyond which new regular objects must be allocated to the LOS */
158      public int maxNonLOSDefaultAllocBytes() { return org.mmtk.utility.Constants.MAX_INT;}
159    
160      /** @return Size (in bytes) beyond which new non-moving objects must be allocated to the LOS */
161      public int maxNonLOSNonMovingAllocBytes() { return SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES;}
162    
163      /** @return Size (in bytes) beyond which copied objects must be copied to the LOS */
164      public int maxNonLOSCopyBytes() { return org.mmtk.utility.Constants.MAX_INT;}
165    
166      /** @return {@code true} if this object forwards objects <i>after</i>
167       * determining global object liveness (e.g. many compacting collectors). */
168      public boolean needsForwardAfterLiveness() { return false;}
169    
170      /** @return Is this plan generational in nature. */
171      public boolean generational() { return false;}
172    
173      /** @return The number of header bits that are required. */
174      public abstract int gcHeaderBits();
175    
176      /** @return The number of header words that are required. */
177      public abstract int gcHeaderWords();
178    
179      /** @return {@code true} if this plan contains GCspy. */
180      public boolean withGCspy() { return false; }
181    
182      /** @return {@code true} if this plan contains GCTrace. */
183      public boolean generateGCTrace() { return false; }
184    
185      /** @return The specialized scan methods required */
186      public int numSpecializedScans() { return 0; }
187    
188      /** @return {@code true} if this plan requires concurrent worker threads */
189      public boolean needsConcurrentWorkers() { return false; }
190    
191      /** @return {@code true} if this Plan requires a header bit for object logging */
192      public boolean needsLogBitInHeader() { return false; }
193    }