]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - assembler/CodeLocation.h
JavaScriptCore-1218.35.tar.gz
[apple/javascriptcore.git] / assembler / CodeLocation.h
index cab28cd905c1695ca447c6c896c5bf918bf0c99d..86d1f2b7552e960859e135b21d748a221fc14984 100644 (file)
@@ -26,8 +26,7 @@
 #ifndef CodeLocation_h
 #define CodeLocation_h
 
-
-#include <MacroAssemblerCodeRef.h>
+#include "MacroAssemblerCodeRef.h"
 
 #if ENABLE(ASSEMBLER)
 
@@ -38,8 +37,10 @@ class CodeLocationLabel;
 class CodeLocationJump;
 class CodeLocationCall;
 class CodeLocationNearCall;
+class CodeLocationDataLabelCompact;
 class CodeLocationDataLabel32;
 class CodeLocationDataLabelPtr;
+class CodeLocationConvertibleLoad;
 
 // The CodeLocation* types are all pretty much do-nothing wrappers around
 // CodePtr (or MacroAssemblerCodePtr, to give it its full name).  These
@@ -61,6 +62,8 @@ public:
     CodeLocationNearCall nearCallAtOffset(int offset);
     CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset);
     CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
+    CodeLocationDataLabelCompact dataLabelCompactAtOffset(int offset);
+    CodeLocationConvertibleLoad convertibleLoadAtOffset(int offset);
 
 protected:
     CodeLocationCommon()
@@ -127,6 +130,15 @@ public:
         : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
 };
 
+class CodeLocationDataLabelCompact : public CodeLocationCommon {
+public:
+    CodeLocationDataLabelCompact() { }
+    explicit CodeLocationDataLabelCompact(MacroAssemblerCodePtr location)
+        : CodeLocationCommon(location) { }
+    explicit CodeLocationDataLabelCompact(void* location)
+        : CodeLocationCommon(MacroAssemblerCodePtr(location)) { }
+};
+
 class CodeLocationDataLabelPtr : public CodeLocationCommon {
 public:
     CodeLocationDataLabelPtr() {}
@@ -136,6 +148,15 @@ public:
         : CodeLocationCommon(MacroAssemblerCodePtr(location)) {}
 };
 
+class CodeLocationConvertibleLoad : public CodeLocationCommon {
+public:
+    CodeLocationConvertibleLoad() { }
+    explicit CodeLocationConvertibleLoad(MacroAssemblerCodePtr location)
+        : CodeLocationCommon(location) { }
+    explicit CodeLocationConvertibleLoad(void* location)
+        : CodeLocationCommon(MacroAssemblerCodePtr(location)) { }
+};
+
 inline CodeLocationInstruction CodeLocationCommon::instructionAtOffset(int offset)
 {
     ASSERT_VALID_CODE_OFFSET(offset);
@@ -178,6 +199,18 @@ inline CodeLocationDataLabel32 CodeLocationCommon::dataLabel32AtOffset(int offse
     return CodeLocationDataLabel32(reinterpret_cast<char*>(dataLocation()) + offset);
 }
 
+inline CodeLocationDataLabelCompact CodeLocationCommon::dataLabelCompactAtOffset(int offset)
+{
+    ASSERT_VALID_CODE_OFFSET(offset);
+    return CodeLocationDataLabelCompact(reinterpret_cast<char*>(dataLocation()) + offset);
+}
+
+inline CodeLocationConvertibleLoad CodeLocationCommon::convertibleLoadAtOffset(int offset)
+{
+    ASSERT_VALID_CODE_OFFSET(offset);
+    return CodeLocationConvertibleLoad(reinterpret_cast<char*>(dataLocation()) + offset);
+}
+
 } // namespace JSC
 
 #endif // ENABLE(ASSEMBLER)