Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index 69164b03d908061e87dcb6423b4d2594a83c2fc3..5dce068ce3755f6a0272f597e0782b600a912ad6 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -7,6 +7,7 @@ |
| #include "vm/allocation.h" |
| #include "vm/ast.h" |
| +#include "vm/flags.h" |
| #include "vm/growable_array.h" |
| #include "vm/locations.h" |
| #include "vm/method_recognizer.h" |
| @@ -730,7 +731,7 @@ class Instruction : public ZoneAllocated { |
| } |
| inline Definition* ArgumentAt(intptr_t index) const; |
| - // Returns true, if this instruction can deoptimize with its current imputs. |
| + // Returns true, if this instruction can deoptimize with its current inputs. |
| // This property can change if we add or remove redefinitions that constrain |
| // the type or the range of input operands during compilation. |
| virtual bool ComputeCanDeoptimize() const = 0; |
| @@ -7179,12 +7180,26 @@ class BinaryMintOpInstr : public BinaryIntegerOpInstr { |
| Value* left, |
| Value* right, |
| intptr_t deopt_id) |
| - : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) {} |
| + : BinaryIntegerOpInstr(op_kind, left, right, deopt_id) { |
| + if (FLAG_truncate_ints_to_64_bits) { |
| + mark_truncating(); |
| + } |
| + } |
| virtual bool ComputeCanDeoptimize() const { |
| - return (can_overflow() && |
| - ((op_kind() == Token::kADD) || (op_kind() == Token::kSUB))) || |
| - (op_kind() == Token::kMUL); // Deopt if inputs are not int32. |
| + switch (op_kind()) { |
| + case Token::kADD: |
| + case Token::kSUB: |
| + return can_overflow(); |
| + case Token::kMUL: |
| +#if defined(TARGET_ARCH_X64) |
|
regis
2017/07/07 20:10:30
What about TARGET_ARCH_ARM64?
alexmarkov
2017/07/07 20:46:38
As far as I can see from intermediate_language_arm
regis
2017/07/07 21:46:53
I was not aware of that. You should probably write
alexmarkov
2017/07/07 22:28:44
Done.
|
| + return can_overflow(); // Deopt if overflow. |
| +#else |
| + return true; // Deopt if inputs are not int32. |
| +#endif |
| + default: |
| + return false; |
| + } |
| } |
| virtual Representation representation() const { return kUnboxedMint; } |
| @@ -7213,6 +7228,9 @@ class ShiftMintOpInstr : public BinaryIntegerOpInstr { |
| : BinaryIntegerOpInstr(op_kind, left, right, deopt_id), |
| shift_range_(NULL) { |
| ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); |
| + if (FLAG_truncate_ints_to_64_bits) { |
| + mark_truncating(); |
| + } |
| } |
| Range* shift_range() const { return shift_range_; } |