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

Side by Side Diff: src/api.cc

Issue 197873015: StopCpuProfiling should return non-const CpuProfile (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
« no previous file with comments | « include/v8-profiler.h ('k') | no next file » | 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 6938 matching lines...) Expand 10 before | Expand all | Expand 10 after
6949 } 6949 }
6950 6950
6951 6951
6952 void CpuProfiler::SetSamplingInterval(int us) { 6952 void CpuProfiler::SetSamplingInterval(int us) {
6953 ASSERT(us >= 0); 6953 ASSERT(us >= 0);
6954 return reinterpret_cast<i::CpuProfiler*>(this)->set_sampling_interval( 6954 return reinterpret_cast<i::CpuProfiler*>(this)->set_sampling_interval(
6955 i::TimeDelta::FromMicroseconds(us)); 6955 i::TimeDelta::FromMicroseconds(us));
6956 } 6956 }
6957 6957
6958 6958
6959 void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) { 6959 void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
6960 reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling( 6960 reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
6961 *Utils::OpenHandle(*title), record_samples); 6961 *Utils::OpenHandle(*title), record_samples);
6962 } 6962 }
6963 6963
6964 6964
6965 const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) { 6965 void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) {
6966 return reinterpret_cast<const CpuProfile*>( 6966 StartProfiling(title, record_samples);
6967 }
6968
6969
6970 CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) {
6971 return reinterpret_cast<CpuProfile*>(
6967 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling( 6972 reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
6968 *Utils::OpenHandle(*title))); 6973 *Utils::OpenHandle(*title)));
6969 } 6974 }
6970 6975
6971 6976
6977 const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) {
6978 return StopProfiling(title);
6979 }
6980
6981
6972 void CpuProfiler::SetIdle(bool is_idle) { 6982 void CpuProfiler::SetIdle(bool is_idle) {
6973 i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate(); 6983 i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
6974 i::StateTag state = isolate->current_vm_state(); 6984 i::StateTag state = isolate->current_vm_state();
6975 ASSERT(state == i::EXTERNAL || state == i::IDLE); 6985 ASSERT(state == i::EXTERNAL || state == i::IDLE);
6976 if (isolate->js_entry_sp() != NULL) return; 6986 if (isolate->js_entry_sp() != NULL) return;
6977 if (is_idle) { 6987 if (is_idle) {
6978 isolate->set_current_vm_state(i::IDLE); 6988 isolate->set_current_vm_state(i::IDLE);
6979 } else if (state == i::IDLE) { 6989 } else if (state == i::IDLE) {
6980 isolate->set_current_vm_state(i::EXTERNAL); 6990 isolate->set_current_vm_state(i::EXTERNAL);
6981 } 6991 }
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
7456 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7466 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7457 Address callback_address = 7467 Address callback_address =
7458 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7468 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7459 VMState<EXTERNAL> state(isolate); 7469 VMState<EXTERNAL> state(isolate);
7460 ExternalCallbackScope call_scope(isolate, callback_address); 7470 ExternalCallbackScope call_scope(isolate, callback_address);
7461 callback(info); 7471 callback(info);
7462 } 7472 }
7463 7473
7464 7474
7465 } } // namespace v8::internal 7475 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698