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

Unified Diff: vm/raw_object.h

Issue 10917222: Move all the closure related fields in RawFunction into a new class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 | « vm/object.cc ('k') | vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « vm/object.cc ('k') | vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698