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

Side by Side Diff: src/objects.cc

Issue 2788513004: [disasm] Print all pc offsets as hex (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 14729 matching lines...) Expand 10 before | Expand all | Expand 10 after
14740 os << static_cast<const void*>(ptr) << " " << buf.start() << "\n"; 14740 os << static_cast<const void*>(ptr) << " " << buf.start() << "\n";
14741 } 14741 }
14742 } 14742 }
14743 } 14743 }
14744 os << "\n"; 14744 os << "\n";
14745 14745
14746 SourcePositionTableIterator it(source_position_table()); 14746 SourcePositionTableIterator it(source_position_table());
14747 if (!it.done()) { 14747 if (!it.done()) {
14748 os << "Source positions:\n pc offset position\n"; 14748 os << "Source positions:\n pc offset position\n";
14749 for (; !it.done(); it.Advance()) { 14749 for (; !it.done(); it.Advance()) {
14750 os << std::setw(10) << it.code_offset() << std::setw(10) 14750 os << std::setw(10) << std::hex << it.code_offset() << std::dec
14751 << it.source_position().ScriptOffset() 14751 << std::setw(10) << it.source_position().ScriptOffset()
14752 << (it.is_statement() ? " statement" : "") << "\n"; 14752 << (it.is_statement() ? " statement" : "") << "\n";
14753 } 14753 }
14754 os << "\n"; 14754 os << "\n";
14755 } 14755 }
14756 14756
14757 if (kind() == FUNCTION) { 14757 if (kind() == FUNCTION) {
14758 DeoptimizationOutputData* data = 14758 DeoptimizationOutputData* data =
14759 DeoptimizationOutputData::cast(this->deoptimization_data()); 14759 DeoptimizationOutputData::cast(this->deoptimization_data());
14760 data->DeoptimizationOutputDataPrint(os); 14760 data->DeoptimizationOutputDataPrint(os);
14761 } else if (kind() == OPTIMIZED_FUNCTION) { 14761 } else if (kind() == OPTIMIZED_FUNCTION) {
14762 DeoptimizationInputData* data = 14762 DeoptimizationInputData* data =
14763 DeoptimizationInputData::cast(this->deoptimization_data()); 14763 DeoptimizationInputData::cast(this->deoptimization_data());
14764 data->DeoptimizationInputDataPrint(os); 14764 data->DeoptimizationInputDataPrint(os);
14765 } 14765 }
14766 os << "\n"; 14766 os << "\n";
14767 14767
14768 if (is_crankshafted()) { 14768 if (is_crankshafted()) {
14769 SafepointTable table(this); 14769 SafepointTable table(this);
14770 os << "Safepoints (size = " << table.size() << ")\n"; 14770 os << "Safepoints (size = " << table.size() << ")\n";
14771 for (unsigned i = 0; i < table.length(); i++) { 14771 for (unsigned i = 0; i < table.length(); i++) {
14772 unsigned pc_offset = table.GetPcOffset(i); 14772 unsigned pc_offset = table.GetPcOffset(i);
14773 os << static_cast<const void*>(instruction_start() + pc_offset) << " "; 14773 os << static_cast<const void*>(instruction_start() + pc_offset) << " ";
14774 os << std::setw(4) << pc_offset << " "; 14774 os << std::setw(4) << std::hex << pc_offset << std::dec << " ";
14775 table.PrintEntry(i, os); 14775 table.PrintEntry(i, os);
14776 os << " (sp -> fp) "; 14776 os << " (sp -> fp) ";
14777 SafepointEntry entry = table.GetEntry(i); 14777 SafepointEntry entry = table.GetEntry(i);
14778 if (entry.deoptimization_index() != Safepoint::kNoDeoptimizationIndex) { 14778 if (entry.deoptimization_index() != Safepoint::kNoDeoptimizationIndex) {
14779 os << std::setw(6) << entry.deoptimization_index(); 14779 os << std::setw(6) << entry.deoptimization_index();
14780 } else { 14780 } else {
14781 os << "<none>"; 14781 os << "<none>";
14782 } 14782 }
14783 if (entry.argument_count() > 0) { 14783 if (entry.argument_count() > 0) {
14784 os << " argc: " << entry.argument_count(); 14784 os << " argc: " << entry.argument_count();
14785 } 14785 }
14786 os << "\n"; 14786 os << "\n";
14787 } 14787 }
14788 os << "\n"; 14788 os << "\n";
14789 } else if (kind() == FUNCTION) { 14789 } else if (kind() == FUNCTION) {
14790 unsigned offset = back_edge_table_offset(); 14790 unsigned offset = back_edge_table_offset();
14791 // If there is no back edge table, the "table start" will be at or after 14791 // If there is no back edge table, the "table start" will be at or after
14792 // (due to alignment) the end of the instruction stream. 14792 // (due to alignment) the end of the instruction stream.
14793 if (static_cast<int>(offset) < instruction_size()) { 14793 if (static_cast<int>(offset) < instruction_size()) {
14794 DisallowHeapAllocation no_gc; 14794 DisallowHeapAllocation no_gc;
14795 BackEdgeTable back_edges(this, &no_gc); 14795 BackEdgeTable back_edges(this, &no_gc);
14796 14796
14797 os << "Back edges (size = " << back_edges.length() << ")\n"; 14797 os << "Back edges (size = " << back_edges.length() << ")\n";
14798 os << "ast_id pc_offset loop_depth\n"; 14798 os << "ast_id pc_offset loop_depth\n";
14799 14799
14800 for (uint32_t i = 0; i < back_edges.length(); i++) { 14800 for (uint32_t i = 0; i < back_edges.length(); i++) {
14801 os << std::setw(6) << back_edges.ast_id(i).ToInt() << " " 14801 os << std::setw(6) << back_edges.ast_id(i).ToInt() << " "
14802 << std::setw(9) << back_edges.pc_offset(i) << " " << std::setw(10) 14802 << std::setw(9) << std::hex << back_edges.pc_offset(i) << std::dec
14803 << back_edges.loop_depth(i) << "\n"; 14803 << " " << std::setw(10) << back_edges.loop_depth(i) << "\n";
14804 } 14804 }
14805 14805
14806 os << "\n"; 14806 os << "\n";
14807 } 14807 }
14808 #ifdef OBJECT_PRINT 14808 #ifdef OBJECT_PRINT
14809 if (!type_feedback_info()->IsUndefined(GetIsolate())) { 14809 if (!type_feedback_info()->IsUndefined(GetIsolate())) {
14810 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(os); 14810 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(os);
14811 os << "\n"; 14811 os << "\n";
14812 } 14812 }
14813 #endif 14813 #endif
(...skipping 5580 matching lines...) Expand 10 before | Expand all | Expand 10 after
20394 // depend on this. 20394 // depend on this.
20395 return DICTIONARY_ELEMENTS; 20395 return DICTIONARY_ELEMENTS;
20396 } 20396 }
20397 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20397 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20398 return kind; 20398 return kind;
20399 } 20399 }
20400 } 20400 }
20401 20401
20402 } // namespace internal 20402 } // namespace internal
20403 } // namespace v8 20403 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698