Added CefV8Value::GetObjectIdentityHash. This function provides a hash for values of the following types: Object, Symbol, and BigInt.
Added basic support for BigInt and Symbol;
Reduced the size of the _cef_v8value_t. I replaced the type checking functions with _cef_v8value_t::get_type and _cef_v8value_t::is_object_of_type. For compatibility with legacy code the CefV8Value::Is* functions are saved in the C++ API.
Can you explain the use case for GetObjectIdentityHash? From the V8 documentation is sounds like this value is not guaranteed to be unique.
The GetObjectIdentityHash provides a hash code for algorithms that need quick checks of V8 object equality. There is no unique identifier for an V8 object. But GetObjectIdentityHash enough to build hash maps, hash tables, sets for CefV8Value's. Currently, the only legal way to find equal CefV8Value's is to CefV8Value::IsSame against every single object in the table, which is very slow if there are a lot of objects to keep track of. With simple CefV8Value types like int, string, time there is no problem - is to compute a hash for their value. As usual, when using hash functions, collisions can occur, the algorithm should check objects with the same hash codes for equality.
In my case, I use a cache for the C API wrappers. I compute a hash for cef_v8value_t and use it as a hash for a key to insert into a dictionary that contains weak references to .NET wrappers around cef_v8value_t. Unlike other CEF objects the CefV8Value instances are always new even for the same V8 object. Unable to get any identifier for them by raw pointer to CefV8Value. If CEF binary distribution from Spotify are used, then only somehow working way available to me now is to read from the memory the value of CefV8ValueImpl::handle ->GetPersistentV8Handle().val_. This approach is very bad because it depends on how several structures are stored in memory. The GetObjectIdentityHash is a good way to identify in this case.