OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 280 } |
281 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { | 281 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { |
282 out.AddFormatted(" (id = %d)", static_cast<int>(relocinfo.data())); | 282 out.AddFormatted(" (id = %d)", static_cast<int>(relocinfo.data())); |
283 } | 283 } |
284 } else if (rmode == RelocInfo::RUNTIME_ENTRY && | 284 } else if (rmode == RelocInfo::RUNTIME_ENTRY && |
285 Isolate::Current()->deoptimizer_data() != NULL) { | 285 Isolate::Current()->deoptimizer_data() != NULL) { |
286 // A runtime entry reloinfo might be a deoptimization bailout. | 286 // A runtime entry reloinfo might be a deoptimization bailout. |
287 Address addr = relocinfo.target_address(); | 287 Address addr = relocinfo.target_address(); |
288 int id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::EAGER); | 288 int id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::EAGER); |
289 if (id == Deoptimizer::kNotDeoptimizationEntry) { | 289 if (id == Deoptimizer::kNotDeoptimizationEntry) { |
290 id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::LAZY); | 290 out.AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode)); |
291 if (id == Deoptimizer::kNotDeoptimizationEntry) { | |
292 out.AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode)); | |
293 } else { | |
294 out.AddFormatted(" ;; lazy deoptimization bailout %d", id); | |
295 } | |
296 } else { | 291 } else { |
297 out.AddFormatted(" ;; deoptimization bailout %d", id); | 292 out.AddFormatted(" ;; deoptimization bailout %d", id); |
298 } | 293 } |
299 } else { | 294 } else { |
300 out.AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode)); | 295 out.AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode)); |
301 } | 296 } |
302 } | 297 } |
303 DumpBuffer(f, &out); | 298 DumpBuffer(f, &out); |
304 } | 299 } |
305 | 300 |
(...skipping 14 matching lines...) Expand all Loading... |
320 | 315 |
321 | 316 |
322 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { | 317 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { |
323 V8NameConverter defaultConverter(NULL); | 318 V8NameConverter defaultConverter(NULL); |
324 return DecodeIt(f, defaultConverter, begin, end); | 319 return DecodeIt(f, defaultConverter, begin, end); |
325 } | 320 } |
326 | 321 |
327 | 322 |
328 // Called by Code::CodePrint. | 323 // Called by Code::CodePrint. |
329 void Disassembler::Decode(FILE* f, Code* code) { | 324 void Disassembler::Decode(FILE* f, Code* code) { |
330 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION || | 325 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION) |
331 code->kind() == Code::COMPILED_STUB) | |
332 ? static_cast<int>(code->safepoint_table_offset()) | 326 ? static_cast<int>(code->safepoint_table_offset()) |
333 : code->instruction_size(); | 327 : code->instruction_size(); |
334 // If there might be a stack check table, stop before reaching it. | 328 // If there might be a stack check table, stop before reaching it. |
335 if (code->kind() == Code::FUNCTION) { | 329 if (code->kind() == Code::FUNCTION) { |
336 decode_size = | 330 decode_size = |
337 Min(decode_size, static_cast<int>(code->stack_check_table_offset())); | 331 Min(decode_size, static_cast<int>(code->stack_check_table_offset())); |
338 } | 332 } |
339 | 333 |
340 byte* begin = code->instruction_start(); | 334 byte* begin = code->instruction_start(); |
341 byte* end = begin + decode_size; | 335 byte* end = begin + decode_size; |
342 V8NameConverter v8NameConverter(code); | 336 V8NameConverter v8NameConverter(code); |
343 DecodeIt(f, v8NameConverter, begin, end); | 337 DecodeIt(f, v8NameConverter, begin, end); |
344 } | 338 } |
345 | 339 |
346 #else // ENABLE_DISASSEMBLER | 340 #else // ENABLE_DISASSEMBLER |
347 | 341 |
348 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} | 342 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} |
349 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } | 343 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } |
350 void Disassembler::Decode(FILE* f, Code* code) {} | 344 void Disassembler::Decode(FILE* f, Code* code) {} |
351 | 345 |
352 #endif // ENABLE_DISASSEMBLER | 346 #endif // ENABLE_DISASSEMBLER |
353 | 347 |
354 } } // namespace v8::internal | 348 } } // namespace v8::internal |
OLD | NEW |