| 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(); |
| 449 // Enable stack sampling. | 450 // Enable stack sampling. |
| 450 Sampler* sampler = logger->sampler(); | 451 Sampler* sampler = logger->sampler(); |
| 451 sampler->IncreaseProfilingDepth(); | 452 sampler->IncreaseProfilingDepth(); |
| 452 if (!sampler->IsActive()) { | 453 if (!sampler->IsActive()) { |
| 453 sampler->Start(); | 454 sampler->Start(); |
| 454 need_to_stop_sampler_ = true; | 455 need_to_stop_sampler_ = true; |
| 455 } | 456 } |
| 456 } | 457 } |
| 457 } | 458 } |
| 458 | 459 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 processor_->Stop(); | 500 processor_->Stop(); |
| 500 processor_->Join(); | 501 processor_->Join(); |
| 501 delete processor_; | 502 delete processor_; |
| 502 delete generator_; | 503 delete generator_; |
| 503 processor_ = NULL; | 504 processor_ = NULL; |
| 504 generator_ = NULL; | 505 generator_ = NULL; |
| 505 logger->logging_nesting_ = saved_logging_nesting_; | 506 logger->logging_nesting_ = saved_logging_nesting_; |
| 506 } | 507 } |
| 507 | 508 |
| 508 | 509 |
| 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 |
| 509 } } // namespace v8::internal | 524 } } // namespace v8::internal |
| OLD | NEW |