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/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 // Convert inputs to the output representation of this phi, pass the | 910 // Convert inputs to the output representation of this phi, pass the |
911 // truncation truncation along. | 911 // truncation truncation along. |
912 UseInfo input_use(output, truncation); | 912 UseInfo input_use(output, truncation); |
913 for (int i = 0; i < node->InputCount(); i++) { | 913 for (int i = 0; i < node->InputCount(); i++) { |
914 ProcessInput(node, i, i < values ? input_use : UseInfo::None()); | 914 ProcessInput(node, i, i < values ? input_use : UseInfo::None()); |
915 } | 915 } |
916 } | 916 } |
917 | 917 |
918 void VisitCall(Node* node, SimplifiedLowering* lowering) { | 918 void VisitCall(Node* node, SimplifiedLowering* lowering) { |
919 const CallDescriptor* desc = CallDescriptorOf(node->op()); | 919 const CallDescriptor* desc = CallDescriptorOf(node->op()); |
920 const MachineSignature* sig = desc->GetMachineSignature(); | 920 int params = static_cast<int>(desc->ParameterCount()); |
921 int params = static_cast<int>(sig->parameter_count()); | |
922 // Propagate representation information from call descriptor. | 921 // Propagate representation information from call descriptor. |
923 for (int i = 0; i < node->InputCount(); i++) { | 922 for (int i = 0; i < node->InputCount(); i++) { |
924 if (i == 0) { | 923 if (i == 0) { |
925 // The target of the call. | 924 // The target of the call. |
926 ProcessInput(node, i, UseInfo::None()); | 925 ProcessInput(node, i, UseInfo::None()); |
927 } else if ((i - 1) < params) { | 926 } else if ((i - 1) < params) { |
928 ProcessInput(node, i, TruncatingUseInfoFromRepresentation( | 927 ProcessInput(node, i, TruncatingUseInfoFromRepresentation( |
929 sig->GetParam(i - 1).representation())); | 928 desc->GetInputType(i).representation())); |
930 } else { | 929 } else { |
931 ProcessInput(node, i, UseInfo::None()); | 930 ProcessInput(node, i, UseInfo::None()); |
932 } | 931 } |
933 } | 932 } |
934 | 933 |
935 if (sig->return_count() > 0) { | 934 if (desc->ReturnCount() > 0) { |
936 SetOutput(node, | 935 SetOutput(node, desc->GetReturnType(0).representation()); |
937 desc->GetMachineSignature()->GetReturn().representation()); | |
938 } else { | 936 } else { |
939 SetOutput(node, MachineRepresentation::kTagged); | 937 SetOutput(node, MachineRepresentation::kTagged); |
940 } | 938 } |
941 } | 939 } |
942 | 940 |
943 MachineSemantic DeoptValueSemanticOf(Type* type) { | 941 MachineSemantic DeoptValueSemanticOf(Type* type) { |
944 // We only need signedness to do deopt correctly. | 942 // We only need signedness to do deopt correctly. |
945 if (type->Is(Type::Signed32())) { | 943 if (type->Is(Type::Signed32())) { |
946 return MachineSemantic::kInt32; | 944 return MachineSemantic::kInt32; |
947 } else if (type->Is(Type::Unsigned32())) { | 945 } else if (type->Is(Type::Unsigned32())) { |
(...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3152 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3150 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3153 Operator::kNoProperties); | 3151 Operator::kNoProperties); |
3154 to_number_operator_.set(common()->Call(desc)); | 3152 to_number_operator_.set(common()->Call(desc)); |
3155 } | 3153 } |
3156 return to_number_operator_.get(); | 3154 return to_number_operator_.get(); |
3157 } | 3155 } |
3158 | 3156 |
3159 } // namespace compiler | 3157 } // namespace compiler |
3160 } // namespace internal | 3158 } // namespace internal |
3161 } // namespace v8 | 3159 } // namespace v8 |
OLD | NEW |