Skip to content

Commit 997b2c1

Browse files
committed
feat: add v8 release and atomicString impl
1 parent 575e6f0 commit 997b2c1

15 files changed

+771
-200
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = bridge/third_party/quickjs/vendor/mimalloc
33
url = https://github.com/microsoft/mimalloc
44
branch = v1.7.9
5+
[submodule "bridge/third_party/v8"]
6+
path = bridge/third_party/v8
7+
url = [email protected]:openwebf/v8-release.git
8+
branch = 11.9.169.6

bridge/CMakeLists.txt

Lines changed: 176 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ list(APPEND WEBF_PUBLIC_HEADERS
5959
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_bridge.h
6060
)
6161

62-
set(QUICKJS_PUBLIC_HEADERS
63-
third_party/quickjs/cutils.h
64-
third_party/quickjs/libregexp.h
65-
third_party/quickjs/libregexp-opcode.h
66-
third_party/quickjs/libunicode.h
67-
third_party/quickjs/libunicode-table.h
68-
third_party/quickjs/list.h
69-
third_party/quickjs/quickjs.h
70-
third_party/quickjs/quickjs-atom.h
71-
third_party/quickjs/quickjs-opcode.h
72-
)
73-
7462
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
7563
add_compile_options(-fPIC)
7664
endif()
@@ -140,6 +128,18 @@ list(APPEND BRIDGE_INCLUDE
140128
)
141129

142130
if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
131+
set(QUICKJS_PUBLIC_HEADERS
132+
third_party/quickjs/cutils.h
133+
third_party/quickjs/libregexp.h
134+
third_party/quickjs/libregexp-opcode.h
135+
third_party/quickjs/libunicode.h
136+
third_party/quickjs/libunicode-table.h
137+
third_party/quickjs/list.h
138+
third_party/quickjs/quickjs.h
139+
third_party/quickjs/quickjs-atom.h
140+
third_party/quickjs/quickjs-opcode.h
141+
)
142+
143143
add_compile_options(-DWEBF_QUICK_JS_ENGINE=1)
144144

145145
execute_process(
@@ -235,7 +235,6 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
235235
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
236236
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/modp_b64/include)
237237
list(APPEND BRIDGE_LINK_LIBS quickjs)
238-
list(APPEND BRIDGE_LINK_LIBS modb)
239238

