Chromium Code Reviews| Index: runtime/vm/object.h |
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
| index ba8b6255848ac66218019d4fbcd804be02cde665..96da2e4aafae2a9d877a622e19762d1e3aca1c5c 100644 |
| --- a/runtime/vm/object.h |
| +++ b/runtime/vm/object.h |
| @@ -1665,6 +1665,10 @@ class Function : public Object { |
| return KindBits::decode(raw_ptr()->kind_tag_); |
| } |
| + RawFunction::AsyncModifier modifier() const { |
| + return ModifierBits::decode(raw_ptr()->kind_tag_); |
| + } |
| + |
| static const char* KindToCString(RawFunction::Kind kind); |
| bool is_static() const { return StaticBit::decode(raw_ptr()->kind_tag_); } |
| @@ -1811,6 +1815,11 @@ class Function : public Object { |
| void SetIsOptimizable(bool value) const; |
| void SetIsNativeAutoSetupScope(bool value) const; |
| + bool is_async_closure() const { |
| + return AsyncClosureBit::decode(raw_ptr()->kind_tag_); |
| + } |
| + void set_is_async_closure(bool value) const; |
| + |
| bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); } |
| void set_is_native(bool value) const; |
| @@ -1961,6 +1970,10 @@ class Function : public Object { |
| return kind() == RawFunction::kSignatureFunction; |
| } |
| + bool IsAsyncFunction() const { |
| + return modifier() == RawFunction::kAsync; |
| + } |
| + |
| static intptr_t InstanceSize() { |
| return RoundedAllocationSize(sizeof(RawFunction)); |
| } |
| @@ -2015,6 +2028,8 @@ class Function : public Object { |
| static const int kCtorPhaseBody = 1 << 1; |
| static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); |
| + void set_modifier(RawFunction::AsyncModifier value) const; |
| + |
| private: |
| void set_ic_data_array(const Array& value) const; |
| @@ -2033,6 +2048,8 @@ class Function : public Object { |
| kRedirectingBit = 13, |
| kExternalBit = 14, |
| kAllowsHoistingCheckClassBit = 15, |
| + kModifierPos = 16, |
| + kAsyncClosureBit = 18, |
| }; |
| class KindBits : |
| public BitField<RawFunction::Kind, kKindTagPos, kKindTagSize> {}; // NOLINT |
| @@ -2049,6 +2066,9 @@ class Function : public Object { |
| class RedirectingBit : public BitField<bool, kRedirectingBit, 1> {}; |
| class AllowsHoistingCheckClassBit : |
| public BitField<bool, kAllowsHoistingCheckClassBit, 1> {}; // NOLINT |
| + class ModifierBits : |
| + public BitField<RawFunction::AsyncModifier, kModifierPos, 2> {}; // NOLINT |
|
Ivan Posva
2014/07/29 23:56:14
There is still a mismatch between the number of bi
|
| + class AsyncClosureBit : public BitField<bool, kAsyncClosureBit, 1> {}; |
| void set_name(const String& value) const; |
| void set_kind(RawFunction::Kind value) const; |