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

Unified Diff: runtime/vm/object.h

Issue 423213005: Reland transformation of async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698