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

Unified Diff: src/objects-inl.h

Issue 1483003002: Revert of Introduce instance type for transition arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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-debug.cc ('k') | src/objects-printer.cc » ('j') | 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 df56d5ce5b14260ad439532e45f1ceda5cb473ca..b39bf682c3d9db8a14fb02740c95547735a14182 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -134,14 +134,6 @@
}
-bool Object::IsFixedArray() const {
- if (!IsHeapObject()) return false;
- InstanceType instance_type = HeapObject::cast(this)->map()->instance_type();
- return instance_type == FIXED_ARRAY_TYPE ||
- instance_type == TRANSITION_ARRAY_TYPE;
-}
-
-
// External objects are not extensible, so the map check is enough.
bool Object::IsExternal() const {
return Object::IsHeapObject() &&
@@ -725,9 +717,9 @@
TYPE_CHECKER(JSWeakSet, JS_WEAK_SET_TYPE)
TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE)
TYPE_CHECKER(Map, MAP_TYPE)
+TYPE_CHECKER(FixedArray, FIXED_ARRAY_TYPE)
TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE)
TYPE_CHECKER(WeakFixedArray, FIXED_ARRAY_TYPE)
-TYPE_CHECKER(TransitionArray, TRANSITION_ARRAY_TYPE)
bool Object::IsJSWeakCollection() const {
@@ -745,6 +737,11 @@
bool Object::IsLayoutDescriptor() const {
return IsSmi() || IsFixedTypedArrayBase();
+}
+
+
+bool Object::IsTransitionArray() const {
+ return IsFixedArray();
}
@@ -2409,7 +2406,7 @@
void FixedArray::set(int index, Object* value) {
DCHECK_NE(GetHeap()->fixed_cow_array_map(), map());
- DCHECK(IsFixedArray());
+ DCHECK_EQ(FIXED_ARRAY_TYPE, map()->instance_type());
DCHECK(index >= 0 && index < this->length());
int offset = kHeaderSize + index * kPointerSize;
WRITE_FIELD(this, offset, value);
@@ -4459,8 +4456,7 @@
if (instance_size != kVariableSizeSentinel) return instance_size;
// Only inline the most frequent cases.
InstanceType instance_type = map->instance_type();
- if (instance_type == FIXED_ARRAY_TYPE ||
- instance_type == TRANSITION_ARRAY_TYPE) {
+ if (instance_type == FIXED_ARRAY_TYPE) {
return FixedArray::SizeFor(
reinterpret_cast<FixedArray*>(this)->synchronized_length());
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698