Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: src/compiler/linkage.h

Issue 1460183002: [turbofan] Add general support for sp-based frame access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address reviewer feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_COMPILER_LINKAGE_H_ 5 #ifndef V8_COMPILER_LINKAGE_H_
6 #define V8_COMPILER_LINKAGE_H_ 6 #define V8_COMPILER_LINKAGE_H_
7 7
8 #include "src/base/flags.h" 8 #include "src/base/flags.h"
9 #include "src/compiler/frame.h" 9 #include "src/compiler/frame.h"
10 #include "src/compiler/machine-type.h" 10 #include "src/compiler/machine-type.h"
11 #include "src/compiler/operator.h" 11 #include "src/compiler/operator.h"
12 #include "src/frames.h" 12 #include "src/frames.h"
13 #include "src/runtime/runtime.h" 13 #include "src/runtime/runtime.h"
14 #include "src/zone.h" 14 #include "src/zone.h"
15 15
16 namespace v8 { 16 namespace v8 {
17 namespace internal { 17 namespace internal {
18 18
19 class CallInterfaceDescriptor; 19 class CallInterfaceDescriptor;
20 class CompilationInfo; 20 class CompilationInfo;
21 21
22 namespace compiler { 22 namespace compiler {
23 23
24 const RegList kNoCalleeSaved = 0; 24 const RegList kNoCalleeSaved = 0;
25 25
26 class FrameAccessState;
titzer 2015/11/24 17:45:56 I think you can drop this forward declaration now.
26 class Node; 27 class Node;
27 class OsrHelper; 28 class OsrHelper;
28 29
29 // Describes the location for a parameter or a return value to a call. 30 // Describes the location for a parameter or a return value to a call.
30 class LinkageLocation { 31 class LinkageLocation {
31 public: 32 public:
32 bool operator==(const LinkageLocation& other) const { 33 bool operator==(const LinkageLocation& other) const {
33 return bit_field_ == other.bit_field_; 34 return bit_field_ == other.bit_field_;
34 } 35 }
35 36
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 182
182 // Returns the kind of this call. 183 // Returns the kind of this call.
183 Kind kind() const { return kind_; } 184 Kind kind() const { return kind_; }
184 185
185 // Returns {true} if this descriptor is a call to a C function. 186 // Returns {true} if this descriptor is a call to a C function.
186 bool IsCFunctionCall() const { return kind_ == kCallAddress; } 187 bool IsCFunctionCall() const { return kind_ == kCallAddress; }
187 188
188 // Returns {true} if this descriptor is a call to a JSFunction. 189 // Returns {true} if this descriptor is a call to a JSFunction.
189 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; } 190 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; }
190 191
192 bool RequiresFrameAsIncoming() const {
193 return IsCFunctionCall() || IsJSFunctionCall();
194 }
195
191 // The number of return values from this call. 196 // The number of return values from this call.
192 size_t ReturnCount() const { return machine_sig_->return_count(); } 197 size_t ReturnCount() const { return machine_sig_->return_count(); }
193 198
194 // The number of C parameters to this call. 199 // The number of C parameters to this call.
195 size_t CParameterCount() const { return machine_sig_->parameter_count(); } 200 size_t CParameterCount() const { return machine_sig_->parameter_count(); }
196 201
197 // The number of stack parameters to the call. 202 // The number of stack parameters to the call.
198 size_t StackParameterCount() const { return stack_param_count_; } 203 size_t StackParameterCount() const { return stack_param_count_; }
199 204
200 // The number of parameters to the JS function call. 205 // The number of parameters to the JS function call.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 346 }
342 347
343 // Get the machine type of this function's return value. 348 // Get the machine type of this function's return value.
344 MachineType GetReturnType(size_t index = 0) const { 349 MachineType GetReturnType(size_t index = 0) const {
345 return incoming_->GetReturnType(index); 350 return incoming_->GetReturnType(index);
346 } 351 }
347 352
348 bool ParameterHasSecondaryLocation(int index) const; 353 bool ParameterHasSecondaryLocation(int index) const;
349 LinkageLocation GetParameterSecondaryLocation(int index) const; 354 LinkageLocation GetParameterSecondaryLocation(int index) const;
350 355
351 // Get the frame offset for a given spill slot. The location depends on the
352 // calling convention and the specific frame layout, and may thus be
353 // architecture-specific. Negative spill slots indicate arguments on the
354 // caller's frame.
355 FrameOffset GetFrameOffset(int spill_slot, Frame* frame) const;
356
357 static int FrameStateInputCount(Runtime::FunctionId function); 356 static int FrameStateInputCount(Runtime::FunctionId function);
358 357
359 // Get the location where an incoming OSR value is stored. 358 // Get the location where an incoming OSR value is stored.
360 LinkageLocation GetOsrValueLocation(int index) const; 359 LinkageLocation GetOsrValueLocation(int index) const;
361 360
362 // A special {Parameter} index for JSCalls that represents the new target. 361 // A special {Parameter} index for JSCalls that represents the new target.
363 static int GetJSCallNewTargetParamIndex(int parameter_count) { 362 static int GetJSCallNewTargetParamIndex(int parameter_count) {
364 return parameter_count + 0; // Parameter (arity + 0) is special. 363 return parameter_count + 0; // Parameter (arity + 0) is special.
365 } 364 }
366 365
(...skipping 26 matching lines...) Expand all
393 CallDescriptor* const incoming_; 392 CallDescriptor* const incoming_;
394 393
395 DISALLOW_COPY_AND_ASSIGN(Linkage); 394 DISALLOW_COPY_AND_ASSIGN(Linkage);
396 }; 395 };
397 396
398 } // namespace compiler 397 } // namespace compiler
399 } // namespace internal 398 } // namespace internal
400 } // namespace v8 399 } // namespace v8
401 400
402 #endif // V8_COMPILER_LINKAGE_H_ 401 #endif // V8_COMPILER_LINKAGE_H_
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698