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