diff --git a/tools/v8windbg/src/object-inspection.cc b/tools/v8windbg/src/object-inspection.cc index b206dfa792..b682f5b1b9 100644 --- a/tools/v8windbg/src/object-inspection.cc +++ b/tools/v8windbg/src/object-inspection.cc @@ -17,6 +17,7 @@ V8CachedObject::V8CachedObject(Location location, uncompressed_type_name_(std::move(uncompressed_type_name)), context_(std::move(context)), is_compressed_(is_compressed) {} + HRESULT V8CachedObject::Create(IModelObject* p_v8_object_instance, IV8CachedObject** result) { Location location; @@ -25,15 +26,16 @@ HRESULT V8CachedObject::Create(IModelObject* p_v8_object_instance, WRL::ComPtr context; RETURN_IF_FAIL(p_v8_object_instance->GetContext(&context)); + WRL::ComPtr sp_type; + _bstr_t type_name; + RETURN_IF_FAIL(p_v8_object_instance->GetTypeInfo(&sp_type)); + RETURN_IF_FAIL(sp_type->GetName(type_name.GetAddress())); + // If the object is of type v8::internal::TaggedValue, and this build uses // compressed pointers, then the value is compressed. Other types such as // v8::internal::Object represent uncompressed tagged values. - WRL::ComPtr sp_type; - _bstr_t type_name; bool is_compressed = COMPRESS_POINTERS_BOOL && - SUCCEEDED(p_v8_object_instance->GetTypeInfo(&sp_type)) && - SUCCEEDED(sp_type->GetName(type_name.GetAddress())) && static_cast(type_name) == std::string(kTaggedValue); const char* uncompressed_type_name = @@ -44,6 +46,7 @@ HRESULT V8CachedObject::Create(IModelObject* p_v8_object_instance, .Detach(); return S_OK; } + V8CachedObject::V8CachedObject(V8HeapObject heap_object) : heap_object_(std::move(heap_object)), heap_object_initialized_(true) {}