Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: test/cctest/test-heap-profiler.cc

Issue 163593002: Count ArrayBuffer's backing_store memory in heap snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a static_cast Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); 2374 const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
2375 const v8::HeapGraphNode* arr1_obj = 2375 const v8::HeapGraphNode* arr1_obj =
2376 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1"); 2376 GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1");
2377 CHECK_NE(NULL, arr1_obj); 2377 CHECK_NE(NULL, arr1_obj);
2378 const v8::HeapGraphNode* arr1_buffer = 2378 const v8::HeapGraphNode* arr1_buffer =
2379 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer"); 2379 GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer");
2380 CHECK_NE(NULL, arr1_buffer); 2380 CHECK_NE(NULL, arr1_buffer);
2381 const v8::HeapGraphNode* first_view = 2381 const v8::HeapGraphNode* first_view =
2382 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "weak_first_view"); 2382 GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "weak_first_view");
2383 CHECK_NE(NULL, first_view); 2383 CHECK_NE(NULL, first_view);
2384 const v8::HeapGraphNode* backing_store =
2385 GetProperty(arr1_buffer, v8::HeapGraphEdge::kInternal, "backing_store");
2386 CHECK_NE(NULL, backing_store);
2387 CHECK_EQ(400, backing_store->GetSelfSize());
2384 } 2388 }
2385 2389
2386 2390
2387 TEST(BoxObject) { 2391 TEST(BoxObject) {
2388 v8::Isolate* isolate = CcTest::isolate(); 2392 v8::Isolate* isolate = CcTest::isolate();
2389 v8::HandleScope scope(isolate); 2393 v8::HandleScope scope(isolate);
2390 LocalContext env; 2394 LocalContext env;
2391 v8::Handle<v8::Object> global_proxy = env->Global(); 2395 v8::Handle<v8::Object> global_proxy = env->Global();
2392 v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>(); 2396 v8::Handle<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>();
2393 2397
(...skipping 10 matching lines...) Expand all
2404 const v8::HeapGraphNode* global_node = GetGlobalObject(snapshot); 2408 const v8::HeapGraphNode* global_node = GetGlobalObject(snapshot);
2405 const v8::HeapGraphNode* box_node = 2409 const v8::HeapGraphNode* box_node =
2406 GetProperty(global_node, v8::HeapGraphEdge::kElement, "0"); 2410 GetProperty(global_node, v8::HeapGraphEdge::kElement, "0");
2407 CHECK_NE(NULL, box_node); 2411 CHECK_NE(NULL, box_node);
2408 v8::String::Utf8Value box_node_name(box_node->GetName()); 2412 v8::String::Utf8Value box_node_name(box_node->GetName());
2409 CHECK_EQ("system / Box", *box_node_name); 2413 CHECK_EQ("system / Box", *box_node_name);
2410 const v8::HeapGraphNode* box_value = 2414 const v8::HeapGraphNode* box_value =
2411 GetProperty(box_node, v8::HeapGraphEdge::kInternal, "value"); 2415 GetProperty(box_node, v8::HeapGraphEdge::kInternal, "value");
2412 CHECK_NE(NULL, box_value); 2416 CHECK_NE(NULL, box_value);
2413 } 2417 }
OLDNEW
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698