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

Side by Side Diff: src/api.cc

Issue 22412003: Support idle time in CPU profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months 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 7619 matching lines...) Expand 10 before | Expand all | Expand 10 after
7630 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling( 7630 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
7631 *Utils::OpenHandle(*title))); 7631 *Utils::OpenHandle(*title)));
7632 } 7632 }
7633 7633
7634 7634
7635 void CpuProfiler::DeleteAllCpuProfiles() { 7635 void CpuProfiler::DeleteAllCpuProfiles() {
7636 reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles(); 7636 reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles();
7637 } 7637 }
7638 7638
7639 7639
7640 void CpuProfiler::SetIdle(bool is_idle) {
7641 i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
7642 if (isolate->js_entry_sp() != NULL) return;
7643 if (is_idle) {
Yang 2013/08/07 16:23:27 Could we assert that the current vm state at this
yurys 2013/08/07 16:55:44 Done.
7644 isolate->set_current_vm_state(i::IDLE);
7645 } else if (isolate->current_vm_state() == i::IDLE) {
7646 isolate->set_current_vm_state(i::EXTERNAL);
7647 }
7648 }
7649
7650
7640 static i::HeapGraphEdge* ToInternal(const HeapGraphEdge* edge) { 7651 static i::HeapGraphEdge* ToInternal(const HeapGraphEdge* edge) {
7641 return const_cast<i::HeapGraphEdge*>( 7652 return const_cast<i::HeapGraphEdge*>(
7642 reinterpret_cast<const i::HeapGraphEdge*>(edge)); 7653 reinterpret_cast<const i::HeapGraphEdge*>(edge));
7643 } 7654 }
7644 7655
7645 7656
7646 HeapGraphEdge::Type HeapGraphEdge::GetType() const { 7657 HeapGraphEdge::Type HeapGraphEdge::GetType() const {
7647 i::Isolate* isolate = i::Isolate::Current(); 7658 i::Isolate* isolate = i::Isolate::Current();
7648 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetType"); 7659 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetType");
7649 return static_cast<HeapGraphEdge::Type>(ToInternal(this)->type()); 7660 return static_cast<HeapGraphEdge::Type>(ToInternal(this)->type());
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
8160 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8171 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8161 Address callback_address = 8172 Address callback_address =
8162 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8173 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8163 VMState<EXTERNAL> state(isolate); 8174 VMState<EXTERNAL> state(isolate);
8164 ExternalCallbackScope call_scope(isolate, callback_address); 8175 ExternalCallbackScope call_scope(isolate, callback_address);
8165 return callback(info); 8176 return callback(info);
8166 } 8177 }
8167 8178
8168 8179
8169 } } // namespace v8::internal 8180 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | src/isolate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698