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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 2206553002: [turbofan] Fix invalid representation selection for Phis/Selects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/mjsunit/regress/regress-v8-5255-1.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } 832 }
833 833
834 // Infer representation for phi-like nodes. 834 // Infer representation for phi-like nodes.
835 MachineRepresentation GetOutputInfoForPhi(Node* node, Truncation use) { 835 MachineRepresentation GetOutputInfoForPhi(Node* node, Truncation use) {
836 // Compute the representation. 836 // Compute the representation.
837 Type* type = TypeOf(node); 837 Type* type = TypeOf(node);
838 if (type->Is(Type::None())) { 838 if (type->Is(Type::None())) {
839 return MachineRepresentation::kNone; 839 return MachineRepresentation::kNone;
840 } else if (type->Is(Type::Signed32()) || type->Is(Type::Unsigned32())) { 840 } else if (type->Is(Type::Signed32()) || type->Is(Type::Unsigned32())) {
841 return MachineRepresentation::kWord32; 841 return MachineRepresentation::kWord32;
842 } else if (use.IsUsedAsWord32()) { 842 } else if (type->Is(Type::NumberOrOddball()) && use.IsUsedAsWord32()) {
843 return MachineRepresentation::kWord32; 843 return MachineRepresentation::kWord32;
844 } else if (type->Is(Type::Boolean())) { 844 } else if (type->Is(Type::Boolean())) {
845 return MachineRepresentation::kBit; 845 return MachineRepresentation::kBit;
846 } else if (use.IsUsedAsFloat64()) { 846 } else if (type->Is(Type::NumberOrOddball()) && use.IsUsedAsFloat64()) {
847 return MachineRepresentation::kFloat64; 847 return MachineRepresentation::kFloat64;
848 } else if (type->Is( 848 } else if (type->Is(
849 Type::Union(Type::SignedSmall(), Type::NaN(), zone()))) { 849 Type::Union(Type::SignedSmall(), Type::NaN(), zone()))) {
850 // TODO(turbofan): For Phis that return either NaN or some Smi, it's 850 // TODO(turbofan): For Phis that return either NaN or some Smi, it's
851 // beneficial to not go all the way to double, unless the uses are 851 // beneficial to not go all the way to double, unless the uses are
852 // double uses. For tagging that just means some potentially expensive 852 // double uses. For tagging that just means some potentially expensive
853 // allocation code; we might want to do the same for -0 as well? 853 // allocation code; we might want to do the same for -0 as well?
854 return MachineRepresentation::kTagged; 854 return MachineRepresentation::kTagged;
855 } else if (type->Is(Type::Number())) { 855 } else if (type->Is(Type::Number())) {
856 return MachineRepresentation::kFloat64; 856 return MachineRepresentation::kFloat64;
(...skipping 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after
3617 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3617 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3618 Operator::kNoProperties); 3618 Operator::kNoProperties);
3619 to_number_operator_.set(common()->Call(desc)); 3619 to_number_operator_.set(common()->Call(desc));
3620 } 3620 }
3621 return to_number_operator_.get(); 3621 return to_number_operator_.get();
3622 } 3622 }
3623 3623
3624 } // namespace compiler 3624 } // namespace compiler
3625 } // namespace internal 3625 } // namespace internal
3626 } // namespace v8 3626 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-v8-5255-1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698