| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 GetProperty(fun, v8::HeapGraphEdge::kInternal, "shared"); | 1881 GetProperty(fun, v8::HeapGraphEdge::kInternal, "shared"); |
| 1882 CHECK(!HasWeakEdge(shared)); | 1882 CHECK(!HasWeakEdge(shared)); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 | 1885 |
| 1886 TEST(NoDebugObjectInSnapshot) { | 1886 TEST(NoDebugObjectInSnapshot) { |
| 1887 LocalContext env; | 1887 LocalContext env; |
| 1888 v8::HandleScope scope(env->GetIsolate()); | 1888 v8::HandleScope scope(env->GetIsolate()); |
| 1889 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 1889 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
| 1890 | 1890 |
| 1891 CcTest::i_isolate()->debug()->Load(); | 1891 CHECK(CcTest::i_isolate()->debug()->Load()); |
| 1892 CompileRun("foo = {};"); | 1892 CompileRun("foo = {};"); |
| 1893 const v8::HeapSnapshot* snapshot = | 1893 const v8::HeapSnapshot* snapshot = |
| 1894 heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); | 1894 heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); |
| 1895 CHECK(ValidateSnapshot(snapshot)); | 1895 CHECK(ValidateSnapshot(snapshot)); |
| 1896 const v8::HeapGraphNode* root = snapshot->GetRoot(); | 1896 const v8::HeapGraphNode* root = snapshot->GetRoot(); |
| 1897 int globals_count = 0; | 1897 int globals_count = 0; |
| 1898 for (int i = 0; i < root->GetChildrenCount(); ++i) { | 1898 for (int i = 0; i < root->GetChildrenCount(); ++i) { |
| 1899 const v8::HeapGraphEdge* edge = root->GetChild(i); | 1899 const v8::HeapGraphEdge* edge = root->GetChild(i); |
| 1900 if (edge->GetType() == v8::HeapGraphEdge::kShortcut) { | 1900 if (edge->GetType() == v8::HeapGraphEdge::kShortcut) { |
| 1901 ++globals_count; | 1901 ++globals_count; |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2590 map.AddRange(ToAddress(0x180), 0x80, 6U); |
| 2591 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2591 map.AddRange(ToAddress(0x180), 0x80, 7U); |
| 2592 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); | 2592 CHECK_EQ(7, map.GetTraceNodeId(ToAddress(0x180))); |
| 2593 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); | 2593 CHECK_EQ(5, map.GetTraceNodeId(ToAddress(0x200))); |
| 2594 CHECK_EQ(3, static_cast<int>(map.size())); | 2594 CHECK_EQ(3, static_cast<int>(map.size())); |
| 2595 | 2595 |
| 2596 map.Clear(); | 2596 map.Clear(); |
| 2597 CHECK_EQ(0, static_cast<int>(map.size())); | 2597 CHECK_EQ(0, static_cast<int>(map.size())); |
| 2598 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); | 2598 CHECK_EQ(0, map.GetTraceNodeId(ToAddress(0x400))); |
| 2599 } | 2599 } |
| OLD | NEW |