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

Unified Diff: runtime/vm/object.h

Issue 10352012: Using SubtypeTestCache object instead of an array, that way we do not need to patch and can communi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 7302)
+++ runtime/vm/object.h (working copy)
@@ -167,6 +167,7 @@
kContextClass,
kContextScopeClass,
kICDataClass,
+ kSubtypeTestCacheClass,
kApiErrorClass,
kLanguageErrorClass,
kUnhandledExceptionClass,
@@ -316,6 +317,7 @@
}
static RawClass* unwind_error_class() { return unwind_error_class_; }
static RawClass* icdata_class() { return icdata_class_; }
+ static RawClass* subtypetestcache_class() { return subtypetestcache_class_; }
static int GetSingletonClassIndex(const RawClass* raw_class);
static RawClass* GetSingletonClass(int index);
@@ -417,6 +419,7 @@
static RawClass* context_class_; // Class of the Context vm object.
static RawClass* context_scope_class_; // Class of ContextScope vm object.
static RawClass* icdata_class_; // Class of ICData.
+ static RawClass* subtypetestcache_class_; // Class of SubtypeTestCache.
static RawClass* api_error_class_; // Class of ApiError.
static RawClass* language_error_class_; // Class of LanguageError.
static RawClass* unhandled_exception_class_; // Class of UnhandledException.
@@ -2004,7 +2007,6 @@
kIcCall, // IC call.
kFuncCall, // Call to known target, e.g. static call, closure call.
kReturn, // Return from function.
- kTypeTest, // Array caching previous type tests.
kOther
};
@@ -2505,6 +2507,51 @@
};
+class SubtypeTestCache : public Object {
+ public:
+ enum Entries {
+ kInstanceClass = 0,
+ kInstanceTypeArguments = 1,
+ kInstantiatorTypeArguments = 2,
+ kTestResult = 3,
+ kTestEntryLength = 4,
+ };
+
+ intptr_t NumberOfChecks() const;
+ void AddCheck(const Class& instance_class,
+ const AbstractTypeArguments& instance_type_arguments,
+ const AbstractTypeArguments& instantiator_type_arguments,
+ const Bool& test_result) const;
+ void GetCheck(intptr_t ix,
+ Class* instance_class,
+ AbstractTypeArguments* instance_type_arguments,
+ AbstractTypeArguments* instantiator_type_arguments,
+ Bool* test_result) const;
+
+ static RawSubtypeTestCache* New();
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawSubtypeTestCache));
+ }
+
+ static intptr_t cache_offset() {
+ return OFFSET_OF(RawSubtypeTestCache, cache_);
+ }
+
+ private:
+ RawArray* cache() const {
+ return raw_ptr()->cache_;
+ }
+
+ void set_cache(const Array& value) const;
+
+ intptr_t TestEntryLength() const;
+
+ HEAP_OBJECT_IMPLEMENTATION(SubtypeTestCache, Object);
+ friend class Class;
+};
+
+
class Error : public Object {
public:
virtual const char* ToErrorCString() const;
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698