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

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

Issue 1749233002: Convert float64 to float32 when coerced with a heapf32 assignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | test/cctest/test-asm-validator.cc » ('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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 VariableProxy* effective_value_var = GetLeft(value_op)->AsVariableProxy(); 687 VariableProxy* effective_value_var = GetLeft(value_op)->AsVariableProxy();
688 if (target_var != nullptr && effective_value_var != nullptr && 688 if (target_var != nullptr && effective_value_var != nullptr &&
689 target_var->var() == effective_value_var->var()) { 689 target_var->var() == effective_value_var->var()) {
690 block_size_--; 690 block_size_--;
691 return; 691 return;
692 } 692 }
693 } 693 }
694 is_set_op_ = true; 694 is_set_op_ = true;
695 RECURSE(Visit(expr->target())); 695 RECURSE(Visit(expr->target()));
696 DCHECK(!is_set_op_); 696 DCHECK(!is_set_op_);
697 // Assignment to heapf32 from float64 converts.
698 if (TypeOf(expr->value()) == kAstF64 && expr->target()->IsProperty() &&
699 expr->target()->AsProperty()->obj()->bounds().lower->Is(
700 cache_.kFloat32Array)) {
701 current_function_builder_->Emit(kExprF32ConvertF64);
702 }
697 RECURSE(Visit(expr->value())); 703 RECURSE(Visit(expr->value()));
698 if (in_init) { 704 if (in_init) {
699 UnLoadInitFunction(); 705 UnLoadInitFunction();
700 } 706 }
701 } 707 }
702 708
703 void VisitYield(Yield* expr) { UNREACHABLE(); } 709 void VisitYield(Yield* expr) { UNREACHABLE(); }
704 710
705 void VisitThrow(Throw* expr) { UNREACHABLE(); } 711 void VisitThrow(Throw* expr) { UNREACHABLE(); }
706 712
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 // that zone in constructor may be thrown away once wasm module is written. 1511 // that zone in constructor may be thrown away once wasm module is written.
1506 WasmModuleIndex* AsmWasmBuilder::Run() { 1512 WasmModuleIndex* AsmWasmBuilder::Run() {
1507 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); 1513 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_);
1508 impl.Compile(); 1514 impl.Compile();
1509 WasmModuleWriter* writer = impl.builder_->Build(zone_); 1515 WasmModuleWriter* writer = impl.builder_->Build(zone_);
1510 return writer->WriteTo(zone_); 1516 return writer->WriteTo(zone_);
1511 } 1517 }
1512 } // namespace wasm 1518 } // namespace wasm
1513 } // namespace internal 1519 } // namespace internal
1514 } // namespace v8 1520 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698