| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 current = next; | 251 current = next; |
| 252 } | 252 } |
| 253 optimize_soon_list_ = NULL; | 253 optimize_soon_list_ = NULL; |
| 254 | 254 |
| 255 // Run through the JavaScript frames and collect them. If we already | 255 // Run through the JavaScript frames and collect them. If we already |
| 256 // have a sample of the function, we mark it for optimizations | 256 // have a sample of the function, we mark it for optimizations |
| 257 // (eagerly or lazily). | 257 // (eagerly or lazily). |
| 258 JSFunction* samples[kSamplerFrameCount]; | 258 JSFunction* samples[kSamplerFrameCount]; |
| 259 int sample_count = 0; | 259 int sample_count = 0; |
| 260 int frame_count = 0; | 260 int frame_count = 0; |
| 261 for (JavaScriptFrameIterator it; | 261 for (JavaScriptFrameIterator it(isolate_); |
| 262 frame_count++ < kSamplerFrameCount && !it.done(); | 262 frame_count++ < kSamplerFrameCount && !it.done(); |
| 263 it.Advance()) { | 263 it.Advance()) { |
| 264 JavaScriptFrame* frame = it.frame(); | 264 JavaScriptFrame* frame = it.frame(); |
| 265 JSFunction* function = JSFunction::cast(frame->function()); | 265 JSFunction* function = JSFunction::cast(frame->function()); |
| 266 | 266 |
| 267 // Adjust threshold each time we have processed | 267 // Adjust threshold each time we have processed |
| 268 // a certain number of ticks. | 268 // a certain number of ticks. |
| 269 if (sampler_ticks_until_threshold_adjustment_ > 0) { | 269 if (sampler_ticks_until_threshold_adjustment_ > 0) { |
| 270 sampler_ticks_until_threshold_adjustment_--; | 270 sampler_ticks_until_threshold_adjustment_--; |
| 271 if (sampler_ticks_until_threshold_adjustment_ <= 0) { | 271 if (sampler_ticks_until_threshold_adjustment_ <= 0) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } else { | 469 } else { |
| 470 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); | 470 return RuntimeProfiler::WaitForSomeIsolateToEnterJS(); |
| 471 } | 471 } |
| 472 } | 472 } |
| 473 #endif | 473 #endif |
| 474 return false; | 474 return false; |
| 475 } | 475 } |
| 476 | 476 |
| 477 | 477 |
| 478 } } // namespace v8::internal | 478 } } // namespace v8::internal |
| OLD | NEW |