Index: vm/raw_object.h |
=================================================================== |
--- vm/raw_object.h (revision 12230) |
+++ vm/raw_object.h (working copy) |
@@ -24,6 +24,7 @@ |
V(InstantiatedTypeArguments) \ |
V(PatchClass) \ |
V(Function) \ |
+ V(ClosureData) \ |
V(Field) \ |
V(LiteralToken) \ |
V(TokenStream) \ |
@@ -601,13 +602,9 @@ |
RawArray* parameter_names_; |
RawCode* code_; // Compiled code for the function. |
RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. |
- RawContextScope* context_scope_; |
- RawFunction* parent_function_; // Enclosing function of this local function. |
- RawClass* signature_class_; // Only for closure or signature function. |
- RawCode* closure_allocation_stub_; // Stub code for allocation of closures. |
- RawFunction* implicit_closure_function_; // Implicit closure function. |
+ RawObject* data_; // Additional data specific to the function kind. |
RawObject** to() { |
- return reinterpret_cast<RawObject**>(&ptr()->implicit_closure_function_); |
+ return reinterpret_cast<RawObject**>(&ptr()->data_); |
} |
intptr_t token_pos_; |
@@ -621,6 +618,23 @@ |
}; |
+class RawClosureData : public RawObject { |
+ private: |
+ RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); |
+ |
+ RawObject** from() { |
+ return reinterpret_cast<RawObject**>(&ptr()->context_scope_); |
+ } |
+ RawContextScope* context_scope_; |
+ RawFunction* parent_function_; // Enclosing function of this local function. |
+ RawClass* signature_class_; |
+ RawCode* closure_allocation_stub_; // Stub code for allocation of closures. |
+ RawObject** to() { |
+ return reinterpret_cast<RawObject**>(&ptr()->closure_allocation_stub_); |
+ } |
+}; |
+ |
+ |
class RawField : public RawObject { |
RAW_HEAP_OBJECT_IMPLEMENTATION(Field); |