Index: runtime/vm/object.h |
diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
index 05c4150934b90432d8605bae5e978706c03378aa..bca6244085e726f25570377ed9c6854064bb3f1c 100644 |
--- a/runtime/vm/object.h |
+++ b/runtime/vm/object.h |
@@ -1666,6 +1666,10 @@ class Function : public Object { |
return KindBits::decode(raw_ptr()->kind_tag_); |
} |
+ RawFunction::Modifier 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_); } |
@@ -1812,6 +1816,13 @@ class Function : public Object { |
void SetIsOptimizable(bool value) const; |
void SetIsNativeAutoSetupScope(bool value) const; |
+ bool is_synthetic_container() const { |
+ return SyntheticContainerBit::decode(raw_ptr()->kind_tag_); |
+ } |
+ void set_is_synthetic_container(bool value) const { |
+ set_kind_tag(SyntheticContainerBit::update(value, raw_ptr()->kind_tag_)); |
+ } |
+ |
bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); } |
void set_is_native(bool value) const; |
@@ -1962,6 +1973,11 @@ class Function : public Object { |
return kind() == RawFunction::kSignatureFunction; |
} |
+ |
+ bool IsAsyncFunction() const { |
+ return modifier() == RawFunction::kAsync; |
+ } |
+ |
static intptr_t InstanceSize() { |
return RoundedAllocationSize(sizeof(RawFunction)); |
} |
@@ -2012,6 +2028,9 @@ class Function : public Object { |
static const int kCtorPhaseBody = 1 << 1; |
static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); |
+ // TODO(mlippautz): This should be private in the end. |
+ void set_modifier(RawFunction::Modifier value) const; |
+ |
private: |
void set_ic_data_array(const Array& value) const; |
@@ -2030,6 +2049,8 @@ class Function : public Object { |
kRedirectingBit = 13, |
kExternalBit = 14, |
kAllowsHoistingCheckClassBit = 15, |
+ kModifierPos = 16, |
+ kSyntheticContainerBit = 18, |
}; |
class KindBits : |
public BitField<RawFunction::Kind, kKindTagPos, kKindTagSize> {}; // NOLINT |
@@ -2046,6 +2067,10 @@ class Function : public Object { |
class RedirectingBit : public BitField<bool, kRedirectingBit, 1> {}; |
class AllowsHoistingCheckClassBit : |
public BitField<bool, kAllowsHoistingCheckClassBit, 1> {}; // NOLINT |
+ class ModifierBits : |
+ public BitField<RawFunction::Modifier, kModifierPos, 2> {}; |
+ class SyntheticContainerBit : |
+ public BitField<bool, kSyntheticContainerBit, 1> {}; |
void set_name(const String& value) const; |
void set_kind(RawFunction::Kind value) const; |