OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "runtime-profiler.h" | 30 #include "runtime-profiler.h" |
31 | 31 |
32 #include "assembler.h" | 32 #include "assembler.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
34 #include "compilation-cache.h" | 34 #include "compilation-cache.h" |
35 #include "deoptimizer.h" | 35 #include "deoptimizer.h" |
36 #include "execution.h" | 36 #include "execution.h" |
37 #include "global-handles.h" | 37 #include "global-handles.h" |
| 38 #include "isolate-inl.h" |
38 #include "mark-compact.h" | 39 #include "mark-compact.h" |
39 #include "platform.h" | 40 #include "platform.h" |
40 #include "scopeinfo.h" | 41 #include "scopeinfo.h" |
41 | 42 |
42 namespace v8 { | 43 namespace v8 { |
43 namespace internal { | 44 namespace internal { |
44 | 45 |
45 | 46 |
46 // Optimization sampler constants. | 47 // Optimization sampler constants. |
47 static const int kSamplerFrameCount = 2; | 48 static const int kSamplerFrameCount = 2; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // was not waiting. | 332 // was not waiting. |
332 if (new_state != 0) { | 333 if (new_state != 0) { |
333 NoBarrier_AtomicIncrement(&state_, -1); | 334 NoBarrier_AtomicIncrement(&state_, -1); |
334 } | 335 } |
335 } | 336 } |
336 | 337 |
337 | 338 |
338 void RuntimeProfiler::RemoveDeadSamples() { | 339 void RuntimeProfiler::RemoveDeadSamples() { |
339 for (int i = 0; i < kSamplerWindowSize; i++) { | 340 for (int i = 0; i < kSamplerWindowSize; i++) { |
340 Object* function = sampler_window_[i]; | 341 Object* function = sampler_window_[i]; |
341 if (function != NULL && !HeapObject::cast(function)->IsMarked()) { | 342 if (function != NULL && |
| 343 !Marking::MarkBitFrom(HeapObject::cast(function)).Get()) { |
342 sampler_window_[i] = NULL; | 344 sampler_window_[i] = NULL; |
343 } | 345 } |
344 } | 346 } |
345 } | 347 } |
346 | 348 |
347 | 349 |
348 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { | 350 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { |
349 for (int i = 0; i < kSamplerWindowSize; i++) { | 351 for (int i = 0; i < kSamplerWindowSize; i++) { |
350 visitor->VisitPointer(&sampler_window_[i]); | 352 visitor->VisitPointer(&sampler_window_[i]); |
351 } | 353 } |
352 } | 354 } |
353 | 355 |
354 | 356 |
355 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { | 357 bool RuntimeProfilerRateLimiter::SuspendIfNecessary() { |
356 if (!RuntimeProfiler::IsSomeIsolateInJS()) { | 358 if (!RuntimeProfiler::IsSomeIsolateInJS()) { |
357 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 359 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
358 } | 360 } |
359 return false; | 361 return false; |
360 } | 362 } |
361 | 363 |
362 | 364 |
363 } } // namespace v8::internal | 365 } } // namespace v8::internal |
OLD | NEW |