| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
| 9 #include "src/compiler/compiler-source-position-table.h" | 9 #include "src/compiler/compiler-source-position-table.h" |
| 10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value); | 1804 Node* vfalse = __ LoadField(AccessBuilder::ForHeapNumberValue(), value); |
| 1805 vfalse = __ TruncateFloat64ToWord32(vfalse); | 1805 vfalse = __ TruncateFloat64ToWord32(vfalse); |
| 1806 __ Goto(&done, vfalse); | 1806 __ Goto(&done, vfalse); |
| 1807 | 1807 |
| 1808 __ Bind(&done); | 1808 __ Bind(&done); |
| 1809 return done.PhiAt(0); | 1809 return done.PhiAt(0); |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 Node* EffectControlLinearizer::LowerCheckedTruncateTaggedToWord32( | 1812 Node* EffectControlLinearizer::LowerCheckedTruncateTaggedToWord32( |
| 1813 Node* node, Node* frame_state) { | 1813 Node* node, Node* frame_state) { |
| 1814 CheckTaggedInputMode mode = CheckTaggedInputModeOf(node->op()); |
| 1814 Node* value = node->InputAt(0); | 1815 Node* value = node->InputAt(0); |
| 1815 | 1816 |
| 1816 auto if_not_smi = __ MakeLabel<1>(); | 1817 auto if_not_smi = __ MakeLabel<1>(); |
| 1817 auto done = __ MakeLabel<2>(MachineRepresentation::kWord32); | 1818 auto done = __ MakeLabel<2>(MachineRepresentation::kWord32); |
| 1818 | 1819 |
| 1819 Node* check = ObjectIsSmi(value); | 1820 Node* check = ObjectIsSmi(value); |
| 1820 __ GotoUnless(check, &if_not_smi); | 1821 __ GotoUnless(check, &if_not_smi); |
| 1821 // In the Smi case, just convert to int32. | 1822 // In the Smi case, just convert to int32. |
| 1822 __ Goto(&done, ChangeSmiToInt32(value)); | 1823 __ Goto(&done, ChangeSmiToInt32(value)); |
| 1823 | 1824 |
| 1824 // Otherwise, check that it's a heap number or oddball and truncate the value | 1825 // Otherwise, check that it's a heap number or oddball and truncate the value |
| 1825 // to int32. | 1826 // to int32. |
| 1826 __ Bind(&if_not_smi); | 1827 __ Bind(&if_not_smi); |
| 1827 Node* number = BuildCheckedHeapNumberOrOddballToFloat64( | 1828 Node* number = |
| 1828 CheckTaggedInputMode::kNumberOrOddball, value, frame_state); | 1829 BuildCheckedHeapNumberOrOddballToFloat64(mode, value, frame_state); |
| 1829 number = __ TruncateFloat64ToWord32(number); | 1830 number = __ TruncateFloat64ToWord32(number); |
| 1830 __ Goto(&done, number); | 1831 __ Goto(&done, number); |
| 1831 | 1832 |
| 1832 __ Bind(&done); | 1833 __ Bind(&done); |
| 1833 return done.PhiAt(0); | 1834 return done.PhiAt(0); |
| 1834 } | 1835 } |
| 1835 | 1836 |
| 1836 Node* EffectControlLinearizer::LowerObjectIsDetectableCallable(Node* node) { | 1837 Node* EffectControlLinearizer::LowerObjectIsDetectableCallable(Node* node) { |
| 1837 Node* value = node->InputAt(0); | 1838 Node* value = node->InputAt(0); |
| 1838 | 1839 |
| (...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3076 return isolate()->factory(); | 3077 return isolate()->factory(); |
| 3077 } | 3078 } |
| 3078 | 3079 |
| 3079 Isolate* EffectControlLinearizer::isolate() const { | 3080 Isolate* EffectControlLinearizer::isolate() const { |
| 3080 return jsgraph()->isolate(); | 3081 return jsgraph()->isolate(); |
| 3081 } | 3082 } |
| 3082 | 3083 |
| 3083 } // namespace compiler | 3084 } // namespace compiler |
| 3084 } // namespace internal | 3085 } // namespace internal |
| 3085 } // namespace v8 | 3086 } // namespace v8 |
| OLD | NEW |