Lines Matching defs:code

2 // Use of this source code is governed by a BSD-style license that can be
125 #include "src/wasm/wasm-code-manager.h"
238 void SetStickyEmbeddedBlob(const uint8_t* code, uint32_t code_size,
240 sticky_embedded_blob_code_ = code;
285 const uint8_t* code =
287 if (code == nullptr) return false;
288 return code == DefaultEmbeddedBlobCode();
291 void Isolate::SetEmbeddedBlob(const uint8_t* code, uint32_t code_size,
293 CHECK_NOT_NULL(code);
296 embedded_blob_code_ = code;
300 current_embedded_blob_code_.store(code, std::memory_order_relaxed);
318 "Embedded blob code section checksum verification failed. This "
321 "within builtin code.");
423 // Hash data sections of builtin code objects.
426 Code code = FromCodeT(builtins()->code(builtin));
428 DCHECK(Internals::HasHeapObjectTag(code.ptr()));
430 reinterpret_cast<uint8_t*>(code.ptr() - kHeapObjectTag);
687 // Keeping a reference to the last code objects to increase likelyhood that
714 // framework and library code, and stack depth tends to be more than
739 Handle<BytecodeArray> code(function->shared().GetBytecodeArray(isolate_),
754 AppendFrame(receiver, function, code, offset, flags, parameters);
765 // TODO(v8:11880): avoid roundtrips between cdc and code.
766 Handle<Code> code(FromCodeT(combinator->code()), isolate_);
776 AppendFrame(receiver, combinator, code, promise_index, flags, parameters);
795 if (summary.code()->kind() != wasm::WasmCode::kWasmFunction) return;
805 auto code = Managed<wasm::GlobalWasmCodeRef>::Allocate(
806 isolate_, 0, summary.code(),
809 handle(Smi::FromInt(summary.function_index()), isolate_), code,
881 Handle<HeapObject> code, int offset, int flags,
889 receiver_or_instance, function, code, offset, flags, parameters);
925 return function.code() == isolate->builtins()->code(builtin);
1543 // overflow per frame in generated code, but might call through more smaller
1901 // (2) within generated-code land, that one place is the return register.
1910 // Wasm code, we unwind the handlers until the top ENTRY handler is found.
1941 Code code = frame->LookupCode();
1942 HandlerTable table(code);
1943 return FoundHandler(Context(), code.InstructionStart(this, frame->pc()),
1944 table.LookupReturn(0), code.constant_pool(),
1953 Code code = frame->LookupCode();
1954 HandlerTable table(code);
1955 Address instruction_start = code.InstructionStart(this, frame->pc());
1963 code.stack_slots() * kSystemPointerSize;
1965 code.constant_pool(), return_sp, frame->fp(),
1973 // This code ref scope is here to avoid a check failure when looking up
1974 // the code. It's not actually necessary to keep the code alive as it's
2010 Code code = frame->LookupCode();
2017 code.stack_slots() * kSystemPointerSize;
2020 // but do not have a code kind of TURBOFAN.
2021 if (CodeKindCanDeoptimize(code.kind()) &&
2022 code.marked_for_deoptimization()) {
2023 // If the target code is lazy deoptimized, we jump to the original
2026 offset = static_cast<int>(frame->pc() - code.entry());
2030 return FoundHandler(Context(), code.InstructionStart(this, frame->pc()),
2031 offset, code.constant_pool(), return_sp,
2043 Code code = stub_frame->LookupCode();
2044 if (!code.IsCode() || code.kind() != CodeKind::BUILTIN ||
2045 !code.has_handler_table() || !code.is_turbofanned()) {
2056 code.stack_slots() * kSystemPointerSize;
2058 return FoundHandler(Context(), code.InstructionStart(this, frame->pc()),
2059 offset, code.constant_pool(), return_sp,
2093 Code code = sp_frame->LookupCode();
2096 // need to have a context read + write in the baseline code.
2099 Context(), code.InstructionStart(this, sp_frame->sp()), pc_offset,
2100 code.constant_pool(), return_sp, sp_frame->fp(), visited_frames);
2105 Code code =
2106 FromCodeT(builtins()->code(Builtin::kInterpreterEnterAtBytecode));
2113 // it and the context in which this C++ code runs.
2115 return FoundHandler(context, code.InstructionStart(), 0,
2116 code.constant_pool(), return_sp, frame->fp(),
2138 Code code = js_frame->LookupCode();
2139 return FoundHandler(Context(), code.InstructionStart(), 0,
2140 code.constant_pool(), return_sp, frame->fp(),
2153 // If there were any materialized objects, the code should be
2169 // tables on the unoptimized code objects.
2174 Handle<AbstractCode> code = summary.AsJavaScript().abstract_code();
2175 if (code->IsCode() && code->kind() == CodeKind::BUILTIN) {
2176 prediction = code->GetCode().GetBuiltinCatchPrediction();
2182 CHECK_EQ(CodeKind::INTERPRETED_FUNCTION, code->kind());
2184 HandlerTable table(code->GetBytecodeArray());
2252 Handle<Code> code(frame->LookupCode(), this);
2253 if (!code->IsCode() || code->kind() != CodeKind::BUILTIN ||
2254 !code->has_handler_table() || !code->is_turbofanned()) {
2258 CatchType prediction = ToCatchType(code->GetBuiltinCatchPrediction());
2263 Handle<Code> code(frame->LookupCode(), this);
2264 CatchType prediction = ToCatchType(code->GetBuiltinCatchPrediction());
2353 // baseline code. For optimized code this will use the deoptimization
2732 Code code = frame->LookupCode();
2733 if (!code.IsCode() || code.kind() != CodeKind::BUILTIN ||
2734 !code.has_handler_table() || !code.is_turbofanned()) {
2737 catch_prediction = code.GetBuiltinCatchPrediction();
2750 // namely in the code in an async function before the first
2879 // NOTE: This code assumes that the stack grows downward.
3670 // TODO(v8:11880): avoid roundtrips between cdc and code.
3674 // From this point onwards, the old builtin code object is unreachable and
3690 const uint8_t* code = DefaultEmbeddedBlobCode();
3699 code = StickyEmbeddedBlobCode();
3707 if (code == nullptr) {
3710 SetEmbeddedBlob(code, code_size, data, data_size);
3729 uint8_t* code;
3734 this, &code, &code_size, &data, &data_size);
3737 const uint8_t* const_code = const_cast<const uint8_t*>(code);
3742 SetStickyEmbeddedBlob(code, code_size, data, data_size);
3756 // The embedded builtins are within the pc-relative reach from the code
3768 // The un-embedded code blob is already a part of the registered code range
3908 // We need to initialize code_pages_ before any on-heap code is allocated to
3909 // make sure we record all code allocations.
4006 // The short builtin calls could still be enabled if allocated code range
4063 // interpreted code.
4066 // offset, effectively limiting code space size to 32MB. We can guarantee
4070 FromCodeT(builtins()->code(Builtin::kInterpreterEntryTrampoline)));
4376 void Isolate::IncreaseTotalRegexpCodeGenerated(Handle<HeapObject> code) {
4378 DCHECK(code->IsCode(cage_base) || code->IsByteArray(cage_base));
4379 total_regexp_code_generated_ += code->Size(cage_base);
5093 // This has to be kept in sync with the code in said file. Currently this
5499 // We only keep track of individual code pages/allocations if we are on arm32,
5500 // because on x64 and arm64 we have a code range which makes this unnecessary.
5584 // We only keep track of individual code pages/allocations if we are on arm32,
5585 // because on x64 and arm64 we have a code range which makes this unnecessary.