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

Side by Side Diff: src/api.cc

Issue 159581: Add generic V8 API functions for controlling profiling aspects. (Closed)
Patch Set: Renamings Created 11 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
« no previous file with comments | « include/v8.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 3228
3229 bool V8::IsProfilerPaused() { 3229 bool V8::IsProfilerPaused() {
3230 #ifdef ENABLE_LOGGING_AND_PROFILING 3230 #ifdef ENABLE_LOGGING_AND_PROFILING
3231 return i::Logger::IsProfilerPaused(); 3231 return i::Logger::IsProfilerPaused();
3232 #else 3232 #else
3233 return true; 3233 return true;
3234 #endif 3234 #endif
3235 } 3235 }
3236 3236
3237 3237
3238 void V8::ResumeProfilerEx(int flags) {
3239 #ifdef ENABLE_LOGGING_AND_PROFILING
3240 if (flags & PROFILER_MODULE_CPU) {
3241 i::Logger::ResumeProfiler();
3242 }
3243 if (flags & (PROFILER_MODULE_HEAP_STATS | PROFILER_MODULE_JS_CONSTRUCTORS)) {
3244 i::FLAG_log_gc = true;
3245 }
3246 #endif
3247 }
3248
3249
3250 void V8::PauseProfilerEx(int flags) {
3251 #ifdef ENABLE_LOGGING_AND_PROFILING
3252 if (flags & PROFILER_MODULE_CPU) {
3253 i::Logger::PauseProfiler();
3254 }
3255 if (flags & (PROFILER_MODULE_HEAP_STATS | PROFILER_MODULE_JS_CONSTRUCTORS)) {
3256 i::FLAG_log_gc = false;
3257 }
3258 #endif
3259 }
3260
3261
3262 int V8::GetActiveProfilerModules() {
3263 #ifdef ENABLE_LOGGING_AND_PROFILING
3264 int result = PROFILER_MODULE_NONE;
3265 if (!i::Logger::IsProfilerPaused()) {
3266 result |= PROFILER_MODULE_CPU;
3267 }
3268 if (i::FLAG_log_gc) {
3269 result |= PROFILER_MODULE_HEAP_STATS | PROFILER_MODULE_JS_CONSTRUCTORS;
3270 }
3271 return result;
3272 #else
3273 return PROFILER_MODULE_NONE;
3274 #endif
3275 }
3276
3277
3238 int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) { 3278 int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) {
3239 #ifdef ENABLE_LOGGING_AND_PROFILING 3279 #ifdef ENABLE_LOGGING_AND_PROFILING
3240 return i::Logger::GetLogLines(from_pos, dest_buf, max_size); 3280 return i::Logger::GetLogLines(from_pos, dest_buf, max_size);
3241 #endif 3281 #endif
3242 return 0; 3282 return 0;
3243 } 3283 }
3244 3284
3245 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) { 3285 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) {
3246 EnsureInitialized("v8::String::Utf8Value::Utf8Value()"); 3286 EnsureInitialized("v8::String::Utf8Value::Utf8Value()");
3247 if (obj.IsEmpty()) { 3287 if (obj.IsEmpty()) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3583 reinterpret_cast<HandleScopeImplementer*>(storage); 3623 reinterpret_cast<HandleScopeImplementer*>(storage);
3584 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); 3624 List<void**>* blocks_of_archived_thread = thread_local->Blocks();
3585 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = 3625 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread =
3586 &thread_local->handle_scope_data_; 3626 &thread_local->handle_scope_data_;
3587 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); 3627 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread);
3588 3628
3589 return storage + ArchiveSpacePerThread(); 3629 return storage + ArchiveSpacePerThread();
3590 } 3630 }
3591 3631
3592 } } // namespace v8::internal 3632 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698