X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..refs/heads/master:/assembler/CodeLocation.h?ds=inline diff --git a/assembler/CodeLocation.h b/assembler/CodeLocation.h index b910b6f..86d1f2b 100644 --- a/assembler/CodeLocation.h +++ b/assembler/CodeLocation.h @@ -26,9 +26,7 @@ #ifndef CodeLocation_h #define CodeLocation_h -#include - -#include +#include "MacroAssemblerCodeRef.h" #if ENABLE(ASSEMBLER) @@ -39,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 @@ -62,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() @@ -128,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() {} @@ -137,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); @@ -179,6 +199,18 @@ inline CodeLocationDataLabel32 CodeLocationCommon::dataLabel32AtOffset(int offse return CodeLocationDataLabel32(reinterpret_cast(dataLocation()) + offset); } +inline CodeLocationDataLabelCompact CodeLocationCommon::dataLabelCompactAtOffset(int offset) +{ + ASSERT_VALID_CODE_OFFSET(offset); + return CodeLocationDataLabelCompact(reinterpret_cast(dataLocation()) + offset); +} + +inline CodeLocationConvertibleLoad CodeLocationCommon::convertibleLoadAtOffset(int offset) +{ + ASSERT_VALID_CODE_OFFSET(offset); + return CodeLocationConvertibleLoad(reinterpret_cast(dataLocation()) + offset); +} + } // namespace JSC #endif // ENABLE(ASSEMBLER)