Commit 0eb62c2c authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Cleanup ProcessXXX methods in streaming compilation

R=clemensh@chromium.org

Change-Id: Ifb5c02698b5ad9189283e227e89fa020f92186a8
Reviewed-on: https://chromium-review.googlesource.com/781720Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49525}
parent 00a225e0
...@@ -3434,6 +3434,8 @@ bool AsyncStreamingProcessor::ProcessFunctionBody(Vector<const uint8_t> bytes, ...@@ -3434,6 +3434,8 @@ bool AsyncStreamingProcessor::ProcessFunctionBody(Vector<const uint8_t> bytes,
bytes, name); bytes, name);
} }
++next_function_; ++next_function_;
// This method always succeeds. The return value is necessary to comply with
// the StreamingProcessor interface.
return true; return true;
} }
......
...@@ -211,32 +211,38 @@ class V8_EXPORT_PRIVATE StreamingDecoder { ...@@ -211,32 +211,38 @@ class V8_EXPORT_PRIVATE StreamingDecoder {
void ProcessModuleHeader() { void ProcessModuleHeader() {
if (!ok_) return; if (!ok_) return;
ok_ &= processor_->ProcessModuleHeader( if (!processor_->ProcessModuleHeader(
Vector<const uint8_t>(state_->buffer(), Vector<const uint8_t>(state_->buffer(),
static_cast<int>(state_->size())), static_cast<int>(state_->size())),
0); 0)) {
ok_ = false;
}
} }
void ProcessSection(SectionBuffer* buffer) { void ProcessSection(SectionBuffer* buffer) {
if (!ok_) return; if (!ok_) return;
ok_ &= processor_->ProcessSection( if (!processor_->ProcessSection(
buffer->section_code(), buffer->payload(), buffer->section_code(), buffer->payload(),
buffer->module_offset() + buffer->module_offset() +
static_cast<uint32_t>(buffer->payload_offset())); static_cast<uint32_t>(buffer->payload_offset()))) {
ok_ = false;
}
} }
void StartCodeSection(size_t num_functions) { void StartCodeSection(size_t num_functions) {
if (!ok_) return; if (!ok_) return;
// The offset passed to {ProcessCodeSectionHeader} is an error offset and // The offset passed to {ProcessCodeSectionHeader} is an error offset and
// not the start offset of a buffer. Therefore we need the -1 here. // not the start offset of a buffer. Therefore we need the -1 here.
ok_ &= processor_->ProcessCodeSectionHeader(num_functions, if (!processor_->ProcessCodeSectionHeader(num_functions,
module_offset() - 1); module_offset() - 1)) {
ok_ = false;
}
} }
void ProcessFunctionBody(Vector<const uint8_t> bytes, void ProcessFunctionBody(Vector<const uint8_t> bytes,
uint32_t module_offset) { uint32_t module_offset) {
if (!ok_) return; if (!ok_) return;
ok_ &= processor_->ProcessFunctionBody(bytes, module_offset); if (!processor_->ProcessFunctionBody(bytes, module_offset)) ok_ = false;
} }
bool ok() const { return ok_; } bool ok() const { return ok_; }
......
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