Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/disassembler.cc

Issue 874323003: Externalize deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 out.AddPadding(' ', kRelocInfoPosition); 166 out.AddPadding(' ', kRelocInfoPosition);
167 } 167 }
168 168
169 RelocInfo::Mode rmode = relocinfo.rmode(); 169 RelocInfo::Mode rmode = relocinfo.rmode();
170 if (RelocInfo::IsPosition(rmode)) { 170 if (RelocInfo::IsPosition(rmode)) {
171 if (RelocInfo::IsStatementPosition(rmode)) { 171 if (RelocInfo::IsStatementPosition(rmode)) {
172 out.AddFormatted(" ;; debug: statement %d", relocinfo.data()); 172 out.AddFormatted(" ;; debug: statement %d", relocinfo.data());
173 } else { 173 } else {
174 out.AddFormatted(" ;; debug: position %d", relocinfo.data()); 174 out.AddFormatted(" ;; debug: position %d", relocinfo.data());
175 } 175 }
176 } else if (rmode == RelocInfo::DEOPT_REASON) {
177 Deoptimizer::DeoptReason reason =
178 static_cast<Deoptimizer::DeoptReason>(relocinfo.data());
179 out.AddFormatted(" ;; debug: deopt reason '%s'",
180 Deoptimizer::GetDeoptReason(reason));
176 } else if (rmode == RelocInfo::EMBEDDED_OBJECT) { 181 } else if (rmode == RelocInfo::EMBEDDED_OBJECT) {
177 HeapStringAllocator allocator; 182 HeapStringAllocator allocator;
178 StringStream accumulator(&allocator); 183 StringStream accumulator(&allocator);
179 relocinfo.target_object()->ShortPrint(&accumulator); 184 relocinfo.target_object()->ShortPrint(&accumulator);
180 SmartArrayPointer<const char> obj_name = accumulator.ToCString(); 185 SmartArrayPointer<const char> obj_name = accumulator.ToCString();
181 out.AddFormatted(" ;; object: %s", obj_name.get()); 186 out.AddFormatted(" ;; object: %s", obj_name.get());
182 } else if (rmode == RelocInfo::EXTERNAL_REFERENCE) { 187 } else if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
183 const char* reference_name = 188 const char* reference_name =
184 ref_encoder.NameOfAddress(relocinfo.target_reference()); 189 ref_encoder.NameOfAddress(relocinfo.target_reference());
185 out.AddFormatted(" ;; external reference (%s)", reference_name); 190 out.AddFormatted(" ;; external reference (%s)", reference_name);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 #else // ENABLE_DISASSEMBLER 289 #else // ENABLE_DISASSEMBLER
285 290
286 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin, 291 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin,
287 byte* end, Code* code) { 292 byte* end, Code* code) {
288 return 0; 293 return 0;
289 } 294 }
290 295
291 #endif // ENABLE_DISASSEMBLER 296 #endif // ENABLE_DISASSEMBLER
292 297
293 } } // namespace v8::internal 298 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698