Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index a6f04b308d03d42c0dc511fe19c0519fcf383be1..48ff5ee2f00de0b37daf6909c033a635e7cd1b4d 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -10,31 +10,6 @@ |
#include "utils-inl.h" |
#include "../include/v8-profiler.h" |
-namespace { |
- |
-class NamedEntriesDetector { |
- public: |
- NamedEntriesDetector() |
- : has_A2(false), has_B2(false), has_C2(false) { |
- } |
- |
- void Apply(i::HeapEntry** entry_ptr) { |
- if (IsReachableNodeWithName(*entry_ptr, "A2")) has_A2 = true; |
- if (IsReachableNodeWithName(*entry_ptr, "B2")) has_B2 = true; |
- if (IsReachableNodeWithName(*entry_ptr, "C2")) has_C2 = true; |
- } |
- |
- static bool IsReachableNodeWithName(i::HeapEntry* entry, const char* name) { |
- return strcmp(name, entry->name()) == 0 && entry->painted_reachable(); |
- } |
- |
- bool has_A2; |
- bool has_B2; |
- bool has_C2; |
-}; |
- |
-} // namespace |
- |
static const v8::HeapGraphNode* GetGlobalObject( |
const v8::HeapSnapshot* snapshot) { |
@@ -86,14 +61,7 @@ TEST(HeapSnapshot) { |
"var c2 = new C2(a2);"); |
const v8::HeapSnapshot* snapshot_env2 = |
v8::HeapProfiler::TakeSnapshot(v8_str("env2")); |
- i::HeapSnapshot* i_snapshot_env2 = |
- const_cast<i::HeapSnapshot*>( |
- reinterpret_cast<const i::HeapSnapshot*>(snapshot_env2)); |
const v8::HeapGraphNode* global_env2 = GetGlobalObject(snapshot_env2); |
- // Paint all nodes reachable from global object. |
- i_snapshot_env2->ClearPaint(); |
- const_cast<i::HeapEntry*>( |
- reinterpret_cast<const i::HeapEntry*>(global_env2))->PaintAllReachable(); |
// Verify, that JS global object of env2 has '..2' properties. |
const v8::HeapGraphNode* a2_node = |
@@ -104,12 +72,6 @@ TEST(HeapSnapshot) { |
CHECK_NE( |
NULL, GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "b2_2")); |
CHECK_NE(NULL, GetProperty(global_env2, v8::HeapGraphEdge::kShortcut, "c2")); |
- |
- NamedEntriesDetector det; |
- i_snapshot_env2->IterateEntries(&det); |
- CHECK(det.has_A2); |
mnaganov (inactive)
2012/02/24 23:19:50
I'm against removing this code. It checks that A2,
alexeif
2012/02/27 11:57:25
Done.
|
- CHECK(det.has_B2); |
- CHECK(det.has_C2); |
} |
@@ -136,14 +98,10 @@ TEST(HeapSnapshotObjectSizes) { |
GetProperty(x, v8::HeapGraphEdge::kProperty, "b"); |
CHECK_NE(NULL, x2); |
- // Test approximate sizes. |
- CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize(false)); |
- CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize(false)); |
- CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize(false)); |
- // Test exact sizes. |
- CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize(true)); |
- CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize(true)); |
- CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize(true)); |
+ // Test sizes. |
+ CHECK_EQ(x->GetSelfSize() * 3, x->GetRetainedSize()); |
+ CHECK_EQ(x1->GetSelfSize(), x1->GetRetainedSize()); |
+ CHECK_EQ(x2->GetSelfSize(), x2->GetRetainedSize()); |
} |