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

Unified Diff: runtime/vm/object.h

Issue 1323813004: Changes to prepare for allowing script snapshots to be taken after running the main application (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-long-line Created 5 years, 4 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 | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/raw_object_snapshot.cc » ('J')
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 fef9c4c3443c63432b1361e031516fd91b3acf86..555079b258fbff6b532171edf5440544e744678d 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -401,6 +401,11 @@ class Object {
return *zero_array_;
}
+ static const ContextScope& empty_context_scope() {
+ ASSERT(empty_context_scope_ != NULL);
+ return *empty_context_scope_;
+ }
+
static const ObjectPool& empty_object_pool() {
ASSERT(empty_object_pool_ != NULL);
return *empty_object_pool_;
@@ -791,6 +796,7 @@ class Object {
static TypeArguments* null_type_arguments_;
static Array* empty_array_;
static Array* zero_array_;
+ static ContextScope* empty_context_scope_;
static ObjectPool* empty_object_pool_;
static PcDescriptors* empty_descriptors_;
static LocalVarDescriptors* empty_var_descriptors_;
@@ -4463,7 +4469,8 @@ class Context : public Object {
// by its token position in the source, its name, its type, its allocation index
// in the context, and its context level. The function nesting level and loop
// nesting level are not preserved, since they are only used until the context
-// level is assigned.
+// level is assigned. In addition the ContextScope has a field 'is_implicit'
+// which is true if the ContextScope was created for an implicit closure.
class ContextScope : public Object {
public:
intptr_t num_variables() const { return raw_ptr()->num_variables_; }
@@ -4508,13 +4515,17 @@ class ContextScope : public Object {
sizeof(RawContextScope) + (len * kBytesPerElement));
}
- static RawContextScope* New(intptr_t num_variables);
+ static RawContextScope* New(intptr_t num_variables, bool is_implicit);
private:
void set_num_variables(intptr_t num_variables) const {
StoreNonPointer(&raw_ptr()->num_variables_, num_variables);
}
+ void set_is_implicit(bool is_implicit) const {
+ StoreNonPointer(&raw_ptr()->is_implicit_, is_implicit);
+ }
+
const RawContextScope::VariableDesc* VariableDescAddr(intptr_t index) const {
ASSERT((index >= 0) && (index < num_variables()));
return raw_ptr()->VariableDescAddr(index);
@@ -4522,6 +4533,7 @@ class ContextScope : public Object {
FINAL_HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object);
friend class Class;
+ friend class Object;
};
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/raw_object_snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698