OLD | NEW |
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/x87/lithium-x87.h" | 5 #include "src/crankshaft/x87/lithium-x87.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X87 | 9 #if V8_TARGET_ARCH_X87 |
10 | 10 |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 | 908 |
909 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { | 909 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { |
910 return new(zone()) LGoto(instr->FirstSuccessor()); | 910 return new(zone()) LGoto(instr->FirstSuccessor()); |
911 } | 911 } |
912 | 912 |
913 | 913 |
914 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 914 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
915 HValue* value = instr->value(); | 915 HValue* value = instr->value(); |
916 Representation r = value->representation(); | 916 Representation r = value->representation(); |
917 HType type = value->type(); | 917 HType type = value->type(); |
918 ToBooleanICStub::Types expected = instr->expected_input_types(); | 918 ToBooleanHints expected = instr->expected_input_types(); |
919 if (expected.IsEmpty()) expected = ToBooleanICStub::Types::Generic(); | 919 if (expected == ToBooleanHint::kNone) expected = ToBooleanHint::kAny; |
920 | 920 |
921 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || | 921 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || |
922 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); | 922 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); |
923 LOperand* temp = !easy_case && expected.NeedsMap() ? TempRegister() : NULL; | 923 LOperand* temp = !easy_case && (expected & ToBooleanHint::kNeedsMap) |
| 924 ? TempRegister() |
| 925 : NULL; |
924 LInstruction* branch = | 926 LInstruction* branch = |
925 temp != NULL ? new (zone()) LBranch(UseRegister(value), temp) | 927 temp != NULL ? new (zone()) LBranch(UseRegister(value), temp) |
926 : new (zone()) LBranch(UseRegisterAtStart(value), temp); | 928 : new (zone()) LBranch(UseRegisterAtStart(value), temp); |
927 if (!easy_case && | 929 if (!easy_case && ((!(expected & ToBooleanHint::kSmallInteger) && |
928 ((!expected.Contains(ToBooleanICStub::SMI) && expected.NeedsMap()) || | 930 (expected & ToBooleanHint::kNeedsMap)) || |
929 !expected.IsGeneric())) { | 931 expected != ToBooleanHint::kAny)) { |
930 branch = AssignEnvironment(branch); | 932 branch = AssignEnvironment(branch); |
931 } | 933 } |
932 return branch; | 934 return branch; |
933 } | 935 } |
934 | 936 |
935 | 937 |
936 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { | 938 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { |
937 return new(zone()) LDebugBreak(); | 939 return new(zone()) LDebugBreak(); |
938 } | 940 } |
939 | 941 |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 LOperand* index = UseTempRegister(instr->index()); | 2466 LOperand* index = UseTempRegister(instr->index()); |
2465 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2467 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2466 LInstruction* result = DefineSameAsFirst(load); | 2468 LInstruction* result = DefineSameAsFirst(load); |
2467 return AssignPointerMap(result); | 2469 return AssignPointerMap(result); |
2468 } | 2470 } |
2469 | 2471 |
2470 } // namespace internal | 2472 } // namespace internal |
2471 } // namespace v8 | 2473 } // namespace v8 |
2472 | 2474 |
2473 #endif // V8_TARGET_ARCH_X87 | 2475 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |