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

Side by Side Diff: src/compiler/code-generator.cc

Issue 2495243002: [turbofan] Fix deoptimization of boolean bit constants. (Closed)
Patch Set: Created 4 years, 1 month 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 | src/compiler/simplified-lowering.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/address-map.h" 7 #include "src/address-map.h"
8 #include "src/base/adapters.h" 8 #include "src/base/adapters.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 switch (constant.type()) { 851 switch (constant.type()) {
852 case Constant::kInt32: 852 case Constant::kInt32:
853 if (type.representation() == MachineRepresentation::kTagged || 853 if (type.representation() == MachineRepresentation::kTagged ||
854 type.representation() == MachineRepresentation::kTaggedSigned) { 854 type.representation() == MachineRepresentation::kTaggedSigned) {
855 // When pointers are 4 bytes, we can use int32 constants to represent 855 // When pointers are 4 bytes, we can use int32 constants to represent
856 // Smis. 856 // Smis.
857 DCHECK_EQ(4, kPointerSize); 857 DCHECK_EQ(4, kPointerSize);
858 constant_object = 858 constant_object =
859 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); 859 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate());
860 DCHECK(constant_object->IsSmi()); 860 DCHECK(constant_object->IsSmi());
861 } else if (type.representation() == MachineRepresentation::kBit) {
862 if (constant.ToInt32() == 0) {
863 constant_object = isolate()->factory()->false_value();
864 } else {
865 DCHECK_EQ(1, constant.ToInt32());
866 constant_object = isolate()->factory()->true_value();
867 }
861 } else { 868 } else {
862 // TODO(jarin,bmeurer): We currently pass in raw pointers to the 869 // TODO(jarin,bmeurer): We currently pass in raw pointers to the
863 // JSFunction::entry here. We should really consider fixing this. 870 // JSFunction::entry here. We should really consider fixing this.
864 DCHECK(type == MachineType::Int32() || 871 DCHECK(type == MachineType::Int32() ||
865 type == MachineType::Uint32() || 872 type == MachineType::Uint32() ||
866 type.representation() == MachineRepresentation::kBit ||
867 type.representation() == MachineRepresentation::kWord32 || 873 type.representation() == MachineRepresentation::kWord32 ||
868 type.representation() == MachineRepresentation::kNone); 874 type.representation() == MachineRepresentation::kNone);
869 DCHECK(type.representation() != MachineRepresentation::kNone || 875 DCHECK(type.representation() != MachineRepresentation::kNone ||
870 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); 876 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue);
871 877
872 constant_object = 878 constant_object =
873 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); 879 isolate()->factory()->NewNumberFromInt(constant.ToInt32());
874 } 880 }
875 break; 881 break;
876 case Constant::kInt64: 882 case Constant::kInt64:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { 947 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) {
942 gen->ools_ = this; 948 gen->ools_ = this;
943 } 949 }
944 950
945 951
946 OutOfLineCode::~OutOfLineCode() {} 952 OutOfLineCode::~OutOfLineCode() {}
947 953
948 } // namespace compiler 954 } // namespace compiler
949 } // namespace internal 955 } // namespace internal
950 } // namespace v8 956 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698