OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/ic/handler-configuration.h" | 9 #include "src/ic/handler-configuration.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 Goto(&if_join); | 1816 Goto(&if_join); |
1817 Bind(&if_join); | 1817 Bind(&if_join); |
1818 return var_result.value(); | 1818 return var_result.value(); |
1819 } | 1819 } |
1820 | 1820 |
1821 Node* CodeStubAssembler::ChangeUint32ToTagged(Node* value) { | 1821 Node* CodeStubAssembler::ChangeUint32ToTagged(Node* value) { |
1822 Label if_overflow(this, Label::kDeferred), if_not_overflow(this), | 1822 Label if_overflow(this, Label::kDeferred), if_not_overflow(this), |
1823 if_join(this); | 1823 if_join(this); |
1824 Variable var_result(this, MachineRepresentation::kTagged); | 1824 Variable var_result(this, MachineRepresentation::kTagged); |
1825 // If {value} > 2^31 - 1, we need to store it in a HeapNumber. | 1825 // If {value} > 2^31 - 1, we need to store it in a HeapNumber. |
1826 Branch(Int32LessThan(value, Int32Constant(0)), &if_overflow, | 1826 Branch(Uint32LessThan(Int32Constant(Smi::kMaxValue), value), &if_overflow, |
1827 &if_not_overflow); | 1827 &if_not_overflow); |
| 1828 |
1828 Bind(&if_not_overflow); | 1829 Bind(&if_not_overflow); |
1829 { | 1830 { |
1830 if (Is64()) { | 1831 if (Is64()) { |
1831 var_result.Bind(SmiTag(ChangeUint32ToUint64(value))); | 1832 var_result.Bind(SmiTag(ChangeUint32ToUint64(value))); |
1832 } else { | 1833 } else { |
1833 // If tagging {value} results in an overflow, we need to use a HeapNumber | 1834 // If tagging {value} results in an overflow, we need to use a HeapNumber |
1834 // to represent it. | 1835 // to represent it. |
1835 Node* pair = Int32AddWithOverflow(value, value); | 1836 Node* pair = Int32AddWithOverflow(value, value); |
1836 Node* overflow = Projection(1, pair); | 1837 Node* overflow = Projection(1, pair); |
1837 GotoIf(overflow, &if_overflow); | 1838 GotoIf(overflow, &if_overflow); |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3978 Heap::kTheHoleValueRootIndex); | 3979 Heap::kTheHoleValueRootIndex); |
3979 | 3980 |
3980 // Store the WeakCell in the feedback vector. | 3981 // Store the WeakCell in the feedback vector. |
3981 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, | 3982 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, |
3982 CodeStubAssembler::SMI_PARAMETERS); | 3983 CodeStubAssembler::SMI_PARAMETERS); |
3983 return cell; | 3984 return cell; |
3984 } | 3985 } |
3985 | 3986 |
3986 } // namespace internal | 3987 } // namespace internal |
3987 } // namespace v8 | 3988 } // namespace v8 |
OLD | NEW |