OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 10682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10693 CODE_AGE_LIST(HANDLE_CODE_AGE) | 10693 CODE_AGE_LIST(HANDLE_CODE_AGE) |
10694 #undef HANDLE_CODE_AGE | 10694 #undef HANDLE_CODE_AGE |
10695 default: | 10695 default: |
10696 UNREACHABLE(); | 10696 UNREACHABLE(); |
10697 break; | 10697 break; |
10698 } | 10698 } |
10699 return NULL; | 10699 return NULL; |
10700 } | 10700 } |
10701 | 10701 |
10702 | 10702 |
10703 void Code::PrintDeoptLocation(int bailout_id) { | 10703 void Code::PrintDeoptLocation(FILE* out, int bailout_id) { |
10704 const char* last_comment = NULL; | 10704 const char* last_comment = NULL; |
10705 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) | 10705 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT) |
10706 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); | 10706 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); |
10707 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10707 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
10708 RelocInfo* info = it.rinfo(); | 10708 RelocInfo* info = it.rinfo(); |
10709 if (info->rmode() == RelocInfo::COMMENT) { | 10709 if (info->rmode() == RelocInfo::COMMENT) { |
10710 last_comment = reinterpret_cast<const char*>(info->data()); | 10710 last_comment = reinterpret_cast<const char*>(info->data()); |
10711 } else if (last_comment != NULL) { | 10711 } else if (last_comment != NULL) { |
10712 if ((bailout_id == Deoptimizer::GetDeoptimizationId( | 10712 if ((bailout_id == Deoptimizer::GetDeoptimizationId( |
10713 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || | 10713 GetIsolate(), info->target_address(), Deoptimizer::EAGER)) || |
10714 (bailout_id == Deoptimizer::GetDeoptimizationId( | 10714 (bailout_id == Deoptimizer::GetDeoptimizationId( |
10715 GetIsolate(), info->target_address(), Deoptimizer::SOFT))) { | 10715 GetIsolate(), info->target_address(), Deoptimizer::SOFT))) { |
10716 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); | 10716 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); |
10717 PrintF(" %s\n", last_comment); | 10717 PrintF(out, " %s\n", last_comment); |
10718 return; | 10718 return; |
10719 } | 10719 } |
10720 } | 10720 } |
10721 } | 10721 } |
10722 } | 10722 } |
10723 | 10723 |
10724 | 10724 |
10725 bool Code::CanDeoptAt(Address pc) { | 10725 bool Code::CanDeoptAt(Address pc) { |
10726 DeoptimizationInputData* deopt_data = | 10726 DeoptimizationInputData* deopt_data = |
10727 DeoptimizationInputData::cast(deoptimization_data()); | 10727 DeoptimizationInputData::cast(deoptimization_data()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10909 } | 10909 } |
10910 } | 10910 } |
10911 } | 10911 } |
10912 | 10912 |
10913 | 10913 |
10914 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { | 10914 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { |
10915 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", | 10915 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", |
10916 this->DeoptPoints()); | 10916 this->DeoptPoints()); |
10917 if (this->DeoptPoints() == 0) return; | 10917 if (this->DeoptPoints() == 0) return; |
10918 | 10918 |
10919 PrintF("%6s %8s %s\n", "ast id", "pc", "state"); | 10919 PrintF(out, "%6s %8s %s\n", "ast id", "pc", "state"); |
10920 for (int i = 0; i < this->DeoptPoints(); i++) { | 10920 for (int i = 0; i < this->DeoptPoints(); i++) { |
10921 int pc_and_state = this->PcAndState(i)->value(); | 10921 int pc_and_state = this->PcAndState(i)->value(); |
10922 PrintF("%6d %8d %s\n", | 10922 PrintF(out, "%6d %8d %s\n", |
10923 this->AstId(i).ToInt(), | 10923 this->AstId(i).ToInt(), |
10924 FullCodeGenerator::PcField::decode(pc_and_state), | 10924 FullCodeGenerator::PcField::decode(pc_and_state), |
10925 FullCodeGenerator::State2String( | 10925 FullCodeGenerator::State2String( |
10926 FullCodeGenerator::StateField::decode(pc_and_state))); | 10926 FullCodeGenerator::StateField::decode(pc_and_state))); |
10927 } | 10927 } |
10928 } | 10928 } |
10929 | 10929 |
10930 | 10930 |
10931 const char* Code::ICState2String(InlineCacheState state) { | 10931 const char* Code::ICState2String(InlineCacheState state) { |
10932 switch (state) { | 10932 switch (state) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11023 | 11023 |
11024 if (kind() == FUNCTION) { | 11024 if (kind() == FUNCTION) { |
11025 DeoptimizationOutputData* data = | 11025 DeoptimizationOutputData* data = |
11026 DeoptimizationOutputData::cast(this->deoptimization_data()); | 11026 DeoptimizationOutputData::cast(this->deoptimization_data()); |
11027 data->DeoptimizationOutputDataPrint(out); | 11027 data->DeoptimizationOutputDataPrint(out); |
11028 } else if (kind() == OPTIMIZED_FUNCTION) { | 11028 } else if (kind() == OPTIMIZED_FUNCTION) { |
11029 DeoptimizationInputData* data = | 11029 DeoptimizationInputData* data = |
11030 DeoptimizationInputData::cast(this->deoptimization_data()); | 11030 DeoptimizationInputData::cast(this->deoptimization_data()); |
11031 data->DeoptimizationInputDataPrint(out); | 11031 data->DeoptimizationInputDataPrint(out); |
11032 } | 11032 } |
11033 PrintF("\n"); | 11033 PrintF(out, "\n"); |
11034 | 11034 |
11035 if (is_crankshafted()) { | 11035 if (is_crankshafted()) { |
11036 SafepointTable table(this); | 11036 SafepointTable table(this); |
11037 PrintF(out, "Safepoints (size = %u)\n", table.size()); | 11037 PrintF(out, "Safepoints (size = %u)\n", table.size()); |
11038 for (unsigned i = 0; i < table.length(); i++) { | 11038 for (unsigned i = 0; i < table.length(); i++) { |
11039 unsigned pc_offset = table.GetPcOffset(i); | 11039 unsigned pc_offset = table.GetPcOffset(i); |
11040 PrintF(out, "%p %4d ", (instruction_start() + pc_offset), pc_offset); | 11040 PrintF(out, "%p %4d ", (instruction_start() + pc_offset), pc_offset); |
11041 table.PrintEntry(i); | 11041 table.PrintEntry(i, out); |
11042 PrintF(out, " (sp -> fp)"); | 11042 PrintF(out, " (sp -> fp)"); |
11043 SafepointEntry entry = table.GetEntry(i); | 11043 SafepointEntry entry = table.GetEntry(i); |
11044 if (entry.deoptimization_index() != Safepoint::kNoDeoptimizationIndex) { | 11044 if (entry.deoptimization_index() != Safepoint::kNoDeoptimizationIndex) { |
11045 PrintF(out, " %6d", entry.deoptimization_index()); | 11045 PrintF(out, " %6d", entry.deoptimization_index()); |
11046 } else { | 11046 } else { |
11047 PrintF(out, " <none>"); | 11047 PrintF(out, " <none>"); |
11048 } | 11048 } |
11049 if (entry.argument_count() > 0) { | 11049 if (entry.argument_count() > 0) { |
11050 PrintF(out, " argc: %d", entry.argument_count()); | 11050 PrintF(out, " argc: %d", entry.argument_count()); |
11051 } | 11051 } |
(...skipping 20 matching lines...) Expand all Loading... |
11072 PrintF(out, "\n"); | 11072 PrintF(out, "\n"); |
11073 } | 11073 } |
11074 #ifdef OBJECT_PRINT | 11074 #ifdef OBJECT_PRINT |
11075 if (!type_feedback_info()->IsUndefined()) { | 11075 if (!type_feedback_info()->IsUndefined()) { |
11076 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out); | 11076 TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out); |
11077 PrintF(out, "\n"); | 11077 PrintF(out, "\n"); |
11078 } | 11078 } |
11079 #endif | 11079 #endif |
11080 } | 11080 } |
11081 | 11081 |
11082 PrintF("RelocInfo (size = %d)\n", relocation_size()); | 11082 PrintF(out, "RelocInfo (size = %d)\n", relocation_size()); |
11083 for (RelocIterator it(this); !it.done(); it.next()) { | 11083 for (RelocIterator it(this); !it.done(); it.next()) { |
11084 it.rinfo()->Print(GetIsolate(), out); | 11084 it.rinfo()->Print(GetIsolate(), out); |
11085 } | 11085 } |
11086 PrintF(out, "\n"); | 11086 PrintF(out, "\n"); |
11087 } | 11087 } |
11088 #endif // ENABLE_DISASSEMBLER | 11088 #endif // ENABLE_DISASSEMBLER |
11089 | 11089 |
11090 | 11090 |
11091 MaybeObject* JSObject::SetFastElementsCapacityAndLength( | 11091 MaybeObject* JSObject::SetFastElementsCapacityAndLength( |
11092 int capacity, | 11092 int capacity, |
(...skipping 5276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16369 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16369 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16370 static const char* error_messages_[] = { | 16370 static const char* error_messages_[] = { |
16371 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16371 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16372 }; | 16372 }; |
16373 #undef ERROR_MESSAGES_TEXTS | 16373 #undef ERROR_MESSAGES_TEXTS |
16374 return error_messages_[reason]; | 16374 return error_messages_[reason]; |
16375 } | 16375 } |
16376 | 16376 |
16377 | 16377 |
16378 } } // namespace v8::internal | 16378 } } // namespace v8::internal |
OLD | NEW |