240239
list(APPEND BRIDGE_SOURCE
241240
# Binding files
@@ -260,143 +259,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
260259
bindings/qjs/exception_message.cc
261260
bindings/qjs/rejected_promises.cc
262261
bindings/qjs/union_base.cc
263-
# Core sources
264-
webf_bridge.cc
265-
core/api/api.cc
266-
core/executing_context.cc
267-
core/script_forbidden_scope.cc
268-
core/script_state.cc
269-
core/page.cc
270-
core/dart_methods.cc
271-
core/dart_isolate_context.cc
272-
core/dart_context_data.cc
273-
core/executing_context_data.cc
274-
core/fileapi/blob.cc
275-
core/fileapi/blob_part.cc
276-
core/fileapi/blob_property_bag.cc
277-
core/frame/console.cc
278-
core/frame/dom_timer.cc
279-
core/frame/dom_timer_coordinator.cc
280-
core/frame/window_or_worker_global_scope.cc
281-
core/frame/module_listener.cc
282-
core/frame/module_listener_container.cc
283-
core/frame/module_manager.cc
284-
core/frame/module_callback.cc
285-
core/frame/module_context_coordinator.cc
286-
core/frame/window.cc
287-
core/frame/screen.cc
288-
core/frame/legacy/location.cc
289-
core/timing/performance.cc
290-
core/timing/performance_mark.cc
291-
core/timing/performance_entry.cc
292-
core/timing/performance_measure.cc
293-
core/css/css_style_declaration.cc
294-
core/css/inline_css_style_declaration.cc
295-
core/css/computed_css_style_declaration.cc
296-
core/dom/frame_request_callback_collection.cc
297-
core/dom/events/registered_eventListener.cc
298-
core/dom/events/event_listener_map.cc
299-
core/dom/events/event.cc
300-
core/dom/events/custom_event.cc
301-
core/dom/events/event_target.cc
302-
core/dom/events/event_listener_map.cc
303-
core/dom/events/event_target_impl.cc
304-
core/binding_object.cc
305-
core/dom/node.cc
306-
core/dom/node_list.cc
307-
core/dom/static_node_list.cc
308-
core/dom/node_traversal.cc
309-
core/dom/live_node_list_base.cc
310-
core/dom/character_data.cc
311-
core/dom/comment.cc
312-
core/dom/text.cc
313-
core/dom/tree_scope.cc
314-
core/dom/element.cc
315-
core/dom/parent_node.cc
316-
core/dom/element_data.cc
317-
core/dom/document.cc
318-
core/dom/dom_token_list.cc
319-
core/dom/dom_string_map.cc
320-
core/dom/space_split_string.cc
321-
core/dom/scripted_animation_controller.cc
322-
core/dom/node_data.cc
323-
core/dom/document_fragment.cc
324-
core/dom/child_node_list.cc
325-
core/dom/empty_node_list.cc
326-
core/dom/mutation_observer.cc
327-
core/dom/mutation_observer_registration.cc
328-
core/dom/mutation_observer_interest_group.cc
329-
core/dom/mutation_record.cc
330-
core/dom/child_list_mutation_scope.cc
331-
core/dom/container_node.cc
332-
core/html/custom/widget_element.cc
333-
core/events/error_event.cc
334-
core/events/message_event.cc
335-
core/events/animation_event.cc
336-
core/events/close_event.cc
337-
core/events/ui_event.cc
338-
core/events/focus_event.cc
339-
core/events/gesture_event.cc
340-
core/events/input_event.cc
341-
core/events/touch_event.cc
342-
core/events/mouse_event.cc
343-
core/events/pop_state_event.cc
344-
core/events/pointer_event.cc
345-
core/events/transition_event.cc
346-
core/events/intersection_change_event.cc
347-
core/events/keyboard_event.cc
348-
core/events/promise_rejection_event.cc
349-
core/html/parser/html_parser.cc
350-
core/html/html_element.cc
351-
core/html/html_div_element.cc
352-
core/html/html_head_element.cc
353-
core/html/html_body_element.cc
354-
core/html/html_html_element.cc
355-
core/html/html_template_element.cc
356-
core/html/html_all_collection.cc
357-
core/html/html_anchor_element.cc
358-
core/html/html_image_element.cc
359-
core/html/html_script_element.cc
360-
core/html/html_iframe_element.cc
361-
core/html/html_link_element.cc
362-
core/html/html_unknown_element.cc
363-
core/html/image.cc
364-
core/html/html_collection.cc
365-
core/html/canvas/html_canvas_element.cc
366-
core/html/canvas/canvas_rendering_context.cc
367-
core/html/canvas/canvas_rendering_context_2d.cc
368-
core/html/canvas/canvas_gradient.cc
369-
core/html/canvas/canvas_pattern.cc
370-
core/geometry/dom_matrix.cc
371-
core/geometry/dom_matrix_readonly.cc
372-
core/html/forms/html_button_element.cc
373-
core/html/forms/html_input_element.cc
374-
core/html/forms/html_form_element.cc
375-
core/html/forms/html_textarea_element.cc
376-
377-
# SVG files
378-
core/svg/svg_element.cc
379-
core/svg/svg_graphics_element.cc
380-
core/svg/svg_geometry_element.cc
381-
core/svg/svg_text_content_element.cc
382-
core/svg/svg_text_positioning_element.cc
383-
384-
core/svg/svg_svg_element.cc
385-
core/svg/svg_path_element.cc
386-
core/svg/svg_rect_element.cc
387-
core/svg/svg_text_element.cc
388-
core/svg/svg_g_element.cc
389-
core/svg/svg_circle_element.cc
390-
core/svg/svg_ellipse_element.cc
391-
core/svg/svg_style_element.cc
392-
core/svg/svg_line_element.cc
393-
394-
# Legacy implements, should remove them in the future.
395-
core/dom/legacy/element_attributes.cc
396-
core/dom/legacy/bounding_client_rect.cc
397-
core/input/touch.cc
398-
core/input/touch_list.cc
399-
)
262+
)
400263

