| 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 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 current_function_builder_->Emit(kExprF64UConvertI32); | 1430 current_function_builder_->Emit(kExprF64UConvertI32); |
| 1431 } else if (type == kFloat32) { | 1431 } else if (type == kFloat32) { |
| 1432 current_function_builder_->Emit(kExprF64ConvertF32); | 1432 current_function_builder_->Emit(kExprF64ConvertF32); |
| 1433 } else { | 1433 } else { |
| 1434 UNREACHABLE(); | 1434 UNREACHABLE(); |
| 1435 } | 1435 } |
| 1436 } else if (convertOperation == kToInt) { | 1436 } else if (convertOperation == kToInt) { |
| 1437 RECURSE(Visit(GetLeft(expr))); | 1437 RECURSE(Visit(GetLeft(expr))); |
| 1438 TypeIndex type = TypeIndexOf(GetLeft(expr)); | 1438 TypeIndex type = TypeIndexOf(GetLeft(expr)); |
| 1439 if (type == kFloat32) { | 1439 if (type == kFloat32) { |
| 1440 current_function_builder_->Emit(kExprI32SConvertF32); | 1440 current_function_builder_->Emit(kExprI32AsmjsSConvertF32); |
| 1441 } else if (type == kFloat64) { | 1441 } else if (type == kFloat64) { |
| 1442 current_function_builder_->Emit(kExprI32SConvertF64); | 1442 current_function_builder_->Emit(kExprI32AsmjsSConvertF64); |
| 1443 } else { | 1443 } else { |
| 1444 UNREACHABLE(); | 1444 UNREACHABLE(); |
| 1445 } | 1445 } |
| 1446 } else if (convertOperation == kAsIs) { | 1446 } else if (convertOperation == kAsIs) { |
| 1447 RECURSE(Visit(GetLeft(expr))); | 1447 RECURSE(Visit(GetLeft(expr))); |
| 1448 } else { | 1448 } else { |
| 1449 if (expr->op() == Token::COMMA) { | 1449 if (expr->op() == Token::COMMA) { |
| 1450 current_function_builder_->Emit(kExprBlock); | 1450 current_function_builder_->Emit(kExprBlock); |
| 1451 } | 1451 } |
| 1452 | 1452 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 // that zone in constructor may be thrown away once wasm module is written. | 1704 // that zone in constructor may be thrown away once wasm module is written. |
| 1705 WasmModuleIndex* AsmWasmBuilder::Run() { | 1705 WasmModuleIndex* AsmWasmBuilder::Run() { |
| 1706 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); | 1706 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); |
| 1707 impl.Compile(); | 1707 impl.Compile(); |
| 1708 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1708 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
| 1709 return writer->WriteTo(zone_); | 1709 return writer->WriteTo(zone_); |
| 1710 } | 1710 } |
| 1711 } // namespace wasm | 1711 } // namespace wasm |
| 1712 } // namespace internal | 1712 } // namespace internal |
| 1713 } // namespace v8 | 1713 } // namespace v8 |
| OLD | NEW |