diff graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java @ 10898:ea308a63760b

added unalignedMemoryAccess to Architecture
author twisti
date Fri, 26 Jul 2013 20:34:05 -0700
parents e865310767be
children 1e07d9303420
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java	Fri Jul 26 14:03:07 2013 -0700
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java	Fri Jul 26 20:34:05 2013 -0700
@@ -63,6 +63,11 @@
     private final ByteOrder byteOrder;
 
     /**
+     * Whether the architecture supports unaligned memory accesses.
+     */
+    private final boolean unalignedMemoryAccess;
+
+    /**
      * Mask of the barrier constants denoting the barriers that are not required to be explicitly
      * inserted under this architecture.
      */
@@ -79,12 +84,13 @@
      */
     private final int returnAddressSize;
 
-    protected Architecture(String name, int wordSize, ByteOrder byteOrder, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, int registerReferenceMapBitCount,
-                    int returnAddressSize) {
+    protected Architecture(String name, int wordSize, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset,
+                    int registerReferenceMapBitCount, int returnAddressSize) {
         this.name = name;
         this.registers = registers;
         this.wordSize = wordSize;
         this.byteOrder = byteOrder;
+        this.unalignedMemoryAccess = unalignedMemoryAccess;
         this.implicitMemoryBarriers = implicitMemoryBarriers;
         this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset;
         this.registerReferenceMapBitCount = registerReferenceMapBitCount;
@@ -133,6 +139,13 @@
     }
 
     /**
+     * @return true if the architecture supports unaligned memory accesses.
+     */
+    public boolean supportsUnalignedMemoryAccess() {
+        return unalignedMemoryAccess;
+    }
+
+    /**
      * Gets the size of the return address pushed to the stack by a call instruction. A value of 0
      * denotes that call linkage uses registers instead.
      */