| 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 2622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2633 const v8::HeapSnapshot* snapshot = | 2633 const v8::HeapSnapshot* snapshot = |
| 2634 heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); | 2634 heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); |
| 2635 CHECK(ValidateSnapshot(snapshot)); | 2635 CHECK(ValidateSnapshot(snapshot)); |
| 2636 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); | 2636 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
| 2637 const v8::HeapGraphNode* arr1_obj = | 2637 const v8::HeapGraphNode* arr1_obj = |
| 2638 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); | 2638 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); |
| 2639 CHECK(arr1_obj); | 2639 CHECK(arr1_obj); |
| 2640 const v8::HeapGraphNode* arr1_buffer = | 2640 const v8::HeapGraphNode* arr1_buffer = |
| 2641 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); | 2641 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); |
| 2642 CHECK(arr1_buffer); | 2642 CHECK(arr1_buffer); |
| 2643 const v8::HeapGraphNode* first_view = | |
| 2644 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "weak_first_view"); | |
| 2645 CHECK(first_view); | |
| 2646 const v8::HeapGraphNode* backing_store = | 2643 const v8::HeapGraphNode* backing_store = |
| 2647 GetProperty(arr1_buffer, v8::HeapGraphEdge::kInternal, "backing_store"); | 2644 GetProperty(arr1_buffer, v8::HeapGraphEdge::kInternal, "backing_store"); |
| 2648 CHECK(backing_store); | 2645 CHECK(backing_store); |
| 2649 CHECK_EQ(400, static_cast<int>(backing_store->GetShallowSize())); | 2646 CHECK_EQ(400, static_cast<int>(backing_store->GetShallowSize())); |
| 2650 } | 2647 } |
| 2651 | 2648 |
| 2652 | 2649 |
| 2653 static int GetRetainersCount(const v8::HeapSnapshot* snapshot, | 2650 static int GetRetainersCount(const v8::HeapSnapshot* snapshot, |
| 2654 const v8::HeapGraphNode* node) { | 2651 const v8::HeapGraphNode* node) { |
| 2655 int count = 0; | 2652 int count = 0; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2825 map.AddRange(ToAddress(0x180), 0x80, 6U); | 2822 map.AddRange(ToAddress(0x180), 0x80, 6U); |
| 2826 map.AddRange(ToAddress(0x180), 0x80, 7U); | 2823 map.AddRange(ToAddress(0x180), 0x80, 7U); |
| 2827 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); | 2824 CHECK_EQ(7u, map.GetTraceNodeId(ToAddress(0x180))); |
| 2828 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); | 2825 CHECK_EQ(5u, map.GetTraceNodeId(ToAddress(0x200))); |
| 2829 CHECK_EQ(3u, map.size()); | 2826 CHECK_EQ(3u, map.size()); |
| 2830 | 2827 |
| 2831 map.Clear(); | 2828 map.Clear(); |
| 2832 CHECK_EQ(0u, map.size()); | 2829 CHECK_EQ(0u, map.size()); |
| 2833 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); | 2830 CHECK_EQ(0u, map.GetTraceNodeId(ToAddress(0x400))); |
| 2834 } | 2831 } |
| OLD | NEW |