Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 7179c8c3f77850c777d263299348f338056f1f50..0ccfb8126dadfc7da7ab5739b30dc1acd4f92a2e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1290,6 +1290,82 @@ void JSObject::EnsureWritableFastElements(Handle<JSObject> object) { |
isolate->counters()->cow_arrays_converted()->Increment(); |
} |
+int JSObject::GetHeaderSize(InstanceType type) { |
+ switch (type) { |
+ case JS_OBJECT_TYPE: |
+ case JS_API_OBJECT_TYPE: |
+ case JS_SPECIAL_API_OBJECT_TYPE: |
+ return JSObject::kHeaderSize; |
+ case JS_GENERATOR_OBJECT_TYPE: |
+ return JSGeneratorObject::kSize; |
+ case JS_ASYNC_GENERATOR_OBJECT_TYPE: |
+ return JSAsyncGeneratorObject::kSize; |
+ case JS_GLOBAL_PROXY_TYPE: |
+ return JSGlobalProxy::kSize; |
+ case JS_GLOBAL_OBJECT_TYPE: |
+ return JSGlobalObject::kSize; |
+ case JS_BOUND_FUNCTION_TYPE: |
+ return JSBoundFunction::kSize; |
+ case JS_FUNCTION_TYPE: |
+ return JSFunction::kSize; |
+ case JS_VALUE_TYPE: |
+ return JSValue::kSize; |
+ case JS_DATE_TYPE: |
+ return JSDate::kSize; |
+ case JS_ARRAY_TYPE: |
+ return JSArray::kSize; |
+ case JS_ARRAY_BUFFER_TYPE: |
+ return JSArrayBuffer::kSize; |
+ case JS_TYPED_ARRAY_TYPE: |
+ return JSTypedArray::kSize; |
+ case JS_DATA_VIEW_TYPE: |
+ return JSDataView::kSize; |
+ case JS_SET_TYPE: |
+ return JSSet::kSize; |
+ case JS_MAP_TYPE: |
+ return JSMap::kSize; |
+ case JS_SET_ITERATOR_TYPE: |
+ return JSSetIterator::kSize; |
+ case JS_MAP_ITERATOR_TYPE: |
+ return JSMapIterator::kSize; |
+ case JS_WEAK_MAP_TYPE: |
+ return JSWeakMap::kSize; |
+ case JS_WEAK_SET_TYPE: |
+ return JSWeakSet::kSize; |
+ case JS_PROMISE_CAPABILITY_TYPE: |
+ return JSPromiseCapability::kSize; |
+ case JS_PROMISE_TYPE: |
+ return JSPromise::kSize; |
+ case JS_REGEXP_TYPE: |
+ return JSRegExp::kSize; |
+ case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
+ return JSObject::kHeaderSize; |
+ case JS_MESSAGE_OBJECT_TYPE: |
+ return JSMessageObject::kSize; |
+ case JS_ARGUMENTS_TYPE: |
+ return JSArgumentsObject::kHeaderSize; |
+ case JS_ERROR_TYPE: |
+ return JSObject::kHeaderSize; |
+ case JS_STRING_ITERATOR_TYPE: |
+ return JSStringIterator::kSize; |
+ case JS_MODULE_NAMESPACE_TYPE: |
+ return JSModuleNamespace::kHeaderSize; |
+ case WASM_INSTANCE_TYPE: |
+ return WasmInstanceObject::kSize; |
+ case WASM_MEMORY_TYPE: |
+ return WasmMemoryObject::kSize; |
+ case WASM_MODULE_TYPE: |
+ return WasmModuleObject::kSize; |
+ case WASM_TABLE_TYPE: |
+ return WasmTableObject::kSize; |
+ default: |
+ if (type >= FIRST_ARRAY_ITERATOR_TYPE && |
+ type <= LAST_ARRAY_ITERATOR_TYPE) { |
+ return JSArrayIterator::kSize; |
+ } |
+ UNREACHABLE(); |
+ } |
+} |
// ES6 9.5.1 |
// static |
@@ -3011,6 +3087,10 @@ VisitorId Map::GetVisitorId(Map* map) { |
case JS_PROMISE_CAPABILITY_TYPE: |
case JS_PROMISE_TYPE: |
+ case WASM_INSTANCE_TYPE: |
+ case WASM_MEMORY_TYPE: |
+ case WASM_MODULE_TYPE: |
+ case WASM_TABLE_TYPE: |
case JS_BOUND_FUNCTION_TYPE: |
return has_unboxed_fields ? kVisitJSObject : kVisitJSObjectFast; |
case JS_API_OBJECT_TYPE: |