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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 processor_ = new ProfilerEventsProcessor(generator_, profiles_); | 439 processor_ = new ProfilerEventsProcessor(generator_, profiles_); |
440 is_profiling_ = true; | 440 is_profiling_ = true; |
441 processor_->StartSynchronously(); | 441 processor_->StartSynchronously(); |
442 // Enumerate stuff we already have in the heap. | 442 // Enumerate stuff we already have in the heap. |
443 if (isolate_->heap()->HasBeenSetUp()) { | 443 if (isolate_->heap()->HasBeenSetUp()) { |
444 if (!FLAG_prof_browser_mode) { | 444 if (!FLAG_prof_browser_mode) { |
445 isolate_->logger()->LogCodeObjects(); | 445 isolate_->logger()->LogCodeObjects(); |
446 } | 446 } |
447 isolate_->logger()->LogCompiledFunctions(); | 447 isolate_->logger()->LogCompiledFunctions(); |
448 isolate_->logger()->LogAccessorCallbacks(); | 448 isolate_->logger()->LogAccessorCallbacks(); |
| 449 LogBuiltins(); |
449 } | 450 } |
450 // Enable stack sampling. | 451 // Enable stack sampling. |
451 Sampler* sampler = isolate_->logger()->sampler(); | 452 Sampler* sampler = isolate_->logger()->sampler(); |
452 sampler->IncreaseProfilingDepth(); | 453 sampler->IncreaseProfilingDepth(); |
453 if (!sampler->IsActive()) { | 454 if (!sampler->IsActive()) { |
454 sampler->Start(); | 455 sampler->Start(); |
455 need_to_stop_sampler_ = true; | 456 need_to_stop_sampler_ = true; |
456 } | 457 } |
457 } | 458 } |
458 } | 459 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 processor_->Stop(); | 501 processor_->Stop(); |
501 processor_->Join(); | 502 processor_->Join(); |
502 delete processor_; | 503 delete processor_; |
503 delete generator_; | 504 delete generator_; |
504 processor_ = NULL; | 505 processor_ = NULL; |
505 generator_ = NULL; | 506 generator_ = NULL; |
506 logger->logging_nesting_ = saved_logging_nesting_; | 507 logger->logging_nesting_ = saved_logging_nesting_; |
507 } | 508 } |
508 | 509 |
509 | 510 |
| 511 void CpuProfiler::LogBuiltins() { |
| 512 Builtins* builtins = isolate_->builtins(); |
| 513 ASSERT(builtins->is_initialized()); |
| 514 for (int i = 0; i < Builtins::builtin_count; i++) { |
| 515 CodeEventsContainer evt_rec(CodeEventRecord::REPORT_BUILTIN); |
| 516 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
| 517 Builtins::Name id = static_cast<Builtins::Name>(i); |
| 518 rec->start = builtins->builtin(id)->address(); |
| 519 rec->builtin_id = id; |
| 520 processor_->Enqueue(evt_rec); |
| 521 } |
| 522 } |
| 523 |
| 524 |
510 } } // namespace v8::internal | 525 } } // namespace v8::internal |
OLD | NEW |