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

Unified Diff: runtime/vm/object.cc

Issue 10695136: Use class id instead of class in subtype test cache. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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') | runtime/vm/object_test.cc » ('j') | 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 9557)
+++ runtime/vm/object.cc (working copy)
@@ -7220,7 +7220,7 @@
void SubtypeTestCache::AddCheck(
- const Class& instance_class,
+ intptr_t instance_class_id,
const AbstractTypeArguments& instance_type_arguments,
const AbstractTypeArguments& instantiator_type_arguments,
const Bool& test_result) const {
@@ -7230,7 +7230,8 @@
data = Array::Grow(data, new_len);
set_cache(data);
intptr_t data_pos = old_num * kTestEntryLength;
- data.SetAt(data_pos + kInstanceClass, instance_class);
+ data.SetAt(data_pos + kInstanceClassId,
+ Smi::Handle(Smi::New(instance_class_id)));
data.SetAt(data_pos + kInstanceTypeArguments, instance_type_arguments);
data.SetAt(data_pos + kInstantiatorTypeArguments,
instantiator_type_arguments);
@@ -7240,13 +7241,15 @@
void SubtypeTestCache::GetCheck(
intptr_t ix,
- Class* instance_class,
+ intptr_t* instance_class_id,
AbstractTypeArguments* instance_type_arguments,
AbstractTypeArguments* instantiator_type_arguments,
Bool* test_result) const {
Array& data = Array::Handle(cache());
intptr_t data_pos = ix * kTestEntryLength;
- *instance_class ^= data.At(data_pos + kInstanceClass);
+ Smi& instance_class_id_handle = Smi::Handle();
+ instance_class_id_handle ^= data.At(data_pos + kInstanceClassId);
+ *instance_class_id = instance_class_id_handle.Value();
*instance_type_arguments ^= data.At(data_pos + kInstanceTypeArguments);
*instantiator_type_arguments ^=
data.At(data_pos + kInstantiatorTypeArguments);
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698