OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 __ Bind(slow_path->exit_label()); | 2587 __ Bind(slow_path->exit_label()); |
2588 } | 2588 } |
2589 | 2589 |
2590 | 2590 |
2591 static void EmitJavascriptOverflowCheck(FlowGraphCompiler* compiler, | 2591 static void EmitJavascriptOverflowCheck(FlowGraphCompiler* compiler, |
2592 Range* range, | 2592 Range* range, |
2593 Label* overflow, | 2593 Label* overflow, |
2594 Register result) { | 2594 Register result) { |
2595 if (!range->IsWithin(-0x20000000000000LL, 0x20000000000000LL)) { | 2595 if (!range->IsWithin(-0x20000000000000LL, 0x20000000000000LL)) { |
2596 ASSERT(overflow != NULL); | 2596 ASSERT(overflow != NULL); |
| 2597 // TODO(zra): This can be tightened to one compare/branch using: |
| 2598 // overflow = (result + 2^52) > 2^53 with an unsigned comparison. |
2597 __ CompareImmediate(result, Immediate(-0x20000000000000LL), PP); | 2599 __ CompareImmediate(result, Immediate(-0x20000000000000LL), PP); |
2598 __ j(LESS, overflow); | 2600 __ j(LESS, overflow); |
2599 __ CompareImmediate(result, Immediate(0x20000000000000LL), PP); | 2601 __ CompareImmediate(result, Immediate(0x20000000000000LL), PP); |
2600 __ j(GREATER, overflow); | 2602 __ j(GREATER, overflow); |
2601 } | 2603 } |
2602 } | 2604 } |
2603 | 2605 |
2604 | 2606 |
2605 static void EmitSmiShiftLeft(FlowGraphCompiler* compiler, | 2607 static void EmitSmiShiftLeft(FlowGraphCompiler* compiler, |
2606 BinarySmiOpInstr* shift_left) { | 2608 BinarySmiOpInstr* shift_left) { |
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5779 PcDescriptors::kOther, | 5781 PcDescriptors::kOther, |
5780 locs()); | 5782 locs()); |
5781 __ Drop(ArgumentCount()); // Discard arguments. | 5783 __ Drop(ArgumentCount()); // Discard arguments. |
5782 } | 5784 } |
5783 | 5785 |
5784 } // namespace dart | 5786 } // namespace dart |
5785 | 5787 |
5786 #undef __ | 5788 #undef __ |
5787 | 5789 |
5788 #endif // defined TARGET_ARCH_X64 | 5790 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |