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

Side by Side Diff: src/asmjs/asm-wasm-builder.cc

Issue 2535723009: [wasm][asm.js] Allow a function to be exported more than once. (Closed)
Patch Set: fix Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module-builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 DCHECK_EQ(kExportScope, scope_); 708 DCHECK_EQ(kExportScope, scope_);
709 VariableProxy* expr = prop->value()->AsVariableProxy(); 709 VariableProxy* expr = prop->value()->AsVariableProxy();
710 DCHECK_NOT_NULL(expr); 710 DCHECK_NOT_NULL(expr);
711 Variable* var = expr->var(); 711 Variable* var = expr->var();
712 Literal* name = prop->key()->AsLiteral(); 712 Literal* name = prop->key()->AsLiteral();
713 DCHECK_NOT_NULL(name); 713 DCHECK_NOT_NULL(name);
714 DCHECK(name->IsPropertyName()); 714 DCHECK(name->IsPropertyName());
715 const AstRawString* raw_name = name->AsRawPropertyName(); 715 const AstRawString* raw_name = name->AsRawPropertyName();
716 if (var->is_function()) { 716 if (var->is_function()) {
717 WasmFunctionBuilder* function = LookupOrInsertFunction(var); 717 WasmFunctionBuilder* function = LookupOrInsertFunction(var);
718 function->Export(); 718 function->ExportAs({reinterpret_cast<const char*>(raw_name->raw_data()),
719 function->SetName({reinterpret_cast<const char*>(raw_name->raw_data()), 719 raw_name->length()});
720 raw_name->length()});
721 } 720 }
722 } 721 }
723 } 722 }
724 723
725 void VisitArrayLiteral(ArrayLiteral* expr) { UNREACHABLE(); } 724 void VisitArrayLiteral(ArrayLiteral* expr) { UNREACHABLE(); }
726 725
727 void LoadInitFunction() { 726 void LoadInitFunction() {
728 current_function_builder_ = init_function_; 727 current_function_builder_ = init_function_;
729 scope_ = kInitScope; 728 scope_ = kInitScope;
730 } 729 }
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); 1961 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer);
1963 return {module_buffer, asm_offsets_buffer, success}; 1962 return {module_buffer, asm_offsets_buffer, success};
1964 } 1963 }
1965 1964
1966 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; 1965 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__";
1967 const char* AsmWasmBuilder::single_function_name = "__single_function__"; 1966 const char* AsmWasmBuilder::single_function_name = "__single_function__";
1968 1967
1969 } // namespace wasm 1968 } // namespace wasm
1970 } // namespace internal 1969 } // namespace internal
1971 } // namespace v8 1970 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698