OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 return; | 148 return; |
149 } | 149 } |
150 | 150 |
151 const Address js_entry_sp = Top::js_entry_sp(Top::GetCurrentThread()); | 151 const Address js_entry_sp = Top::js_entry_sp(Top::GetCurrentThread()); |
152 if (js_entry_sp == 0) { | 152 if (js_entry_sp == 0) { |
153 // Not executing JS now. | 153 // Not executing JS now. |
154 sample->frames_count = 0; | 154 sample->frames_count = 0; |
155 return; | 155 return; |
156 } | 156 } |
157 | 157 |
158 int i = 0; | |
159 const Address callback = Logger::current_state_ ? | |
Søren Thygesen Gjesse
2009/11/23 14:35:12
Please use Logger::current_state_ != NULL.
mnaganov (inactive)
2009/11/23 14:42:26
Done.
| |
160 Logger::current_state_->external_callback() : NULL; | |
161 if (callback != NULL) { | |
162 sample->stack[i++] = callback; | |
163 } | |
164 | |
158 SafeStackTraceFrameIterator it( | 165 SafeStackTraceFrameIterator it( |
159 reinterpret_cast<Address>(sample->fp), | 166 reinterpret_cast<Address>(sample->fp), |
160 reinterpret_cast<Address>(sample->sp), | 167 reinterpret_cast<Address>(sample->sp), |
161 reinterpret_cast<Address>(sample->sp), | 168 reinterpret_cast<Address>(sample->sp), |
162 js_entry_sp); | 169 js_entry_sp); |
163 int i = 0; | |
164 while (!it.done() && i < TickSample::kMaxFramesCount) { | 170 while (!it.done() && i < TickSample::kMaxFramesCount) { |
165 sample->stack[i++] = it.frame()->pc(); | 171 sample->stack[i++] = it.frame()->pc(); |
166 it.Advance(); | 172 it.Advance(); |
167 } | 173 } |
168 sample->frames_count = i; | 174 sample->frames_count = i; |
169 } | 175 } |
170 | 176 |
171 | 177 |
172 // | 178 // |
173 // Ticker used to provide ticks to the profiler and the sliding state | 179 // Ticker used to provide ticks to the profiler and the sliding state |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
676 | 682 |
677 void Logger::CallbackEvent(String* name, Address entry_point) { | 683 void Logger::CallbackEvent(String* name, Address entry_point) { |
678 #ifdef ENABLE_LOGGING_AND_PROFILING | 684 #ifdef ENABLE_LOGGING_AND_PROFILING |
679 if (!Log::IsEnabled() || !FLAG_log_code) return; | 685 if (!Log::IsEnabled() || !FLAG_log_code) return; |
680 LogMessageBuilder msg; | 686 LogMessageBuilder msg; |
681 msg.Append("%s,%s,", | 687 msg.Append("%s,%s,", |
682 log_events_[CODE_CREATION_EVENT], log_events_[CALLBACK_TAG]); | 688 log_events_[CODE_CREATION_EVENT], log_events_[CALLBACK_TAG]); |
683 msg.AppendAddress(entry_point); | 689 msg.AppendAddress(entry_point); |
684 SmartPointer<char> str = | 690 SmartPointer<char> str = |
685 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 691 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
686 msg.Append(",0,\"%s\"", *str); | 692 msg.Append(",1,\"%s\"", *str); |
687 if (FLAG_compress_log) { | 693 if (FLAG_compress_log) { |
688 ASSERT(compression_helper_ != NULL); | 694 ASSERT(compression_helper_ != NULL); |
689 if (!compression_helper_->HandleMessage(&msg)) return; | 695 if (!compression_helper_->HandleMessage(&msg)) return; |
690 } | 696 } |
691 msg.Append('\n'); | 697 msg.Append('\n'); |
692 msg.WriteToLogFile(); | 698 msg.WriteToLogFile(); |
693 #endif | 699 #endif |
694 } | 700 } |
695 | 701 |
696 | 702 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1390 // Otherwise, if the sliding state window computation has not been | 1396 // Otherwise, if the sliding state window computation has not been |
1391 // started we do it now. | 1397 // started we do it now. |
1392 if (sliding_state_window_ == NULL) { | 1398 if (sliding_state_window_ == NULL) { |
1393 sliding_state_window_ = new SlidingStateWindow(); | 1399 sliding_state_window_ = new SlidingStateWindow(); |
1394 } | 1400 } |
1395 #endif | 1401 #endif |
1396 } | 1402 } |
1397 | 1403 |
1398 | 1404 |
1399 } } // namespace v8::internal | 1405 } } // namespace v8::internal |
OLD | NEW |