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 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2817 const v8::HeapGraphNode* map = | 2817 const v8::HeapGraphNode* map = |
2818 GetProperty(obj, v8::HeapGraphEdge::kInternal, "map"); | 2818 GetProperty(obj, v8::HeapGraphEdge::kInternal, "map"); |
2819 CHECK(map); | 2819 CHECK(map); |
2820 const v8::HeapGraphNode* dependent_code = | 2820 const v8::HeapGraphNode* dependent_code = |
2821 GetProperty(map, v8::HeapGraphEdge::kInternal, "dependent_code"); | 2821 GetProperty(map, v8::HeapGraphEdge::kInternal, "dependent_code"); |
2822 if (!dependent_code) return; | 2822 if (!dependent_code) return; |
2823 int count = dependent_code->GetChildrenCount(); | 2823 int count = dependent_code->GetChildrenCount(); |
2824 CHECK_NE(0, count); | 2824 CHECK_NE(0, count); |
2825 for (int i = 0; i < count; ++i) { | 2825 for (int i = 0; i < count; ++i) { |
2826 const v8::HeapGraphEdge* prop = dependent_code->GetChild(i); | 2826 const v8::HeapGraphEdge* prop = dependent_code->GetChild(i); |
2827 CHECK_EQ(v8::HeapGraphEdge::kWeak, prop->GetType()); | 2827 CHECK_EQ(v8::HeapGraphEdge::kInternal, prop->GetType()); |
2828 } | 2828 } |
2829 } | 2829 } |
2830 | 2830 |
2831 | 2831 |
2832 static inline i::Address ToAddress(int n) { | 2832 static inline i::Address ToAddress(int n) { |
2833 return reinterpret_cast<i::Address>(n); | 2833 return reinterpret_cast<i::Address>(n); |
2834 } | 2834 } |
2835 | 2835 |
2836 | 2836 |
2837 TEST(AddressToTraceMap) { | 2837 TEST(AddressToTraceMap) { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3085 " a[i] = i;\n" | 3085 " a[i] = i;\n" |
3086 " for (var i = 0; i < 3; ++i)\n" | 3086 " for (var i = 0; i < 3; ++i)\n" |
3087 " a.shift();\n" | 3087 " a.shift();\n" |
3088 "}\n"); | 3088 "}\n"); |
3089 | 3089 |
3090 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); | 3090 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); |
3091 // Should not crash. | 3091 // Should not crash. |
3092 | 3092 |
3093 heap_profiler->StopSamplingHeapProfiler(); | 3093 heap_profiler->StopSamplingHeapProfiler(); |
3094 } | 3094 } |
OLD | NEW |