401264
# Gen sources.
402265
list(APPEND BRIDGE_SOURCE
@@ -545,7 +408,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
545408
out/qjs_svg_ellipse_element.cc
546409
out/qjs_svg_style_element.cc
547410
out/qjs_svg_line_element.cc
548-
)
411+
)
549412

550413

551414
if (NOT MSVC)
@@ -555,7 +418,168 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
555418
endif()
556419
target_compile_options(quickjs PUBLIC -DCONFIG_VERSION=${\"QUICKJS_VERSION\"})
557420

558-
endif ()
421+
elseif ($ENV{WEBF_JS_ENGINE} MATCHES "v8")
422+
423+
add_compile_options(-DWEBF_V8_JS_ENGINE=1)
424+
425+
list(APPEND BRIDGE_SOURCE
426+
# Binding files
427+
bindings/v8/atomic_string.cc
428+
)
429+
430+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
431+
add_library(v8 SHARED IMPORTED)
432+
set_target_properties(v8 PROPERTIES IMPORTED_LOCATION "third_party/v8/lib/macos/arm64/libv8.dylib")
433+
add_library(v8_platform SHARED IMPORTED)
434+
set_target_properties(v8_platform PROPERTIES IMPORTED_LOCATION "third_party/v8/lib/macos/arm64/libv8_libplatform.dylib")
435+
list(APPEND BRIDGE_LINK_LIBS v8 v8_platform)
436+
endif()
437+
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/v8/include)
438+
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/v8/include/v8)
439+
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/v8/include/v8/cppgc)
440+
list(APPEND BRIDGE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/v8/include/v8/libplatform)
441+
endif()
442+
443+
list(APPEND BRIDGE_LINK_LIBS modb)
444+
445+
list(APPEND BRIDGE_SOURCE
446+
# Core sources
447+
webf_bridge.cc
448+
core/api/api.cc
449+
core/executing_context.cc
450+
core/script_forbidden_scope.cc
451+
core/script_state.cc
452+
core/page.cc
453+
core/dart_methods.cc
454+
core/dart_isolate_context.cc
455+
core/dart_context_data.cc
456+
core/executing_context_data.cc
457+
core/fileapi/blob.cc
458+
core/fileapi/blob_part.cc
459+
core/fileapi/blob_property_bag.cc
460+
core/frame/console.cc
461+
core/frame/dom_timer.cc
462+
core/frame/dom_timer_coordinator.cc
463+
core/frame/window_or_worker_global_scope.cc
464+
core/frame/module_listener.cc
465+
core/frame/module_listener_container.cc
466+
core/frame/module_manager.cc
467+
core/frame/module_callback.cc
468+
core/frame/module_context_coordinator.cc
469+
core/frame/window.cc
470+
core/frame/screen.cc
471+
core/frame/legacy/location.cc
472+
core/timing/performance.cc
473+
core/timing/performance_mark.cc
474+
core/timing/performance_entry.cc
475+
core/timing/performance_measure.cc
476+
core/css/css_style_declaration.cc
477+
core/css/inline_css_style_declaration.cc
478+
core/css/computed_css_style_declaration.cc
479+
core/dom/frame_request_callback_collection.cc
480+
core/dom/events/registered_eventListener.cc
481+
core/dom/events/event_listener_map.cc
482+
core/dom/events/event.cc
483+
core/dom/events/custom_event.cc
484+
core/dom/events/event_target.cc
485+
core/dom/events/event_listener_map.cc
486+
core/dom/events/event_target_impl.cc
487+
core/binding_object.cc
488+
core/dom/node.cc
489+
core/dom/node_list.cc
490+
core/dom/static_node_list.cc
491+
core/dom/node_traversal.cc
492+
core/dom/live_node_list_base.cc
493+
core/dom/character_data.cc
494+
core/dom/comment.cc
495+
core/dom/text.cc
496+
core/dom/tree_scope.cc
497+
core/dom/element.cc
498+
core/dom/parent_node.cc
499+
core/dom/element_data.cc
500+
core/dom/document.cc
501+
core/dom/dom_token_list.cc
502+
core/dom/dom_string_map.cc
503+
core/dom/space_split_string.cc
504+
core/dom/scripted_animation_controller.cc
505+
core/dom/node_data.cc
506+
core/dom/document_fragment.cc
507+
core/dom/child_node_list.cc
508+
core/dom/empty_node_list.cc
509+
core/dom/mutation_observer.cc
510+
core/dom/mutation_observer_registration.cc
511+
core/dom/mutation_observer_interest_group.cc
512+
core/dom/mutation_record.cc
513+
core/dom/child_list_mutation_scope.cc
514+
core/dom/container_node.cc
515+
core/html/custom/widget_element.cc
516+
core/events/error_event.cc
517+
core/events/message_event.cc
518+
core/events/animation_event.cc
519+
core/events/close_event.cc
520+
core/events/ui_event.cc
521+
core/events/focus_event.cc
522+
core/events/gesture_event.cc
523+
core/events/input_event.cc
524+
core/events/touch_event.cc
525+
core/events/mouse_event.cc
526+
core/events/pop_state_event.cc
527+
core/events/pointer_event.cc
528+
core/events/transition_event.cc
529+
core/events/intersection_change_event.cc
530+
core/events/keyboard_event.cc
531+
core/events/promise_rejection_event.cc
532+
core/html/parser/html_parser.cc
533+
core/html/html_element.cc
534+
core/html/html_div_element.cc
535+
core/html/html_head_element.cc
536+
core/html/html_body_element.cc
537+
core/html/html_html_element.cc
538+
core/html/html_template_element.cc
539+
core/html/html_all_collection.cc
540+
core/html/html_anchor_element.cc
541+
core/html/html_image_element.cc
542+
core/html/html_script_element.cc
543+
core/html/html_iframe_element.cc
544+
core/html/html_link_element.cc
545+
core/html/html_unknown_element.cc
546+
core/html/image.cc
547+
core/html/html_collection.cc
548+
core/html/canvas/html_canvas_element.cc
549+
core/html/canvas/canvas_rendering_context.cc
550+
core/html/canvas/canvas_rendering_context_2d.cc
551+
core/html/canvas/canvas_gradient.cc
552+
core/html/canvas/canvas_pattern.cc
553+
core/geometry/dom_matrix.cc
554+
core/geometry/dom_matrix_readonly.cc
555+
core/html/forms/html_button_element.cc
556+
core/html/forms/html_input_element.cc
557+
core/html/forms/html_form_element.cc
558+
core/html/forms/html_textarea_element.cc
559+
560+
# SVG files
561+
core/svg/svg_element.cc
562+
core/svg/svg_graphics_element.cc
563+
core/svg/svg_geometry_element.cc
564+
core/svg/svg_text_content_element.cc
565+
core/svg/svg_text_positioning_element.cc
566+
567+
core/svg/svg_svg_element.cc
568+
core/svg/svg_path_element.cc
569+
core/svg/svg_rect_element.cc
570+
core/svg/svg_text_element.cc
571+
core/svg/svg_g_element.cc
572+
core/svg/svg_circle_element.cc
573+
core/svg/svg_ellipse_element.cc
574+
core/svg/svg_style_element.cc
575+
core/svg/svg_line_element.cc
576+
577+
# Legacy implements, should remove them in the future.
578+
core/dom/legacy/element_attributes.cc
579+
core/dom/legacy/bounding_client_rect.cc
580+
core/input/touch.cc
581+
core/input/touch_list.cc
582+
)
559583

560584
list(APPEND PUBLIC_HEADER
561585
include/webf_bridge.h

0 commit comments

Comments
 (0)