| 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/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 | 891 |
| 892 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { | 892 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { |
| 893 return new(zone()) LDebugBreak(); | 893 return new(zone()) LDebugBreak(); |
| 894 } | 894 } |
| 895 | 895 |
| 896 | 896 |
| 897 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 897 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
| 898 HValue* value = instr->value(); | 898 HValue* value = instr->value(); |
| 899 Representation r = value->representation(); | 899 Representation r = value->representation(); |
| 900 HType type = value->type(); | 900 HType type = value->type(); |
| 901 ToBooleanICStub::Types expected = instr->expected_input_types(); | 901 ToBooleanHints expected = instr->expected_input_types(); |
| 902 if (expected.IsEmpty()) expected = ToBooleanICStub::Types::Generic(); | 902 if (expected == ToBooleanHint::kNone) expected = ToBooleanHint::kAny; |
| 903 | 903 |
| 904 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || | 904 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || |
| 905 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); | 905 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); |
| 906 LInstruction* branch = new(zone()) LBranch(UseRegister(value)); | 906 LInstruction* branch = new(zone()) LBranch(UseRegister(value)); |
| 907 if (!easy_case && | 907 if (!easy_case && ((!(expected & ToBooleanHint::kSmallInteger) && |
| 908 ((!expected.Contains(ToBooleanICStub::SMI) && expected.NeedsMap()) || | 908 (expected & ToBooleanHint::kNeedsMap)) || |
| 909 !expected.IsGeneric())) { | 909 expected != ToBooleanHint::kAny)) { |
| 910 branch = AssignEnvironment(branch); | 910 branch = AssignEnvironment(branch); |
| 911 } | 911 } |
| 912 return branch; | 912 return branch; |
| 913 } | 913 } |
| 914 | 914 |
| 915 | 915 |
| 916 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 916 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
| 917 DCHECK(instr->value()->representation().IsTagged()); | 917 DCHECK(instr->value()->representation().IsTagged()); |
| 918 LOperand* value = UseRegisterAtStart(instr->value()); | 918 LOperand* value = UseRegisterAtStart(instr->value()); |
| 919 return new(zone()) LCmpMapAndBranch(value); | 919 return new(zone()) LCmpMapAndBranch(value); |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 LOperand* index = UseTempRegister(instr->index()); | 2467 LOperand* index = UseTempRegister(instr->index()); |
| 2468 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2468 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
| 2469 LInstruction* result = DefineSameAsFirst(load); | 2469 LInstruction* result = DefineSameAsFirst(load); |
| 2470 return AssignPointerMap(result); | 2470 return AssignPointerMap(result); |
| 2471 } | 2471 } |
| 2472 | 2472 |
| 2473 } // namespace internal | 2473 } // namespace internal |
| 2474 } // namespace v8 | 2474 } // namespace v8 |
| 2475 | 2475 |
| 2476 #endif // V8_TARGET_ARCH_X64 | 2476 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |