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

Unified Diff: src/objects-inl.h

Issue 2196533003: [api] Cleaning up: Replace NeanderArray with FixedArray implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mind the pointers Created 4 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 211ae2c2d81fc6ebaf38dcf75a8589db4c742dc6..c645f344a8c24a1432cd2db74bd87026c9d0b982 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -752,6 +752,14 @@ bool HeapObject::IsHandlerTable() const {
return true;
}
+bool HeapObject::IsTemplateList() const {
+ if (!IsFixedArray()) return false;
+ // There's actually no way to see the difference between a fixed array and
+ // a template list.
+ if (FixedArray::cast(this)->length() < 1) return false;
+ return true;
+}
+
bool HeapObject::IsDependentCode() const {
if (!IsFixedArray()) return false;
// There's actually no way to see the difference between a fixed array and
@@ -3244,6 +3252,7 @@ CAST_ACCESSOR(Oddball)
CAST_ACCESSOR(OrderedHashMap)
CAST_ACCESSOR(OrderedHashSet)
CAST_ACCESSOR(PropertyCell)
+CAST_ACCESSOR(TemplateList)
CAST_ACCESSOR(ScopeInfo)
CAST_ACCESSOR(SeededNumberDictionary)
CAST_ACCESSOR(SeqOneByteString)
@@ -5690,25 +5699,41 @@ SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset)
ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset)
ACCESSORS(ObjectTemplateInfo, data, Object, kDataOffset)
+
int ObjectTemplateInfo::internal_field_count() const {
Object* value = data();
DCHECK(value->IsSmi());
return InternalFieldCount::decode(Smi::cast(value)->value());
}
+
void ObjectTemplateInfo::set_internal_field_count(int count) {
return set_data(Smi::FromInt(
InternalFieldCount::update(Smi::cast(data())->value(), count)));
}
+
bool ObjectTemplateInfo::immutable_proto() const {
Object* value = data();
DCHECK(value->IsSmi());
return IsImmutablePrototype::decode(Smi::cast(value)->value());
}
+
void ObjectTemplateInfo::set_immutable_proto(bool immutable) {
return set_data(Smi::FromInt(
IsImmutablePrototype::update(Smi::cast(data())->value(), immutable)));
}
+int TemplateList::length() const {
+ return Smi::cast(FixedArray::cast(this)->get(kLengthIndex))->value();
+}
+
+Object* TemplateList::get(int index) const {
+ return FixedArray::cast(this)->get(kFirstElementIndex + index);
+}
+
+void TemplateList::set(int index, Object* value) {
+ FixedArray::cast(this)->set(kFirstElementIndex + index, value);
+}
+
ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset)
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698