| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 sampler_window_[i] = NULL; | 219 sampler_window_[i] = NULL; |
| 220 sampler_window_weight_[i] = 0; | 220 sampler_window_weight_[i] = 0; |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 | 225 |
| 226 int RuntimeProfiler::LookupSample(JSFunction* function) { | 226 int RuntimeProfiler::LookupSample(JSFunction* function) { |
| 227 int weight = 0; | 227 int weight = 0; |
| 228 for (int i = 0; i < kSamplerWindowSize; i++) { | 228 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 229 JSFunction* sample = sampler_window_[i]; | 229 Object* sample = sampler_window_[i]; |
| 230 if (sample != NULL) { | 230 if (sample != NULL) { |
| 231 if (function == sample) { | 231 if (function == sample) { |
| 232 weight += sampler_window_weight_[i]; | 232 weight += sampler_window_weight_[i]; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 return weight; | 236 return weight; |
| 237 } | 237 } |
| 238 | 238 |
| 239 | 239 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 sampler_threshold_size_factor_ = kSamplerThresholdSizeFactorInit; | 346 sampler_threshold_size_factor_ = kSamplerThresholdSizeFactorInit; |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| 350 void RuntimeProfiler::TearDown() { | 350 void RuntimeProfiler::TearDown() { |
| 351 // Nothing to do. | 351 // Nothing to do. |
| 352 } | 352 } |
| 353 | 353 |
| 354 | 354 |
| 355 Object** RuntimeProfiler::SamplerWindowAddress() { | 355 Object** RuntimeProfiler::SamplerWindowAddress() { |
| 356 return reinterpret_cast<Object**>(sampler_window_); | 356 return sampler_window_; |
| 357 } | 357 } |
| 358 | 358 |
| 359 | 359 |
| 360 int RuntimeProfiler::SamplerWindowSize() { | 360 int RuntimeProfiler::SamplerWindowSize() { |
| 361 return kSamplerWindowSize; | 361 return kSamplerWindowSize; |
| 362 } | 362 } |
| 363 | 363 |
| 364 | 364 |
| 365 void RuntimeProfiler::HandleWakeUp(Isolate* isolate) { | 365 void RuntimeProfiler::HandleWakeUp(Isolate* isolate) { |
| 366 // The profiler thread must still be waiting. | 366 // The profiler thread must still be waiting. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 ++non_js_ticks_; | 403 ++non_js_ticks_; |
| 404 } else { | 404 } else { |
| 405 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 405 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 return false; | 408 return false; |
| 409 } | 409 } |
| 410 | 410 |
| 411 | 411 |
| 412 } } // namespace v8::internal | 412 } } // namespace v8::internal |
| OLD | NEW |