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

Side by Side Diff: src/api.cc

Issue 619004: Implement tagging of profiler log event blocks. (Closed)
Patch Set: Created 10 years, 10 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') | src/checks.h » ('j') | src/log.cc » ('J')
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 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3462 3462
3463 3463
3464 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) { 3464 void V8::SetGlobalGCEpilogueCallback(GCCallback callback) {
3465 if (IsDeadCheck("v8::V8::SetGlobalGCEpilogueCallback()")) return; 3465 if (IsDeadCheck("v8::V8::SetGlobalGCEpilogueCallback()")) return;
3466 i::Heap::SetGlobalGCEpilogueCallback(callback); 3466 i::Heap::SetGlobalGCEpilogueCallback(callback);
3467 } 3467 }
3468 3468
3469 3469
3470 void V8::PauseProfiler() { 3470 void V8::PauseProfiler() {
3471 #ifdef ENABLE_LOGGING_AND_PROFILING 3471 #ifdef ENABLE_LOGGING_AND_PROFILING
3472 i::Logger::PauseProfiler(PROFILER_MODULE_CPU); 3472 PauseProfilerEx(PROFILER_MODULE_CPU);
3473 #endif 3473 #endif
3474 } 3474 }
3475 3475
3476 3476
3477 void V8::ResumeProfiler() { 3477 void V8::ResumeProfiler() {
3478 #ifdef ENABLE_LOGGING_AND_PROFILING 3478 #ifdef ENABLE_LOGGING_AND_PROFILING
3479 i::Logger::ResumeProfiler(PROFILER_MODULE_CPU); 3479 ResumeProfilerEx(PROFILER_MODULE_CPU);
3480 #endif 3480 #endif
3481 } 3481 }
3482 3482
3483 3483
3484 bool V8::IsProfilerPaused() { 3484 bool V8::IsProfilerPaused() {
3485 #ifdef ENABLE_LOGGING_AND_PROFILING 3485 #ifdef ENABLE_LOGGING_AND_PROFILING
3486 return i::Logger::GetActiveProfilerModules() & PROFILER_MODULE_CPU; 3486 return i::Logger::GetActiveProfilerModules() & PROFILER_MODULE_CPU;
3487 #else 3487 #else
3488 return true; 3488 return true;
3489 #endif 3489 #endif
3490 } 3490 }
3491 3491
3492 3492
3493 void V8::ResumeProfilerEx(int flags) { 3493 void V8::ResumeProfilerEx(int flags, int tag) {
3494 #ifdef ENABLE_LOGGING_AND_PROFILING 3494 #ifdef ENABLE_LOGGING_AND_PROFILING
3495 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) { 3495 if (flags & PROFILER_MODULE_HEAP_SNAPSHOT) {
3496 // Snapshot mode: resume modules, perform GC, then pause only 3496 // Snapshot mode: resume modules, perform GC, then pause only
3497 // those modules which haven't been started prior to making a 3497 // those modules which haven't been started prior to making a
3498 // snapshot. 3498 // snapshot.
3499 3499
3500 // Reset snapshot flag and CPU module flags. 3500 // Reset snapshot flag and CPU module flags.
3501 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU); 3501 flags &= ~(PROFILER_MODULE_HEAP_SNAPSHOT | PROFILER_MODULE_CPU);
3502 const int current_flags = i::Logger::GetActiveProfilerModules(); 3502 const int current_flags = i::Logger::GetActiveProfilerModules();
3503 i::Logger::ResumeProfiler(flags); 3503 i::Logger::ResumeProfiler(flags, tag);
3504 i::Heap::CollectAllGarbage(false); 3504 i::Heap::CollectAllGarbage(false);
3505 i::Logger::PauseProfiler(~current_flags & flags); 3505 i::Logger::PauseProfiler(~current_flags & flags, tag);
3506 } else { 3506 } else {
3507 i::Logger::ResumeProfiler(flags); 3507 i::Logger::ResumeProfiler(flags, tag);
3508 } 3508 }
3509 #endif 3509 #endif
3510 } 3510 }
3511 3511
3512 3512
3513 void V8::PauseProfilerEx(int flags) { 3513 void V8::PauseProfilerEx(int flags, int tag) {
3514 #ifdef ENABLE_LOGGING_AND_PROFILING 3514 #ifdef ENABLE_LOGGING_AND_PROFILING
3515 i::Logger::PauseProfiler(flags); 3515 i::Logger::PauseProfiler(flags, tag);
3516 #endif 3516 #endif
3517 } 3517 }
3518 3518
3519 3519
3520 int V8::GetActiveProfilerModules() { 3520 int V8::GetActiveProfilerModules() {
3521 #ifdef ENABLE_LOGGING_AND_PROFILING 3521 #ifdef ENABLE_LOGGING_AND_PROFILING
3522 return i::Logger::GetActiveProfilerModules(); 3522 return i::Logger::GetActiveProfilerModules();
3523 #else 3523 #else
3524 return PROFILER_MODULE_NONE; 3524 return PROFILER_MODULE_NONE;
3525 #endif 3525 #endif
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 3938
3939 3939
3940 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3940 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3941 HandleScopeImplementer* thread_local = 3941 HandleScopeImplementer* thread_local =
3942 reinterpret_cast<HandleScopeImplementer*>(storage); 3942 reinterpret_cast<HandleScopeImplementer*>(storage);
3943 thread_local->IterateThis(v); 3943 thread_local->IterateThis(v);
3944 return storage + ArchiveSpacePerThread(); 3944 return storage + ArchiveSpacePerThread();
3945 } 3945 }
3946 3946
3947 } } // namespace v8::internal 3947 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/checks.h » ('j') | src/log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698