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 5871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5882 LifetimePosition::FromInstructionIndex(first_index).Value()); | 5882 LifetimePosition::FromInstructionIndex(first_index).Value()); |
5883 PrintIntProperty( | 5883 PrintIntProperty( |
5884 "last_lir_id", | 5884 "last_lir_id", |
5885 LifetimePosition::FromInstructionIndex(last_index).Value()); | 5885 LifetimePosition::FromInstructionIndex(last_index).Value()); |
5886 } | 5886 } |
5887 | 5887 |
5888 { | 5888 { |
5889 Tag states_tag(this, "states"); | 5889 Tag states_tag(this, "states"); |
5890 Tag locals_tag(this, "locals"); | 5890 Tag locals_tag(this, "locals"); |
5891 int total = current->phis()->length(); | 5891 int total = current->phis()->length(); |
5892 trace_.Add("size %d\n", total); | 5892 PrintIntProperty("size", current->phis()->length()); |
5893 trace_.Add("method \"None\""); | 5893 PrintStringProperty("method", "None"); |
5894 for (int j = 0; j < total; ++j) { | 5894 for (int j = 0; j < total; ++j) { |
5895 HPhi* phi = current->phis()->at(j); | 5895 HPhi* phi = current->phis()->at(j); |
| 5896 PrintIndent(); |
5896 trace_.Add("%d ", phi->merged_index()); | 5897 trace_.Add("%d ", phi->merged_index()); |
5897 phi->PrintNameTo(&trace_); | 5898 phi->PrintNameTo(&trace_); |
5898 trace_.Add(" "); | 5899 trace_.Add(" "); |
5899 phi->PrintTo(&trace_); | 5900 phi->PrintTo(&trace_); |
5900 trace_.Add("\n"); | 5901 trace_.Add("\n"); |
5901 } | 5902 } |
5902 } | 5903 } |
5903 | 5904 |
5904 { | 5905 { |
5905 Tag HIR_tag(this, "HIR"); | 5906 Tag HIR_tag(this, "HIR"); |
5906 HInstruction* instruction = current->first(); | 5907 HInstruction* instruction = current->first(); |
5907 while (instruction != NULL) { | 5908 while (instruction != NULL) { |
5908 int bci = 0; | 5909 int bci = 0; |
5909 int uses = instruction->UseCount(); | 5910 int uses = instruction->UseCount(); |
| 5911 PrintIndent(); |
5910 trace_.Add("%d %d ", bci, uses); | 5912 trace_.Add("%d %d ", bci, uses); |
5911 instruction->PrintNameTo(&trace_); | 5913 instruction->PrintNameTo(&trace_); |
5912 trace_.Add(" "); | 5914 trace_.Add(" "); |
5913 instruction->PrintTo(&trace_); | 5915 instruction->PrintTo(&trace_); |
5914 trace_.Add(" <|@\n"); | 5916 trace_.Add(" <|@\n"); |
5915 instruction = instruction->next(); | 5917 instruction = instruction->next(); |
5916 } | 5918 } |
5917 } | 5919 } |
5918 | 5920 |
5919 | 5921 |
5920 if (chunk != NULL) { | 5922 if (chunk != NULL) { |
5921 Tag LIR_tag(this, "LIR"); | 5923 Tag LIR_tag(this, "LIR"); |
5922 int first_index = current->first_instruction_index(); | 5924 int first_index = current->first_instruction_index(); |
5923 int last_index = current->last_instruction_index(); | 5925 int last_index = current->last_instruction_index(); |
5924 if (first_index != -1 && last_index != -1) { | 5926 if (first_index != -1 && last_index != -1) { |
5925 const ZoneList<LInstruction*>* instructions = chunk->instructions(); | 5927 const ZoneList<LInstruction*>* instructions = chunk->instructions(); |
5926 for (int i = first_index; i <= last_index; ++i) { | 5928 for (int i = first_index; i <= last_index; ++i) { |
5927 LInstruction* linstr = instructions->at(i); | 5929 LInstruction* linstr = instructions->at(i); |
5928 if (linstr != NULL) { | 5930 if (linstr != NULL) { |
| 5931 PrintIndent(); |
5929 trace_.Add("%d ", | 5932 trace_.Add("%d ", |
5930 LifetimePosition::FromInstructionIndex(i).Value()); | 5933 LifetimePosition::FromInstructionIndex(i).Value()); |
5931 linstr->PrintTo(&trace_); | 5934 linstr->PrintTo(&trace_); |
5932 trace_.Add(" <|@\n"); | 5935 trace_.Add(" <|@\n"); |
5933 } | 5936 } |
5934 } | 5937 } |
5935 } | 5938 } |
5936 } | 5939 } |
5937 } | 5940 } |
5938 } | 5941 } |
(...skipping 15 matching lines...) Expand all Loading... |
5954 | 5957 |
5955 const ZoneList<LiveRange*>* live_ranges = allocator->live_ranges(); | 5958 const ZoneList<LiveRange*>* live_ranges = allocator->live_ranges(); |
5956 for (int i = 0; i < live_ranges->length(); ++i) { | 5959 for (int i = 0; i < live_ranges->length(); ++i) { |
5957 TraceLiveRange(live_ranges->at(i), "object"); | 5960 TraceLiveRange(live_ranges->at(i), "object"); |
5958 } | 5961 } |
5959 } | 5962 } |
5960 | 5963 |
5961 | 5964 |
5962 void HTracer::TraceLiveRange(LiveRange* range, const char* type) { | 5965 void HTracer::TraceLiveRange(LiveRange* range, const char* type) { |
5963 if (range != NULL && !range->IsEmpty()) { | 5966 if (range != NULL && !range->IsEmpty()) { |
| 5967 PrintIndent(); |
5964 trace_.Add("%d %s", range->id(), type); | 5968 trace_.Add("%d %s", range->id(), type); |
5965 if (range->HasRegisterAssigned()) { | 5969 if (range->HasRegisterAssigned()) { |
5966 LOperand* op = range->CreateAssignedOperand(); | 5970 LOperand* op = range->CreateAssignedOperand(); |
5967 int assigned_reg = op->index(); | 5971 int assigned_reg = op->index(); |
5968 if (op->IsDoubleRegister()) { | 5972 if (op->IsDoubleRegister()) { |
5969 trace_.Add(" \"%s\"", | 5973 trace_.Add(" \"%s\"", |
5970 DoubleRegister::AllocationIndexToString(assigned_reg)); | 5974 DoubleRegister::AllocationIndexToString(assigned_reg)); |
5971 } else { | 5975 } else { |
5972 ASSERT(op->IsRegister()); | 5976 ASSERT(op->IsRegister()); |
5973 trace_.Add(" \"%s\"", Register::AllocationIndexToString(assigned_reg)); | 5977 trace_.Add(" \"%s\"", Register::AllocationIndexToString(assigned_reg)); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6113 } | 6117 } |
6114 } | 6118 } |
6115 | 6119 |
6116 #ifdef DEBUG | 6120 #ifdef DEBUG |
6117 if (graph_ != NULL) graph_->Verify(); | 6121 if (graph_ != NULL) graph_->Verify(); |
6118 if (allocator_ != NULL) allocator_->Verify(); | 6122 if (allocator_ != NULL) allocator_->Verify(); |
6119 #endif | 6123 #endif |
6120 } | 6124 } |
6121 | 6125 |
6122 } } // namespace v8::internal | 6126 } } // namespace v8::internal |
OLD | NEW |