| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "accessors.h" | 7 #include "accessors.h" |
| 8 #include "allocation-site-scopes.h" | 8 #include "allocation-site-scopes.h" |
| 9 #include "api.h" | 9 #include "api.h" |
| 10 #include "arguments.h" | 10 #include "arguments.h" |
| (...skipping 10685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10696 PrintF(", reason: %s]\n", GetBailoutReason(reason)); | 10696 PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
| 10697 } | 10697 } |
| 10698 } | 10698 } |
| 10699 | 10699 |
| 10700 | 10700 |
| 10701 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 10701 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
| 10702 ASSERT(!id.IsNone()); | 10702 ASSERT(!id.IsNone()); |
| 10703 Code* unoptimized = code(); | 10703 Code* unoptimized = code(); |
| 10704 DeoptimizationOutputData* data = | 10704 DeoptimizationOutputData* data = |
| 10705 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 10705 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
| 10706 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 10706 unsigned ignore = Deoptimizer::GetOutputInfoIndex(data, id, this); |
| 10707 USE(ignore); | 10707 USE(ignore); |
| 10708 return true; // Return true if there was no ASSERT. | 10708 return true; // Return true if there was no ASSERT. |
| 10709 } | 10709 } |
| 10710 | 10710 |
| 10711 | 10711 |
| 10712 #if defined(COMPARE_OPT_STACK_HEIGHT) |
| 10713 int SharedFunctionInfo::GetExpectedStackHeight(BailoutId id) { |
| 10714 ASSERT(!id.IsNone()); |
| 10715 Code* unoptimized = code(); |
| 10716 DeoptimizationOutputData* data = |
| 10717 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
| 10718 return Deoptimizer::GetOutputInfoStackHeight(data, id, this); |
| 10719 } |
| 10720 #endif |
| 10721 |
| 10712 void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) { | 10722 void SharedFunctionInfo::StartInobjectSlackTracking(Map* map) { |
| 10713 ASSERT(!IsInobjectSlackTrackingInProgress()); | 10723 ASSERT(!IsInobjectSlackTrackingInProgress()); |
| 10714 | 10724 |
| 10715 if (!FLAG_clever_optimizations) return; | 10725 if (!FLAG_clever_optimizations) return; |
| 10716 | 10726 |
| 10717 // Only initiate the tracking the first time. | 10727 // Only initiate the tracking the first time. |
| 10718 if (live_objects_may_exist()) return; | 10728 if (live_objects_may_exist()) return; |
| 10719 set_live_objects_may_exist(true); | 10729 set_live_objects_may_exist(true); |
| 10720 | 10730 |
| 10721 // No tracking during the snapshot construction phase. | 10731 // No tracking during the snapshot construction phase. |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11609 } | 11619 } |
| 11610 } | 11620 } |
| 11611 } | 11621 } |
| 11612 | 11622 |
| 11613 | 11623 |
| 11614 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { | 11624 void DeoptimizationOutputData::DeoptimizationOutputDataPrint(FILE* out) { |
| 11615 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", | 11625 PrintF(out, "Deoptimization Output Data (deopt points = %d)\n", |
| 11616 this->DeoptPoints()); | 11626 this->DeoptPoints()); |
| 11617 if (this->DeoptPoints() == 0) return; | 11627 if (this->DeoptPoints() == 0) return; |
| 11618 | 11628 |
| 11629 #if defined(COMPARE_OPT_STACK_HEIGHT) |
| 11630 PrintF(out, "%6s %8s %15s %s\n", "ast id", "pc", "state", "stack height"); |
| 11631 for (int i = 0; i < this->DeoptPoints(); i++) { |
| 11632 int pc_and_state = this->PcAndState(i)->value(); |
| 11633 PrintF(out, "%6d %8d %15s %i\n", |
| 11634 this->AstId(i).ToInt(), |
| 11635 FullCodeGenerator::PcField::decode(pc_and_state), |
| 11636 FullCodeGenerator::State2String( |
| 11637 FullCodeGenerator::StateField::decode(pc_and_state)), |
| 11638 this->StackHeight(i)->value()); |
| 11639 } |
| 11640 #else |
| 11619 PrintF(out, "%6s %8s %s\n", "ast id", "pc", "state"); | 11641 PrintF(out, "%6s %8s %s\n", "ast id", "pc", "state"); |
| 11620 for (int i = 0; i < this->DeoptPoints(); i++) { | 11642 for (int i = 0; i < this->DeoptPoints(); i++) { |
| 11621 int pc_and_state = this->PcAndState(i)->value(); | 11643 int pc_and_state = this->PcAndState(i)->value(); |
| 11622 PrintF(out, "%6d %8d %s\n", | 11644 PrintF(out, "%6d %8d %s\n", |
| 11623 this->AstId(i).ToInt(), | 11645 this->AstId(i).ToInt(), |
| 11624 FullCodeGenerator::PcField::decode(pc_and_state), | 11646 FullCodeGenerator::PcField::decode(pc_and_state), |
| 11625 FullCodeGenerator::State2String( | 11647 FullCodeGenerator::State2String( |
| 11626 FullCodeGenerator::StateField::decode(pc_and_state))); | 11648 FullCodeGenerator::StateField::decode(pc_and_state))); |
| 11627 } | 11649 } |
| 11650 #endif |
| 11628 } | 11651 } |
| 11629 | 11652 |
| 11630 | 11653 |
| 11631 const char* Code::ICState2String(InlineCacheState state) { | 11654 const char* Code::ICState2String(InlineCacheState state) { |
| 11632 switch (state) { | 11655 switch (state) { |
| 11633 case UNINITIALIZED: return "UNINITIALIZED"; | 11656 case UNINITIALIZED: return "UNINITIALIZED"; |
| 11634 case PREMONOMORPHIC: return "PREMONOMORPHIC"; | 11657 case PREMONOMORPHIC: return "PREMONOMORPHIC"; |
| 11635 case MONOMORPHIC: return "MONOMORPHIC"; | 11658 case MONOMORPHIC: return "MONOMORPHIC"; |
| 11636 case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE"; | 11659 case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE"; |
| 11637 case POLYMORPHIC: return "POLYMORPHIC"; | 11660 case POLYMORPHIC: return "POLYMORPHIC"; |
| (...skipping 5590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17228 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17251 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 17229 static const char* error_messages_[] = { | 17252 static const char* error_messages_[] = { |
| 17230 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17253 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 17231 }; | 17254 }; |
| 17232 #undef ERROR_MESSAGES_TEXTS | 17255 #undef ERROR_MESSAGES_TEXTS |
| 17233 return error_messages_[reason]; | 17256 return error_messages_[reason]; |
| 17234 } | 17257 } |
| 17235 | 17258 |
| 17236 | 17259 |
| 17237 } } // namespace v8::internal | 17260 } } // namespace v8::internal |
| OLD | NEW |