| OLD | NEW |
| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/lithium-inl.h" | 9 #include "src/lithium-inl.h" |
| 10 | 10 |
| (...skipping 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2125 HValue** left) { | 2125 HValue** left) { |
| 2126 if (!val->representation().IsInteger32()) return NULL; | 2126 if (!val->representation().IsInteger32()) return NULL; |
| 2127 if (!(val->IsBitwise() || val->IsAdd() || val->IsSub())) return NULL; | 2127 if (!(val->IsBitwise() || val->IsAdd() || val->IsSub())) return NULL; |
| 2128 | 2128 |
| 2129 HBinaryOperation* hinstr = HBinaryOperation::cast(val); | 2129 HBinaryOperation* hinstr = HBinaryOperation::cast(val); |
| 2130 HValue* hleft = hinstr->left(); | 2130 HValue* hleft = hinstr->left(); |
| 2131 HValue* hright = hinstr->right(); | 2131 HValue* hright = hinstr->right(); |
| 2132 DCHECK(hleft->representation().Equals(hinstr->representation())); | 2132 DCHECK(hleft->representation().Equals(hinstr->representation())); |
| 2133 DCHECK(hright->representation().Equals(hinstr->representation())); | 2133 DCHECK(hright->representation().Equals(hinstr->representation())); |
| 2134 | 2134 |
| 2135 if (hleft == hright) return NULL; |
| 2136 |
| 2135 if ((hright->IsConstant() && | 2137 if ((hright->IsConstant() && |
| 2136 LikelyFitsImmField(hinstr, HConstant::cast(hright)->Integer32Value())) || | 2138 LikelyFitsImmField(hinstr, HConstant::cast(hright)->Integer32Value())) || |
| 2137 (hinstr->IsCommutative() && hleft->IsConstant() && | 2139 (hinstr->IsCommutative() && hleft->IsConstant() && |
| 2138 LikelyFitsImmField(hinstr, HConstant::cast(hleft)->Integer32Value()))) { | 2140 LikelyFitsImmField(hinstr, HConstant::cast(hleft)->Integer32Value()))) { |
| 2139 // The constant operand will likely fit in the immediate field. We are | 2141 // The constant operand will likely fit in the immediate field. We are |
| 2140 // better off with | 2142 // better off with |
| 2141 // lsl x8, x9, #imm | 2143 // lsl x8, x9, #imm |
| 2142 // add x0, x8, #imm2 | 2144 // add x0, x8, #imm2 |
| 2143 // than with | 2145 // than with |
| 2144 // mov x16, #imm2 | 2146 // mov x16, #imm2 |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 LOperand* context = UseFixed(instr->context(), cp); | 2793 LOperand* context = UseFixed(instr->context(), cp); |
| 2792 LOperand* function = UseRegisterAtStart(instr->function()); | 2794 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2793 LAllocateBlockContext* result = | 2795 LAllocateBlockContext* result = |
| 2794 new(zone()) LAllocateBlockContext(context, function); | 2796 new(zone()) LAllocateBlockContext(context, function); |
| 2795 return MarkAsCall(DefineFixed(result, cp), instr); | 2797 return MarkAsCall(DefineFixed(result, cp), instr); |
| 2796 } | 2798 } |
| 2797 | 2799 |
| 2798 | 2800 |
| 2799 } // namespace internal | 2801 } // namespace internal |
| 2800 } // namespace v8 | 2802 } // namespace v8 |
| OLD | NEW |