OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6108 isolate()->PrintStack(stdout); | 6108 isolate()->PrintStack(stdout); |
6109 AllSpaces spaces(this); | 6109 AllSpaces spaces(this); |
6110 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 6110 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
6111 space->Print(); | 6111 space->Print(); |
6112 } | 6112 } |
6113 } | 6113 } |
6114 | 6114 |
6115 | 6115 |
6116 void Heap::ReportCodeStatistics(const char* title) { | 6116 void Heap::ReportCodeStatistics(const char* title) { |
6117 PrintF(">>>>>> Code Stats (%s) >>>>>>\n", title); | 6117 PrintF(">>>>>> Code Stats (%s) >>>>>>\n", title); |
6118 PagedSpace::ResetCodeStatistics(); | 6118 PagedSpace::ResetCodeStatistics(isolate()); |
6119 // We do not look for code in new space, map space, or old space. If code | 6119 // We do not look for code in new space, map space, or old space. If code |
6120 // somehow ends up in those spaces, we would miss it here. | 6120 // somehow ends up in those spaces, we would miss it here. |
6121 code_space_->CollectCodeStatistics(); | 6121 code_space_->CollectCodeStatistics(); |
6122 lo_space_->CollectCodeStatistics(); | 6122 lo_space_->CollectCodeStatistics(); |
6123 PagedSpace::ReportCodeStatistics(); | 6123 PagedSpace::ReportCodeStatistics(isolate()); |
6124 } | 6124 } |
6125 | 6125 |
6126 | 6126 |
6127 // This function expects that NewSpace's allocated objects histogram is | 6127 // This function expects that NewSpace's allocated objects histogram is |
6128 // populated (via a call to CollectStatistics or else as a side effect of a | 6128 // populated (via a call to CollectStatistics or else as a side effect of a |
6129 // just-completed scavenge collection). | 6129 // just-completed scavenge collection). |
6130 void Heap::ReportHeapStatistics(const char* title) { | 6130 void Heap::ReportHeapStatistics(const char* title) { |
6131 USE(title); | 6131 USE(title); |
6132 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", | 6132 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", |
6133 title, gc_count_); | 6133 title, gc_count_); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6628 v->Synchronize(VisitorSynchronization::kThreadManager); | 6628 v->Synchronize(VisitorSynchronization::kThreadManager); |
6629 | 6629 |
6630 // Iterate over the pointers the Serialization/Deserialization code is | 6630 // Iterate over the pointers the Serialization/Deserialization code is |
6631 // holding. | 6631 // holding. |
6632 // During garbage collection this keeps the partial snapshot cache alive. | 6632 // During garbage collection this keeps the partial snapshot cache alive. |
6633 // During deserialization of the startup snapshot this creates the partial | 6633 // During deserialization of the startup snapshot this creates the partial |
6634 // snapshot cache and deserializes the objects it refers to. During | 6634 // snapshot cache and deserializes the objects it refers to. During |
6635 // serialization this does nothing, since the partial snapshot cache is | 6635 // serialization this does nothing, since the partial snapshot cache is |
6636 // empty. However the next thing we do is create the partial snapshot, | 6636 // empty. However the next thing we do is create the partial snapshot, |
6637 // filling up the partial snapshot cache with objects it needs as we go. | 6637 // filling up the partial snapshot cache with objects it needs as we go. |
6638 SerializerDeserializer::Iterate(v); | 6638 SerializerDeserializer::Iterate(isolate_, v); |
6639 // We don't do a v->Synchronize call here, because in debug mode that will | 6639 // We don't do a v->Synchronize call here, because in debug mode that will |
6640 // output a flag to the snapshot. However at this point the serializer and | 6640 // output a flag to the snapshot. However at this point the serializer and |
6641 // deserializer are deliberately a little unsynchronized (see above) so the | 6641 // deserializer are deliberately a little unsynchronized (see above) so the |
6642 // checking of the sync flag in the snapshot would fail. | 6642 // checking of the sync flag in the snapshot would fail. |
6643 } | 6643 } |
6644 | 6644 |
6645 | 6645 |
6646 // TODO(1236194): Since the heap size is configurable on the command line | 6646 // TODO(1236194): Since the heap size is configurable on the command line |
6647 // and through the API, we should gracefully handle the case that the heap | 6647 // and through the API, we should gracefully handle the case that the heap |
6648 // size is not big enough to fit all the initial objects. | 6648 // size is not big enough to fit all the initial objects. |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8059 if (FLAG_concurrent_recompilation) { | 8059 if (FLAG_concurrent_recompilation) { |
8060 heap_->relocation_mutex_->Lock(); | 8060 heap_->relocation_mutex_->Lock(); |
8061 #ifdef DEBUG | 8061 #ifdef DEBUG |
8062 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8062 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
8063 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8063 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
8064 #endif // DEBUG | 8064 #endif // DEBUG |
8065 } | 8065 } |
8066 } | 8066 } |
8067 | 8067 |
8068 } } // namespace v8::internal | 8068 } } // namespace v8::internal |
OLD | NEW |