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

Unified Diff: runtime/vm/object.h

Issue 1857273002: Fix detection if a function was compiled, (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments Created 4 years, 8 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/flow_graph_inliner.cc ('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 91d8e0e46e58301bba742c04fee3be487ea5a5ce..9a946b0d9820a6beec129ccfa99af81e8cdad7ed 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -2433,10 +2433,11 @@ class Function : public Object {
StoreNonPointer(&raw_ptr()->usage_counter_, value);
}
- int16_t deoptimization_counter() const {
+ int8_t deoptimization_counter() const {
return raw_ptr()->deoptimization_counter_;
}
- void set_deoptimization_counter(int16_t value) const {
+ void set_deoptimization_counter(int8_t value) const {
+ ASSERT(value >= 0);
StoreNonPointer(&raw_ptr()->deoptimization_counter_, value);
}
@@ -2718,6 +2719,15 @@ class Function : public Object {
void set_modifier(RawFunction::AsyncModifier value) const;
+ // 'was_compiled' is true if the function was compiled once in this
+ // VM instantiation. It independent from presence of type feedback
+ // (ic_data_array) and code, whihc may be loaded from a snapshot.
+ void set_was_compiled(bool value) const {
+ StoreNonPointer(&raw_ptr()->was_compiled_, value ? 1 : 0);
+ }
+ bool was_compiled() const { return raw_ptr()->was_compiled_ == 1; }
+
+
// static: Considered during class-side or top-level resolution rather than
// instance-side resolution.
// const: Valid target of a const constructor call.
@@ -2824,7 +2834,7 @@ FOR_EACH_FUNCTION_KIND_BIT(DEFINE_BIT)
RawScript* eval_script() const;
void set_eval_script(const Script& value) const;
void set_num_optional_parameters(intptr_t value) const; // Encoded value.
- void set_kind_tag(intptr_t value) const;
+ void set_kind_tag(uint32_t value) const;
void set_data(const Object& value) const;
static RawFunction* New();
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698