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

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

Issue 1971693002: [wasm] Introduce custom asm.js bytecodes for double->int conversions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-opcodes.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 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698