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

Unified Diff: runtime/vm/object.h

Issue 2891053003: Add support for converted closures with explicit contexts to VM (Closed)
Patch Set: Temporarily disable Run step in closures test suite Created 3 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/kernel_to_il.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 82a88e6cff619ccf8043077079e33bfbd779663f..90a70005d924b9fce8a3f209072ad3392a980267 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -497,6 +497,10 @@ class Object {
ASSERT(void_type_ != NULL);
return *void_type_;
}
+ static const Type& vector_type() {
+ ASSERT(vector_type_ != NULL);
+ return *vector_type_;
+ }
static void set_vm_isolate_snapshot_object_table(const Array& table);
@@ -761,6 +765,7 @@ class Object {
static RawClass* class_class_; // Class of the Class vm object.
static RawClass* dynamic_class_; // Class of the 'dynamic' type.
static RawClass* void_class_; // Class of the 'void' type.
+ static RawClass* vector_class_; // Class of the 'vector' type.
static RawClass* unresolved_class_class_; // Class of UnresolvedClass.
static RawClass* type_arguments_class_; // Class of TypeArguments vm object.
static RawClass* patch_class_class_; // Class of the PatchClass vm object.
@@ -827,6 +832,7 @@ class Object {
static Array* vm_isolate_snapshot_object_table_;
static Type* dynamic_type_;
static Type* void_type_;
+ static Type* vector_type_;
friend void ClassTable::Register(const Class& cls);
friend void RawObject::Validate(Isolate* isolate) const;
@@ -2399,11 +2405,25 @@ class Function : public Object {
return implicit_closure_function() != null();
}
- // Return the closure function implicitly created for this function.
- // If none exists yet, create one and remember it.
+ // Returns true iff a converted closure function has been created
+ // for this function.
+ bool HasConvertedClosureFunction() const {
+ return converted_closure_function() != null();
+ }
+
+ // Returns the closure function implicitly created for this function. If none
+ // exists yet, create one and remember it. Implicit closure functions are
+ // used in VM Closure instances that represent results of tear-off operations.
RawFunction* ImplicitClosureFunction() const;
void DropUncompiledImplicitClosureFunction() const;
+ // Returns the converted closure function created for this function.
+ // If none exists yet, create one and remember it. See the comment on
+ // ConvertedClosureFunction definition in runtime/vm/object.cc for elaborate
+ // explanation.
+ RawFunction* ConvertedClosureFunction() const;
+ void DropUncompiledConvertedClosureFunction() const;
+
// Return the closure implicitly created for this function.
// If none exists yet, create one and remember it.
RawInstance* ImplicitStaticClosure() const;
@@ -2764,6 +2784,11 @@ class Function : public Object {
// Returns true if this function represents an implicit closure function.
bool IsImplicitClosureFunction() const;
+ // Returns true if this function represents a converted closure function.
+ bool IsConvertedClosureFunction() const {
+ return kind() == RawFunction::kConvertedClosureFunction;
+ }
+
// Returns true if this function represents a non implicit closure function.
bool IsNonImplicitClosureFunction() const {
return IsClosureFunction() && !IsImplicitClosureFunction();
@@ -2856,6 +2881,11 @@ class Function : public Object {
const Function& parent,
TokenPosition token_pos);
+ // Allocates a new Function object representing a converted closure function.
+ static RawFunction* NewConvertedClosureFunction(const String& name,
+ const Function& parent,
+ TokenPosition token_pos);
+
// Allocates a new Function object representing a signature function.
// The owner is the scope class of the function type.
// The parent is the enclosing function or null if none.
@@ -3019,6 +3049,8 @@ class Function : public Object {
void set_owner(const Object& value) const;
RawFunction* implicit_closure_function() const;
void set_implicit_closure_function(const Function& value) const;
+ RawFunction* converted_closure_function() const;
+ void set_converted_closure_function(const Function& value) const;
RawInstance* implicit_static_closure() const;
void set_implicit_static_closure(const Instance& closure) const;
RawScript* eval_script() const;
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698