OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 } | 1882 } |
1883 if (vtrue_type->Is(false_type_) && vfalse_type->Is(true_type_)) { | 1883 if (vtrue_type->Is(false_type_) && vfalse_type->Is(true_type_)) { |
1884 // Select(condition, vtrue:false, vfalse:true) => BooleanNot(condition) | 1884 // Select(condition, vtrue:false, vfalse:true) => BooleanNot(condition) |
1885 node->TrimInputCount(1); | 1885 node->TrimInputCount(1); |
1886 NodeProperties::ChangeOp(node, simplified()->BooleanNot()); | 1886 NodeProperties::ChangeOp(node, simplified()->BooleanNot()); |
1887 return Changed(node); | 1887 return Changed(node); |
1888 } | 1888 } |
1889 return NoChange(); | 1889 return NoChange(); |
1890 } | 1890 } |
1891 | 1891 |
| 1892 Reduction JSTypedLowering::ReduceCheckString(Node* node) { |
| 1893 // TODO(bmeurer): Find a better home for this thing! |
| 1894 Node* const input = NodeProperties::GetValueInput(node, 0); |
| 1895 Type* const input_type = NodeProperties::GetType(input); |
| 1896 if (input_type->Is(Type::String())) { |
| 1897 ReplaceWithValue(node, input); |
| 1898 return Replace(input); |
| 1899 } |
| 1900 return NoChange(); |
| 1901 } |
| 1902 |
1892 Reduction JSTypedLowering::ReduceNumberRoundop(Node* node) { | 1903 Reduction JSTypedLowering::ReduceNumberRoundop(Node* node) { |
1893 // TODO(bmeurer): Find a better home for this thing! | 1904 // TODO(bmeurer): Find a better home for this thing! |
1894 Node* const input = NodeProperties::GetValueInput(node, 0); | 1905 Node* const input = NodeProperties::GetValueInput(node, 0); |
1895 Type* const input_type = NodeProperties::GetType(input); | 1906 Type* const input_type = NodeProperties::GetType(input); |
1896 if (input_type->Is(type_cache_.kIntegerOrMinusZeroOrNaN)) { | 1907 if (input_type->Is(type_cache_.kIntegerOrMinusZeroOrNaN)) { |
1897 return Replace(input); | 1908 return Replace(input); |
1898 } | 1909 } |
1899 return NoChange(); | 1910 return NoChange(); |
1900 } | 1911 } |
1901 | 1912 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2012 case IrOpcode::kJSForInStep: | 2023 case IrOpcode::kJSForInStep: |
2013 return ReduceJSForInStep(node); | 2024 return ReduceJSForInStep(node); |
2014 case IrOpcode::kJSGeneratorStore: | 2025 case IrOpcode::kJSGeneratorStore: |
2015 return ReduceJSGeneratorStore(node); | 2026 return ReduceJSGeneratorStore(node); |
2016 case IrOpcode::kJSGeneratorRestoreContinuation: | 2027 case IrOpcode::kJSGeneratorRestoreContinuation: |
2017 return ReduceJSGeneratorRestoreContinuation(node); | 2028 return ReduceJSGeneratorRestoreContinuation(node); |
2018 case IrOpcode::kJSGeneratorRestoreRegister: | 2029 case IrOpcode::kJSGeneratorRestoreRegister: |
2019 return ReduceJSGeneratorRestoreRegister(node); | 2030 return ReduceJSGeneratorRestoreRegister(node); |
2020 case IrOpcode::kSelect: | 2031 case IrOpcode::kSelect: |
2021 return ReduceSelect(node); | 2032 return ReduceSelect(node); |
| 2033 case IrOpcode::kCheckString: |
| 2034 return ReduceCheckString(node); |
2022 case IrOpcode::kNumberCeil: | 2035 case IrOpcode::kNumberCeil: |
2023 case IrOpcode::kNumberFloor: | 2036 case IrOpcode::kNumberFloor: |
2024 case IrOpcode::kNumberRound: | 2037 case IrOpcode::kNumberRound: |
2025 case IrOpcode::kNumberTrunc: | 2038 case IrOpcode::kNumberTrunc: |
2026 return ReduceNumberRoundop(node); | 2039 return ReduceNumberRoundop(node); |
2027 default: | 2040 default: |
2028 break; | 2041 break; |
2029 } | 2042 } |
2030 return NoChange(); | 2043 return NoChange(); |
2031 } | 2044 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 } | 2079 } |
2067 | 2080 |
2068 | 2081 |
2069 CompilationDependencies* JSTypedLowering::dependencies() const { | 2082 CompilationDependencies* JSTypedLowering::dependencies() const { |
2070 return dependencies_; | 2083 return dependencies_; |
2071 } | 2084 } |
2072 | 2085 |
2073 } // namespace compiler | 2086 } // namespace compiler |
2074 } // namespace internal | 2087 } // namespace internal |
2075 } // namespace v8 | 2088 } // namespace v8 |
OLD | NEW |