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

Unified Diff: runtime/vm/object.cc

Issue 20755004: Make sure that ICData always contains valid data (non-null values). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 25521)
+++ runtime/vm/object.cc (working copy)
@@ -8864,16 +8864,19 @@
void ICData::set_function(const Function& value) const {
+ ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->function_, value.raw());
}
void ICData::set_target_name(const String& value) const {
+ ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->target_name_, value.raw());
}
void ICData::set_arguments_descriptor(const Array& value) const {
+ ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->args_descriptor_, value.raw());
}
@@ -8888,6 +8891,7 @@
void ICData::set_ic_data(const Array& value) const {
+ ASSERT(!value.IsNull());
StorePointer(&raw_ptr()->ic_data_, value.raw());
}
@@ -8918,6 +8922,7 @@
void ICData::WriteSentinel(const Array& data) const {
+ ASSERT(!data.IsNull());
for (intptr_t i = 1; i <= TestEntryLength(); i++) {
data.SetAt(data.Length() - i, smi_illegal_cid());
}
@@ -8950,6 +8955,7 @@
// Used for unoptimized static calls when no class-ids are checked.
void ICData::AddTarget(const Function& target) const {
+ ASSERT(!target.IsNull());
if (num_args_tested() > 0) {
// Create a fake cid entry, so that we can store the target.
GrowableArray<intptr_t> class_ids(num_args_tested());
@@ -8978,6 +8984,7 @@
void ICData::AddCheck(const GrowableArray<intptr_t>& class_ids,
const Function& target) const {
+ ASSERT(!target.IsNull());
DEBUG_ASSERT(!HasCheck(class_ids));
ASSERT(num_args_tested() > 1); // Otherwise use 'AddReceiverCheck'.
ASSERT(class_ids.length() == num_args_tested());
@@ -9033,6 +9040,7 @@
class_ids.Add(receiver_class_id);
ASSERT(!HasCheck(class_ids));
#endif // DEBUG
+ ASSERT(!target.IsNull());
ASSERT(num_args_tested() == 1); // Otherwise use 'AddCheck'.
ASSERT(receiver_class_id != kIllegalCid);
@@ -9269,6 +9277,8 @@
const Array& arguments_descriptor,
intptr_t deopt_id,
intptr_t num_args_tested) {
+ ASSERT(!function.IsNull());
+ ASSERT(!target_name.IsNull());
Cutch 2013/07/26 19:11:20 ASSERT(!arguments_descriptor.IsNull());
srdjan 2013/07/26 19:42:00 Done.
ASSERT(Object::icdata_class() != Class::null());
ASSERT(num_args_tested >= 0);
ICData& result = ICData::Handle();
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698