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

Side by Side Diff: src/crankshaft/ia32/lithium-ia32.cc

Issue 2498563002: [cleanup] Replace ToBooleanICStub::Types with ToBooleanHints (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 | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/lithium.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/crankshaft/ia32/lithium-ia32.h" 5 #include "src/crankshaft/ia32/lithium-ia32.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 10
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 893
894 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 894 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
895 return new(zone()) LGoto(instr->FirstSuccessor()); 895 return new(zone()) LGoto(instr->FirstSuccessor());
896 } 896 }
897 897
898 898
899 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 899 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
900 HValue* value = instr->value(); 900 HValue* value = instr->value();
901 Representation r = value->representation(); 901 Representation r = value->representation();
902 HType type = value->type(); 902 HType type = value->type();
903 ToBooleanICStub::Types expected = instr->expected_input_types(); 903 ToBooleanHints expected = instr->expected_input_types();
904 if (expected.IsEmpty()) expected = ToBooleanICStub::Types::Generic(); 904 if (expected == ToBooleanHint::kNone) expected = ToBooleanHint::kAny;
905 905
906 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || 906 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() ||
907 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); 907 type.IsJSArray() || type.IsHeapNumber() || type.IsString();
908 LOperand* temp = !easy_case && expected.NeedsMap() ? TempRegister() : NULL; 908 LOperand* temp = !easy_case && (expected & ToBooleanHint::kNeedsMap)
909 ? TempRegister()
910 : NULL;
909 LInstruction* branch = new(zone()) LBranch(UseRegister(value), temp); 911 LInstruction* branch = new(zone()) LBranch(UseRegister(value), temp);
910 if (!easy_case && 912 if (!easy_case && ((!(expected & ToBooleanHint::kSmallInteger) &&
911 ((!expected.Contains(ToBooleanICStub::SMI) && expected.NeedsMap()) || 913 (expected & ToBooleanHint::kNeedsMap)) ||
912 !expected.IsGeneric())) { 914 expected != ToBooleanHint::kAny)) {
913 branch = AssignEnvironment(branch); 915 branch = AssignEnvironment(branch);
914 } 916 }
915 return branch; 917 return branch;
916 } 918 }
917 919
918 920
919 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { 921 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {
920 return new(zone()) LDebugBreak(); 922 return new(zone()) LDebugBreak();
921 } 923 }
922 924
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 LOperand* index = UseTempRegister(instr->index()); 2464 LOperand* index = UseTempRegister(instr->index());
2463 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2465 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2464 LInstruction* result = DefineSameAsFirst(load); 2466 LInstruction* result = DefineSameAsFirst(load);
2465 return AssignPointerMap(result); 2467 return AssignPointerMap(result);
2466 } 2468 }
2467 2469
2468 } // namespace internal 2470 } // namespace internal
2469 } // namespace v8 2471 } // namespace v8
2470 2472
2471 #endif // V8_TARGET_ARCH_IA32 2473 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/lithium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698