Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 #ifdef ENABLE_CPP_PROFILES_PROCESSOR | 33 #ifdef ENABLE_CPP_PROFILES_PROCESSOR |
| 34 | 34 |
| 35 #include "circular-queue-inl.h" | 35 #include "circular-queue-inl.h" |
| 36 #include "profile-generator-inl.h" | 36 #include "profile-generator-inl.h" |
| 37 | 37 |
| 38 namespace v8 { | 38 namespace v8 { |
| 39 namespace internal { | 39 namespace internal { |
| 40 | 40 |
| 41 void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) { | 41 void CodeCreateEventRecord::UpdateCodeMap(CodeMap* code_map) { |
| 42 code_map->AddCode(start, entry, size); | 42 code_map->AddCode(start, entry, size); |
| 43 } | 43 } |
| 44 | 44 |
| 45 | 45 |
| 46 void CodeMoveEventRecord::UpdateCodeMap(CodeMap* code_map) { | 46 void CodeMoveEventRecord::UpdateCodeMap(CodeMap* code_map) { |
| 47 code_map->MoveCode(from, to); | 47 code_map->MoveCode(from, to); |
| 48 } | 48 } |
| 49 | 49 |
| 50 | 50 |
| 51 void CodeDeleteEventRecord::UpdateCodeMap(CodeMap* code_map) { | 51 void CodeDeleteEventRecord::UpdateCodeMap(CodeMap* code_map) { |
| 52 code_map->DeleteCode(start); | 52 code_map->DeleteCode(start); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 void CodeAliasEventRecord::UpdateCodeMap(CodeMap* code_map) { | 56 void CodeAliasEventRecord::UpdateCodeMap(CodeMap* code_map) { |
| 57 code_map->AddAlias(alias, start); | 57 code_map->AddAlias(alias, start); |
| 58 } | |
| 59 | |
| 60 | |
| 61 TickSampleEventRecord* TickSampleEventRecord::init(void* value) { | |
| 62 TickSampleEventRecord* result = | |
| 63 reinterpret_cast<TickSampleEventRecord*>(value); | |
| 64 result->filler = 1; // != SamplingCircularQueue::kClear. | |
|
Søren Thygesen Gjesse
2010/04/12 06:56:28
Please add
ASSERT(result->filler = != SamplingCi
mnaganov (inactive)
2010/04/12 07:17:45
Done.
| |
| 65 // Init the required fields only. | |
| 66 result->sample.pc = NULL; | |
| 67 result->sample.frames_count = 0; | |
| 68 return result; | |
| 58 } | 69 } |
| 59 | 70 |
| 60 | 71 |
| 61 TickSample* ProfilerEventsProcessor::TickSampleEvent() { | 72 TickSample* ProfilerEventsProcessor::TickSampleEvent() { |
| 62 TickSampleEventRecord* evt = | 73 TickSampleEventRecord* evt = |
| 63 TickSampleEventRecord::cast(ticks_buffer_.Enqueue()); | 74 TickSampleEventRecord::init(ticks_buffer_.Enqueue()); |
| 64 evt->order = enqueue_order_; // No increment! | 75 evt->order = enqueue_order_; // No increment! |
| 65 return &evt->sample; | 76 return &evt->sample; |
| 66 } | 77 } |
| 67 | 78 |
| 68 | 79 |
| 69 bool ProfilerEventsProcessor::FilterOutCodeCreateEvent( | 80 bool ProfilerEventsProcessor::FilterOutCodeCreateEvent( |
| 70 Logger::LogEventsAndTags tag) { | 81 Logger::LogEventsAndTags tag) { |
| 71 // In browser mode, leave only callbacks and non-native JS entries. | 82 // In browser mode, leave only callbacks and non-native JS entries. |
| 72 // We filter out regular expressions as currently we can't tell | 83 // We filter out regular expressions as currently we can't tell |
| 73 // whether they origin from native scripts, so let's not confise people by | 84 // whether they origin from native scripts, so let's not confise people by |
| 74 // showing them weird regexes they didn't wrote. | 85 // showing them weird regexes they didn't wrote. |
| 75 return FLAG_prof_browser_mode | 86 return FLAG_prof_browser_mode |
| 76 && (tag != Logger::CALLBACK_TAG | 87 && (tag != Logger::CALLBACK_TAG |
| 77 && tag != Logger::FUNCTION_TAG | 88 && tag != Logger::FUNCTION_TAG |
| 78 && tag != Logger::LAZY_COMPILE_TAG | 89 && tag != Logger::LAZY_COMPILE_TAG |
| 79 && tag != Logger::SCRIPT_TAG); | 90 && tag != Logger::SCRIPT_TAG); |
| 80 } | 91 } |
| 81 | 92 |
| 82 } } // namespace v8::internal | 93 } } // namespace v8::internal |
| 83 | 94 |
| 84 #endif // ENABLE_CPP_PROFILES_PROCESSOR | 95 #endif // ENABLE_CPP_PROFILES_PROCESSOR |
| 85 | 96 |
| 86 #endif // V8_CPU_PROFILER_INL_H_ | 97 #endif // V8_CPU_PROFILER_INL_H_ |
| OLD | NEW |