Lines Matching defs:code
2 // Use of this source code is governed by a BSD-style license that can be
22 #include "src/wasm/wasm-code-manager.h"
62 // If {return_location == kAfterBreakpoint} we search for the first code
64 // If {return_location == kAfterWasmCall} we return the last code offset
157 return module->functions[scope.code->index()];
227 int offset = frame->position() - function.code.offset();
264 // Re-install the code, in case it was replaced in the meantime.
265 native_module_->ReinstallDebugCode(it->code);
267 return it->code;
276 FunctionBody body{function->sig, function->code.offset(),
277 wire_bytes.begin() + function->code.offset(),
278 wire_bytes.begin() + function->code.end_offset()};
305 // Insert new code into the cache. Insert before existing elements for LRU.
314 // Put the code in the surrounding CodeRefScope to delay deletion until
316 WasmCodeRefScope::AddRef(cached_debugging_code_.back().code);
317 cached_debugging_code_.back().code->DecRefOnLiveCode();
326 // Put the code ref scope outside of the mutex, so we don't unnecessarily
327 // hold the mutex while freeing code.
359 // code. Otherwise, recompile it. In any case, rewrite this isolate's stack
360 // to make sure that it uses up-to-date code containing the breakpoint.
409 wasm::WasmCode* code = frame->wasm_code();
410 if (!code->is_liftoff()) return false; // Cannot step in TurboFan code.
418 wasm::WasmCode* code = frame->wasm_code();
419 if (!code->is_liftoff()) return; // Cannot step out to TurboFan code.
426 auto* code = frame->wasm_code();
427 if (code->for_debugging() != kForStepping) return;
428 int func_index = code->index();
452 // Put the code ref scope outside of the mutex, so we don't unnecessarily
453 // hold the mutex while freeing code.
461 int offset = position - function.code.offset();
485 for (auto* code : codes) {
486 debug_side_tables_.erase(code);
490 DebugSideTable* GetDebugSideTableIfExists(const WasmCode* code) const {
492 auto it = debug_side_tables_.find(code);
509 // Put the code ref scope outside of the mutex, so we don't unnecessarily
510 // hold the mutex while freeing code.
533 : code(wasm::GetWasmCodeManager()->LookupCode(pc)),
534 pc_offset(static_cast<int>(pc - code->instruction_start())),
535 debug_side_table(code->is_inspectable()
536 ? debug_info->GetDebugSideTable(code)
541 DCHECK_IMPLIES(code->is_inspectable(), debug_side_table_entry != nullptr);
547 wasm::WasmCode* code;
553 const DebugSideTable* GetDebugSideTable(WasmCode* code) {
554 DCHECK(code->is_inspectable());
559 auto it = debug_side_tables_.find(code);
565 GenerateLiftoffDebugSideTable(code);
572 auto& slot = debug_side_tables_[code];
577 // Print the code together with the debug table, if requested.
578 code->MaybePrint();
601 reg.code());
624 // ifdef here to workaround unreachable code for is_fp_pair.
626 int code = reg.is_fp_pair() ? reg.low_fp().code() : reg.fp().code();
628 int code = reg.fp().code();
632 WasmDebugBreakFrameConstants::GetPushedFpRegisterOffset(code);
673 // After installing a Liftoff code object with a different set of breakpoints,
675 // code. The frame layout itself should be independent of breakpoints.
726 WireBytesRef code = native_module->module()->functions[func_index].code;
727 return static_cast<size_t>(position) == code.end_offset() - 1;
746 // DebugSideTable per code object, lazily initialized.
754 // This is useful especially in stepping, because stepping code is cleared on
762 WasmCode* code;
808 WireBytesRef DebugInfo::GetExportName(ImportExportKindCode code,
810 return impl_->GetExportName(code, index);
814 ImportExportKindCode code, uint32_t index) {
815 return impl_->GetImportName(code, index);
858 void DebugInfo::RemoveDebugSideTables(base::Vector<WasmCode* const> code) {
859 impl_->RemoveDebugSideTables(code);
863 const WasmCode* code) const {
864 return impl_->GetDebugSideTableIfExists(code);
887 wasm::BytecodeIterator iterator(module_start + func.code.offset(),
888 module_start + func.code.end_offset(),
925 int offset_in_func = *position - func.code.offset();
930 *position = func.code.offset() + breakable_offset;
974 AddBreakpointToInfo(script, func.code.offset() + offset, break_point);
1179 end_offset = functions[end_func_index].code.end_offset();
1188 start_offset > functions[end_func_index].code.end_offset())
1197 if (func.code.length() == 0) continue;
1200 wasm::BytecodeIterator iterator(module_start + func.code.offset(),
1201 module_start + func.code.end_offset(),
1205 uint32_t total_offset = func.code.offset() + iterator.pc_offset();