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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 processor_ = new ProfilerEventsProcessor(generator_); | 447 processor_ = new ProfilerEventsProcessor(generator_); |
448 is_profiling_ = true; | 448 is_profiling_ = true; |
449 processor_->StartSynchronously(); | 449 processor_->StartSynchronously(); |
450 // Enumerate stuff we already have in the heap. | 450 // Enumerate stuff we already have in the heap. |
451 ASSERT(isolate_->heap()->HasBeenSetUp()); | 451 ASSERT(isolate_->heap()->HasBeenSetUp()); |
452 if (!FLAG_prof_browser_mode) { | 452 if (!FLAG_prof_browser_mode) { |
453 logger->LogCodeObjects(); | 453 logger->LogCodeObjects(); |
454 } | 454 } |
455 logger->LogCompiledFunctions(); | 455 logger->LogCompiledFunctions(); |
456 logger->LogAccessorCallbacks(); | 456 logger->LogAccessorCallbacks(); |
| 457 LogBuiltins(); |
457 // Enable stack sampling. | 458 // Enable stack sampling. |
458 Sampler* sampler = logger->sampler(); | 459 Sampler* sampler = logger->sampler(); |
459 sampler->IncreaseProfilingDepth(); | 460 sampler->IncreaseProfilingDepth(); |
460 if (!sampler->IsActive()) { | 461 if (!sampler->IsActive()) { |
461 sampler->Start(); | 462 sampler->Start(); |
462 need_to_stop_sampler_ = true; | 463 need_to_stop_sampler_ = true; |
463 } | 464 } |
464 } | 465 } |
465 } | 466 } |
466 | 467 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 processor_->Stop(); | 508 processor_->Stop(); |
508 processor_->Join(); | 509 processor_->Join(); |
509 delete processor_; | 510 delete processor_; |
510 delete generator_; | 511 delete generator_; |
511 processor_ = NULL; | 512 processor_ = NULL; |
512 generator_ = NULL; | 513 generator_ = NULL; |
513 logger->logging_nesting_ = saved_logging_nesting_; | 514 logger->logging_nesting_ = saved_logging_nesting_; |
514 } | 515 } |
515 | 516 |
516 | 517 |
| 518 void CpuProfiler::LogBuiltins() { |
| 519 Builtins* builtins = isolate_->builtins(); |
| 520 ASSERT(builtins->is_initialized()); |
| 521 for (int i = 0; i < Builtins::builtin_count; i++) { |
| 522 CodeEventsContainer evt_rec(CodeEventRecord::REPORT_BUILTIN); |
| 523 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
| 524 Builtins::Name id = static_cast<Builtins::Name>(i); |
| 525 rec->start = builtins->builtin(id)->address(); |
| 526 rec->builtin_id = id; |
| 527 processor_->Enqueue(evt_rec); |
| 528 } |
| 529 } |
| 530 |
| 531 |
517 } } // namespace v8::internal | 532 } } // namespace v8::internal |
OLD | NEW |