harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r599519 - /harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
Date Thu, 29 Nov 2007 17:09:45 GMT
Author: gshimansky
Date: Thu Nov 29 09:09:45 2007
New Revision: 599519

URL: http://svn.apache.org/viewvc?rev=599519&view=rev
Log:
Applied additional patch from HARMONY-5098
This change is necessary after changes done in 598532. Now x86 architecture works ok.


Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java?rev=599519&r1=599518&r2=599519&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
(original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
Thu Nov 29 09:09:45 2007
@@ -34,7 +34,8 @@
     public static final int TLS_GC_OFFSET = TLSGCOffset();
 
     @Inline
-    public static Address alloc(int objSize, int allocationHandle) {
+    private static Address alloc(int objSize, int allocationHandle ) {
+
         Address TLS_BASE = VMHelper.getTlsBaseAddress();
 
         Address allocator_addr = TLS_BASE.plus(TLS_GC_OFFSET);
@@ -54,12 +55,23 @@
         return VMHelper.newResolvedUsingAllocHandleAndSize(objSize, allocationHandle);  
 
     }
 
+    @Inline
+    public static Address alloc(Address classHandle) {
+        int objSize = VMHelper.getTypeSize(classHandle);
+        int allocationHandle = VMHelper.getAllocationHandle(classHandle);
+        return alloc(objSize, allocationHandle);
+    }
+
+
     private static final int ARRAY_LEN_OFFSET = 8;
-    private static final int GC_OBJECT_ALIGNMENT = 4; //TODO: EM64 or IPF could have 8!
+    private static final int GC_OBJECT_ALIGNMENT = 4;
 
     @Inline
-    public static Address allocArray(int arrayLen, int elemSize, int allocationHandle) {
+    public static Address allocArray(Address elemClassHandle, int arrayLen) {
+        Address arrayClassHandle = VMHelper.getArrayClass(elemClassHandle);
+        int allocationHandle = VMHelper.getAllocationHandle(arrayClassHandle);
         if (arrayLen >= 0) {
+            int elemSize = VMHelper.getArrayElemSize(arrayClassHandle);
             int firstElementOffset = ARRAY_LEN_OFFSET + (elemSize==8?8:4);
             int size = firstElementOffset + elemSize*arrayLen;
             size = (((size + (GC_OBJECT_ALIGNMENT - 1)) & (~(GC_OBJECT_ALIGNMENT - 1))));
@@ -80,7 +92,7 @@
     public static boolean GEN_MODE = getGenMode();
 
     @Inline
-    public static void write_barrier_slot_rem(Address p_objBase, Address p_objSlot, Address
p_target) {
+    public static void write_barrier_slot_rem(Address p_target, Address p_objSlot, Address
p_objBase) {
       
        /* If the slot is in NOS or the target is not in NOS, we simply return*/
         if(p_objSlot.GE(NOS_BOUNDARY) || p_target.LT(NOS_BOUNDARY) || !GEN_MODE) {



Mime
View raw message