| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 | 48 |
| 49 ProfilerEventsProcessor::ProfilerEventsProcessor(Isolate* isolate, | 49 ProfilerEventsProcessor::ProfilerEventsProcessor(Isolate* isolate, |
| 50 ProfileGenerator* generator) | 50 ProfileGenerator* generator) |
| 51 : Thread(isolate, "v8:ProfEvntProc"), | 51 : Thread(isolate, "v8:ProfEvntProc"), |
| 52 generator_(generator), | 52 generator_(generator), |
| 53 running_(true), | 53 running_(true), |
| 54 ticks_buffer_(sizeof(TickSampleEventRecord), | 54 ticks_buffer_(sizeof(TickSampleEventRecord), |
| 55 kTickSamplesBufferChunkSize, | 55 kTickSamplesBufferChunkSize, |
| 56 kTickSamplesBufferChunksCount), | 56 kTickSamplesBufferChunksCount), |
| 57 enqueue_order_(0), | 57 enqueue_order_(0) { |
| 58 known_functions_(new HashMap(AddressesMatch)) { | |
| 59 } | |
| 60 | |
| 61 | |
| 62 ProfilerEventsProcessor::~ProfilerEventsProcessor() { | |
| 63 delete known_functions_; | |
| 64 } | 58 } |
| 65 | 59 |
| 66 | 60 |
| 67 void ProfilerEventsProcessor::CallbackCreateEvent(Logger::LogEventsAndTags tag, | 61 void ProfilerEventsProcessor::CallbackCreateEvent(Logger::LogEventsAndTags tag, |
| 68 const char* prefix, | 62 const char* prefix, |
| 69 String* name, | 63 String* name, |
| 70 Address start) { | 64 Address start) { |
| 71 if (FilterOutCodeCreateEvent(tag)) return; | 65 if (FilterOutCodeCreateEvent(tag)) return; |
| 72 CodeEventsContainer evt_rec; | 66 CodeEventsContainer evt_rec; |
| 73 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 67 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| 74 rec->type = CodeEventRecord::CODE_CREATION; | 68 rec->type = CodeEventRecord::CODE_CREATION; |
| 75 rec->order = ++enqueue_order_; | 69 rec->order = ++enqueue_order_; |
| 76 rec->start = start; | 70 rec->start = start; |
| 77 rec->entry = generator_->NewCodeEntry(tag, prefix, name); | 71 rec->entry = generator_->NewCodeEntry(tag, prefix, name); |
| 78 rec->size = 1; | 72 rec->size = 1; |
| 73 rec->sfi_address = NULL; |
| 79 events_buffer_.Enqueue(evt_rec); | 74 events_buffer_.Enqueue(evt_rec); |
| 80 } | 75 } |
| 81 | 76 |
| 82 | 77 |
| 83 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, | 78 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 84 String* name, | 79 String* name, |
| 85 String* resource_name, | 80 String* resource_name, |
| 86 int line_number, | 81 int line_number, |
| 87 Address start, | 82 Address start, |
| 88 unsigned size) { | 83 unsigned size, |
| 84 Address sfi_address) { |
| 89 if (FilterOutCodeCreateEvent(tag)) return; | 85 if (FilterOutCodeCreateEvent(tag)) return; |
| 90 CodeEventsContainer evt_rec; | 86 CodeEventsContainer evt_rec; |
| 91 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 87 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| 92 rec->type = CodeEventRecord::CODE_CREATION; | 88 rec->type = CodeEventRecord::CODE_CREATION; |
| 93 rec->order = ++enqueue_order_; | 89 rec->order = ++enqueue_order_; |
| 94 rec->start = start; | 90 rec->start = start; |
| 95 rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number); | 91 rec->entry = generator_->NewCodeEntry(tag, name, resource_name, line_number); |
| 96 rec->size = size; | 92 rec->size = size; |
| 93 rec->sfi_address = sfi_address; |
| 97 events_buffer_.Enqueue(evt_rec); | 94 events_buffer_.Enqueue(evt_rec); |
| 98 } | 95 } |
| 99 | 96 |
| 100 | 97 |
| 101 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, | 98 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 102 const char* name, | 99 const char* name, |
| 103 Address start, | 100 Address start, |
| 104 unsigned size) { | 101 unsigned size) { |
| 105 if (FilterOutCodeCreateEvent(tag)) return; | 102 if (FilterOutCodeCreateEvent(tag)) return; |
| 106 CodeEventsContainer evt_rec; | 103 CodeEventsContainer evt_rec; |
| 107 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 104 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| 108 rec->type = CodeEventRecord::CODE_CREATION; | 105 rec->type = CodeEventRecord::CODE_CREATION; |
| 109 rec->order = ++enqueue_order_; | 106 rec->order = ++enqueue_order_; |
| 110 rec->start = start; | 107 rec->start = start; |
| 111 rec->entry = generator_->NewCodeEntry(tag, name); | 108 rec->entry = generator_->NewCodeEntry(tag, name); |
| 112 rec->size = size; | 109 rec->size = size; |
| 110 rec->sfi_address = NULL; |
| 113 events_buffer_.Enqueue(evt_rec); | 111 events_buffer_.Enqueue(evt_rec); |
| 114 } | 112 } |
| 115 | 113 |
| 116 | 114 |
| 117 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, | 115 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 118 int args_count, | 116 int args_count, |
| 119 Address start, | 117 Address start, |
| 120 unsigned size) { | 118 unsigned size) { |
| 121 if (FilterOutCodeCreateEvent(tag)) return; | 119 if (FilterOutCodeCreateEvent(tag)) return; |
| 122 CodeEventsContainer evt_rec; | 120 CodeEventsContainer evt_rec; |
| 123 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 121 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| 124 rec->type = CodeEventRecord::CODE_CREATION; | 122 rec->type = CodeEventRecord::CODE_CREATION; |
| 125 rec->order = ++enqueue_order_; | 123 rec->order = ++enqueue_order_; |
| 126 rec->start = start; | 124 rec->start = start; |
| 127 rec->entry = generator_->NewCodeEntry(tag, args_count); | 125 rec->entry = generator_->NewCodeEntry(tag, args_count); |
| 128 rec->size = size; | 126 rec->size = size; |
| 127 rec->sfi_address = NULL; |
| 129 events_buffer_.Enqueue(evt_rec); | 128 events_buffer_.Enqueue(evt_rec); |
| 130 } | 129 } |
| 131 | 130 |
| 132 | 131 |
| 133 void ProfilerEventsProcessor::CodeMoveEvent(Address from, Address to) { | 132 void ProfilerEventsProcessor::CodeMoveEvent(Address from, Address to) { |
| 134 CodeEventsContainer evt_rec; | 133 CodeEventsContainer evt_rec; |
| 135 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_; | 134 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_; |
| 136 rec->type = CodeEventRecord::CODE_MOVE; | 135 rec->type = CodeEventRecord::CODE_MOVE; |
| 137 rec->order = ++enqueue_order_; | 136 rec->order = ++enqueue_order_; |
| 138 rec->from = from; | 137 rec->from = from; |
| 139 rec->to = to; | 138 rec->to = to; |
| 140 events_buffer_.Enqueue(evt_rec); | 139 events_buffer_.Enqueue(evt_rec); |
| 141 } | 140 } |
| 142 | 141 |
| 143 | 142 |
| 144 void ProfilerEventsProcessor::CodeDeleteEvent(Address from) { | 143 void ProfilerEventsProcessor::CodeDeleteEvent(Address from) { |
| 145 CodeEventsContainer evt_rec; | 144 CodeEventsContainer evt_rec; |
| 146 CodeDeleteEventRecord* rec = &evt_rec.CodeDeleteEventRecord_; | 145 CodeDeleteEventRecord* rec = &evt_rec.CodeDeleteEventRecord_; |
| 147 rec->type = CodeEventRecord::CODE_DELETE; | 146 rec->type = CodeEventRecord::CODE_DELETE; |
| 148 rec->order = ++enqueue_order_; | 147 rec->order = ++enqueue_order_; |
| 149 rec->start = from; | 148 rec->start = from; |
| 150 events_buffer_.Enqueue(evt_rec); | 149 events_buffer_.Enqueue(evt_rec); |
| 151 } | 150 } |
| 152 | 151 |
| 153 | 152 |
| 154 void ProfilerEventsProcessor::FunctionCreateEvent(Address alias, | 153 void ProfilerEventsProcessor::SFIMoveEvent(Address from, Address to) { |
| 155 Address start, | |
| 156 int security_token_id) { | |
| 157 CodeEventsContainer evt_rec; | 154 CodeEventsContainer evt_rec; |
| 158 CodeAliasEventRecord* rec = &evt_rec.CodeAliasEventRecord_; | 155 SFIMoveEventRecord* rec = &evt_rec.SFIMoveEventRecord_; |
| 159 rec->type = CodeEventRecord::CODE_ALIAS; | 156 rec->type = CodeEventRecord::SFI_MOVE; |
| 160 rec->order = ++enqueue_order_; | 157 rec->order = ++enqueue_order_; |
| 161 rec->start = alias; | 158 rec->from = from; |
| 162 rec->entry = generator_->NewCodeEntry(security_token_id); | 159 rec->to = to; |
| 163 rec->code_start = start; | |
| 164 events_buffer_.Enqueue(evt_rec); | 160 events_buffer_.Enqueue(evt_rec); |
| 165 | |
| 166 known_functions_->Lookup(alias, AddressHash(alias), true); | |
| 167 } | |
| 168 | |
| 169 | |
| 170 void ProfilerEventsProcessor::FunctionMoveEvent(Address from, Address to) { | |
| 171 CodeMoveEvent(from, to); | |
| 172 | |
| 173 if (IsKnownFunction(from)) { | |
| 174 known_functions_->Remove(from, AddressHash(from)); | |
| 175 known_functions_->Lookup(to, AddressHash(to), true); | |
| 176 } | |
| 177 } | |
| 178 | |
| 179 | |
| 180 void ProfilerEventsProcessor::FunctionDeleteEvent(Address from) { | |
| 181 CodeDeleteEvent(from); | |
| 182 | |
| 183 known_functions_->Remove(from, AddressHash(from)); | |
| 184 } | |
| 185 | |
| 186 | |
| 187 bool ProfilerEventsProcessor::IsKnownFunction(Address start) { | |
| 188 HashMap::Entry* entry = | |
| 189 known_functions_->Lookup(start, AddressHash(start), false); | |
| 190 return entry != NULL; | |
| 191 } | |
| 192 | |
| 193 | |
| 194 void ProfilerEventsProcessor::ProcessMovedFunctions() { | |
| 195 for (int i = 0; i < moved_functions_.length(); ++i) { | |
| 196 JSFunction* function = moved_functions_[i]; | |
| 197 CpuProfiler::FunctionCreateEvent(function); | |
| 198 } | |
| 199 moved_functions_.Clear(); | |
| 200 } | |
| 201 | |
| 202 | |
| 203 void ProfilerEventsProcessor::RememberMovedFunction(JSFunction* function) { | |
| 204 moved_functions_.Add(function); | |
| 205 } | 161 } |
| 206 | 162 |
| 207 | 163 |
| 208 void ProfilerEventsProcessor::RegExpCodeCreateEvent( | 164 void ProfilerEventsProcessor::RegExpCodeCreateEvent( |
| 209 Logger::LogEventsAndTags tag, | 165 Logger::LogEventsAndTags tag, |
| 210 const char* prefix, | 166 const char* prefix, |
| 211 String* name, | 167 String* name, |
| 212 Address start, | 168 Address start, |
| 213 unsigned size) { | 169 unsigned size) { |
| 214 if (FilterOutCodeCreateEvent(tag)) return; | 170 if (FilterOutCodeCreateEvent(tag)) return; |
| 215 CodeEventsContainer evt_rec; | 171 CodeEventsContainer evt_rec; |
| 216 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 172 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| 217 rec->type = CodeEventRecord::CODE_CREATION; | 173 rec->type = CodeEventRecord::CODE_CREATION; |
| 218 rec->order = ++enqueue_order_; | 174 rec->order = ++enqueue_order_; |
| 219 rec->start = start; | 175 rec->start = start; |
| 220 rec->entry = generator_->NewCodeEntry(tag, prefix, name); | 176 rec->entry = generator_->NewCodeEntry(tag, prefix, name); |
| 221 rec->size = size; | 177 rec->size = size; |
| 222 events_buffer_.Enqueue(evt_rec); | 178 events_buffer_.Enqueue(evt_rec); |
| 223 } | 179 } |
| 224 | 180 |
| 225 | 181 |
| 226 void ProfilerEventsProcessor::AddCurrentStack() { | 182 void ProfilerEventsProcessor::AddCurrentStack() { |
| 227 TickSampleEventRecord record; | 183 TickSampleEventRecord record; |
| 228 TickSample* sample = &record.sample; | 184 TickSample* sample = &record.sample; |
| 229 sample->state = Isolate::Current()->current_vm_state(); | 185 sample->state = Isolate::Current()->current_vm_state(); |
| 230 sample->pc = reinterpret_cast<Address>(sample); // Not NULL. | 186 sample->pc = reinterpret_cast<Address>(sample); // Not NULL. |
| 187 sample->tos = NULL; |
| 231 sample->frames_count = 0; | 188 sample->frames_count = 0; |
| 232 for (StackTraceFrameIterator it; | 189 for (StackTraceFrameIterator it; |
| 233 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; | 190 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; |
| 234 it.Advance()) { | 191 it.Advance()) { |
| 235 JavaScriptFrame* frame = it.frame(); | 192 sample->stack[sample->frames_count++] = it.frame()->pc(); |
| 236 sample->stack[sample->frames_count++] = | |
| 237 reinterpret_cast<Address>(frame->function()); | |
| 238 } | 193 } |
| 239 record.order = enqueue_order_; | 194 record.order = enqueue_order_; |
| 240 ticks_from_vm_buffer_.Enqueue(record); | 195 ticks_from_vm_buffer_.Enqueue(record); |
| 241 } | 196 } |
| 242 | 197 |
| 243 | 198 |
| 244 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { | 199 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { |
| 245 if (!events_buffer_.IsEmpty()) { | 200 if (!events_buffer_.IsEmpty()) { |
| 246 CodeEventsContainer record; | 201 CodeEventsContainer record; |
| 247 events_buffer_.Dequeue(&record); | 202 events_buffer_.Dequeue(&record); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 343 |
| 389 | 344 |
| 390 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 345 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 391 Code* code, String* name) { | 346 Code* code, String* name) { |
| 392 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( | 347 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( |
| 393 tag, | 348 tag, |
| 394 name, | 349 name, |
| 395 HEAP->empty_string(), | 350 HEAP->empty_string(), |
| 396 v8::CpuProfileNode::kNoLineNumberInfo, | 351 v8::CpuProfileNode::kNoLineNumberInfo, |
| 397 code->address(), | 352 code->address(), |
| 398 code->ExecutableSize()); | 353 code->ExecutableSize(), |
| 354 NULL); |
| 399 } | 355 } |
| 400 | 356 |
| 401 | 357 |
| 402 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 358 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 403 Code* code, String* name, | 359 Code* code, |
| 404 String* source, int line) { | 360 SharedFunctionInfo* shared, |
| 361 String* name) { |
| 405 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( | 362 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( |
| 406 tag, | 363 tag, |
| 407 name, | 364 name, |
| 365 HEAP->empty_string(), |
| 366 v8::CpuProfileNode::kNoLineNumberInfo, |
| 367 code->address(), |
| 368 code->ExecutableSize(), |
| 369 shared->address()); |
| 370 } |
| 371 |
| 372 |
| 373 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 374 Code* code, |
| 375 SharedFunctionInfo* shared, |
| 376 String* source, int line) { |
| 377 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( |
| 378 tag, |
| 379 shared->DebugName(), |
| 408 source, | 380 source, |
| 409 line, | 381 line, |
| 410 code->address(), | 382 code->address(), |
| 411 code->ExecutableSize()); | 383 code->ExecutableSize(), |
| 384 shared->address()); |
| 412 } | 385 } |
| 413 | 386 |
| 414 | 387 |
| 415 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 388 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 416 Code* code, int args_count) { | 389 Code* code, int args_count) { |
| 417 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( | 390 Isolate::Current()->cpu_profiler()->processor_->CodeCreateEvent( |
| 418 tag, | 391 tag, |
| 419 args_count, | 392 args_count, |
| 420 code->address(), | 393 code->address(), |
| 421 code->ExecutableSize()); | 394 code->ExecutableSize()); |
| 422 } | 395 } |
| 423 | 396 |
| 424 | 397 |
| 425 void CpuProfiler::CodeMoveEvent(Address from, Address to) { | 398 void CpuProfiler::CodeMoveEvent(Address from, Address to) { |
| 426 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to); | 399 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to); |
| 427 } | 400 } |
| 428 | 401 |
| 429 | 402 |
| 430 void CpuProfiler::CodeDeleteEvent(Address from) { | 403 void CpuProfiler::CodeDeleteEvent(Address from) { |
| 431 Isolate::Current()->cpu_profiler()->processor_->CodeDeleteEvent(from); | 404 Isolate::Current()->cpu_profiler()->processor_->CodeDeleteEvent(from); |
| 432 } | 405 } |
| 433 | 406 |
| 434 | 407 |
| 435 void CpuProfiler::FunctionCreateEvent(JSFunction* function) { | 408 void CpuProfiler::SFIMoveEvent(Address from, Address to) { |
| 436 CpuProfiler* profiler = Isolate::Current()->cpu_profiler(); | 409 CpuProfiler* profiler = Isolate::Current()->cpu_profiler(); |
| 437 int security_token_id = TokenEnumerator::kNoSecurityToken; | 410 profiler->processor_->SFIMoveEvent(from, to); |
| 438 if (function->unchecked_context()->IsContext()) { | |
| 439 security_token_id = profiler->token_enumerator_->GetTokenId( | |
| 440 function->context()->global_context()->security_token()); | |
| 441 } | |
| 442 profiler->processor_->FunctionCreateEvent( | |
| 443 function->address(), | |
| 444 function->shared()->code()->address(), | |
| 445 security_token_id); | |
| 446 } | |
| 447 | |
| 448 | |
| 449 void CpuProfiler::ProcessMovedFunctions() { | |
| 450 CpuProfiler* profiler = Isolate::Current()->cpu_profiler(); | |
| 451 profiler->processor_->ProcessMovedFunctions(); | |
| 452 } | |
| 453 | |
| 454 | |
| 455 void CpuProfiler::FunctionCreateEventFromMove(Heap* heap, | |
| 456 JSFunction* function) { | |
| 457 // This function is called from GC iterators (during Scavenge, | |
| 458 // MC, and MS), so marking bits can be set on objects. That's | |
| 459 // why unchecked accessors are used here. | |
| 460 | |
| 461 // The same function can be reported several times. | |
| 462 Isolate* isolate = heap->isolate(); | |
| 463 if (function->unchecked_code() == | |
| 464 isolate->builtins()->builtin(Builtins::LazyCompile) | |
| 465 || isolate->cpu_profiler()->processor_->IsKnownFunction( | |
| 466 function->address())) | |
| 467 return; | |
| 468 | |
| 469 isolate->cpu_profiler()->processor_->RememberMovedFunction(function); | |
| 470 } | |
| 471 | |
| 472 | |
| 473 void CpuProfiler::FunctionMoveEvent(Heap* heap, Address from, Address to) { | |
| 474 heap->isolate()->cpu_profiler()->processor_->FunctionMoveEvent(from, to); | |
| 475 } | |
| 476 | |
| 477 | |
| 478 void CpuProfiler::FunctionDeleteEvent(Address from) { | |
| 479 Isolate::Current()->cpu_profiler()->processor_->FunctionDeleteEvent(from); | |
| 480 } | 411 } |
| 481 | 412 |
| 482 | 413 |
| 483 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) { | 414 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) { |
| 484 Isolate::Current()->cpu_profiler()->processor_->CallbackCreateEvent( | 415 Isolate::Current()->cpu_profiler()->processor_->CallbackCreateEvent( |
| 485 Logger::CALLBACK_TAG, "get ", name, entry_point); | 416 Logger::CALLBACK_TAG, "get ", name, entry_point); |
| 486 } | 417 } |
| 487 | 418 |
| 488 | 419 |
| 489 void CpuProfiler::RegExpCodeCreateEvent(Code* code, String* source) { | 420 void CpuProfiler::RegExpCodeCreateEvent(Code* code, String* source) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 processor_->Start(); | 473 processor_->Start(); |
| 543 // Enumerate stuff we already have in the heap. | 474 // Enumerate stuff we already have in the heap. |
| 544 if (HEAP->HasBeenSetup()) { | 475 if (HEAP->HasBeenSetup()) { |
| 545 if (!FLAG_prof_browser_mode) { | 476 if (!FLAG_prof_browser_mode) { |
| 546 bool saved_log_code_flag = FLAG_log_code; | 477 bool saved_log_code_flag = FLAG_log_code; |
| 547 FLAG_log_code = true; | 478 FLAG_log_code = true; |
| 548 LOGGER->LogCodeObjects(); | 479 LOGGER->LogCodeObjects(); |
| 549 FLAG_log_code = saved_log_code_flag; | 480 FLAG_log_code = saved_log_code_flag; |
| 550 } | 481 } |
| 551 LOGGER->LogCompiledFunctions(); | 482 LOGGER->LogCompiledFunctions(); |
| 552 LOGGER->LogFunctionObjects(); | |
| 553 LOGGER->LogAccessorCallbacks(); | 483 LOGGER->LogAccessorCallbacks(); |
| 554 } | 484 } |
| 555 // Enable stack sampling. | 485 // Enable stack sampling. |
| 556 Sampler* sampler = reinterpret_cast<Sampler*>(LOGGER->ticker_); | 486 Sampler* sampler = reinterpret_cast<Sampler*>(LOGGER->ticker_); |
| 557 if (!sampler->IsActive()) sampler->Start(); | 487 if (!sampler->IsActive()) sampler->Start(); |
| 558 sampler->IncreaseProfilingDepth(); | 488 sampler->IncreaseProfilingDepth(); |
| 559 } | 489 } |
| 560 } | 490 } |
| 561 | 491 |
| 562 | 492 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 #ifdef ENABLE_LOGGING_AND_PROFILING | 551 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 622 Isolate* isolate = Isolate::Current(); | 552 Isolate* isolate = Isolate::Current(); |
| 623 if (isolate->cpu_profiler() != NULL) { | 553 if (isolate->cpu_profiler() != NULL) { |
| 624 delete isolate->cpu_profiler(); | 554 delete isolate->cpu_profiler(); |
| 625 } | 555 } |
| 626 isolate->set_cpu_profiler(NULL); | 556 isolate->set_cpu_profiler(NULL); |
| 627 #endif | 557 #endif |
| 628 } | 558 } |
| 629 | 559 |
| 630 } } // namespace v8::internal | 560 } } // namespace v8::internal |
| OLD | NEW |