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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "cpu-profiler-inl.h" | 30 #include "cpu-profiler-inl.h" |
31 | 31 |
| 32 #include "compiler.h" |
32 #include "frames-inl.h" | 33 #include "frames-inl.h" |
33 #include "hashmap.h" | 34 #include "hashmap.h" |
34 #include "log-inl.h" | 35 #include "log-inl.h" |
35 #include "vm-state-inl.h" | 36 #include "vm-state-inl.h" |
36 | 37 |
37 #include "../include/v8-profiler.h" | 38 #include "../include/v8-profiler.h" |
38 | 39 |
39 namespace v8 { | 40 namespace v8 { |
40 namespace internal { | 41 namespace internal { |
41 | 42 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 events_buffer_.Enqueue(evt_rec); | 74 events_buffer_.Enqueue(evt_rec); |
74 } | 75 } |
75 | 76 |
76 | 77 |
77 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, | 78 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, |
78 Name* name, | 79 Name* name, |
79 String* resource_name, | 80 String* resource_name, |
80 int line_number, | 81 int line_number, |
81 Address start, | 82 Address start, |
82 unsigned size, | 83 unsigned size, |
83 Address shared) { | 84 Address shared, |
| 85 CompilationInfo* info) { |
84 if (FilterOutCodeCreateEvent(tag)) return; | 86 if (FilterOutCodeCreateEvent(tag)) return; |
85 CodeEventsContainer evt_rec; | 87 CodeEventsContainer evt_rec; |
86 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 88 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
87 rec->type = CodeEventRecord::CODE_CREATION; | 89 rec->type = CodeEventRecord::CODE_CREATION; |
88 rec->order = ++enqueue_order_; | 90 rec->order = ++enqueue_order_; |
89 rec->start = start; | 91 rec->start = start; |
90 rec->entry = profiles_->NewCodeEntry(tag, name, resource_name, line_number); | 92 rec->entry = profiles_->NewCodeEntry(tag, name, resource_name, line_number); |
| 93 if (info) { |
| 94 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); |
| 95 } |
91 rec->size = size; | 96 rec->size = size; |
92 rec->shared = shared; | 97 rec->shared = shared; |
93 events_buffer_.Enqueue(evt_rec); | 98 events_buffer_.Enqueue(evt_rec); |
94 } | 99 } |
95 | 100 |
96 | 101 |
97 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, | 102 void ProfilerEventsProcessor::CodeCreateEvent(Logger::LogEventsAndTags tag, |
98 const char* name, | 103 const char* name, |
99 Address start, | 104 Address start, |
100 unsigned size) { | 105 unsigned size) { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 321 |
317 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 322 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
318 Code* code, Name* name) { | 323 Code* code, Name* name) { |
319 processor_->CodeCreateEvent( | 324 processor_->CodeCreateEvent( |
320 tag, | 325 tag, |
321 name, | 326 name, |
322 isolate_->heap()->empty_string(), | 327 isolate_->heap()->empty_string(), |
323 v8::CpuProfileNode::kNoLineNumberInfo, | 328 v8::CpuProfileNode::kNoLineNumberInfo, |
324 code->address(), | 329 code->address(), |
325 code->ExecutableSize(), | 330 code->ExecutableSize(), |
| 331 NULL, |
326 NULL); | 332 NULL); |
327 } | 333 } |
328 | 334 |
329 | 335 |
330 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 336 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
331 Code* code, | 337 Code* code, |
332 SharedFunctionInfo* shared, | 338 SharedFunctionInfo* shared, |
| 339 CompilationInfo* info, |
333 Name* name) { | 340 Name* name) { |
334 processor_->CodeCreateEvent( | 341 processor_->CodeCreateEvent( |
335 tag, | 342 tag, |
336 name, | 343 name, |
337 isolate_->heap()->empty_string(), | 344 isolate_->heap()->empty_string(), |
338 v8::CpuProfileNode::kNoLineNumberInfo, | 345 v8::CpuProfileNode::kNoLineNumberInfo, |
339 code->address(), | 346 code->address(), |
340 code->ExecutableSize(), | 347 code->ExecutableSize(), |
341 shared->address()); | 348 shared->address(), |
| 349 info); |
342 } | 350 } |
343 | 351 |
344 | 352 |
345 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 353 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
346 Code* code, | 354 Code* code, |
347 SharedFunctionInfo* shared, | 355 SharedFunctionInfo* shared, |
| 356 CompilationInfo* info, |
348 String* source, int line) { | 357 String* source, int line) { |
349 processor_->CodeCreateEvent( | 358 processor_->CodeCreateEvent( |
350 tag, | 359 tag, |
351 shared->DebugName(), | 360 shared->DebugName(), |
352 source, | 361 source, |
353 line, | 362 line, |
354 code->address(), | 363 code->address(), |
355 code->ExecutableSize(), | 364 code->ExecutableSize(), |
356 shared->address()); | 365 shared->address(), |
| 366 info); |
357 } | 367 } |
358 | 368 |
359 | 369 |
360 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, | 370 void CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag, |
361 Code* code, int args_count) { | 371 Code* code, int args_count) { |
362 processor_->CodeCreateEvent( | 372 processor_->CodeCreateEvent( |
363 tag, | 373 tag, |
364 args_count, | 374 args_count, |
365 code->address(), | 375 code->address(), |
366 code->ExecutableSize()); | 376 code->ExecutableSize()); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 processor_->Join(); | 523 processor_->Join(); |
514 delete processor_; | 524 delete processor_; |
515 delete generator_; | 525 delete generator_; |
516 processor_ = NULL; | 526 processor_ = NULL; |
517 generator_ = NULL; | 527 generator_ = NULL; |
518 logger->logging_nesting_ = saved_logging_nesting_; | 528 logger->logging_nesting_ = saved_logging_nesting_; |
519 } | 529 } |
520 | 530 |
521 | 531 |
522 } } // namespace v8::internal | 532 } } // namespace v8::internal |
OLD | NEW |