| 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[] = {kMachAnyTagged, kMachAnyTagged, kMachAnyTagged, | 17 MachineType kMachineTypes[] = { |
| 18 kMachAnyTagged, kMachAnyTagged, kMachAnyTagged, | 18 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 19 kMachAnyTagged, kMachAnyTagged}; | 19 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 20 MachineType::AnyTagged(), MachineType::AnyTagged(), |
| 21 MachineType::AnyTagged(), MachineType::AnyTagged()}; |
| 20 } | 22 } |
| 21 | 23 |
| 22 class LinkageTailCall : public TestWithZone { | 24 class LinkageTailCall : public TestWithZone { |
| 23 protected: | 25 protected: |
| 24 CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) { | 26 CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) { |
| 25 DCHECK(arraysize(kMachineTypes) >= | 27 DCHECK(arraysize(kMachineTypes) >= |
| 26 locations->return_count() + locations->parameter_count()); | 28 locations->return_count() + locations->parameter_count()); |
| 27 MachineSignature* types = new (zone()) MachineSignature( | 29 MachineSignature* types = new (zone()) MachineSignature( |
| 28 locations->return_count(), locations->parameter_count(), kMachineTypes); | 30 locations->return_count(), locations->parameter_count(), kMachineTypes); |
| 29 return new (zone()) | 31 return new (zone()) CallDescriptor(CallDescriptor::kCallCodeObject, |
| 30 CallDescriptor(CallDescriptor::kCallCodeObject, kMachAnyTagged, | 32 MachineType::AnyTagged(), |
| 31 LinkageLocation::ForAnyRegister(), | 33 LinkageLocation::ForAnyRegister(), |
| 32 types, // machine_sig | 34 types, // machine_sig |
| 33 locations, // location_sig | 35 locations, // location_sig |
| 34 0, // js_parameter_count | 36 0, // js_parameter_count |
| 35 Operator::kNoProperties, // properties | 37 Operator::kNoProperties, // properties |
| 36 0, // callee-saved | 38 0, // callee-saved |
| 37 0, // callee-saved fp | 39 0, // callee-saved fp |
| 38 CallDescriptor::kNoFlags, // flags, | 40 CallDescriptor::kNoFlags, // flags, |
| 39 ""); | 41 ""); |
| 40 } | 42 } |
| 41 | 43 |
| 42 LinkageLocation StackLocation(int loc) { | 44 LinkageLocation StackLocation(int loc) { |
| 43 return LinkageLocation::ForCallerFrameSlot(-loc); | 45 return LinkageLocation::ForCallerFrameSlot(-loc); |
| 44 } | 46 } |
| 45 | 47 |
| 46 LinkageLocation RegisterLocation(int loc) { | 48 LinkageLocation RegisterLocation(int loc) { |
| 47 return LinkageLocation::ForRegister(loc); | 49 return LinkageLocation::ForRegister(loc); |
| 48 } | 50 } |
| 49 }; | 51 }; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 Node* const node = | 343 Node* const node = |
| 342 Node::New(zone(), 1, op, arraysize(parameters), parameters, false); | 344 Node::New(zone(), 1, op, arraysize(parameters), parameters, false); |
| 343 int stack_param_delta = 0; | 345 int stack_param_delta = 0; |
| 344 EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta)); | 346 EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta)); |
| 345 EXPECT_EQ(-1, stack_param_delta); | 347 EXPECT_EQ(-1, stack_param_delta); |
| 346 } | 348 } |
| 347 | 349 |
| 348 } // namespace compiler | 350 } // namespace compiler |
| 349 } // namespace internal | 351 } // namespace internal |
| 350 } // namespace v8 | 352 } // namespace v8 |
| OLD | NEW |