OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 } | 1548 } |
1549 | 1549 |
1550 | 1550 |
1551 void HeapSnapshotGenerator::ExtractClosureReferences(JSObject* js_obj, | 1551 void HeapSnapshotGenerator::ExtractClosureReferences(JSObject* js_obj, |
1552 HeapEntry* entry) { | 1552 HeapEntry* entry) { |
1553 if (js_obj->IsJSFunction()) { | 1553 if (js_obj->IsJSFunction()) { |
1554 HandleScope hs; | 1554 HandleScope hs; |
1555 JSFunction* func = JSFunction::cast(js_obj); | 1555 JSFunction* func = JSFunction::cast(js_obj); |
1556 Context* context = func->context(); | 1556 Context* context = func->context(); |
1557 ZoneScope zscope(DELETE_ON_EXIT); | 1557 ZoneScope zscope(DELETE_ON_EXIT); |
1558 Object* scope_info = context->closure()->shared()->scope_info(); | 1558 SerializedScopeInfo* serialized_scope_info = |
1559 ScopeInfo<ZoneListAllocationPolicy> zone_scope_info(scope_info); | 1559 context->closure()->shared()->scope_info(); |
| 1560 ScopeInfo<ZoneListAllocationPolicy> zone_scope_info(serialized_scope_info); |
1560 int locals_number = zone_scope_info.NumberOfLocals(); | 1561 int locals_number = zone_scope_info.NumberOfLocals(); |
1561 for (int i = 0; i < locals_number; ++i) { | 1562 for (int i = 0; i < locals_number; ++i) { |
1562 String* local_name = *zone_scope_info.LocalName(i); | 1563 String* local_name = *zone_scope_info.LocalName(i); |
1563 int idx = ScopeInfo<>::ContextSlotIndex(scope_info, local_name, NULL); | 1564 int idx = serialized_scope_info->ContextSlotIndex(local_name, NULL); |
1564 if (idx >= 0 && idx < context->length()) { | 1565 if (idx >= 0 && idx < context->length()) { |
1565 snapshot_->SetClosureReference(entry, local_name, context->get(idx)); | 1566 snapshot_->SetClosureReference(entry, local_name, context->get(idx)); |
1566 } | 1567 } |
1567 } | 1568 } |
1568 snapshot_->SetInternalReference(entry, "code", func->shared()); | 1569 snapshot_->SetInternalReference(entry, "code", func->shared()); |
1569 } | 1570 } |
1570 } | 1571 } |
1571 | 1572 |
1572 | 1573 |
1573 void HeapSnapshotGenerator::ExtractPropertyReferences(JSObject* js_obj, | 1574 void HeapSnapshotGenerator::ExtractPropertyReferences(JSObject* js_obj, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1625 uint32_t index = static_cast<uint32_t>(k->Number()); | 1626 uint32_t index = static_cast<uint32_t>(k->Number()); |
1626 snapshot_->SetElementReference(entry, index, dictionary->ValueAt(i)); | 1627 snapshot_->SetElementReference(entry, index, dictionary->ValueAt(i)); |
1627 } | 1628 } |
1628 } | 1629 } |
1629 } | 1630 } |
1630 } | 1631 } |
1631 | 1632 |
1632 } } // namespace v8::internal | 1633 } } // namespace v8::internal |
1633 | 1634 |
1634 #endif // ENABLE_LOGGING_AND_PROFILING | 1635 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |