Lines Matching defs:function
23 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
25 if (FLAG_trace_lazy && !function->shared()->is_compiled()) {
27 function->PrintName();
34 // Compile the target function.
35 DCHECK(function->shared()->allows_lazy_compilation());
39 Compiler::GetLazyCode(function));
42 function->ReplaceCode(*code);
49 Object* CompileOptimized(Isolate* isolate, Handle<JSFunction> function,
55 Handle<Code> unoptimized(function->shared()->code());
56 if (Compiler::GetOptimizedCode(function, unoptimized, mode).ToHandle(&code)) {
58 function->ReplaceCode(*code);
64 code = Handle<Code>(function->shared()->code(), isolate);
65 if (code->kind() != Code::FUNCTION &&
68 isolate, code, Compiler::GetUnoptimizedCode(function));
70 function->ReplaceCode(*code);
73 DCHECK(function->code()->kind() == Code::FUNCTION ||
74 function->code()->kind() == Code::OPTIMIZED_FUNCTION ||
75 function->IsInOptimizationQueue());
76 return function->code();
85 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
86 return CompileOptimized(isolate, function, Compiler::CONCURRENT);
93 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
94 return CompileOptimized(isolate, function, Compiler::NOT_CONCURRENT);
139 Handle<JSFunction> function = deoptimizer->function();
151 RUNTIME_ASSERT(frame->function()->IsJSFunction());
152 DCHECK(frame->function() == *function);
163 // Search for other activations of the same function and code.
169 if (function->code() == *optimized_code) {
172 function->PrintName();
175 function->ReplaceCode(function->shared()->code());
177 // Evict optimized code for this function from the cache so that it
179 function->shared()->EvictFromOptimizedCodeMap(*optimized_code,
184 // If there is an index by shared function info, all the better.
185 Deoptimizer::DeoptimizeFunction(*function);
193 Handle<JSFunction> function) {
195 if (function->shared()->optimization_disabled()) return false;
197 // activations of the function, it means (a) the function is directly or
200 // Check for optimized activations of this function.
203 if (frame->is_optimized() && frame->function() == *function) return false;
213 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
214 Handle<Code> caller_code(function->shared()->code());
216 // We're not prepared to handle a function with arguments object.
217 DCHECK(!function->shared()->uses_arguments());
227 // function info. It may have been replaced to include deoptimization data.
235 DCHECK_EQ(frame->function(), *function);
246 !function->shared()->asm_function() &&
247 function->shared()->ast_node_count() > 512)
259 if (dispatcher->IsQueuedForOSR(function, ast_id)) {
262 function->PrintName();
268 job = dispatcher->FindReadyOSRCandidate(function, ast_id);
274 function->PrintName();
278 } else if (IsSuitableForOnStackReplacement(isolate, function)) {
281 function->PrintName();
285 function, caller_code, mode, ast_id,
310 function->shared()->increment_deopt_count();
313 // TurboFanned OSR code cannot be installed into the function.
314 // But the function is obviously hot, so optimize it next time.
315 function->ReplaceCode(
318 // Crankshafted OSR code can be installed into the function.
319 function->ReplaceCode(*result);
328 function->PrintName();
332 if (!function->IsOptimized()) {
333 function->ReplaceCode(function->shared()->code());
342 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
352 return (function->IsOptimized()) ? function->code()
353 : function->shared()->code();
395 // and return the compiled function bound in the local context.