Lines Matching defs:code

2 // Use of this source code is governed by a BSD-style license that can be
32 #include "src/diagnostics/code-tracer.h"
62 #include "src/snapshot/code-serializer.h"
191 PrintTracePrefix(scope, "found optimized code for", function, code_kind);
261 // Log the code generation. If source information is available include
559 Handle<AbstractCode>::cast(compilation_info()->code());
607 Handle<Code> code = isolate->factory()->CopyCode(Handle<Code>::cast(
615 interpreter_data->set_interpreter_trampoline(ToCodeT(*code));
620 Handle<AbstractCode> abstract_code = Handle<AbstractCode>::cast(code);
893 // A wrapper to access either the OSR optimized code cache (one per native
894 // context), or the optimized code cache slot on the feedback vector.
906 CodeT code;
908 // For OSR, check the OSR optimized code cache.
909 code = function->native_context().osr_code_cache().TryGet(
912 // Non-OSR code may be cached on the feedback vector.
917 code = feedback_vector.optimized_code();
921 DCHECK_IMPLIES(!code.is_null(), code.kind() <= code_kind);
922 if (code.is_null() || code.kind() != code_kind) return {};
924 DCHECK(!code.marked_for_deoptimization());
926 DCHECK(CodeKindIsStoredInOptimizedCodeCache(code.kind()));
927 DCHECK_IMPLIES(IsOSR(osr_offset), CodeKindCanOSR(code.kind()));
931 return handle(code, isolate);
938 // Cache optimized code.
941 Handle<CodeT> code = ToCodeT(compilation_info->code(), isolate);
949 OSROptimizedCodeCache::Insert(isolate, native_context, shared, code,
958 // sharing can occur. Make sure the optimized code cache is cleared.
965 function->feedback_vector().SetOptimizedCode(code);
1123 return ToCodeT(job->compilation_info()->code(), isolate);
1136 AbstractCode::cast(FromCodeT(function->code())), isolate);
1196 return handle(function->code(), isolate);
1244 // If code was pending optimization for testing, remove the entry from the
1933 // statistics since we've already parsed the code before.
2083 Handle<CodeT> code = handle(shared_info->GetCode(), isolate);
2115 code = maybe_code;
2119 // Install code on closure.
2120 function->set_code(*code, kReleaseStore);
2123 if (code->kind() == CodeKind::BASELINE) {
2157 Handle<Code> code;
2161 if (!GenerateBaselineCode(isolate, shared).ToHandle(&code)) {
2166 shared->set_baseline_code(ToCodeT(*code), kReleaseStore);
2180 Handle<AbstractCode>::cast(code), CodeKind::BASELINE,
2195 // Baseline code needs a feedback vector.
2215 // Maglev code needs a feedback vector.
2219 Handle<CodeT> code;
2220 if (!maybe_code.ToHandle(&code)) return false;
2222 DCHECK_EQ(code->kind(), CodeKind::MAGLEV);
2223 function->set_code(*code);
2269 Handle<CodeT> code;
2271 .ToHandle(&code)) {
2272 function->set_code(*code, kReleaseStore);
2361 // If the position is missing, attempt to get the code offset by
2362 // walking the stack. Do not translate the code offset into source
2433 // Check whether embedder allows code generation in this context.
2444 // Callback set. Let it decide if code generation is allowed.
2448 // Check whether embedder allows code generation in this context.
2477 // Run Embedder-mandated checks before generating code from a string.
2495 // Check if the context unconditionally allows code gen from strings.
2504 // Check if the context allows code generation for this string.
2509 // templates as "code like", but has given us a callback that only accepts
2744 // when we want to produce the code cache.
3033 // Then check cached code provided by embedder.
3176 // Then check cached code provided by embedder.
3262 // the code compiled on the background thread.
3286 // Add compiled code to the isolate cache.
3328 // Precondition: code has been parsed and scopes have been analyzed.
3459 // 3) The code may have already been invalidated due to dependency change.
3480 function->set_code(*compilation_info->code(), kReleaseStore);
3514 // If code is compiled to bytecode (i.e., isn't asm.js), then allocate a
3515 // feedback and check for optimized code.
3522 // Evict any deoptimized code on feedback vector. We need to do this after
3524 // deoptimized the code on the feedback vector. So check for any
3525 // deoptimized code just before installing it on the funciton.
3528 CodeT code = function->feedback_vector().optimized_code();
3529 if (!code.is_null()) {
3530 // Caching of optimized code enabled and optimized code found.
3531 DCHECK(!code.marked_for_deoptimization());
3534 // We don't need a release store because the optimized code was
3538 function->set_code(code);