OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 } | 1975 } |
1976 | 1976 |
1977 | 1977 |
1978 void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) { | 1978 void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) { |
1979 #define EXTRACT_CONTEXT_FIELD(index, type, name) \ | 1979 #define EXTRACT_CONTEXT_FIELD(index, type, name) \ |
1980 SetInternalReference(context, entry, #name, context->get(Context::index), \ | 1980 SetInternalReference(context, entry, #name, context->get(Context::index), \ |
1981 FixedArray::OffsetOfElementAt(Context::index)); | 1981 FixedArray::OffsetOfElementAt(Context::index)); |
1982 EXTRACT_CONTEXT_FIELD(CLOSURE_INDEX, JSFunction, closure); | 1982 EXTRACT_CONTEXT_FIELD(CLOSURE_INDEX, JSFunction, closure); |
1983 EXTRACT_CONTEXT_FIELD(PREVIOUS_INDEX, Context, previous); | 1983 EXTRACT_CONTEXT_FIELD(PREVIOUS_INDEX, Context, previous); |
1984 EXTRACT_CONTEXT_FIELD(EXTENSION_INDEX, Object, extension); | 1984 EXTRACT_CONTEXT_FIELD(EXTENSION_INDEX, Object, extension); |
1985 EXTRACT_CONTEXT_FIELD(GLOBAL_INDEX, GlobalObject, global); | 1985 EXTRACT_CONTEXT_FIELD(GLOBAL_OBJECT_INDEX, GlobalObject, global); |
1986 if (context->IsNativeContext()) { | 1986 if (context->IsNativeContext()) { |
1987 TagObject(context->jsfunction_result_caches(), | 1987 TagObject(context->jsfunction_result_caches(), |
1988 "(context func. result caches)"); | 1988 "(context func. result caches)"); |
1989 TagObject(context->normalized_map_cache(), "(context norm. map cache)"); | 1989 TagObject(context->normalized_map_cache(), "(context norm. map cache)"); |
1990 TagObject(context->runtime_context(), "(runtime context)"); | 1990 TagObject(context->runtime_context(), "(runtime context)"); |
1991 TagObject(context->data(), "(context data)"); | 1991 TagObject(context->data(), "(context data)"); |
1992 NATIVE_CONTEXT_FIELDS(EXTRACT_CONTEXT_FIELD); | 1992 NATIVE_CONTEXT_FIELDS(EXTRACT_CONTEXT_FIELD); |
1993 #undef EXTRACT_CONTEXT_FIELD | 1993 #undef EXTRACT_CONTEXT_FIELD |
1994 for (int i = Context::FIRST_WEAK_SLOT; | 1994 for (int i = Context::FIRST_WEAK_SLOT; |
1995 i < Context::NATIVE_CONTEXT_SLOTS; | 1995 i < Context::NATIVE_CONTEXT_SLOTS; |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 | 3579 |
3580 | 3580 |
3581 void HeapSnapshotJSONSerializer::SortHashMap( | 3581 void HeapSnapshotJSONSerializer::SortHashMap( |
3582 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3582 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3583 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3583 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3584 sorted_entries->Add(p); | 3584 sorted_entries->Add(p); |
3585 sorted_entries->Sort(SortUsingEntryValue); | 3585 sorted_entries->Sort(SortUsingEntryValue); |
3586 } | 3586 } |
3587 | 3587 |
3588 } } // namespace v8::internal | 3588 } } // namespace v8::internal |
OLD | NEW |