harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r599491 - in /harmony/enhanced/drlvm/trunk: build/make/components/vm/ vm/gc_gen/javasrc_uncomp/ vm/gc_gen/javasrc_uncomp/org/ vm/gc_gen/javasrc_uncomp/org/apache/ vm/gc_gen/javasrc_uncomp/org/apache/harmony/ vm/gc_gen/javasrc_uncomp/org/apa...
Date Thu, 29 Nov 2007 15:43:58 GMT
Author: gshimansky
Date: Thu Nov 29 07:43:56 2007
New Revision: 599491

URL: http://svn.apache.org/viewvc?rev=599491&view=rev
Log:
Added missing files from HARMONY-5098 committed by Xiao-Feng at 599482


Added:
    harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml   (with props)
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/
    harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
  (with props)

Added: harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml?rev=599491&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml (added)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml Thu Nov 29 07:43:56
2007
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!--
+Author: Marina V. Goldburt, Dmitry B. Yershov
+Version: $Revision: 1.2 $
+-->
+<!--
+    This is build descriptor for the component "vm.gc_gen_uncomp".
+
+    Please refer to make/components/README.txt for details about the component
+    build descriptor structure.
+  -->
+
+<project name="vm.gc_gen_uncomp">
+    <!-- Do we need CG for uncompressed mode -->
+    <condition property="build.uncompressed.gc">
+        <not><!-- refs.comp.mode is not REFS_USE_COMPRESSED for uncompressed and
runtime switching modes -->
+            <equals arg1="${refs.comp.mode}" arg2="REFS_USE_COMPRESSED" />
+        </not>
+    </condition>
+
+    <target name="init" depends="common_vm" if="build.uncompressed.gc">
+        <property name="build.depends" value="extra.apr,vm.vmcore,vm.hythr,vm.kernel_classes"
/>
+        <property name="outtype" value="shared" />
+        <property name="libname" value="gc_gen_uncomp" />
+        <property name="src" location="${build.vm.home}" />
+
+        <compiler id="cpp.compiler" extends="common.cpp.compiler">
+            <includepath>
+                <pathelement location="${extra.apr.includes}" />
+            </includepath>
+
+            <includepath>
+                <dirset dir="${build.vm.home}">
+                    <include name="include" />
+                    <include name="vmcore/include" />
+                    <include name="vm/interface" />
+                    <include name="vmcore/src/util/win/include" if="is.windows"/>
+                    <include name="vmcore/src/util/linux/include" if="is.unix"/>
+                </dirset>
+            </includepath>
+
+            <fileset dir="${src}/gc_gen/src">
+                <select arch="ia32,em64t,ipf">
+                <include name="common/*.cpp" />
+                <include name="gen/*.cpp" />
+                <include name="mark_compact/*.cpp" />
+                <include name="mark_sweep/*.cpp" />
+                <include name="los/*.cpp" />
+                <include name="thread/*.cpp" />
+                <include name="trace_forward/*.cpp" />
+                <include name="utils/*.cpp" />
+                <include name="jni/*.cpp" />
+                <include name="verify/*.cpp" />
+                <include name="finalizer_weakref/*.cpp" />
+                </select>
+            </fileset>
+
+            <defineset define="BUILDING_GC" />
+
+            <defineset define="_USRDLL" if="is.windows"/>
+        </compiler>
+
+        <!--select os="win" arch="ipf">
+            <fileset id="asm.fileset"
+                     dir="${build.vm.home}/gc_gen/src">
+                <include name="ini_ipf_low_level.asm" />
+            </fileset>
+        </select-->
+
+        <linker id="linker" extends="common.linker">
+            <syslibset libs="advapi32,odbc32,ws2_32,mswsock" if="is.windows"/>
+            <libset libs="${vm.vmcore.lib}" dir="${vm.vmcore.libdir}" if="is.windows"/>
+
+            <syslibset libs="AdvAPI32" if="is.windows.ia64"/>
+
+            <linkerarg value="/NODEFAULTLIB:libcmtd.lib" if="is.windows" unless="is.cfg.release"/>
+            <syslibset libs="msvcrtd" if="is.windows" unless="is.cfg.release"/>
+
+            <libset libs="${vm.hythr.lib}" dir="${vm.hythr.libdir}" />
+            <linkerarg value="-Bsymbolic" if="is.unix"/>
+            <linkerarg value="--version-script=${build.vm.home}/gc_gen/build/gc_gen.exp"
if="is.unix"/>
+        </linker>
+
+        <!-- Java helpers -->
+        <property name="build.java.depends" value=""/>
+
+        <property name="java.source.dir"
+                  location="${build.vm.home}/gc_gen/javasrc_uncomp"/>
+
+        <path id="java.class.path">
+            <pathelement location="${java.build.dir}"/>
+
+            <fileset dir="${external.dep.CLASSLIB.jardir}" includes="*.jar" />
+            <pathelement location="${vm.kernel_classes.jardir}/kernel.jar"/>
+            <fileset dir="${build.VMMAGIC.home}" includes="vmmagic-20070207.jar" />
+        </path>
+
+        <property name="jarname" value="gc_gen_uncomp.jar"/>
+        <property name="srcjarname" value="gc_gen_uncomp-src.jar"/>
+
+    </target>
+</project>

