| 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
| 6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 namespace compiler { | 13 namespace compiler { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 MachineType kMachineTypes[] = { | 17 MachineType kMachineTypes[] = { |
| 18 MachineType::AnyTagged(), MachineType::AnyTagged(), | 18 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 19 MachineType::AnyTagged(), MachineType::AnyTagged(), | 19 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 20 MachineType::AnyTagged(), MachineType::AnyTagged(), | 20 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 21 MachineType::AnyTagged(), MachineType::AnyTagged()}; | 21 MachineType::AnyTagged(), MachineType::AnyTagged()}; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class LinkageTailCall : public TestWithZone { | 24 class LinkageTailCall : public TestWithZone { |
| 25 protected: | 25 protected: |
| 26 CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) { | 26 CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) { |
| 27 DCHECK(arraysize(kMachineTypes) >= | 27 DCHECK(arraysize(kMachineTypes) >= |
| 28 locations->return_count() + locations->parameter_count()); | 28 locations->return_count() + locations->parameter_count()); |
| 29 USE(kMachineTypes); |
| 29 return new (zone()) CallDescriptor( | 30 return new (zone()) CallDescriptor( |
| 30 CallDescriptor::kCallCodeObject, MachineType::AnyTagged(), | 31 CallDescriptor::kCallCodeObject, MachineType::AnyTagged(), |
| 31 LinkageLocation::ForAnyRegister(MachineType::Pointer()), | 32 LinkageLocation::ForAnyRegister(MachineType::Pointer()), |
| 32 locations, // location_sig | 33 locations, // location_sig |
| 33 0, // js_parameter_count | 34 0, // js_parameter_count |
| 34 Operator::kNoProperties, // properties | 35 Operator::kNoProperties, // properties |
| 35 0, // callee-saved | 36 0, // callee-saved |
| 36 0, // callee-saved fp | 37 0, // callee-saved fp |
| 37 CallDescriptor::kNoFlags, // flags, | 38 CallDescriptor::kNoFlags, // flags, |
| 38 ""); | 39 ""); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 Node* const node = | 340 Node* const node = |
| 340 Node::New(zone(), 1, op, arraysize(parameters), parameters, false); | 341 Node::New(zone(), 1, op, arraysize(parameters), parameters, false); |
| 341 EXPECT_TRUE(desc1->CanTailCall(node)); | 342 EXPECT_TRUE(desc1->CanTailCall(node)); |
| 342 int stack_param_delta = desc2->GetStackParameterDelta(desc1); | 343 int stack_param_delta = desc2->GetStackParameterDelta(desc1); |
| 343 EXPECT_EQ(1, stack_param_delta); | 344 EXPECT_EQ(1, stack_param_delta); |
| 344 } | 345 } |
| 345 | 346 |
| 346 } // namespace compiler | 347 } // namespace compiler |
| 347 } // namespace internal | 348 } // namespace internal |
| 348 } // namespace v8 | 349 } // namespace v8 |
| OLD | NEW |