Index: src/lithium-codegen.cc |
diff --git a/src/lithium-codegen.cc b/src/lithium-codegen.cc |
index 3ca47e1e8da75c6556f0d54e6c649a7ada190ce9..412b00e3474dd3662d74c789713b1a3c75c01559 100644 |
--- a/src/lithium-codegen.cc |
+++ b/src/lithium-codegen.cc |
@@ -152,12 +152,17 @@ void LCodeGenBase::Comment(const char* format, ...) { |
} |
+void LCodeGenBase::Comment(bool force, const char* string) { |
+ size_t length = strlen(string); |
+ Vector<char> copy = Vector<char>::New(static_cast<int>(length) + 1); |
+ MemCopy(copy.start(), string, copy.length()); |
+ masm()->RecordComment(copy.start(), force); |
+} |
+ |
+ |
void LCodeGenBase::DeoptComment(const Deoptimizer::Reason& reason) { |
- std::ostringstream os; |
- os << ";;; deoptimize at " << HSourcePosition(reason.raw_position) << " " |
- << reason.mnemonic; |
- if (reason.detail != NULL) os << ": " << reason.detail; |
- Comment("%s", os.str().c_str()); |
+ masm()->RecordDeoptReason(*reinterpret_cast<const int*>(&reason.deopt_reason), |
+ reason.raw_position); |
} |