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 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 | 2312 |
2313 AllocationTraceNode* node = | 2313 AllocationTraceNode* node = |
2314 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); | 2314 FindNode(tracker, Vector<const char*>(names, ARRAY_SIZE(names))); |
2315 CHECK_NE(NULL, node); | 2315 CHECK_NE(NULL, node); |
2316 CHECK_LT(node->allocation_count(), 100); | 2316 CHECK_LT(node->allocation_count(), 100); |
2317 | 2317 |
2318 CcTest::heap()->DisableInlineAllocation(); | 2318 CcTest::heap()->DisableInlineAllocation(); |
2319 heap_profiler->StopTrackingHeapObjects(); | 2319 heap_profiler->StopTrackingHeapObjects(); |
2320 } | 2320 } |
2321 } | 2321 } |
| 2322 |
| 2323 |
| 2324 TEST(ArrayBufferAndArrayBufferView) { |
| 2325 LocalContext env; |
| 2326 v8::HandleScope scope(env->GetIsolate()); |
| 2327 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
| 2328 CompileRun("arr1 = new Uint32Array(100);\n"); |
| 2329 const v8::HeapSnapshot* snapshot = |
| 2330 heap_profiler->TakeHeapSnapshot(v8_str("snapshot")); |
| 2331 CHECK(ValidateSnapshot(snapshot)); |
| 2332 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
| 2333 const v8::HeapGraphNode* arr1_obj = |
| 2334 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); |
| 2335 CHECK_NE(NULL, arr1_obj); |
| 2336 const v8::HeapGraphNode* arr1_buffer = |
| 2337 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); |
| 2338 CHECK_NE(NULL, arr1_buffer); |
| 2339 const v8::HeapGraphNode* first_view = |
| 2340 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "2"); |
| 2341 CHECK_NE(NULL, first_view); |
| 2342 } |
OLD | NEW |