Commit be913785 authored by Frederik Gossen's avatar Frederik Gossen Committed by Commit Bot

[wasm-hints] Refactor Compilation Progress

Simplify accounting for compilation progress. Instead of complicated
logic in {OnUnitsFinished} the compilation progress is initialized in
{InitializeCompilationProgress}. We now keep tack of
  - the required baseline tier,
  - the required top tier, and
  - the currently reached tier.
With this information {OnUnitsFinished} determines whether baseline and
top tier compilation are completed.

Bug: v8:9003
Change-Id: I3d147613f30363aade9ad5bf65be6e4d105e561e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1583722
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61019}
parent eeb8ac68
This diff is collapsed.
......@@ -1011,17 +1011,16 @@ class ModuleDecoderImpl : public Decoder {
// Decode sequence of compilation hints.
if (decoder.ok()) {
module_->compilation_hints.reserve(hint_count);
module_->num_lazy_compilation_hints = 0;
}
for (uint32_t i = 0; decoder.ok() && i < hint_count; i++) {
TRACE("DecodeCompilationHints[%d] module+%d\n", i,
static_cast<int>(pc_ - start_));
// Compilation hints are encoded in one byte each.
// +-------+----------+---------------+------------------+
// | 2 bit | 2 bit | 2 bit | 2 bit |
// | ... | Top tier | Baseline tier | Lazy compilation |
// +-------+----------+---------------+------------------+
// +-------+----------+---------------+----------+
// | 2 bit | 2 bit | 2 bit | 2 bit |
// | ... | Top tier | Baseline tier | Strategy |
// +-------+----------+---------------+----------+
uint8_t hint_byte = decoder.consume_u8("compilation hint");
if (!decoder.ok()) break;
......@@ -1053,9 +1052,6 @@ class ModuleDecoderImpl : public Decoder {
// Happily accept compilation hint.
if (decoder.ok()) {
if (hint.strategy == WasmCompilationHintStrategy::kLazy) {
module_->num_lazy_compilation_hints++;
}
module_->compilation_hints.push_back(std::move(hint));
}
}
......@@ -1063,7 +1059,6 @@ class ModuleDecoderImpl : public Decoder {
// If section was invalid reset compilation hints.
if (decoder.failed()) {
module_->compilation_hints.clear();
module_->num_lazy_compilation_hints = 0;
}
// @TODO(frgossen) Skip the whole compilation hints section in the outer
......
......@@ -195,7 +195,6 @@ struct V8_EXPORT_PRIVATE WasmModule {
uint32_t num_declared_functions = 0; // excluding imported
uint32_t num_exported_functions = 0;
uint32_t num_declared_data_segments = 0; // From the DataCount section.
uint32_t num_lazy_compilation_hints = 0; // From compilation hints section.
WireBytesRef name = {0, 0};
std::vector<FunctionSig*> signatures; // by signature index
std::vector<uint32_t> signature_ids; // by signature index
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment