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

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

Issue 2348383003: [wasm] Support asm.js modules with a single function. (Closed)
Patch Set: Created 4 years, 3 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 | « src/asmjs/asm-js.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-wasm-builder.cc
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc
index 00e304bbcb76edd7b89d4408b720cd434c9b2161..ee2ac53483e3d0c0fd63f3e6c3410980d51cd5aa 100644
--- a/src/asmjs/asm-wasm-builder.cc
+++ b/src/asmjs/asm-wasm-builder.cc
@@ -551,6 +551,14 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
current_function_builder_->EmitGetLocal(
LookupOrInsertLocal(var, var_type));
}
+ } else if (scope_ == kExportScope) {
+ Variable* var = expr->var();
+ DCHECK(var->is_function());
+ uint32_t index = LookupOrInsertFunction(var);
+ builder_->FunctionAt(index)->SetExported();
+ std::string raw_name = "__single_function__";
Mircea Trofin 2016/09/19 18:42:29 could we have these centrally defined?
bradn 2016/09/19 20:30:38 Done.
+ builder_->FunctionAt(index)->SetName(
+ reinterpret_cast<const char*>(raw_name.data()), raw_name.length());
}
}
« no previous file with comments | « src/asmjs/asm-js.cc ('k') | test/mjsunit/wasm/asm-wasm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698