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

Side by Side Diff: src/api.cc

Issue 93843004: Add methods for finding object by its snapshot id and id for an object (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: One more time Created 7 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
« no previous file with comments | « include/v8-profiler.h ('k') | src/heap-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7468 matching lines...) Expand 10 before | Expand all | Expand 10 after
7479 reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshot(index)); 7479 reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshot(index));
7480 } 7480 }
7481 7481
7482 7482
7483 SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) { 7483 SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) {
7484 i::Handle<i::Object> obj = Utils::OpenHandle(*value); 7484 i::Handle<i::Object> obj = Utils::OpenHandle(*value);
7485 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj); 7485 return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
7486 } 7486 }
7487 7487
7488 7488
7489 Handle<Value> HeapProfiler::FindObjectById(SnapshotObjectId id) {
7490 i::Handle<i::Object> obj =
7491 reinterpret_cast<i::HeapProfiler*>(this)->FindHeapObjectById(id);
7492 if (obj.is_null()) return Local<Value>();
7493 return Utils::ToLocal(obj);
7494 }
7495
7496
7497 void HeapProfiler::ClearObjectIds() {
7498 reinterpret_cast<i::HeapProfiler*>(this)->ClearHeapObjectMap();
7499 }
7500
7501
7489 const HeapSnapshot* HeapProfiler::TakeHeapSnapshot( 7502 const HeapSnapshot* HeapProfiler::TakeHeapSnapshot(
7490 Handle<String> title, 7503 Handle<String> title,
7491 ActivityControl* control, 7504 ActivityControl* control,
7492 ObjectNameResolver* resolver) { 7505 ObjectNameResolver* resolver) {
7493 return reinterpret_cast<const HeapSnapshot*>( 7506 return reinterpret_cast<const HeapSnapshot*>(
7494 reinterpret_cast<i::HeapProfiler*>(this)->TakeSnapshot( 7507 reinterpret_cast<i::HeapProfiler*>(this)->TakeSnapshot(
7495 *Utils::OpenHandle(*title), control, resolver)); 7508 *Utils::OpenHandle(*title), control, resolver));
7496 } 7509 }
7497 7510
7498 7511
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
7780 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7793 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7781 Address callback_address = 7794 Address callback_address =
7782 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7795 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7783 VMState<EXTERNAL> state(isolate); 7796 VMState<EXTERNAL> state(isolate);
7784 ExternalCallbackScope call_scope(isolate, callback_address); 7797 ExternalCallbackScope call_scope(isolate, callback_address);
7785 callback(info); 7798 callback(info);
7786 } 7799 }
7787 7800
7788 7801
7789 } } // namespace v8::internal 7802 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698