| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/asmjs/asm-parser.h" | 5 #include "src/asmjs/asm-parser.h" |
| 6 | 6 |
| 7 // Required to get M_E etc. for MSVC. | 7 // Required to get M_E etc. for MSVC. |
| 8 // References from STDLIB_MATH_VALUE_LIST in asm-names.h | 8 // References from STDLIB_MATH_VALUE_LIST in asm-names.h |
| 9 #if defined(_WIN32) | 9 #if defined(_WIN32) |
| 10 #define _USE_MATH_DEFINES | 10 #define _USE_MATH_DEFINES |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 // Store types. | 848 // Store types. |
| 849 EXPECT_TOKEN('='); | 849 EXPECT_TOKEN('='); |
| 850 double dvalue = 0.0; | 850 double dvalue = 0.0; |
| 851 uint64_t uvalue = 0; | 851 uint64_t uvalue = 0; |
| 852 if (Check('-')) { | 852 if (Check('-')) { |
| 853 if (CheckForDouble(&dvalue)) { | 853 if (CheckForDouble(&dvalue)) { |
| 854 info->kind = VarKind::kLocal; | 854 info->kind = VarKind::kLocal; |
| 855 info->type = AsmType::Double(); | 855 info->type = AsmType::Double(); |
| 856 info->index = static_cast<uint32_t>(param_count + locals->size()); | 856 info->index = static_cast<uint32_t>(param_count + locals->size()); |
| 857 locals->push_back(kWasmF64); | 857 locals->push_back(kWasmF64); |
| 858 byte code[] = {WASM_F64(dvalue)}; | 858 byte code[] = {WASM_F64(-dvalue)}; |
| 859 current_function_builder_->EmitCode(code, sizeof(code)); | 859 current_function_builder_->EmitCode(code, sizeof(code)); |
| 860 current_function_builder_->EmitSetLocal(info->index); | 860 current_function_builder_->EmitSetLocal(info->index); |
| 861 } else if (CheckForUnsigned(&uvalue)) { | 861 } else if (CheckForUnsigned(&uvalue)) { |
| 862 if (uvalue > 0x7fffffff) { | 862 if (uvalue > 0x7fffffff) { |
| 863 FAIL("Numeric literal out of range"); | 863 FAIL("Numeric literal out of range"); |
| 864 } | 864 } |
| 865 info->kind = VarKind::kLocal; | 865 info->kind = VarKind::kLocal; |
| 866 info->type = AsmType::Int(); | 866 info->type = AsmType::Int(); |
| 867 info->index = static_cast<uint32_t>(param_count + locals->size()); | 867 info->index = static_cast<uint32_t>(param_count + locals->size()); |
| 868 locals->push_back(kWasmI32); | 868 locals->push_back(kWasmI32); |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2366 break; | 2366 break; |
| 2367 } | 2367 } |
| 2368 scanner_.Next(); | 2368 scanner_.Next(); |
| 2369 } | 2369 } |
| 2370 scanner_.Seek(start); | 2370 scanner_.Seek(start); |
| 2371 } | 2371 } |
| 2372 | 2372 |
| 2373 } // namespace wasm | 2373 } // namespace wasm |
| 2374 } // namespace internal | 2374 } // namespace internal |
| 2375 } // namespace v8 | 2375 } // namespace v8 |
| OLD | NEW |