Chromium Code Reviews| Index: src/compiler/linkage.h |
| diff --git a/src/compiler/linkage.h b/src/compiler/linkage.h |
| index 5e887b7d8efb0fe6934fb8ed0b87fa89b342fa02..5aaf69960eb778513954542edaea4788d16f5a39 100644 |
| --- a/src/compiler/linkage.h |
| +++ b/src/compiler/linkage.h |
| @@ -5,8 +5,7 @@ |
| #ifndef V8_COMPILER_LINKAGE_H_ |
| #define V8_COMPILER_LINKAGE_H_ |
| -#include "src/v8.h" |
| - |
| +#include "src/base/flags.h" |
| #include "src/code-stubs.h" |
| #include "src/compiler/frame.h" |
| #include "src/compiler/machine-operator.h" |
| @@ -37,24 +36,26 @@ class LinkageLocation { |
| }; |
| -class CallDescriptor : public ZoneObject { |
| +class CallDescriptor V8_FINAL : public ZoneObject { |
| public: |
| // Describes whether the first parameter is a code object, a JSFunction, |
| // or an address--all of which require different machine sequences to call. |
| enum Kind { kCallCodeObject, kCallJSFunction, kCallAddress }; |
| - // TODO(jarin) kLazyDeoptimization and kNeedsFrameState should be unified. |
|
Michael Starzinger
2014/08/27 12:50:11
nit: I think the TODO for Jaro still applies, bett
Benedikt Meurer
2014/08/28 11:46:57
Ups, didn't mean to remove that.
|
| - enum DeoptimizationSupport { |
| - kNoDeoptimization = 0, |
| - kLazyDeoptimization = 1, |
| - kNeedsFrameState = 2 |
| + enum Flag { |
| + kNoFlags = 0u, |
| + kLazyDeoptimization = 1u << 0, |
| + kNeedsFrameState = 1u << 1, |
| + kPatchableCallSite = 1u << 2, |
| + kNeedsNopAfterCall = 1u << 3, |
| + kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall |
| }; |
| + DEFINE_FLAGS(Flags, Flag); |
| CallDescriptor(Kind kind, int8_t return_count, int16_t parameter_count, |
| int16_t input_count, LinkageLocation* locations, |
| Operator::Property properties, RegList callee_saved_registers, |
| - DeoptimizationSupport deoptimization_support, |
| - const char* debug_name = "") |
| + Flags flags, const char* debug_name = "") |
| : kind_(kind), |
| return_count_(return_count), |
| parameter_count_(parameter_count), |
| @@ -62,7 +63,7 @@ class CallDescriptor : public ZoneObject { |
| locations_(locations), |
| properties_(properties), |
| callee_saved_registers_(callee_saved_registers), |
| - deoptimization_support_(deoptimization_support), |
| + flags_(flags), |
| debug_name_(debug_name) {} |
| // Returns the kind of this call. |
| Kind kind() const { return kind_; } |
| @@ -81,17 +82,10 @@ class CallDescriptor : public ZoneObject { |
| int FrameStateCount() const { return NeedsFrameState() ? 1 : 0; } |
| - bool CanLazilyDeoptimize() const { |
| - return (deoptimization_support() & kLazyDeoptimization) != 0; |
| - } |
| + Flags flags() const { return flags_; } |
| - bool NeedsFrameState() const { |
| - return (deoptimization_support() & kNeedsFrameState) != 0; |
| - } |
| - |
| - DeoptimizationSupport deoptimization_support() const { |
| - return deoptimization_support_; |
| - } |
| + bool CanLazilyDeoptimize() const { return flags() & kLazyDeoptimization; } |
| + bool NeedsFrameState() const { return flags() & kNeedsFrameState; } |
| LinkageLocation GetReturnLocation(int index) { |
| DCHECK(index < return_count_); |
| @@ -121,10 +115,12 @@ class CallDescriptor : public ZoneObject { |
| LinkageLocation* locations_; |
| Operator::Property properties_; |
| RegList callee_saved_registers_; |
| - DeoptimizationSupport deoptimization_support_; |
| + Flags flags_; |
| const char* debug_name_; |
| }; |
| +DEFINE_OPERATORS_FOR_FLAGS(CallDescriptor::Flags) |
| + |
| OStream& operator<<(OStream& os, const CallDescriptor& d); |
| OStream& operator<<(OStream& os, const CallDescriptor::Kind& k); |
| @@ -155,20 +151,19 @@ class Linkage : public ZoneObject { |
| CallDescriptor* GetRuntimeCallDescriptor( |
| Runtime::FunctionId function, int parameter_count, |
| Operator::Property properties, |
| - CallDescriptor::DeoptimizationSupport can_deoptimize = |
| - CallDescriptor::kNoDeoptimization); |
| - static CallDescriptor* GetRuntimeCallDescriptor( |
| - Runtime::FunctionId function, int parameter_count, |
| - Operator::Property properties, |
| - CallDescriptor::DeoptimizationSupport can_deoptimize, Zone* zone); |
| + CallDescriptor::Flags flags = CallDescriptor::kNoFlags); |
| + static CallDescriptor* GetRuntimeCallDescriptor(Runtime::FunctionId function, |
| + int parameter_count, |
| + Operator::Property properties, |
| + CallDescriptor::Flags flags, |
| + Zone* zone); |
| CallDescriptor* GetStubCallDescriptor( |
| CodeStubInterfaceDescriptor* descriptor, int stack_parameter_count = 0, |
| - CallDescriptor::DeoptimizationSupport can_deoptimize = |
| - CallDescriptor::kNoDeoptimization); |
| + CallDescriptor::Flags flags = CallDescriptor::kNoFlags); |
| static CallDescriptor* GetStubCallDescriptor( |
| CodeStubInterfaceDescriptor* descriptor, int stack_parameter_count, |
| - CallDescriptor::DeoptimizationSupport can_deoptimize, Zone* zone); |
| + CallDescriptor::Flags flags, Zone* zone); |
| // Creates a call descriptor for simplified C calls that is appropriate |
| // for the host platform. This simplified calling convention only supports |
| @@ -201,8 +196,9 @@ class Linkage : public ZoneObject { |
| CompilationInfo* info_; |
| CallDescriptor* incoming_; |
| }; |
| -} |
| -} |
| -} // namespace v8::internal::compiler |
| + |
| +} // namespace compiler |
| +} // namespace internal |
| +} // namespace v8 |
| #endif // V8_COMPILER_LINKAGE_H_ |