OLD | NEW |
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 | 429 |
430 void CpuProfiler::StartProcessorIfNotStarted() { | 430 void CpuProfiler::StartProcessorIfNotStarted() { |
431 if (processor_ == NULL) { | 431 if (processor_ == NULL) { |
432 Logger* logger = isolate_->logger(); | 432 Logger* logger = isolate_->logger(); |
433 // Disable logging when using the new implementation. | 433 // Disable logging when using the new implementation. |
434 saved_is_logging_ = logger->is_logging_; | 434 saved_is_logging_ = logger->is_logging_; |
435 logger->is_logging_ = false; | 435 logger->is_logging_ = false; |
436 generator_ = new ProfileGenerator(profiles_); | 436 generator_ = new ProfileGenerator(profiles_); |
437 Sampler* sampler = logger->sampler(); | 437 Sampler* sampler = logger->sampler(); |
438 #if V8_CC_MSVC && (_MSC_VER >= 1800) | |
439 // VS2013 reports "warning C4316: 'v8::internal::ProfilerEventsProcessor' | |
440 // : object allocated on the heap may not be aligned 64". We need to | |
441 // figure out if this is a legitimate warning or a compiler bug. | |
442 #pragma warning(push) | |
443 #pragma warning(disable:4316) | |
444 #endif | |
445 processor_ = new ProfilerEventsProcessor( | 438 processor_ = new ProfilerEventsProcessor( |
446 generator_, sampler, sampling_interval_); | 439 generator_, sampler, sampling_interval_); |
447 #if V8_CC_MSVC && (_MSC_VER >= 1800) | |
448 #pragma warning(pop) | |
449 #endif | |
450 is_profiling_ = true; | 440 is_profiling_ = true; |
451 // Enumerate stuff we already have in the heap. | 441 // Enumerate stuff we already have in the heap. |
452 ASSERT(isolate_->heap()->HasBeenSetUp()); | 442 ASSERT(isolate_->heap()->HasBeenSetUp()); |
453 if (!FLAG_prof_browser_mode) { | 443 if (!FLAG_prof_browser_mode) { |
454 logger->LogCodeObjects(); | 444 logger->LogCodeObjects(); |
455 } | 445 } |
456 logger->LogCompiledFunctions(); | 446 logger->LogCompiledFunctions(); |
457 logger->LogAccessorCallbacks(); | 447 logger->LogAccessorCallbacks(); |
458 LogBuiltins(); | 448 LogBuiltins(); |
459 // Enable stack sampling. | 449 // Enable stack sampling. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; | 501 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
512 Builtins::Name id = static_cast<Builtins::Name>(i); | 502 Builtins::Name id = static_cast<Builtins::Name>(i); |
513 rec->start = builtins->builtin(id)->address(); | 503 rec->start = builtins->builtin(id)->address(); |
514 rec->builtin_id = id; | 504 rec->builtin_id = id; |
515 processor_->Enqueue(evt_rec); | 505 processor_->Enqueue(evt_rec); |
516 } | 506 } |
517 } | 507 } |
518 | 508 |
519 | 509 |
520 } } // namespace v8::internal | 510 } } // namespace v8::internal |
OLD | NEW |