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

Side by Side Diff: src/api.cc

Issue 11415203: Introduce callback for resolving global object name while taking heap snapshot (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years 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 | Annotate | Revision Log
OLDNEW
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 6387 matching lines...) Expand 10 before | Expand all | Expand 10 after
6398 SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Value> value) { 6398 SnapshotObjectId HeapProfiler::GetSnapshotObjectId(Handle<Value> value) {
6399 i::Isolate* isolate = i::Isolate::Current(); 6399 i::Isolate* isolate = i::Isolate::Current();
6400 IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotObjectId"); 6400 IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotObjectId");
6401 i::Handle<i::Object> obj = Utils::OpenHandle(*value); 6401 i::Handle<i::Object> obj = Utils::OpenHandle(*value);
6402 return i::HeapProfiler::GetSnapshotObjectId(obj); 6402 return i::HeapProfiler::GetSnapshotObjectId(obj);
6403 } 6403 }
6404 6404
6405 6405
6406 const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title, 6406 const HeapSnapshot* HeapProfiler::TakeSnapshot(Handle<String> title,
6407 HeapSnapshot::Type type, 6407 HeapSnapshot::Type type,
6408 ActivityControl* control) { 6408 ActivityControl* control,
6409 ObjectNameResolver* resolver) {
6409 i::Isolate* isolate = i::Isolate::Current(); 6410 i::Isolate* isolate = i::Isolate::Current();
6410 IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot"); 6411 IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot");
6411 i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull; 6412 i::HeapSnapshot::Type internal_type = i::HeapSnapshot::kFull;
6412 switch (type) { 6413 switch (type) {
6413 case HeapSnapshot::kFull: 6414 case HeapSnapshot::kFull:
6414 internal_type = i::HeapSnapshot::kFull; 6415 internal_type = i::HeapSnapshot::kFull;
6415 break; 6416 break;
6416 default: 6417 default:
6417 UNREACHABLE(); 6418 UNREACHABLE();
6418 } 6419 }
6419 return reinterpret_cast<const HeapSnapshot*>( 6420 return reinterpret_cast<const HeapSnapshot*>(
6420 i::HeapProfiler::TakeSnapshot( 6421 i::HeapProfiler::TakeSnapshot(
6421 *Utils::OpenHandle(*title), internal_type, control)); 6422 *Utils::OpenHandle(*title), internal_type, control, resolver));
6422 } 6423 }
6423 6424
6424 6425
6425 void HeapProfiler::StartHeapObjectsTracking() { 6426 void HeapProfiler::StartHeapObjectsTracking() {
6426 i::Isolate* isolate = i::Isolate::Current(); 6427 i::Isolate* isolate = i::Isolate::Current();
6427 IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking"); 6428 IsDeadCheck(isolate, "v8::HeapProfiler::StartHeapObjectsTracking");
6428 i::HeapProfiler::StartHeapObjectsTracking(); 6429 i::HeapProfiler::StartHeapObjectsTracking();
6429 } 6430 }
6430 6431
6431 6432
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
6601 } 6602 }
6602 } 6603 }
6603 6604
6604 6605
6605 void HandleScopeImplementer::Iterate(ObjectVisitor* v) { 6606 void HandleScopeImplementer::Iterate(ObjectVisitor* v) {
6606 v8::ImplementationUtilities::HandleScopeData* current = 6607 v8::ImplementationUtilities::HandleScopeData* current =
6607 isolate_->handle_scope_data(); 6608 isolate_->handle_scope_data();
6608 handle_scope_data_ = *current; 6609 handle_scope_data_ = *current;
6609 IterateThis(v); 6610 IterateThis(v);
6610 } 6611 }
6611 6612
alph 2012/12/03 18:31:15 You've lost an empty line.
yurys 2012/12/03 18:36:06 Done.
6612
6613 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6613 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6614 HandleScopeImplementer* scope_implementer = 6614 HandleScopeImplementer* scope_implementer =
6615 reinterpret_cast<HandleScopeImplementer*>(storage); 6615 reinterpret_cast<HandleScopeImplementer*>(storage);
6616 scope_implementer->IterateThis(v); 6616 scope_implementer->IterateThis(v);
6617 return storage + ArchiveSpacePerThread(); 6617 return storage + ArchiveSpacePerThread();
6618 } 6618 }
6619 6619
6620 6620
6621 DeferredHandles* HandleScopeImplementer::Detach(Object** prev_limit) { 6621 DeferredHandles* HandleScopeImplementer::Detach(Object** prev_limit) {
6622 DeferredHandles* deferred = 6622 DeferredHandles* deferred =
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
6673 6673
6674 v->VisitPointers(blocks_.first(), first_block_limit_); 6674 v->VisitPointers(blocks_.first(), first_block_limit_);
6675 6675
6676 for (int i = 1; i < blocks_.length(); i++) { 6676 for (int i = 1; i < blocks_.length(); i++) {
6677 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 6677 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
6678 } 6678 }
6679 } 6679 }
6680 6680
6681 6681
6682 } } // namespace v8::internal 6682 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/heap-profiler.h » ('j') | src/profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698