| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 kSamplerTicksBetweenThresholdAdjustment; | 401 kSamplerTicksBetweenThresholdAdjustment; |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 | 405 |
| 406 void RuntimeProfiler::TearDown() { | 406 void RuntimeProfiler::TearDown() { |
| 407 // Nothing to do. | 407 // Nothing to do. |
| 408 } | 408 } |
| 409 | 409 |
| 410 | 410 |
| 411 int RuntimeProfiler::SamplerWindowSize() { |
| 412 return kSamplerWindowSize; |
| 413 } |
| 414 |
| 415 |
| 411 // Update the pointers in the sampler window after a GC. | 416 // Update the pointers in the sampler window after a GC. |
| 412 void RuntimeProfiler::UpdateSamplesAfterScavenge() { | 417 void RuntimeProfiler::UpdateSamplesAfterScavenge() { |
| 413 for (int i = 0; i < kSamplerWindowSize; i++) { | 418 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 414 Object* function = sampler_window_[i]; | 419 Object* function = sampler_window_[i]; |
| 415 if (function != NULL && isolate_->heap()->InNewSpace(function)) { | 420 if (function != NULL && isolate_->heap()->InNewSpace(function)) { |
| 416 MapWord map_word = HeapObject::cast(function)->map_word(); | 421 MapWord map_word = HeapObject::cast(function)->map_word(); |
| 417 if (map_word.IsForwardingAddress()) { | 422 if (map_word.IsForwardingAddress()) { |
| 418 sampler_window_[i] = map_word.ToForwardingAddress(); | 423 sampler_window_[i] = map_word.ToForwardingAddress(); |
| 419 } else { | 424 } else { |
| 420 sampler_window_[i] = NULL; | 425 sampler_window_[i] = NULL; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 436 | 441 |
| 437 | 442 |
| 438 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 443 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
| 439 for (int i = 0; i < kSamplerWindowSize; i++) { | 444 for (int i = 0; i < kSamplerWindowSize; i++) { |
| 440 visitor->VisitPointer(&sampler_window_[i]); | 445 visitor->VisitPointer(&sampler_window_[i]); |
| 441 } | 446 } |
| 442 } | 447 } |
| 443 | 448 |
| 444 | 449 |
| 445 } } // namespace v8::internal | 450 } } // namespace v8::internal |
| OLD | NEW |