danbev / learning-v8 Goto Github PK
View Code? Open in Web Editor NEWProject for learning V8 internals
Project for learning V8 internals
Hi there,
can I ask for permission to publish your full guide to Medium? I created this Blog mainly to learn V8 myself and help others on the way. I keep a tested version tag on every story, so no worries about deprecations =)
Posted on https://node-gem.com
Would love to hear your feedback on this effort.
Thank you!
While translating your notes/microtasks.md, I faced Page Not Found Error.
I wonder if Itasks.js script file has been deleted.
Or if its path changed, I'd appreciate it if you could tell me where it is.
Sorry for my bad English... π
Is it possible to do this ?
Hi danbev! Can I translate your book into Chinese to help more people learn v8?
(lldb) jlh value
Failed to evaluate command _v8_internal_Print_Object(*(v8::internal::Object**)((void*)(value).val_)) :
error: reference to 'Object' is ambiguous
candidate found by name lookup is 'Object'
candidate found by name lookup is 'v8::internal::Object'
Hi,i had run V8_shell startup as you followed. But I cann't print any for this result
variable...
What's wrong?
1711 parse_info.set_language_mode(
1712 static_cast<LanguageMode>(parse_info.language_mode() | language_mode));
-> 1713 result = CompileToplevel(&info);
(lldb) p result
(v8::internal::Handle<v8::internal::SharedFunctionInfo>) $0 = {
v8::internal::HandleBase = {
location_ = 0x0000000000000000
}
}
(lldb) job result
error: cannot cast from type 'v8::internal::Handle<v8::internal::SharedFunctionInfo>' to pointer type 'void *'
error: 1 errors parsing expression
(lldb) job *result
error: use of undeclared identifier '_v8_internal_Print_Object'
error: 1 errors parsing expression
Hi @danbev I execute make test/object_test
, show below it, it's no problem, generate object_test executable file.
β learning-v8 git:(master) β make test/object_test
g++ -Wall -g -O0 test/main.cc test/object_test.cc -o test/object_test /Users/videojj/study/googletest/install/lib/libgtest.a -std=c++14 -fno-exceptions -fno-rtti -Wcast-function-type -Wno-unused-variable -Wno-class-memaccess -Wno-comment -Wno-unused-but-set-variable -DV8_COMPRESS_POINTERS -DV8_INTL_SUPPORT -I/Volumes/liyao/v8/include -I/Volumes/liyao/v8 -I/Volumes/liyao/v8/third_party/icu/source/common/ -I/Volumes/liyao/v8/out/x64.release_gcc/gen -L/Volumes/liyao/v8/out/x64.release_gcc -I./Volumes/liyao/googletest/googletest/include -lv8 -lv8_libplatform -lv8_libbase -Wl,-L/Volumes/liyao/v8/out/x64.release_gcc -Wl,-L/usr/lib64 -Wl,-lstdc++ -Wl,-lpthread
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
3 warnings generated.
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
[-Wunknown-warning-option]
3 warnings generated.
ld: warning: directory not found for option '-L/usr/lib64'
however when I execute ./test/object_test, errors below itοΌI don't know to solve it, please help me
dyld: Library not loaded: @rpath/libv8.dylib
Referenced from: /Users/videojj/study/learning-v8/./test/object_test
Reason: image not found
[1] 77150 abort ./test/object_test
My v8 version is 9.9.1
.
I executed commands as below:
make configure_v8
make compile_v8
make hello-world && ./hello-world # it's ok
make test/object_test # throw error as below
v8/src/objects/instance-type.h:247:36: error: static_assert failed due to requirement '(WASM_ARRAY_TYPE >= FIRST_JS_RECEIVER_TYPE && WASM_ARRAY_TYPE <= LAST_CUSTOM_ELEMENTS_RECEIVER) == (WASM_ARRAY_TYPE == JS_PROXY_TYPE || WASM_ARRAY_TYPE == JS_GLOBAL_OBJECT_TYPE || WASM_ARRAY_TYPE == JS_GLOBAL_PROXY_TYPE || WASM_ARRAY_TYPE == JS_MODULE_NAMESPACE_TYPE || WASM_ARRAY_TYPE == JS_SPECIAL_API_OBJECT_TYPE || WASM_ARRAY_TYPE == JS_PRIMITIVE_WRAPPER_TYPE)' "(WASM_ARRAY_TYPE >= FIRST_JS_RECEIVER_TYPE && WASM_ARRAY_TYPE <= LAST_CUSTOM_ELEMENTS_RECEIVER) == (IF_WASM(EXPAND, WASM_ARRAY_TYPE == WASM_STRUCT_TYPE || WASM_ARRAY_TYPE == WASM_ARRAY_TYPE ||) WASM_ARRAY_TYPE == JS_PROXY_TYPE || WASM_ARRAY_TYPE == JS_GLOBAL_OBJECT_TYPE || WASM_ARRAY_TYPE == JS_GLOBAL_PROXY_TYPE || WASM_ARRAY_TYPE == JS_MODULE_NAMESPACE_TYPE || WASM_ARRAY_TYPE == JS_SPECIAL_API_OBJECT_TYPE || WASM_ARRAY_TYPE == JS_PRIMITIVE_WRAPPER_TYPE)"
TORQUE_ASSIGNED_INSTANCE_TYPE_LIST(CHECK_INSTANCE_TYPE)
##Platform: mac OS 10.14.6
hello, I just started learning v8, clone the project, I change the corresponding directory in the makefile to mine.
V8_HOME ?= /Users/videojj/v8/v8
#V8_HOME ?= /home/danielbevenius/work/google/v8_src/v8
#v8_build_dir = #$(V8_HOME)/out/x64.release_gcc
v8_build_dir = $(V8_HOME)/out/x64.release
### The following is a build using clang which seems to work better with lldb
#v8_build_dir = $(V8_HOME)/out/x64.debug
When I execute the make command in the command line,The following error is displayed
Using v8_home = /Users/videojj/v8/v8
g++ -Wall -g -O0 hello-world.cc -o hello-world -std=c++14 -Wcast-function-type -fno-exceptions -fno-rtti -DV8_COMPRESS_POINTERS -I/Users/videojj/v8/v8/include -I/Users/videojj/v8/v8 -I/Users/videojj/v8/v8/out/x64.release/gen -L/Users/videojj/v8/v8/out/x64.release -lv8 -lv8_libplatform -lv8_libbase -Wl,-L/Users/videojj/v8/v8/out/x64.release -Wl,-lpthread
warning: unknown warning option '-Wcast-function-type'; did you mean '-Wbad-function-cast'? [-Wunknown-warning-option]
1 warning generated.
ld: library not found for -lv8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hello-world] Error 1
I did a little digging, I think the error is caused by the following line.
v8_dylibs=-lv8 -lv8_libplatform -lv8_libbase
I compiled v8 for this article, however there is not v8_dylibs options, pease help me to solve it.
@danbev
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.