| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |