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

Unified Diff: runtime/vm/object.h

Issue 12529008: Collect type feedback for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 years, 9 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
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 2510404a9de0d8e11a38dc484b0630e2b28bad16..eba9703d28782443c61faae70ab1f4447f32e261 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -1775,6 +1775,39 @@ class Field : public Object {
raw_ptr()->kind_bits_));
}
+ intptr_t GuardedCid() const {
+ if (is_nullable() && guarded_cid() != kNullCid) {
+ return kDynamicCid;
+ }
+ return raw_ptr()->guarded_cid_;
+ }
+
+ intptr_t guarded_cid() const { return raw_ptr()->guarded_cid_; }
+ void set_guarded_cid(intptr_t cid) const {
+ raw_ptr()->guarded_cid_ = cid;
+ }
+ static intptr_t guarded_cid_offset() {
+ return OFFSET_OF(RawField, guarded_cid_);
+ }
+
+ bool is_nullable() const {
+ return raw_ptr()->is_nullable_ == kNullCid;
+ }
+ void set_is_nullable(bool val) const {
+ raw_ptr()->is_nullable_ = val ? kNullCid : kIllegalCid;
+ }
+ static intptr_t is_nullable_offset() {
+ return OFFSET_OF(RawField, is_nullable_);
+ }
+
+ RawArray* dependent_code() const;
+ void set_dependent_code(const Array& array) const;
+ void RegisterDependentCode(const Code& code) const;
+ void UnregisterDependentCode(const Code& code) const;
+ void DeoptimizeDependentCode() const;
+ void UpdateCid(intptr_t cid) const;
+
+
// Constructs getter and setter names for fields and vice versa.
static RawString* GetterName(const String& field_name);
static RawString* GetterSymbol(const String& field_name);
@@ -4650,6 +4683,9 @@ class Array : public Instance {
}
static intptr_t length_offset() { return OFFSET_OF(RawArray, length_); }
static intptr_t data_offset() { return length_offset() + kWordSize; }
+ static intptr_t element_offset(intptr_t index) {
+ return data_offset() + kWordSize * index;
+ }
RawObject* At(intptr_t index) const {
return *ObjectAddr(index);

Powered by Google App Engine
This is Rietveld 408576698