Lines Matching defs:code
2 // Use of this source code is governed by a BSD-style license that can be
28 #include "src/wasm/code-space-access.h"
31 #include "src/wasm/wasm-code-manager.h"
65 // Lazy compilation can help to reduce startup time and code size at the risk
217 size_t func_size = module->functions[unit.func_index()].code.length();
757 // The amount of generated top tier code since the last
1089 base::Vector<const uint8_t> code,
1094 FunctionBody body{func->sig, func->code.offset(), code.begin(), code.end()};
1127 base::Vector<const uint8_t> code = wire_bytes.GetFunctionBytes(func);
1129 module, func_index, code, counters, allocator, enabled_features);
1196 base::Vector<const uint8_t> code =
1197 compilation_state->GetWireBytesStorage()->GetCode(func->code);
1199 ValidateSingleFunction(module, func_index, code, counters,
1217 WasmCode* code;
1220 code = native_module->PublishCode(
1223 DCHECK_EQ(func_index, code->index());
1231 code->LogCode(isolate, url.get(), module_object->script().id());
1428 void RecordStats(const Code code, Counters* counters) {
1429 counters->wasm_generated_code_size()->Increment(code.raw_body_size());
1430 counters->wasm_reloc_size()->Increment(code.relocation_info().length());
1957 // Ensure that the code objects are logged before returning.
2094 // Running hash of the wire bytes up to code section size, but excluding the
2095 // code section itself. Used by the {NativeModuleCache} to detect potential
2251 // Finally, log all generated code (it does not matter if this happens
2517 base::Vector<const uint8_t> code =
2527 ValidateSingleFunction(module, func_index, code, counters_,
2684 // Sample the generated code size when baseline compilation finished.
2687 // Also, set a callback to sample the code size after top-tier compilation
2772 // Process all sections except for the code section.
2778 // We reached a section after the code section, we do not need the
2784 // Combine section hashes until code section.
2812 // Start the code section.
2819 TRACE_STREAMING("Start the code section with %d functions...\n",
2971 // We are processing a WebAssembly module without code section. Create the
3158 // The Turbofan optimizations we enable for WasmGC code can (for now)
3168 uint32_t size = builder->module()->functions[function_index].code.length();
3339 // code (or code compiled for the wrong tier).
3347 // start yet, and new code will be kept tiered-down from the start. For
3469 // optimization we create a code memory modification scope that avoids
3478 Handle<Code> code = unit->Finalize();
3481 (*export_wrappers_out)->set(wrapper_index, ToCodeT(*code));
3482 RecordStats(*code, isolate->counters());
3514 // generated code.
3525 WasmCode* code = code_vector[i];
3526 DCHECK_NOT_NULL(code);
3527 DCHECK_LT(code->index(), native_module_->num_functions());
3529 if (code->index() <
3532 DCHECK_EQ(code->tier(), ExecutionTier::kTurbofan);
3536 DCHECK_NE(code->tier(), ExecutionTier::kNone);
3540 // compiled code. Any lazily compiled function does not contribute to the
3541 // compilation progress but may publish code to the code manager.
3543 declared_function_index(native_module_->module(), code->index());
3553 required_baseline_tier <= code->tier()) {
3557 if (code->tier() == ExecutionTier::kTurbofan) {
3558 bytes_since_last_chunk_ += code->instructions().size();
3561 required_top_tier <= code->tier()) {
3568 // If tiering up, accept any TurboFan code. For tiering down, look at
3573 ? code->for_debugging()
3574 : code->tier() == ExecutionTier::kTurbofan;
3586 if (code->tier() > reached_tier) {
3588 compilation_progress_[slot_index], code->tier());
3697 for (const auto& code : unpublished_code) {
3698 int func_index = code->index();
3711 (*cache)[key] = code.get();
3712 code->IncRef();
3719 base::Vector<std::unique_ptr<WasmCode>> code) {
3722 native_module_->PublishCode(std::move(code));
3723 // Defer logging code in case wire bytes were not fully received yet.
3736 // Add new code to the queue and return.
3750 // Keep publishing new code that came in.
3929 // optimization we create a code memory modification scope that avoids
3937 Handle<Code> code = unit->Finalize();
3939 (*export_wrappers_out)->set(wrapper_index, ToCodeT(*code));
3940 RecordStats(*code, isolate->counters());