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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 void VisitForOfStatement(ForOfStatement* stmt) { UNREACHABLE(); } | 437 void VisitForOfStatement(ForOfStatement* stmt) { UNREACHABLE(); } |
438 | 438 |
439 void VisitTryCatchStatement(TryCatchStatement* stmt) { UNREACHABLE(); } | 439 void VisitTryCatchStatement(TryCatchStatement* stmt) { UNREACHABLE(); } |
440 | 440 |
441 void VisitTryFinallyStatement(TryFinallyStatement* stmt) { UNREACHABLE(); } | 441 void VisitTryFinallyStatement(TryFinallyStatement* stmt) { UNREACHABLE(); } |
442 | 442 |
443 void VisitDebuggerStatement(DebuggerStatement* stmt) { UNREACHABLE(); } | 443 void VisitDebuggerStatement(DebuggerStatement* stmt) { UNREACHABLE(); } |
444 | 444 |
445 void VisitFunctionLiteral(FunctionLiteral* expr) { | 445 void VisitFunctionLiteral(FunctionLiteral* expr) { |
446 Scope* scope = expr->scope(); | 446 DeclarationScope* scope = expr->scope(); |
447 if (scope_ == kFuncScope) { | 447 if (scope_ == kFuncScope) { |
448 if (auto* func_type = typer_->TypeOf(expr)->AsFunctionType()) { | 448 if (auto* func_type = typer_->TypeOf(expr)->AsFunctionType()) { |
449 // Build the signature for the function. | 449 // Build the signature for the function. |
450 LocalType return_type = TypeFrom(func_type->ReturnType()); | 450 LocalType return_type = TypeFrom(func_type->ReturnType()); |
451 const auto& arguments = func_type->Arguments(); | 451 const auto& arguments = func_type->Arguments(); |
452 FunctionSig::Builder b(zone(), return_type == kAstStmt ? 0 : 1, | 452 FunctionSig::Builder b(zone(), return_type == kAstStmt ? 0 : 1, |
453 arguments.size()); | 453 arguments.size()); |
454 if (return_type != kAstStmt) b.AddReturn(return_type); | 454 if (return_type != kAstStmt) b.AddReturn(return_type); |
455 for (int i = 0; i < expr->parameter_count(); ++i) { | 455 for (int i = 0; i < expr->parameter_count(); ++i) { |
456 LocalType type = TypeFrom(arguments[i]); | 456 LocalType type = TypeFrom(arguments[i]); |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_); | 1782 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, typer_); |
1783 impl.Build(); | 1783 impl.Build(); |
1784 *foreign_args = impl.GetForeignArgs(); | 1784 *foreign_args = impl.GetForeignArgs(); |
1785 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_); | 1785 ZoneBuffer* buffer = new (zone_) ZoneBuffer(zone_); |
1786 impl.builder_->WriteTo(*buffer); | 1786 impl.builder_->WriteTo(*buffer); |
1787 return buffer; | 1787 return buffer; |
1788 } | 1788 } |
1789 } // namespace wasm | 1789 } // namespace wasm |
1790 } // namespace internal | 1790 } // namespace internal |
1791 } // namespace v8 | 1791 } // namespace v8 |
OLD | NEW |