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

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

Issue 2017853003: [wasm] Remove redundant intermediate data structures in encoder.cc. (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
« no previous file with comments | « no previous file | src/wasm/encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/asm-wasm-builder.cc
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc
index f7a0b16a45fc81813445a5083a27914e1f6c11da..bf6db0ece66ca42974b50086d2e21723a3c6bed6 100644
--- a/src/wasm/asm-wasm-builder.cc
+++ b/src/wasm/asm-wasm-builder.cc
@@ -90,7 +90,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
}
current_function_builder_ =
builder_->FunctionAt(foreign_init_function_index_);
- current_function_builder_->Exported(1);
+ current_function_builder_->SetExported();
std::string raw_name = "__foreign_init__";
current_function_builder_->SetName(raw_name.data(),
static_cast<int>(raw_name.size()));
@@ -114,7 +114,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
return ret;
}
- void Compile() {
+ void Build() {
InitializeInitFunction();
RECURSE(VisitFunctionLiteral(literal_));
BuildForeignInitFunction();
@@ -607,7 +607,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
const AstRawString* raw_name = name->AsRawPropertyName();
if (var->is_function()) {
uint32_t index = LookupOrInsertFunction(var);
- builder_->FunctionAt(index)->Exported(1);
+ builder_->FunctionAt(index)->SetExported();
builder_->FunctionAt(index)->SetName(
reinterpret_cast<const char*>(raw_name->raw_data()),
raw_name->length());
@@ -1761,11 +1761,10 @@ AsmWasmBuilder::AsmWasmBuilder(Isolate* isolate, Zone* zone,
// that zone in constructor may be thrown away once wasm module is written.
ZoneBuffer* AsmWasmBuilder::Run(i::Handle<i::FixedArray>* foreign_args) {
AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_);
- impl.Compile();
+ impl.Build();
*foreign_args = impl.GetForeignArgs();
ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_);
- WasmModuleWriter* writer = impl.builder_->Build(zone_);
- writer->WriteTo(*buffer);
+ impl.builder_->WriteTo(*buffer);
return buffer;
}
} // namespace wasm
« no previous file with comments | « no previous file | src/wasm/encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698