Lines Matching refs:function
65 // Number of times a function has to be seen on the stack before it is
68 // If a function does not have enough type info (according to
75 // Maximum size in bytes of generated code for a function to be optimized
111 static void GetICCounts(JSFunction* function,
118 function->shared()->code()->type_feedback_info();
130 void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) {
131 ASSERT(function->IsOptimizable());
134 function->PrintName();
135 PrintF(" 0x%" V8PRIxPTR, reinterpret_cast<intptr_t>(function->address()));
139 GetICCounts(function, &typeinfo, &total, &percentage);
145 // The next call to the function will trigger optimization.
146 function->MarkForLazyRecompilation();
150 void RuntimeProfiler::AttemptOnStackReplacement(JSFunction* function) {
153 ASSERT(function->IsMarkedForLazyRecompilation());
156 function->IsBuiltin()) {
160 SharedFunctionInfo* shared = function->shared();
164 // We are not prepared to do OSR for a function that already has an
174 function->PrintName();
211 int RuntimeProfiler::LookupSample(JSFunction* function) {
216 if (function == sample) {
225 void RuntimeProfiler::AddSample(JSFunction* function, int weight) {
227 sampler_window_[sampler_window_position_] = function;
238 // have a sample of the function, we mark it for optimizations
249 JSFunction* function = JSFunction::cast(frame->function());
268 Code* shared_code = function->shared()->code();
269 if (shared_code->kind() != Code::FUNCTION) continue;
271 if (function->IsMarkedForLazyRecompilation()) {
273 if (nesting == 0) AttemptOnStackReplacement(function);
279 if (!function->IsOptimizable()) continue;
280 if (function->shared()->optimization_disabled()) continue;
286 if (function->shared()->is_toplevel()
288 || function->shared()->SourceSize() > kMaxToplevelSourceSize)) {
297 GetICCounts(function, &typeinfo, &total, &percentage);
299 // If this particular function hasn't had any ICs patched for enough
301 Optimize(function, "hot and stable");
303 Optimize(function, "not much type info but very hot");
308 function->PrintName();
315 // If no IC was patched since the last tick and this function is very
317 Optimize(function, "small function");
325 Optimize(function, "stable on startup");
330 samples[sample_count++] = function;
332 int function_size = function->shared()->SourceSize();
339 if (LookupSample(function) >= threshold) {
340 Optimize(function, "sampler window lookup");
404 Object* function = sampler_window_[i];
405 if (function != NULL && isolate_->heap()->InNewSpace(function)) {
406 MapWord map_word = HeapObject::cast(function)->map_word();
466 Object* function = sampler_window_[i];
467 if (function != NULL &&
468 !Marking::MarkBitFrom(HeapObject::cast(function)).Get()) {