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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/frame.h" | 8 #include "src/compiler/frame.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 incoming_->IsJSFunctionCall() || | 198 incoming_->IsJSFunctionCall() || |
199 incoming_->kind() == CallDescriptor::kCallAddress; | 199 incoming_->kind() == CallDescriptor::kCallAddress; |
200 const int offset = | 200 const int offset = |
201 (StandardFrameConstants::kFixedSlotCountAboveFp - spill_slot - 1) * | 201 (StandardFrameConstants::kFixedSlotCountAboveFp - spill_slot - 1) * |
202 kPointerSize; | 202 kPointerSize; |
203 if (has_frame) { | 203 if (has_frame) { |
204 return FrameOffset::FromFramePointer(offset); | 204 return FrameOffset::FromFramePointer(offset); |
205 } else { | 205 } else { |
206 // No frame. Retrieve all parameters relative to stack pointer. | 206 // No frame. Retrieve all parameters relative to stack pointer. |
207 DCHECK(spill_slot < 0); // Must be a parameter. | 207 DCHECK(spill_slot < 0); // Must be a parameter. |
208 int offsetSpToFp = | 208 int sp_offset = offset + (frame->GetSpToFpSlotCount() * kPointerSize); |
209 kPointerSize * (StandardFrameConstants::kFixedSlotCountAboveFp - | 209 return FrameOffset::FromStackPointer(sp_offset); |
210 frame->GetTotalFrameSlotCount()); | |
211 return FrameOffset::FromStackPointer(offset - offsetSpToFp); | |
212 } | 210 } |
213 } | 211 } |
214 | 212 |
215 | 213 |
216 // static | 214 // static |
217 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { | 215 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { |
218 // Most runtime functions need a FrameState. A few chosen ones that we know | 216 // Most runtime functions need a FrameState. A few chosen ones that we know |
219 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize | 217 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize |
220 // are blacklisted here and can be called without a FrameState. | 218 // are blacklisted here and can be called without a FrameState. |
221 switch (function) { | 219 switch (function) { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 559 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
562 } else { | 560 } else { |
563 // Parameter. Use the assigned location from the incoming call descriptor. | 561 // Parameter. Use the assigned location from the incoming call descriptor. |
564 int parameter_index = 1 + index; // skip index 0, which is the target. | 562 int parameter_index = 1 + index; // skip index 0, which is the target. |
565 return incoming_->GetInputLocation(parameter_index); | 563 return incoming_->GetInputLocation(parameter_index); |
566 } | 564 } |
567 } | 565 } |
568 } // namespace compiler | 566 } // namespace compiler |
569 } // namespace internal | 567 } // namespace internal |
570 } // namespace v8 | 568 } // namespace v8 |
OLD | NEW |