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/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 | 918 |
919 // If {value} is a Smi, then we only need to check that it's not zero. | 919 // If {value} is a Smi, then we only need to check that it's not zero. |
920 Node* if_smi = graph()->NewNode(common()->IfTrue(), branch_smi); | 920 Node* if_smi = graph()->NewNode(common()->IfTrue(), branch_smi); |
921 Node* esmi = effect; | 921 Node* esmi = effect; |
922 { | 922 { |
923 controls[count] = if_smi; | 923 controls[count] = if_smi; |
924 effects[count] = esmi; | 924 effects[count] = esmi; |
925 values[count] = | 925 values[count] = |
926 graph()->NewNode(machine()->Word32Equal(), | 926 graph()->NewNode(machine()->Word32Equal(), |
927 graph()->NewNode(machine()->WordEqual(), value, | 927 graph()->NewNode(machine()->WordEqual(), value, |
928 jsgraph()->ZeroConstant()), | 928 jsgraph()->IntPtrConstant(0)), |
929 zero); | 929 zero); |
930 count++; | 930 count++; |
931 } | 931 } |
932 control = graph()->NewNode(common()->IfFalse(), branch_smi); | 932 control = graph()->NewNode(common()->IfFalse(), branch_smi); |
933 | 933 |
934 // Load the map instance type of {value}. | 934 // Load the map instance type of {value}. |
935 Node* value_map = effect = graph()->NewNode( | 935 Node* value_map = effect = graph()->NewNode( |
936 simplified()->LoadField(AccessBuilder::ForMap()), value, effect, control); | 936 simplified()->LoadField(AccessBuilder::ForMap()), value, effect, control); |
937 Node* value_instance_type = effect = graph()->NewNode( | 937 Node* value_instance_type = effect = graph()->NewNode( |
938 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), value_map, | 938 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), value_map, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // Load the {value} length. | 971 // Load the {value} length. |
972 Node* value_length = estring = graph()->NewNode( | 972 Node* value_length = estring = graph()->NewNode( |
973 simplified()->LoadField(AccessBuilder::ForStringLength()), value, | 973 simplified()->LoadField(AccessBuilder::ForStringLength()), value, |
974 estring, if_string); | 974 estring, if_string); |
975 | 975 |
976 controls[count] = if_string; | 976 controls[count] = if_string; |
977 effects[count] = estring; | 977 effects[count] = estring; |
978 values[count] = | 978 values[count] = |
979 graph()->NewNode(machine()->Word32Equal(), | 979 graph()->NewNode(machine()->Word32Equal(), |
980 graph()->NewNode(machine()->WordEqual(), value_length, | 980 graph()->NewNode(machine()->WordEqual(), value_length, |
981 jsgraph()->ZeroConstant()), | 981 jsgraph()->IntPtrConstant(0)), |
982 zero); | 982 zero); |
983 count++; | 983 count++; |
984 } | 984 } |
985 control = graph()->NewNode(common()->IfFalse(), branch_string); | 985 control = graph()->NewNode(common()->IfFalse(), branch_string); |
986 | 986 |
987 // Check if {value} is a HeapNumber. | 987 // Check if {value} is a HeapNumber. |
988 Node* check_heapnumber = | 988 Node* check_heapnumber = |
989 graph()->NewNode(machine()->Word32Equal(), value_instance_type, | 989 graph()->NewNode(machine()->Word32Equal(), value_instance_type, |
990 jsgraph()->Int32Constant(HEAP_NUMBER_TYPE)); | 990 jsgraph()->Int32Constant(HEAP_NUMBER_TYPE)); |
991 Node* branch_heapnumber = | 991 Node* branch_heapnumber = |
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3642 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3642 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3643 Operator::kEliminatable); | 3643 Operator::kEliminatable); |
3644 to_number_operator_.set(common()->Call(desc)); | 3644 to_number_operator_.set(common()->Call(desc)); |
3645 } | 3645 } |
3646 return to_number_operator_.get(); | 3646 return to_number_operator_.get(); |
3647 } | 3647 } |
3648 | 3648 |
3649 } // namespace compiler | 3649 } // namespace compiler |
3650 } // namespace internal | 3650 } // namespace internal |
3651 } // namespace v8 | 3651 } // namespace v8 |
OLD | NEW |