| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |