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 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 } | 1900 } |
1901 } | 1901 } |
1902 | 1902 |
1903 | 1903 |
1904 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, | 1904 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, |
1905 HeapEntry* entry) { | 1905 HeapEntry* entry) { |
1906 if (js_obj->IsJSFunction()) { | 1906 if (js_obj->IsJSFunction()) { |
1907 HandleScope hs; | 1907 HandleScope hs; |
1908 JSFunction* func = JSFunction::cast(js_obj); | 1908 JSFunction* func = JSFunction::cast(js_obj); |
1909 Context* context = func->context(); | 1909 Context* context = func->context(); |
1910 ZoneScope zscope(DELETE_ON_EXIT); | 1910 ZoneScope zscope(Isolate::Current(), DELETE_ON_EXIT); |
1911 SerializedScopeInfo* serialized_scope_info = | 1911 SerializedScopeInfo* serialized_scope_info = |
1912 context->closure()->shared()->scope_info(); | 1912 context->closure()->shared()->scope_info(); |
1913 ScopeInfo<ZoneListAllocationPolicy> zone_scope_info(serialized_scope_info); | 1913 ScopeInfo<ZoneListAllocationPolicy> zone_scope_info(serialized_scope_info); |
1914 int locals_number = zone_scope_info.NumberOfLocals(); | 1914 int locals_number = zone_scope_info.NumberOfLocals(); |
1915 for (int i = 0; i < locals_number; ++i) { | 1915 for (int i = 0; i < locals_number; ++i) { |
1916 String* local_name = *zone_scope_info.LocalName(i); | 1916 String* local_name = *zone_scope_info.LocalName(i); |
1917 int idx = serialized_scope_info->ContextSlotIndex(local_name, NULL); | 1917 int idx = serialized_scope_info->ContextSlotIndex(local_name, NULL); |
1918 if (idx >= 0 && idx < context->length()) { | 1918 if (idx >= 0 && idx < context->length()) { |
1919 SetClosureReference(js_obj, entry, local_name, context->get(idx)); | 1919 SetClosureReference(js_obj, entry, local_name, context->get(idx)); |
1920 } | 1920 } |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3089 | 3089 |
3090 | 3090 |
3091 String* GetConstructorNameForHeapProfile(JSObject* object) { | 3091 String* GetConstructorNameForHeapProfile(JSObject* object) { |
3092 if (object->IsJSFunction()) return HEAP->closure_symbol(); | 3092 if (object->IsJSFunction()) return HEAP->closure_symbol(); |
3093 return object->constructor_name(); | 3093 return object->constructor_name(); |
3094 } | 3094 } |
3095 | 3095 |
3096 } } // namespace v8::internal | 3096 } } // namespace v8::internal |
3097 | 3097 |
3098 #endif // ENABLE_LOGGING_AND_PROFILING | 3098 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |