Index: src/assembler.cc |
diff --git a/src/assembler.cc b/src/assembler.cc |
index b4958f5b392dc798e6fdd07c09818acc7b7c1371..c92c248820258aeacdda3fd8f313c009355ea695 100644 |
--- a/src/assembler.cc |
+++ b/src/assembler.cc |
@@ -689,6 +689,21 @@ RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { |
// Implementation of RelocInfo |
+#ifdef DEBUG |
+bool RelocInfo::RequiresRelocation(const CodeDesc& desc) { |
+ // Ensure there are no code targets or embedded objects present in the |
+ // deoptimization entries, they would require relocation after code |
+ // generation. |
+ int mode_mask = RelocInfo::kCodeTargetMask | |
+ RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
+ RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
+ RelocInfo::kApplyMask; |
+ RelocIterator it(desc, mode_mask); |
+ return !it.done(); |
+} |
+#endif |
+ |
+ |
#ifdef ENABLE_DISASSEMBLER |
const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { |
switch (rmode) { |