Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/runtime-profiler.cc

Issue 18404009: Refactor JavaScriptFrame::function() to return a JSFunction* and remove associated casts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove implicit ASSERT. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // (eagerly or lazily). 240 // (eagerly or lazily).
241 JSFunction* samples[kSamplerFrameCount]; 241 JSFunction* samples[kSamplerFrameCount];
242 int sample_count = 0; 242 int sample_count = 0;
243 int frame_count = 0; 243 int frame_count = 0;
244 int frame_count_limit = FLAG_watch_ic_patching ? FLAG_frame_count 244 int frame_count_limit = FLAG_watch_ic_patching ? FLAG_frame_count
245 : kSamplerFrameCount; 245 : kSamplerFrameCount;
246 for (JavaScriptFrameIterator it(isolate_); 246 for (JavaScriptFrameIterator it(isolate_);
247 frame_count++ < frame_count_limit && !it.done(); 247 frame_count++ < frame_count_limit && !it.done();
248 it.Advance()) { 248 it.Advance()) {
249 JavaScriptFrame* frame = it.frame(); 249 JavaScriptFrame* frame = it.frame();
250 JSFunction* function = JSFunction::cast(frame->function()); 250 JSFunction* function = frame->function();
251 251
252 if (!FLAG_watch_ic_patching) { 252 if (!FLAG_watch_ic_patching) {
253 // Adjust threshold each time we have processed 253 // Adjust threshold each time we have processed
254 // a certain number of ticks. 254 // a certain number of ticks.
255 if (sampler_ticks_until_threshold_adjustment_ > 0) { 255 if (sampler_ticks_until_threshold_adjustment_ > 0) {
256 sampler_ticks_until_threshold_adjustment_--; 256 sampler_ticks_until_threshold_adjustment_--;
257 if (sampler_ticks_until_threshold_adjustment_ <= 0) { 257 if (sampler_ticks_until_threshold_adjustment_ <= 0) {
258 // If the threshold is not already at the minimum 258 // If the threshold is not already at the minimum
259 // modify and reset the ticks until next adjustment. 259 // modify and reset the ticks until next adjustment.
260 if (sampler_threshold_ > kSamplerThresholdMin) { 260 if (sampler_threshold_ > kSamplerThresholdMin) {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 441
442 442
443 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) { 443 void RuntimeProfiler::UpdateSamplesAfterCompact(ObjectVisitor* visitor) {
444 for (int i = 0; i < kSamplerWindowSize; i++) { 444 for (int i = 0; i < kSamplerWindowSize; i++) {
445 visitor->VisitPointer(&sampler_window_[i]); 445 visitor->VisitPointer(&sampler_window_[i]);
446 } 446 }
447 } 447 }
448 448
449 449
450 } } // namespace v8::internal 450 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698