Previously, I was using the V8 version 7.4.x and I have check method to test if the result object from the script execution is undefined/null or real object. Which works fine with the older version of the V8.
But now, I'm using V8 version 8.1.307 and my check does not work anymore.
This is the code snippet to reproduce the issue:
// create Isolate*, v8::Local<v8::Context>> and ...
v8::Handle<v8::Value> undefinedResult = v8::Undefined(isolate);
v8::Handle<v8::Value> nullResult = v8::Null(isolate);
std::cout << "isUndefined: " << undefinedResult->IsUndefined() << std::endl;
std::cout << "isNull: " << nullResult->IsNull() << std::endl;
with the V8 version 7.4.x, the snippet produces the following output:
But things turn out different for the V8 version 8.1.307, the same snippet produces a different output:
This is my gn args to generate the monolithic V8 7.4.x library:
target_os = "linux"
target_cpu = "x64"
is_component_build = false
is_debug = false
use_custom_libcxx = false
v8_monolithic = true
v8_use_external_startup_data = false
symbol_level = 0
v8_enable_i18n_support= false
I used the same gn args to generate the V8 version 8.1.307, but then V8 immediatelly crashes when `->IsUndefined()`called. I found that V8 8.1 contains a pointer compression feature so I disabled to see how this would effect the result, now there is no crash but wrong result.
target_os = "linux"
target_cpu = "x64"
is_component_build = false
is_debug = false
use_custom_libcxx = false
v8_monolithic = true
v8_use_external_startup_data = false
symbol_level = 0
v8_enable_i18n_support= false
v8_enable_pointer_compression = false
What is the actual cause of this issue? How can I fix it? Maybe I'm missing something but I don't know what it is.