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

Unified Diff: runtime/vm/object.cc

Issue 142233002: Make sure all new Code objects have a non-null PcDescriptors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 711140949112522c953cb854200bf5160b61f488..d86967b3ad6f762948ef46325a3e3a71ec0f77c1 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -89,6 +89,7 @@ String* Object::null_string_ = NULL;
Instance* Object::null_instance_ = NULL;
AbstractTypeArguments* Object::null_abstract_type_arguments_ = NULL;
Array* Object::empty_array_ = NULL;
+PcDescriptors* Object::empty_descriptors_ = NULL;
Instance* Object::sentinel_ = NULL;
Instance* Object::transition_sentinel_ = NULL;
Instance* Object::unknown_constant_ = NULL;
@@ -435,6 +436,7 @@ void Object::InitOnce() {
null_instance_ = Instance::ReadOnlyHandle();
null_abstract_type_arguments_ = AbstractTypeArguments::ReadOnlyHandle();
empty_array_ = Array::ReadOnlyHandle();
+ empty_descriptors_ = PcDescriptors::ReadOnlyHandle();
sentinel_ = Instance::ReadOnlyHandle();
transition_sentinel_ = Instance::ReadOnlyHandle();
unknown_constant_ = Instance::ReadOnlyHandle();
@@ -642,9 +644,21 @@ void Object::InitOnce() {
Array::initializeHandle(
empty_array_,
reinterpret_cast<RawArray*>(address + kHeapObjectTag));
- empty_array_->raw()->ptr()->length_ = Smi::New(0);
+ empty_array_->raw_ptr()->length_ = Smi::New(0);
}
+ // Allocate and initialize the empty_descriptors instance.
+ {
+ uword address = heap->Allocate(PcDescriptors::InstanceSize(0), Heap::kOld);
+ InitializeObject(address, kPcDescriptorsCid,
+ PcDescriptors::InstanceSize(0));
+ PcDescriptors::initializeHandle(
+ empty_descriptors_,
+ reinterpret_cast<RawPcDescriptors*>(address + kHeapObjectTag));
+ empty_descriptors_->raw_ptr()->length_ = Smi::New(0);
+ }
+
+
cls = Class::New<Instance>(kDynamicCid);
cls.set_is_abstract();
cls.set_num_type_arguments(0);
@@ -9882,6 +9896,7 @@ RawCode* Code::New(intptr_t pointer_offsets_length) {
result.set_is_optimized(false);
result.set_is_alive(true);
result.set_comments(Comments::New(0));
+ result.set_pc_descriptors(Object::empty_descriptors());
}
return result.raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698