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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 const v8::HeapGraphNode* z = | 685 const v8::HeapGraphNode* z = |
686 GetProperty(global, v8::HeapGraphEdge::kProperty, "z"); | 686 GetProperty(global, v8::HeapGraphEdge::kProperty, "z"); |
687 CHECK(z); | 687 CHECK(z); |
688 const v8::HeapGraphNode* map = | 688 const v8::HeapGraphNode* map = |
689 GetProperty(z, v8::HeapGraphEdge::kInternal, "map"); | 689 GetProperty(z, v8::HeapGraphEdge::kInternal, "map"); |
690 CHECK(map); | 690 CHECK(map); |
691 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "map")); | 691 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "map")); |
692 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "prototype")); | 692 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "prototype")); |
693 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "back_pointer")); | 693 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "back_pointer")); |
694 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors")); | 694 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors")); |
695 CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "weak_cell_cache")); | 695 const v8::HeapGraphNode* weak_cell = |
| 696 GetProperty(map, v8::HeapGraphEdge::kInternal, "weak_cell_cache"); |
| 697 CHECK(GetProperty(weak_cell, v8::HeapGraphEdge::kWeak, "value")); |
696 } | 698 } |
697 | 699 |
698 TEST(HeapSnapshotInternalReferences) { | 700 TEST(HeapSnapshotInternalReferences) { |
699 v8::Isolate* isolate = CcTest::isolate(); | 701 v8::Isolate* isolate = CcTest::isolate(); |
700 v8::HandleScope scope(isolate); | 702 v8::HandleScope scope(isolate); |
701 v8::Local<v8::ObjectTemplate> global_template = | 703 v8::Local<v8::ObjectTemplate> global_template = |
702 v8::ObjectTemplate::New(isolate); | 704 v8::ObjectTemplate::New(isolate); |
703 global_template->SetInternalFieldCount(2); | 705 global_template->SetInternalFieldCount(2); |
704 LocalContext env(NULL, global_template); | 706 LocalContext env(NULL, global_template); |
705 v8::Local<v8::Object> global_proxy = env->Global(); | 707 v8::Local<v8::Object> global_proxy = env->Global(); |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3083 " a[i] = i;\n" | 3085 " a[i] = i;\n" |
3084 " for (var i = 0; i < 3; ++i)\n" | 3086 " for (var i = 0; i < 3; ++i)\n" |
3085 " a.shift();\n" | 3087 " a.shift();\n" |
3086 "}\n"); | 3088 "}\n"); |
3087 | 3089 |
3088 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); | 3090 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); |
3089 // Should not crash. | 3091 // Should not crash. |
3090 | 3092 |
3091 heap_profiler->StopSamplingHeapProfiler(); | 3093 heap_profiler->StopSamplingHeapProfiler(); |
3092 } | 3094 } |
OLD | NEW |