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

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

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | src/runtime/runtime.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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 } 823 }
824 824
825 if (target_var == nullptr && target_prop == nullptr) { 825 if (target_var == nullptr && target_prop == nullptr) {
826 UNREACHABLE(); // invalid assignment. 826 UNREACHABLE(); // invalid assignment.
827 } 827 }
828 } 828 }
829 829
830 void VisitAssignment(Assignment* expr) { 830 void VisitAssignment(Assignment* expr) {
831 bool as_init = false; 831 bool as_init = false;
832 if (scope_ == kModuleScope) { 832 if (scope_ == kModuleScope) {
833 // Skip extra assignment inserted by the parser when in this form:
834 // (function Module(a, b, c) {... })
835 if (expr->target()->IsVariableProxy() &&
836 expr->target()->AsVariableProxy()->var()->mode() == CONST_LEGACY) {
837 return;
838 }
833 Property* prop = expr->value()->AsProperty(); 839 Property* prop = expr->value()->AsProperty();
834 if (prop != nullptr) { 840 if (prop != nullptr) {
835 VariableProxy* vp = prop->obj()->AsVariableProxy(); 841 VariableProxy* vp = prop->obj()->AsVariableProxy();
836 if (vp != nullptr && vp->var()->IsParameter() && 842 if (vp != nullptr && vp->var()->IsParameter() &&
837 vp->var()->index() == 1) { 843 vp->var()->index() == 1) {
838 VariableProxy* target = expr->target()->AsVariableProxy(); 844 VariableProxy* target = expr->target()->AsVariableProxy();
839 if (typer_->TypeOf(target)->AsFFIType() != nullptr) { 845 if (typer_->TypeOf(target)->AsFFIType() != nullptr) {
840 const AstRawString* name = 846 const AstRawString* name =
841 prop->key()->AsLiteral()->AsRawPropertyName(); 847 prop->key()->AsLiteral()->AsRawPropertyName();
842 imported_function_table_.AddImport( 848 imported_function_table_.AddImport(
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_); 1788 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_);
1783 impl.Build(); 1789 impl.Build();
1784 *foreign_args = impl.GetForeignArgs(); 1790 *foreign_args = impl.GetForeignArgs();
1785 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_); 1791 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_);
1786 impl.builder_->WriteTo(*buffer); 1792 impl.builder_->WriteTo(*buffer);
1787 return buffer; 1793 return buffer;
1788 } 1794 }
1789 } // namespace wasm 1795 } // namespace wasm
1790 } // namespace internal 1796 } // namespace internal
1791 } // namespace v8 1797 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698