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

Unified Diff: runtime/vm/object.cc

Issue 2279563002: AOT: Single target stub. (Closed)
Patch Set: add offset assertions Created 4 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 | « runtime/vm/object.h ('k') | runtime/vm/object_service.cc » ('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 3ad9de1e8beb6c646a19597c1de7316e0e7cf5af..fcd9c15333de76bf06a2fd5362630e76702756b7 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -151,6 +151,8 @@ RawClass* Object::exception_handlers_class_ =
reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::context_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::context_scope_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
+RawClass* Object::singletargetcache_class_ =
+ reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::icdata_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::megamorphic_cache_class_ =
reinterpret_cast<RawClass*>(RAW_NULL);
@@ -651,6 +653,9 @@ void Object::InitOnce(Isolate* isolate) {
cls = Class::New<ContextScope>();
context_scope_class_ = cls.raw();
+ cls = Class::New<SingleTargetCache>();
+ singletargetcache_class_ = cls.raw();
+
cls = Class::New<ICData>();
icdata_class_ = cls.raw();
@@ -992,6 +997,7 @@ void Object::FinalizeVMIsolate(Isolate* isolate) {
SET_CLASS_NAME(exception_handlers, ExceptionHandlers);
SET_CLASS_NAME(context, Context);
SET_CLASS_NAME(context_scope, ContextScope);
+ SET_CLASS_NAME(singletargetcache, SingleTargetCache);
SET_CLASS_NAME(icdata, ICData);
SET_CLASS_NAME(megamorphic_cache, MegamorphicCache);
SET_CLASS_NAME(subtypetestcache, SubtypeTestCache);
@@ -3427,6 +3433,8 @@ NOT_IN_PRODUCT(
return Symbols::Context().raw();
case kContextScopeCid:
return Symbols::ContextScope().raw();
+ case kSingleTargetCacheCid:
+ return Symbols::SingleTargetCache().raw();
case kICDataCid:
return Symbols::ICData().raw();
case kMegamorphicCacheCid:
@@ -12491,6 +12499,34 @@ bool DeoptInfo::VerifyDecompression(const GrowableArray<DeoptInstr*>& original,
}
+void SingleTargetCache::set_target(const Code& value) const {
+ StorePointer(&raw_ptr()->target_, value.raw());
+}
+
+
+const char* SingleTargetCache::ToCString() const {
+ return "SingleTargetCache";
+}
+
+
+RawSingleTargetCache* SingleTargetCache::New() {
+ SingleTargetCache& result = SingleTargetCache::Handle();
+ {
+ // IC data objects are long living objects, allocate them in old generation.
+ RawObject* raw = Object::Allocate(SingleTargetCache::kClassId,
+ SingleTargetCache::InstanceSize(),
+ Heap::kOld);
+ NoSafepointScope no_safepoint;
+ result ^= raw;
+ }
+ result.set_target(Code::Handle());
+ result.set_entry_point(0);
+ result.set_lower_limit(kIllegalCid);
+ result.set_upper_limit(kIllegalCid);
+ return result.raw();
+}
+
+
void ICData::ResetSwitchable(Zone* zone) const {
ASSERT(NumArgsTested() == 1);
set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1)));
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698