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 #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/operator.h" | 10 #include "src/compiler/operator.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 typedef Signature<LinkageLocation> LocationSignature; | 139 typedef Signature<LinkageLocation> LocationSignature; |
140 | 140 |
141 // Describes a call to various parts of the compiler. Every call has the notion | 141 // Describes a call to various parts of the compiler. Every call has the notion |
142 // of a "target", which is the first input to the call. | 142 // of a "target", which is the first input to the call. |
143 class CallDescriptor final : public ZoneObject { | 143 class CallDescriptor final : public ZoneObject { |
144 public: | 144 public: |
145 // Describes the kind of this call, which determines the target. | 145 // Describes the kind of this call, which determines the target. |
146 enum Kind { | 146 enum Kind { |
147 kCallCodeObject, // target is a Code object | 147 kCallCodeObject, // target is a Code object |
148 kCallJSFunction, // target is a JSFunction object | 148 kCallJSFunction, // target is a JSFunction object |
149 kCallAddress, // target is a machine pointer | 149 kCallAddress // target is a machine pointer |
150 kLazyBailout // the call is no-op, only used for lazy bailout | |
151 }; | 150 }; |
152 | 151 |
153 enum Flag { | 152 enum Flag { |
154 kNoFlags = 0u, | 153 kNoFlags = 0u, |
155 kNeedsFrameState = 1u << 0, | 154 kNeedsFrameState = 1u << 0, |
156 kPatchableCallSite = 1u << 1, | 155 kPatchableCallSite = 1u << 1, |
157 kNeedsNopAfterCall = 1u << 2, | 156 kNeedsNopAfterCall = 1u << 2, |
158 kHasExceptionHandler = 1u << 3, | 157 kHasExceptionHandler = 1u << 3, |
159 kHasLocalCatchHandler = 1u << 4, | 158 kHasLocalCatchHandler = 1u << 4, |
160 kSupportsTailCalls = 1u << 5, | 159 kSupportsTailCalls = 1u << 5, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // of incoming parameters and the outgoing return value(s). | 317 // of incoming parameters and the outgoing return value(s). |
319 CallDescriptor* GetIncomingDescriptor() const { return incoming_; } | 318 CallDescriptor* GetIncomingDescriptor() const { return incoming_; } |
320 static CallDescriptor* GetJSCallDescriptor(Zone* zone, bool is_osr, | 319 static CallDescriptor* GetJSCallDescriptor(Zone* zone, bool is_osr, |
321 int parameter_count, | 320 int parameter_count, |
322 CallDescriptor::Flags flags); | 321 CallDescriptor::Flags flags); |
323 | 322 |
324 static CallDescriptor* GetRuntimeCallDescriptor( | 323 static CallDescriptor* GetRuntimeCallDescriptor( |
325 Zone* zone, Runtime::FunctionId function, int parameter_count, | 324 Zone* zone, Runtime::FunctionId function, int parameter_count, |
326 Operator::Properties properties, CallDescriptor::Flags flags); | 325 Operator::Properties properties, CallDescriptor::Flags flags); |
327 | 326 |
328 static CallDescriptor* GetLazyBailoutDescriptor(Zone* zone); | |
329 | |
330 static CallDescriptor* GetStubCallDescriptor( | 327 static CallDescriptor* GetStubCallDescriptor( |
331 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | 328 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
332 int stack_parameter_count, CallDescriptor::Flags flags, | 329 int stack_parameter_count, CallDescriptor::Flags flags, |
333 Operator::Properties properties = Operator::kNoProperties, | 330 Operator::Properties properties = Operator::kNoProperties, |
334 MachineType return_type = MachineType::AnyTagged(), | 331 MachineType return_type = MachineType::AnyTagged(), |
335 size_t return_count = 1); | 332 size_t return_count = 1); |
336 | 333 |
337 // Creates a call descriptor for simplified C calls that is appropriate | 334 // Creates a call descriptor for simplified C calls that is appropriate |
338 // for the host platform. This simplified calling convention only supports | 335 // for the host platform. This simplified calling convention only supports |
339 // integers and pointers of one word size each, i.e. no floating point, | 336 // integers and pointers of one word size each, i.e. no floating point, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 CallDescriptor* const incoming_; | 392 CallDescriptor* const incoming_; |
396 | 393 |
397 DISALLOW_COPY_AND_ASSIGN(Linkage); | 394 DISALLOW_COPY_AND_ASSIGN(Linkage); |
398 }; | 395 }; |
399 | 396 |
400 } // namespace compiler | 397 } // namespace compiler |
401 } // namespace internal | 398 } // namespace internal |
402 } // namespace v8 | 399 } // namespace v8 |
403 | 400 |
404 #endif // V8_COMPILER_LINKAGE_H_ | 401 #endif // V8_COMPILER_LINKAGE_H_ |
OLD | NEW |