Index: src/assembler.h |
diff --git a/src/assembler.h b/src/assembler.h |
index 0349b065821b57f1ad282ec0f58959261e6e575e..af5a2a5bfc82a9a33d2d63ce81f357d6ac63bc2b 100644 |
--- a/src/assembler.h |
+++ b/src/assembler.h |
@@ -107,6 +107,22 @@ class AssemblerBase: public Malloced { |
}; |
+// Avoids emitting debug code during the lifetime of this scope object. |
+class DontEmitDebugCodeScope BASE_EMBEDDED { |
+ public: |
+ explicit DontEmitDebugCodeScope(AssemblerBase* assembler) |
+ : assembler_(assembler), old_value_(assembler->emit_debug_code()) { |
+ assembler_->set_emit_debug_code(false); |
+ } |
+ ~DontEmitDebugCodeScope() { |
+ assembler_->set_emit_debug_code(old_value_); |
+ }; |
+ private: |
+ AssemblerBase* assembler_; |
+ bool old_value_; |
+}; |
+ |
+ |
// Avoids using instructions that vary in size in unpredictable ways between the |
// snapshot and the running VM. |
class PredictableCodeSizeScope { |