Propchange: harmony/enhanced/drlvm/trunk/build/make/components/vm/gc_gen_uncomp.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=599491&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
(added)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
Thu Nov 29 07:43:56 2007
@@ -0,0 +1,99 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/**
+ * @author Xiao-Feng Li
+ */ 
+
+package org.apache.harmony.drlvm.gc_gen;
+
+import org.apache.harmony.drlvm.VMHelper;
+import org.vmmagic.unboxed.*;
+import org.vmmagic.pragma.*;
+
+public class GCHelper {
+
+    static {
+      System.loadLibrary("gc_gen_uncomp");
+      helperCallback();
+    }
+
+    public static final int TLS_GC_OFFSET = TLSGCOffset();
+
+    @Inline
+    public static Address alloc(int objSize, int allocationHandle) {
+        Address TLS_BASE = VMHelper.getTlsBaseAddress();
+
+        Address allocator_addr = TLS_BASE.plus(TLS_GC_OFFSET);
+        Address allocator = allocator_addr.loadAddress();
+        Address free_addr = allocator.plus(0);
+        Address free = free_addr.loadAddress();
+        Address ceiling = allocator.plus(4).loadAddress();
+        
+        Address new_free = free.plus(objSize);
+
+        if (new_free.LE(ceiling)) {
+            free_addr.store(new_free);
+            free.store(allocationHandle);
+            return free;
+        }
+                
+        return VMHelper.newResolvedUsingAllocHandleAndSize(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!
+
+    @Inline
+    public static Address allocArray(int arrayLen, int elemSize, int allocationHandle) {
+        if (arrayLen >= 0) {
+            int firstElementOffset = ARRAY_LEN_OFFSET + (elemSize==8?8:4);
+            int size = firstElementOffset + elemSize*arrayLen;
+            size = (((size + (GC_OBJECT_ALIGNMENT - 1)) & (~(GC_OBJECT_ALIGNMENT - 1))));
+
+            Address arrayAddress = alloc(size, allocationHandle); //never null!
+            arrayAddress.store(arrayLen, Offset.fromIntZeroExtend(ARRAY_LEN_OFFSET));
+            return arrayAddress;
+        }
+        return VMHelper.newVectorUsingAllocHandle(arrayLen, allocationHandle);
+    }
+
+    /** NOS (nursery object space) is higher in address than other spaces.
+       The boundary currently is produced in GC initialization. It can
+       be a constant in future.
+    */
+
+    public static Address NOS_BOUNDARY = Address.fromLong(getNosBoundary());
+    public static boolean GEN_MODE = getGenMode();
+
+    @Inline
+    public static void write_barrier_slot_rem(Address p_objBase, Address p_objSlot, Address
p_target) {
+      
+       /* 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) {
+            p_objSlot.store(p_target);
+            return;
+        }
+
+        VMHelper.writeBarrier(p_objBase, p_objSlot, p_target);
+    }
+
+    private static native int helperCallback();
+    private static native boolean getGenMode(); 
+    private static native long getNosBoundary();    
+    private static native int TLSGCOffset();
+}
+

Propchange: harmony/enhanced/drlvm/trunk/vm/gc_gen/javasrc_uncomp/org/apache/harmony/drlvm/gc_gen/GCHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message