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/linkage.h" | 5 #include "src/compiler/linkage.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/builtins/builtins-utils.h" | 8 #include "src/builtins/builtins-utils.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-info.h" | 10 #include "src/compilation-info.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 } | 101 } |
102 } | 102 } |
103 return callee_slots_above_sp - tail_caller_slots_above_sp; | 103 return callee_slots_above_sp - tail_caller_slots_above_sp; |
104 } | 104 } |
105 | 105 |
106 bool CallDescriptor::CanTailCall(const Node* node) const { | 106 bool CallDescriptor::CanTailCall(const Node* node) const { |
107 return HasSameReturnLocationsAs(CallDescriptorOf(node->op())); | 107 return HasSameReturnLocationsAs(CallDescriptorOf(node->op())); |
108 } | 108 } |
109 | 109 |
| 110 int CallDescriptor::CalculateFixedFrameSize() const { |
| 111 switch (kind_) { |
| 112 case kCallJSFunction: |
| 113 return PushArgumentCount() |
| 114 ? OptimizedBuiltinFrameConstants::kFixedSlotCount |
| 115 : StandardFrameConstants::kFixedSlotCount; |
| 116 break; |
| 117 case kCallAddress: |
| 118 return CommonFrameConstants::kFixedSlotCountAboveFp + |
| 119 CommonFrameConstants::kCPSlotCount; |
| 120 break; |
| 121 case kCallCodeObject: |
| 122 return TypedFrameConstants::kFixedSlotCount; |
| 123 } |
| 124 UNREACHABLE(); |
| 125 return 0; |
| 126 } |
110 | 127 |
111 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { | 128 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
112 DCHECK(!info->IsStub()); | 129 DCHECK(!info->IsStub()); |
113 if (!info->closure().is_null()) { | 130 if (!info->closure().is_null()) { |
114 // If we are compiling a JS function, use a JS call descriptor, | 131 // If we are compiling a JS function, use a JS call descriptor, |
115 // plus the receiver. | 132 // plus the receiver. |
116 SharedFunctionInfo* shared = info->closure()->shared(); | 133 SharedFunctionInfo* shared = info->closure()->shared(); |
117 return GetJSCallDescriptor(zone, info->is_osr(), | 134 return GetJSCallDescriptor(zone, info->is_osr(), |
118 1 + shared->internal_formal_parameter_count(), | 135 1 + shared->internal_formal_parameter_count(), |
119 CallDescriptor::kNoFlags); | 136 CallDescriptor::kNoFlags); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 DCHECK(loc == regloc(kContextRegister, MachineType::AnyTagged())); | 507 DCHECK(loc == regloc(kContextRegister, MachineType::AnyTagged())); |
491 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot, | 508 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot, |
492 MachineType::AnyTagged()); | 509 MachineType::AnyTagged()); |
493 } | 510 } |
494 } | 511 } |
495 | 512 |
496 | 513 |
497 } // namespace compiler | 514 } // namespace compiler |
498 } // namespace internal | 515 } // namespace internal |
499 } // namespace v8 | 516 } // namespace v8 |
OLD | NEW |