+ void dumpWithName(const char* name, PrintStream& out) const
+ {
+ if (executableAddress() == dataLocation()) {
+ out.print(name, "(", RawPointer(executableAddress()), ")");
+ return;
+ }
+ out.print(name, "(executable = ", RawPointer(executableAddress()), ", dataLocation = ", RawPointer(dataLocation()), ")");
+ }
+
+ void dump(PrintStream& out) const
+ {
+ dumpWithName("CodePtr", out);
+ }
+
+ enum EmptyValueTag { EmptyValue };
+ enum DeletedValueTag { DeletedValue };
+
+ MacroAssemblerCodePtr(EmptyValueTag)
+ : m_value(emptyValue())
+ {
+ }
+
+ MacroAssemblerCodePtr(DeletedValueTag)
+ : m_value(deletedValue())
+ {
+ }
+
+ bool isEmptyValue() const { return m_value == emptyValue(); }
+ bool isDeletedValue() const { return m_value == deletedValue(); }
+
+ unsigned hash() const { return PtrHash<void*>::hash(m_value); }
+