OLD | NEW |
1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-2010 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 void HeapProfiler::ObjectMoveEvent(Address from, Address to) { | 467 void HeapProfiler::ObjectMoveEvent(Address from, Address to) { |
468 snapshots_->ObjectMoveEvent(from, to); | 468 snapshots_->ObjectMoveEvent(from, to); |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 const JSObjectsClusterTreeConfig::Key JSObjectsClusterTreeConfig::kNoKey; | 472 const JSObjectsClusterTreeConfig::Key JSObjectsClusterTreeConfig::kNoKey; |
473 const JSObjectsClusterTreeConfig::Value JSObjectsClusterTreeConfig::kNoValue; | 473 const JSObjectsClusterTreeConfig::Value JSObjectsClusterTreeConfig::kNoValue; |
474 | 474 |
475 | 475 |
476 ConstructorHeapProfile::ConstructorHeapProfile() | 476 ConstructorHeapProfile::ConstructorHeapProfile() |
477 : zscope_(DELETE_ON_EXIT) { | 477 : zscope_(Isolate::Current(), DELETE_ON_EXIT) { |
478 } | 478 } |
479 | 479 |
480 | 480 |
481 void ConstructorHeapProfile::Call(const JSObjectsCluster& cluster, | 481 void ConstructorHeapProfile::Call(const JSObjectsCluster& cluster, |
482 const NumberAndSizeInfo& number_and_size) { | 482 const NumberAndSizeInfo& number_and_size) { |
483 HeapStringAllocator allocator; | 483 HeapStringAllocator allocator; |
484 StringStream stream(&allocator); | 484 StringStream stream(&allocator); |
485 cluster.Print(&stream); | 485 cluster.Print(&stream); |
486 LOG(ISOLATE, | 486 LOG(ISOLATE, |
487 HeapSampleJSConstructorEvent(*(stream.ToCString()), | 487 HeapSampleJSConstructorEvent(*(stream.ToCString()), |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 if (a.refs.length() > b.refs.length()) return 1; | 577 if (a.refs.length() > b.refs.length()) return 1; |
578 for (int i = 0; i < a.refs.length(); ++i) { | 578 for (int i = 0; i < a.refs.length(); ++i) { |
579 int cmp = JSObjectsCluster::Compare(a.refs[i], b.refs[i]); | 579 int cmp = JSObjectsCluster::Compare(a.refs[i], b.refs[i]); |
580 if (cmp != 0) return cmp; | 580 if (cmp != 0) return cmp; |
581 } | 581 } |
582 return 0; | 582 return 0; |
583 } | 583 } |
584 | 584 |
585 | 585 |
586 ClustersCoarser::ClustersCoarser() | 586 ClustersCoarser::ClustersCoarser() |
587 : zscope_(DELETE_ON_EXIT), | 587 : zscope_(Isolate::Current(), DELETE_ON_EXIT), |
588 sim_list_(ClustersCoarser::kInitialSimilarityListCapacity), | 588 sim_list_(ClustersCoarser::kInitialSimilarityListCapacity), |
589 current_pair_(NULL), | 589 current_pair_(NULL), |
590 current_set_(NULL), | 590 current_set_(NULL), |
591 self_(NULL) { | 591 self_(NULL) { |
592 } | 592 } |
593 | 593 |
594 | 594 |
595 void ClustersCoarser::Call(const JSObjectsCluster& cluster, | 595 void ClustersCoarser::Call(const JSObjectsCluster& cluster, |
596 JSObjectsClusterTree* tree) { | 596 JSObjectsClusterTree* tree) { |
597 if (!cluster.can_be_coarsed()) return; | 597 if (!cluster.can_be_coarsed()) return; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 | 692 |
693 | 693 |
694 const JSObjectsCluster ClustersCoarser::ClusterEqualityConfig::kNoKey; | 694 const JSObjectsCluster ClustersCoarser::ClusterEqualityConfig::kNoKey; |
695 const JSObjectsCluster ClustersCoarser::ClusterEqualityConfig::kNoValue; | 695 const JSObjectsCluster ClustersCoarser::ClusterEqualityConfig::kNoValue; |
696 const JSObjectsRetainerTreeConfig::Key JSObjectsRetainerTreeConfig::kNoKey; | 696 const JSObjectsRetainerTreeConfig::Key JSObjectsRetainerTreeConfig::kNoKey; |
697 const JSObjectsRetainerTreeConfig::Value JSObjectsRetainerTreeConfig::kNoValue = | 697 const JSObjectsRetainerTreeConfig::Value JSObjectsRetainerTreeConfig::kNoValue = |
698 NULL; | 698 NULL; |
699 | 699 |
700 | 700 |
701 RetainerHeapProfile::RetainerHeapProfile() | 701 RetainerHeapProfile::RetainerHeapProfile() |
702 : zscope_(DELETE_ON_EXIT), | 702 : zscope_(Isolate::Current(), DELETE_ON_EXIT), |
703 aggregator_(NULL) { | 703 aggregator_(NULL) { |
704 JSObjectsCluster roots(JSObjectsCluster::ROOTS); | 704 JSObjectsCluster roots(JSObjectsCluster::ROOTS); |
705 ReferencesExtractor extractor(roots, this); | 705 ReferencesExtractor extractor(roots, this); |
706 HEAP->IterateRoots(&extractor, VISIT_ONLY_STRONG); | 706 HEAP->IterateRoots(&extractor, VISIT_ONLY_STRONG); |
707 } | 707 } |
708 | 708 |
709 | 709 |
710 RetainerHeapProfile::~RetainerHeapProfile() { | 710 RetainerHeapProfile::~RetainerHeapProfile() { |
711 delete aggregator_; | 711 delete aggregator_; |
712 } | 712 } |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 explicit AggregatingRetainerTreeIterator(ClustersCoarser* coarser, | 1020 explicit AggregatingRetainerTreeIterator(ClustersCoarser* coarser, |
1021 HeapEntriesAllocator* allocator, | 1021 HeapEntriesAllocator* allocator, |
1022 HeapEntriesMap* map) | 1022 HeapEntriesMap* map) |
1023 : coarser_(coarser), allocator_(allocator), map_(map) { | 1023 : coarser_(coarser), allocator_(allocator), map_(map) { |
1024 } | 1024 } |
1025 | 1025 |
1026 void Call(const JSObjectsCluster& cluster, JSObjectsClusterTree* tree) { | 1026 void Call(const JSObjectsCluster& cluster, JSObjectsClusterTree* tree) { |
1027 if (coarser_ != NULL && | 1027 if (coarser_ != NULL && |
1028 !coarser_->GetCoarseEquivalent(cluster).is_null()) return; | 1028 !coarser_->GetCoarseEquivalent(cluster).is_null()) return; |
1029 JSObjectsClusterTree* tree_to_iterate = tree; | 1029 JSObjectsClusterTree* tree_to_iterate = tree; |
1030 ZoneScope zs(DELETE_ON_EXIT); | 1030 ZoneScope zs(Isolate::Current(), DELETE_ON_EXIT); |
1031 JSObjectsClusterTree dest_tree_; | 1031 JSObjectsClusterTree dest_tree_; |
1032 if (coarser_ != NULL) { | 1032 if (coarser_ != NULL) { |
1033 RetainersAggregator retainers_aggregator(coarser_, &dest_tree_); | 1033 RetainersAggregator retainers_aggregator(coarser_, &dest_tree_); |
1034 tree->ForEach(&retainers_aggregator); | 1034 tree->ForEach(&retainers_aggregator); |
1035 tree_to_iterate = &dest_tree_; | 1035 tree_to_iterate = &dest_tree_; |
1036 } | 1036 } |
1037 RetainersIterator iterator(cluster, allocator_, map_); | 1037 RetainersIterator iterator(cluster, allocator_, map_); |
1038 tree_to_iterate->ForEach(&iterator); | 1038 tree_to_iterate->ForEach(&iterator); |
1039 } | 1039 } |
1040 | 1040 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 isolate_->global_handles()->MakeWeak(handle.location(), | 1164 isolate_->global_handles()->MakeWeak(handle.location(), |
1165 static_cast<void*>(stack.start()), | 1165 static_cast<void*>(stack.start()), |
1166 StackWeakReferenceCallback); | 1166 StackWeakReferenceCallback); |
1167 } | 1167 } |
1168 | 1168 |
1169 | 1169 |
1170 #endif // ENABLE_LOGGING_AND_PROFILING | 1170 #endif // ENABLE_LOGGING_AND_PROFILING |
1171 | 1171 |
1172 | 1172 |
1173 } } // namespace v8::internal | 1173 } } // namespace v8::internal |
OLD | NEW |