Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 134a92cd029b2782788d08be1015c4c6d8f1b081..d16b0e2b72091fcda20e6a6c9a04f205f67b6410 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2132,10 +2132,8 @@ |
bool WeakCell::next_cleared() { return next()->IsTheHole(); } |
-int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
- |
- |
-int JSObject::GetHeaderSize(InstanceType type) { |
+int JSObject::GetHeaderSize() { |
+ InstanceType type = map()->instance_type(); |
// Check for the most common kind of JavaScript object before |
// falling into the generic switch. This speeds up the internal |
// field operations considerably on average. |
@@ -2192,16 +2190,13 @@ |
} |
-int JSObject::GetInternalFieldCount(Map* map) { |
- int instance_size = map->instance_size(); |
- if (instance_size == kVariableSizeSentinel) return 0; |
- InstanceType instance_type = map->instance_type(); |
- return ((instance_size - GetHeaderSize(instance_type)) >> kPointerSizeLog2) - |
- map->GetInObjectProperties(); |
-} |
- |
- |
-int JSObject::GetInternalFieldCount() { return GetInternalFieldCount(map()); } |
+int JSObject::GetInternalFieldCount() { |
+ DCHECK(1 << kPointerSizeLog2 == kPointerSize); |
+ // Make sure to adjust for the number of in-object properties. These |
+ // properties do contribute to the size, but are not internal fields. |
+ return ((Size() - GetHeaderSize()) >> kPointerSizeLog2) - |
+ map()->GetInObjectProperties(); |
+} |
int JSObject::GetInternalFieldOffset(int index) { |
@@ -5627,12 +5622,6 @@ |
} |
-Handle<Map> Map::CopyInitialMap(Handle<Map> map) { |
- return CopyInitialMap(map, map->instance_size(), map->GetInObjectProperties(), |
- map->unused_property_fields()); |
-} |
- |
- |
ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
ACCESSORS(JSFunction, literals_or_bindings, FixedArray, kLiteralsOffset) |
ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |