Lines Matching refs:function
24 #include "src/objects/shared-function-info.h"
32 Object CompileOptimized(Isolate* isolate, Handle<JSFunction> function,
34 // As a pre- and post-condition of CompileOptimized, the function *must* be
36 IsCompiledScope is_compiled_scope(function->shared(), isolate);
45 Compiler::CompileOptimized(isolate, function, mode, target_kind);
47 DCHECK(function->is_compiled());
48 return function->code();
56 Handle<JSFunction> function = args.at<JSFunction>(0);
58 Handle<SharedFunctionInfo> sfi(function->shared(), isolate);
62 PrintF("[unoptimized: %s]\n", function->DebugNameCStr().get());
71 if (!Compiler::Compile(isolate, function, Compiler::KEEP_EXCEPTION,
75 DCHECK(function->is_compiled());
76 return function->code();
82 Handle<JSFunction> function = args.at<JSFunction>(0);
83 Handle<SharedFunctionInfo> sfi(function->shared(), isolate);
86 DCHECK(!function->HasAvailableOptimizedCode());
87 DCHECK(!function->has_feedback_vector());
88 JSFunction::CreateAndAttachFeedbackVector(isolate, function,
91 function->set_code(baseline_code);
98 Handle<JSFunction> function = args.at<JSFunction>(0);
99 return CompileOptimized(isolate, function, CodeKind::MAGLEV,
106 Handle<JSFunction> function = args.at<JSFunction>(0);
107 return CompileOptimized(isolate, function, CodeKind::MAGLEV,
114 Handle<JSFunction> function = args.at<JSFunction>(0);
115 return CompileOptimized(isolate, function, CodeKind::TURBOFAN,
122 Handle<JSFunction> function = args.at<JSFunction>(0);
123 return CompileOptimized(isolate, function, CodeKind::TURBOFAN,
130 Handle<JSFunction> function = args.at<JSFunction>(0);
132 DCHECK(function->shared().is_compiled());
134 function->feedback_vector().EvictOptimizedCodeMarkedForDeoptimization(
135 function->shared(), "Runtime_HealOptimizedCodeSlot");
136 return function->code();
142 Handle<JSFunction> function = args.at<JSFunction>(0);
156 Handle<SharedFunctionInfo> shared(function->shared(), isolate);
163 // Remove wasm data, mark as broken for asm->wasm, replace function code
169 DCHECK_EQ(function->code(), *BUILTIN_CODE(isolate, InstantiateAsmJs));
170 function->set_code(*BUILTIN_CODE(isolate, CompileLazy));
185 Handle<JSFunction> function = deoptimizer->function();
186 // For OSR the optimized code isn't installed on the function, so get the
193 isolate->set_context(deoptimizer->function()->native_context());
206 Deoptimizer::DeoptimizeFunction(*function, *optimized_code);
242 DCHECK(frame->function().shared().HasBytecodeArray());
254 Handle<JSFunction> function(frame->function(), isolate);
257 // code for the current function but at a different OSR offset - that may
261 function->native_context().osr_code_cache().FirstOsrOffsetFor(
262 function->shared());
270 "cached entry. function: %s, requested: %d, cached: %d]\n",
271 function->DebugNameCStr().get(), osr_offset.ToInt(),
279 if (!Compiler::CompileOptimizedOSR(isolate, function, osr_offset, frame, mode)
285 if (!function->HasAttachedOptimizedCode()) {
286 function->set_code(function->shared().GetCode(), kReleaseStore);
304 "[OSR - entry. function: %s, osr offset: %d, pc offset: %d]\n",
305 function->DebugNameCStr().get(), osr_offset.ToInt(),
309 if (function->feedback_vector().invocation_count() <= 1 &&
310 !IsNone(function->tiering_state()) &&
311 !IsInProgress(function->tiering_state())) {
313 // initial part of the function that was executed before we allocated a
317 // should only mark a function for optimization if it has sufficient
319 // a function for optimization. We should instead change it to be based
321 function->reset_tiering_state();
325 // the function for non-concurrent compilation. We could arm the loops
328 if (!function->HasAvailableOptimizedCode() &&
329 function->feedback_vector().invocation_count() > 1) {
336 "[OSR - forcing synchronous optimization on next entry. function: "
338 function->DebugNameCStr().get());
340 function->set_tiering_state(TieringState::kRequestTurbofan_Synchronous);
375 // and return the compiled function bound in the local context.