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/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/arm64/lithium-codegen-arm64.h" | 9 #include "src/arm64/lithium-codegen-arm64.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2229 ? UseRegister(instr->left()) | 2229 ? UseRegister(instr->left()) |
2230 : UseRegisterAtStart(instr->left()); | 2230 : UseRegisterAtStart(instr->left()); |
2231 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | 2231 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
2232 | 2232 |
2233 // The only shift that can deoptimize is `left >>> 0`, where left is negative. | 2233 // The only shift that can deoptimize is `left >>> 0`, where left is negative. |
2234 // In these cases, the result is a uint32 that is too large for an int32. | 2234 // In these cases, the result is a uint32 that is too large for an int32. |
2235 bool right_can_be_zero = !instr->right()->IsConstant() || | 2235 bool right_can_be_zero = !instr->right()->IsConstant() || |
2236 (JSShiftAmountFromHConstant(instr->right()) == 0); | 2236 (JSShiftAmountFromHConstant(instr->right()) == 0); |
2237 bool can_deopt = false; | 2237 bool can_deopt = false; |
2238 if ((op == Token::SHR) && right_can_be_zero) { | 2238 if ((op == Token::SHR) && right_can_be_zero) { |
2239 if (FLAG_opt_safe_uint32_operations) { | 2239 can_deopt = !instr->CheckFlag(HInstruction::kUint32); |
2240 can_deopt = !instr->CheckFlag(HInstruction::kUint32); | |
2241 } else { | |
2242 can_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32); | |
2243 } | |
2244 } | 2240 } |
2245 | 2241 |
2246 LInstruction* result; | 2242 LInstruction* result; |
2247 if (instr->representation().IsInteger32()) { | 2243 if (instr->representation().IsInteger32()) { |
2248 result = DefineAsRegister(new (zone()) LShiftI(op, left, right, can_deopt)); | 2244 result = DefineAsRegister(new (zone()) LShiftI(op, left, right, can_deopt)); |
2249 } else { | 2245 } else { |
2250 DCHECK(instr->representation().IsSmi()); | 2246 DCHECK(instr->representation().IsSmi()); |
2251 result = DefineAsRegister(new (zone()) LShiftS(op, left, right, can_deopt)); | 2247 result = DefineAsRegister(new (zone()) LShiftS(op, left, right, can_deopt)); |
2252 } | 2248 } |
2253 | 2249 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 HAllocateBlockContext* instr) { | 2744 HAllocateBlockContext* instr) { |
2749 LOperand* context = UseFixed(instr->context(), cp); | 2745 LOperand* context = UseFixed(instr->context(), cp); |
2750 LOperand* function = UseRegisterAtStart(instr->function()); | 2746 LOperand* function = UseRegisterAtStart(instr->function()); |
2751 LAllocateBlockContext* result = | 2747 LAllocateBlockContext* result = |
2752 new(zone()) LAllocateBlockContext(context, function); | 2748 new(zone()) LAllocateBlockContext(context, function); |
2753 return MarkAsCall(DefineFixed(result, cp), instr); | 2749 return MarkAsCall(DefineFixed(result, cp), instr); |
2754 } | 2750 } |
2755 | 2751 |
2756 | 2752 |
2757 } } // namespace v8::internal | 2753 } } // namespace v8::internal |
OLD | NEW |