Lines Matching full:shared
338 int opt_count = function->shared()->opt_count(); in RecordOptimizationStats()
339 function->shared()->set_opt_count(opt_count + 1); in RecordOptimizationStats()
357 code_size += function->shared()->SourceSize(); in RecordOptimizationStats()
375 bool IsEvalToplevel(Handle<SharedFunctionInfo> shared) { in IsEvalToplevel() argument
376 return shared->is_toplevel() && shared->script()->IsScript() && in IsEvalToplevel()
377 Script::cast(shared->script())->compilation_type() == in IsEvalToplevel()
388 Handle<SharedFunctionInfo> shared = info->shared_info(); in RecordFunctionCompilation() local
398 int line_num = Script::GetLineNumber(script, shared->start_position()) + 1; in RecordFunctionCompilation()
400 Script::GetColumnNumber(script, shared->start_position()) + 1; in RecordFunctionCompilation()
407 CodeCreateEvent(log_tag, *abstract_code, *shared, script_name, in RecordFunctionCompilation()
511 Handle<SharedFunctionInfo> shared) { in InstallSharedScopeInfo() argument
514 shared->set_scope_info(*scope_info); in InstallSharedScopeInfo()
518 Handle<SharedFunctionInfo> shared) { in InstallSharedCompilationResult() argument
523 shared->ClearBytecodeArray(); in InstallSharedCompilationResult()
526 DCHECK(!shared->HasDebugInfo()); in InstallSharedCompilationResult()
528 shared->ReplaceCode(*info->code()); in InstallSharedCompilationResult()
530 DCHECK(!shared->HasBytecodeArray()); // Only compiled once. in InstallSharedCompilationResult()
531 shared->set_bytecode_array(*info->bytecode_array()); in InstallSharedCompilationResult()
541 Handle<SharedFunctionInfo> shared = info->shared_info(); in GetUnoptimizedCode() local
542 DCHECK_EQ(shared->language_mode(), info->literal()->language_mode()); in GetUnoptimizedCode()
547 // Update the shared function info with the scope info. in GetUnoptimizedCode()
548 InstallSharedScopeInfo(info, shared); in GetUnoptimizedCode()
550 // Install compilation result on the shared function info in GetUnoptimizedCode()
551 InstallSharedCompilationResult(info, shared); in GetUnoptimizedCode()
561 Handle<SharedFunctionInfo> shared(function->shared()); in GetCodeFromOptimizedCodeMap() local
563 CodeAndLiterals cached = shared->SearchOptimizedCodeMap( in GetCodeFromOptimizedCodeMap()
569 DCHECK(function->shared()->is_compiled()); in GetCodeFromOptimizedCodeMap()
587 Handle<SharedFunctionInfo> shared(function->shared()); in InsertCodeIntoOptimizedCodeMap() local
590 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, in InsertCodeIntoOptimizedCodeMap()
601 Handle<SharedFunctionInfo> shared(function->shared()); in InsertCodeIntoOptimizedCodeMap() local
602 SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap(shared, code); in InsertCodeIntoOptimizedCodeMap()
625 bool UseTurboFan(Handle<SharedFunctionInfo> shared) { in UseTurboFan() argument
626 bool optimization_disabled = shared->optimization_disabled(); in UseTurboFan()
627 bool dont_crankshaft = shared->dont_crankshaft(); in UseTurboFan()
632 FLAG_turbo_asm && shared->asm_function() && !optimization_disabled; in UseTurboFan()
640 bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter); in UseTurboFan()
732 Handle<SharedFunctionInfo> shared(function->shared(), isolate); in GetOptimizedCode() local
749 if (shared->is_compiled()) { in GetOptimizedCode()
750 shared->code()->set_profiler_ticks(0); in GetOptimizedCode()
756 bool use_turbofan = UseTurboFan(shared); in GetOptimizedCode()
790 if (IsEvalToplevel(shared)) { in GetOptimizedCode()
814 explicit InterpreterActivationsFinder(SharedFunctionInfo* shared) in InterpreterActivationsFinder() argument
815 : shared_(shared), has_activations_(false) {} in InterpreterActivationsFinder()
823 if (frame->function()->shared() == shared_) { in VisitThread()
884 if (function->shared()->HasBytecodeArray()) { in GetBaselineCode()
885 function->shared()->set_profiler_ticks(0); in GetBaselineCode()
889 if (function->shared()->code()->kind() == Code::FUNCTION) { in GetBaselineCode()
890 return Handle<Code>(function->shared()->code()); in GetBaselineCode()
895 if (function->shared()->HasDebugInfo()) { in GetBaselineCode()
903 if (function->shared()->is_resumable()) { in GetBaselineCode()
911 InterpreterActivationsFinder activations_finder(function->shared()); in GetBaselineCode()
922 os << "[marking " << Brief(function->shared()) in GetBaselineCode()
938 Handle<SharedFunctionInfo> shared = info.shared_info(); in GetBaselineCode() local
939 DCHECK_EQ(shared->language_mode(), info.literal()->language_mode()); in GetBaselineCode()
951 shared->ClearBytecodeArray(); in GetBaselineCode()
953 // Update the shared function info with the scope info. in GetBaselineCode()
954 InstallSharedScopeInfo(&info, shared); in GetBaselineCode()
956 // Install compilation result on the shared function info in GetBaselineCode()
957 InstallSharedCompilationResult(&info, shared); in GetBaselineCode()
984 DCHECK(function->shared()->is_compiled()); in GetLazyCode()
989 if (function->shared()->is_compiled()) { in GetLazyCode()
990 return Handle<Code>(function->shared()->code()); in GetLazyCode()
1096 // Allocate a shared function info object. in CompileToplevel()
1111 // Update the shared function info with the scope info. in CompileToplevel()
1114 // Install compilation result on the shared function info in CompileToplevel()
1178 DCHECK(function->shared()->is_compiled()); in Compile()
1191 DCHECK(function->shared()->is_compiled()); in CompileBaseline()
1192 code = handle(function->shared()->code()); in CompileBaseline()
1202 DCHECK(function->shared()->is_compiled()); in CompileBaseline()
1218 if (function->shared()->is_compiled()) { in CompileOptimized()
1219 code = handle(function->shared()->code(), isolate); in CompileOptimized()
1236 DCHECK(function->shared()->is_compiled()); in CompileOptimized()
1249 if (IsEvalToplevel(handle(function->shared()))) { in CompileDebugCode()
1264 DCHECK(function->shared()->is_compiled()); in CompileDebugCode()
1265 DCHECK(function->shared()->HasDebugCode()); in CompileDebugCode()
1269 bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) { in CompileDebugCode() argument
1270 Isolate* isolate = shared->GetIsolate(); in CompileDebugCode()
1275 ParseInfo parse_info(&zone, shared); in CompileDebugCode()
1277 DCHECK(shared->allows_lazy_compilation_without_context()); in CompileDebugCode()
1278 DCHECK(!IsEvalToplevel(shared)); in CompileDebugCode()
1287 DCHECK(shared->is_compiled()); in CompileDebugCode()
1288 DCHECK(shared->HasDebugCode()); in CompileDebugCode()
1297 // generated shared function infos, clear the script's list temporarily in CompileForLiveEdit()
1320 // free as much as possible, since some code expects the old shared function in CompileForLiveEdit()
1332 Handle<SharedFunctionInfo> shared = info->shared_info(); in EnsureDeoptimizationSupport() local
1333 if (!shared->has_deoptimization_support()) { in EnsureDeoptimizationSupport()
1342 if (shared->is_resumable()) return false; in EnsureDeoptimizationSupport()
1350 if (shared->HasBytecodeArray()) { in EnsureDeoptimizationSupport()
1351 InterpreterActivationsFinder activations_finder(*shared); in EnsureDeoptimizationSupport()
1360 if (shared->code()->kind() == Code::FUNCTION && in EnsureDeoptimizationSupport()
1361 shared->code()->has_reloc_info_for_serialization()) { in EnsureDeoptimizationSupport()
1370 shared->ClearBytecodeArray(); in EnsureDeoptimizationSupport()
1374 if (shared->scope_info() == ScopeInfo::Empty(info->isolate())) { in EnsureDeoptimizationSupport()
1375 InstallSharedScopeInfo(info, shared); in EnsureDeoptimizationSupport()
1378 // Install compilation result on the shared function info in EnsureDeoptimizationSupport()
1379 shared->EnableDeoptimizationSupport(*unoptimized.code()); in EnsureDeoptimizationSupport()
1616 // Find any previously allocated shared function info for the given literal. in GetSharedFunctionInfo()
1618 // On the first compile, there are no existing shared function info for in GetSharedFunctionInfo()
1627 // We found an existing shared function info. If it's already compiled, in GetSharedFunctionInfo()
1640 // Allocate a shared function info object. in GetSharedFunctionInfo()
1647 // shared function info for this function literal has been created for the in GetSharedFunctionInfo()
1695 // Update the shared function info with the scope info. in GetSharedFunctionInfo()
1697 // Install compilation result on the shared function info. in GetSharedFunctionInfo()
1721 // Instantiate the function and create a shared function info from it. in GetSharedFunctionInfoForNative()
1725 Handle<Code> code = Handle<Code>(fun->shared()->code()); in GetSharedFunctionInfoForNative()
1726 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); in GetSharedFunctionInfoForNative()
1727 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( in GetSharedFunctionInfoForNative() local
1728 name, fun->shared()->num_literals(), FunctionKind::kNormalFunction, code, in GetSharedFunctionInfoForNative()
1729 Handle<ScopeInfo>(fun->shared()->scope_info())); in GetSharedFunctionInfoForNative()
1730 shared->set_construct_stub(*construct_stub); in GetSharedFunctionInfoForNative()
1731 shared->set_feedback_metadata(fun->shared()->feedback_metadata()); in GetSharedFunctionInfoForNative()
1733 // Copy the function data to the shared function info. in GetSharedFunctionInfoForNative()
1734 shared->set_function_data(fun->shared()->function_data()); in GetSharedFunctionInfoForNative()
1735 int parameters = fun->shared()->internal_formal_parameter_count(); in GetSharedFunctionInfoForNative()
1736 shared->set_internal_formal_parameter_count(parameters); in GetSharedFunctionInfoForNative()
1738 return shared; in GetSharedFunctionInfoForNative()
1761 Handle<SharedFunctionInfo> shared = info->shared_info(); in FinalizeCompilationJob() local
1762 shared->code()->set_profiler_ticks(0); in FinalizeCompilationJob()
1764 DCHECK(!shared->HasDebugInfo()); in FinalizeCompilationJob()
1772 if (shared->optimization_disabled()) { in FinalizeCompilationJob()
1779 if (shared->SearchOptimizedCodeMap(info->context()->native_context(), in FinalizeCompilationJob()
1799 info->closure()->ReplaceCode(shared->code()); in FinalizeCompilationJob()
1804 Handle<SharedFunctionInfo> shared(function->shared()); in PostInstantiation() local
1806 if (FLAG_always_opt && shared->allows_lazy_compilation()) { in PostInstantiation()
1810 CodeAndLiterals cached = shared->SearchOptimizedCodeMap( in PostInstantiation()
1815 DCHECK(function->shared()->is_compiled()); in PostInstantiation()
1820 DCHECK(shared->is_compiled()); in PostInstantiation()
1822 } else if (shared->is_compiled()) { in PostInstantiation()