Index: src/assembler.h |
diff --git a/src/assembler.h b/src/assembler.h |
index 06be048fa666e635a6c0a218b8704dff88155c70..da58a725e2764bbcf35f561e8d27c6b7809564cc 100644 |
--- a/src/assembler.h |
+++ b/src/assembler.h |
@@ -1089,6 +1089,13 @@ size_t hash_value(ExternalReference); |
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, ExternalReference); |
+inline int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
+ ptrdiff_t offset = ref0.address() - ref1.address(); |
+ // Check that fits into int. |
+ DCHECK_EQ(offset, static_cast<int>(offset)); |
+ return static_cast<int>(offset); |
+} |
+ |
// ----------------------------------------------------------------------------- |
// Utility functions |