Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: src/wasm/asm-wasm-builder.cc

Issue 2014533003: [wasm] Refactor encoder.h to use a proper buffer and remove OldFunctions section. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/wasm/asm-wasm-builder.cc
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc
index 5e7765adfdcdd8905762892e75cbbee07325649c..f7a0b16a45fc81813445a5083a27914e1f6c11da 100644
--- a/src/wasm/asm-wasm-builder.cc
+++ b/src/wasm/asm-wasm-builder.cc
@@ -1759,12 +1759,14 @@ AsmWasmBuilder::AsmWasmBuilder(Isolate* isolate, Zone* zone,
// TODO(aseemgarg): probably should take zone (to write wasm to) as input so
// that zone in constructor may be thrown away once wasm module is written.
-WasmModuleIndex* AsmWasmBuilder::Run(i::Handle<i::FixedArray>* foreign_args) {
+ZoneBuffer* AsmWasmBuilder::Run(i::Handle<i::FixedArray>* foreign_args) {
AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_);
impl.Compile();
*foreign_args = impl.GetForeignArgs();
+ ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_);
WasmModuleWriter* writer = impl.builder_->Build(zone_);
- return writer->WriteTo(zone_);
+ writer->WriteTo(*buffer);
+ return buffer;
}
} // namespace wasm
} // namespace internal
« no previous file with comments | « src/wasm/asm-wasm-builder.h ('k') | src/wasm/encoder.h » ('j') | src/wasm/encoder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698