X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/assembler/CodeLocation.h?ds=sidebyside diff --git a/assembler/CodeLocation.h b/assembler/CodeLocation.h index 9500b1e..86d1f2b 100644 --- a/assembler/CodeLocation.h +++ b/assembler/CodeLocation.h @@ -40,6 +40,7 @@ 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 +63,7 @@ public: CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset); CodeLocationDataLabel32 dataLabel32AtOffset(int offset); CodeLocationDataLabelCompact dataLabelCompactAtOffset(int offset); + CodeLocationConvertibleLoad convertibleLoadAtOffset(int offset); protected: CodeLocationCommon() @@ -146,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); @@ -194,6 +205,12 @@ inline CodeLocationDataLabelCompact CodeLocationCommon::dataLabelCompactAtOffset 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)