| 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 23 matching lines...) Expand all Loading... |
| 34 namespace v8 { | 34 namespace v8 { |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 StatsTable::StatsTable() | 37 StatsTable::StatsTable() |
| 38 : lookup_function_(NULL), | 38 : lookup_function_(NULL), |
| 39 create_histogram_function_(NULL), | 39 create_histogram_function_(NULL), |
| 40 add_histogram_sample_function_(NULL) {} | 40 add_histogram_sample_function_(NULL) {} |
| 41 | 41 |
| 42 | 42 |
| 43 int* StatsCounter::FindLocationInStatsTable() const { | 43 int* StatsCounter::FindLocationInStatsTable() const { |
| 44 return Isolate::Current()->stats_table()->FindLocation(name_); | 44 return isolate_->stats_table()->FindLocation(name_); |
| 45 } | 45 } |
| 46 | 46 |
| 47 | 47 |
| 48 void Histogram::AddSample(int sample) { | 48 void Histogram::AddSample(int sample) { |
| 49 if (Enabled()) { | 49 if (Enabled()) { |
| 50 isolate()->stats_table()->AddHistogramSample(histogram_, sample); | 50 isolate()->stats_table()->AddHistogramSample(histogram_, sample); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 void* Histogram::CreateHistogram() const { | 54 void* Histogram::CreateHistogram() const { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 74 // Compute the delta between start and stop, in milliseconds. | 74 // Compute the delta between start and stop, in milliseconds. |
| 75 AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds())); | 75 AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds())); |
| 76 timer_.Stop(); | 76 timer_.Stop(); |
| 77 } | 77 } |
| 78 if (FLAG_log_internal_timer_events) { | 78 if (FLAG_log_internal_timer_events) { |
| 79 LOG(isolate(), TimerEvent(Logger::END, name())); | 79 LOG(isolate(), TimerEvent(Logger::END, name())); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 } } // namespace v8::internal | 83 } } // namespace v8::internal |
| OLD | NEW |