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

Side by Side Diff: src/heap-profiler.cc

Issue 209066: Heap profiler: consider Function instances separately, similar to Arrays and Objects. (Closed)
Patch Set: Created 11 years, 3 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
« no previous file with comments | « no previous file | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 static void InsertIntoTree(JSObjectsClusterTree* tree, 61 static void InsertIntoTree(JSObjectsClusterTree* tree,
62 const JSObjectsCluster& cluster, int size); 62 const JSObjectsCluster& cluster, int size);
63 }; 63 };
64 64
65 65
66 JSObjectsCluster Clusterizer::Clusterize(HeapObject* obj, bool fine_grain) { 66 JSObjectsCluster Clusterizer::Clusterize(HeapObject* obj, bool fine_grain) {
67 if (obj->IsJSObject()) { 67 if (obj->IsJSObject()) {
68 JSObject* js_obj = JSObject::cast(obj); 68 JSObject* js_obj = JSObject::cast(obj);
69 String* constructor = JSObject::cast(js_obj)->constructor_name(); 69 String* constructor = JSObject::cast(js_obj)->constructor_name();
70 // Differentiate Object and Array instances. 70 // Differentiate Array, Function, and Object instances.
71 if (fine_grain && (constructor == Heap::Object_symbol() || 71 if (fine_grain && (constructor == Heap::Object_symbol() ||
72 constructor == Heap::Array_symbol())) { 72 constructor == Heap::Array_symbol() ||
73 constructor == Heap::function_class_symbol())) {
73 return JSObjectsCluster(constructor, obj); 74 return JSObjectsCluster(constructor, obj);
74 } else { 75 } else {
75 return JSObjectsCluster(constructor); 76 return JSObjectsCluster(constructor);
76 } 77 }
77 } else if (obj->IsString()) { 78 } else if (obj->IsString()) {
78 return JSObjectsCluster(Heap::String_symbol()); 79 return JSObjectsCluster(Heap::String_symbol());
79 } 80 }
80 return JSObjectsCluster(); 81 return JSObjectsCluster();
81 } 82 }
82 83
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 js_retainer_profile.PrintStats(); 539 js_retainer_profile.PrintStats();
539 540
540 LOG(HeapSampleEndEvent("Heap", "allocated")); 541 LOG(HeapSampleEndEvent("Heap", "allocated"));
541 } 542 }
542 543
543 544
544 #endif // ENABLE_LOGGING_AND_PROFILING 545 #endif // ENABLE_LOGGING_AND_PROFILING
545 546
546 547
547 } } // namespace v8::internal 548 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698