From ac78f6e1fa2a0081476a93fb86fffe5306ef2ef3 Mon Sep 17 00:00:00 2001 From: Darin Dimitrov Date: Fri, 13 Sep 2019 13:33:59 +0300 Subject: [PATCH] v8 7.7.299.11 update instructions --- 7.6.303.28.patch => 7.7.299.11.patch | 976 +++++++++++++-------------- README.md | 4 +- build.sh | 90 +-- 3 files changed, 538 insertions(+), 532 deletions(-) rename 7.6.303.28.patch => 7.7.299.11.patch (99%) diff --git a/7.6.303.28.patch b/7.7.299.11.patch similarity index 99% rename from 7.6.303.28.patch rename to 7.7.299.11.patch index f629c7cf53..7bbfb30a44 100644 --- a/7.6.303.28.patch +++ b/7.7.299.11.patch @@ -1,8 +1,8 @@ diff --git a/BUILD.gn b/BUILD.gn -index 8640517ae5..2e140a9107 100644 +index efca4a626f..3ce80f2d39 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -2008,6 +2008,8 @@ v8_source_set("v8_base_without_compiler") { +@@ -1975,6 +1975,8 @@ v8_source_set("v8_base_without_compiler") { "include/v8-wasm-trap-handler-posix.h", "include/v8.h", "include/v8config.h", @@ -11,296 +11,10 @@ index 8640517ae5..2e140a9107 100644 "src/api/api-arguments-inl.h", "src/api/api-arguments.cc", "src/api/api-arguments.h", -diff --git a/src/V8NativeScriptExtension.cc b/src/V8NativeScriptExtension.cc -new file mode 100644 -index 0000000000..2d9e1401dc ---- /dev/null -+++ b/src/V8NativeScriptExtension.cc -@@ -0,0 +1,212 @@ -+#include "V8NativeScriptExtension.h" -+#include "objects/objects-inl.h" -+#include "objects/contexts.h" -+#include "objects/keys.h" -+#include "api/api-inl.h" -+#include "common/checks.h" -+#include "common/globals.h" -+#include "handles/handles.h" -+#include "codegen/assembler.h" -+#include -+ -+using namespace v8; -+ -+template -+class unsafe_arr -+{ -+public: -+ unsafe_arr() -+ : m_capacity(16), m_size(0) -+ { -+ m_data = alloc_data(m_capacity); -+ } -+ -+ void push_back(const T& e) -+ { -+ if (m_size == m_capacity) -+ { -+ resize(); -+ } -+ m_data[m_size++] = e; -+ } -+ -+ T* data() const -+ { -+ return m_data; -+ } -+ -+ size_t size() const -+ { -+ return m_size; -+ } -+ -+ static void release_data(T *data) -+ { -+ free(data); -+ } -+ -+private: -+ T* alloc_data(size_t size) -+ { -+ T *data = reinterpret_cast(malloc(size * sizeof(T))); -+ return data; -+ } -+ -+ void resize() -+ { -+ size_t capacity = 2 * m_capacity; -+ T *data = alloc_data(capacity); -+ size_t size = m_size * sizeof(T); -+ memcpy(data, m_data, size); -+ release_data(m_data); -+ m_data = data; -+ m_capacity = capacity; -+ } -+ -+ size_t m_capacity; -+ size_t m_size; -+ T *m_data; -+}; -+ -+ -+NativeScriptExtension::NativeScriptExtension() -+{ -+} -+ -+ -+unsigned long NativeScriptExtension::GetAddress(const Local& obj) -+{ -+ i::Handle h = Utils::OpenHandle(*obj); -+ -+ return h->address(); -+} -+ -+Local* NativeScriptExtension::GetClosureObjects(Isolate* isolate, const Local& func, int* length) -+{ -+ unsafe_arr> arr; -+ -+ i::Handle receiver = Utils::OpenHandle(*func); -+ -+ bool isFunction = receiver->IsJSFunction(); -+ -+ if (!isFunction) { -+ *length = static_cast(arr.size()); -+ return arr.data(); -+ } -+ -+ i::Handle f = i::Handle::cast(receiver); -+ -+ i::Isolate* internal_isolate = reinterpret_cast(isolate); -+ -+ v8::internal::Context cxt = f->context(); -+ -+ i::ContextLookupFlags cxtFlags = i::FOLLOW_CHAINS; -+ -+ if (!cxt.is_null() && !cxt.IsNativeContext()) -+ { -+ v8::internal::ScopeInfo si = cxt.scope_info(); -+ -+ if (!si.is_null() && si.HasContext()) -+ { -+ int len = si.length(); -+ -+ for (int i = 0; i < len; i++) -+ { -+ v8::internal::Object cur = si.get(i); -+ -+ if (!cur.IsNullOrUndefined() && cur.IsString()) -+ { -+ v8::internal::String s = i::String::cast(cur); -+ -+ i::Handle name = i::Handle(s, internal_isolate); -+ -+ i::PropertyAttributes attr; -+ i::InitializationFlag init_flag; -+ i::VariableMode var_mode; -+ int idx; -+ -+ i::Handle cxtHandle = i::Handle(cxt, internal_isolate); -+ i::Handle o = v8::internal::Context::Lookup(cxtHandle, name, cxtFlags, &idx, &attr, &init_flag, &var_mode); -+ -+ if (idx >= 0) -+ { -+ i::Handle hndCxt = i::Handle::cast(o); -+ i::Handle obj = i::Handle(hndCxt->get(idx), internal_isolate); -+ -+ if (!obj.is_null() && obj->IsObject()) -+ { -+ Local local = Utils::ToLocal(obj); -+ -+ arr.push_back(local); -+ } -+ } -+ } -+ } // for -+ } // si != nullptr -+ } -+ -+ *length = static_cast(arr.size()); -+ return arr.data(); -+} -+ -+ -+void NativeScriptExtension::ReleaseClosureObjects(Local* closureObjects) -+{ -+ unsafe_arr>::release_data(closureObjects); -+} -+ -+ -+void NativeScriptExtension::GetAssessorPair(Isolate* isolate, const Local& obj, const Local& propName, Local& getter, Local& setter) -+{ -+ i::Handle o = i::Handle::cast(Utils::OpenHandle(*obj)); -+ -+ i::Handle intname = Utils::OpenHandle(*propName); -+ -+ //Isolate* isolate = object->GetIsolate(); -+ i::Isolate* internal_isolate = reinterpret_cast(isolate); -+ -+ internal::LookupIterator it(internal_isolate, o, intname, internal::LookupIterator::OWN); -+ i::Handle maybe_pair = it.GetAccessors(); -+ -+ // if (maybe_pair->IsAccessorPair()) { -+ i::MaybeHandle g = internal::AccessorPair::GetComponent(internal_isolate, i::Handle::cast(maybe_pair), i::AccessorComponent::ACCESSOR_GETTER); -+ if (!g.is_null()) -+ { -+ getter = Utils::ToLocal(g.ToHandleChecked()); -+ } -+ -+ i::MaybeHandle s = internal::AccessorPair::GetComponent(internal_isolate, i::Handle::cast(maybe_pair), i::AccessorComponent::ACCESSOR_SETTER); -+ if (!s.is_null()) -+ { -+ setter = Utils::ToLocal(s.ToHandleChecked()); -+ } -+ // } -+} -+ -+ -+std::vector> NativeScriptExtension::GetPropertyKeys(Isolate* isolate, const Local& object) -+{ -+ i::Handle obj = i::Handle::cast(Utils::OpenHandle(*object)); -+ i::Isolate* internal_isolate = reinterpret_cast(isolate); -+ -+ i::Handle arr = i::KeyAccumulator::GetOwnEnumPropertyKeys(internal_isolate, obj); -+ -+ int len = arr->length(); -+ -+ std::vector> keys(len); -+ for (int i = 0; i < len; i++) -+ { -+ i::Handle elem = i::Handle(arr->get(i), obj->GetIsolate()); -+ Local val = Utils::ToLocal(elem); -+ if (!val.IsEmpty()) -+ { -+ keys.push_back(val); -+ } -+ } -+ -+ return keys; -+} -+ -+void NativeScriptExtension::CpuFeaturesProbe(bool cross_compile) { -+ i::CpuFeatures::Probe(cross_compile); -+} -diff --git a/src/V8NativeScriptExtension.h b/src/V8NativeScriptExtension.h -new file mode 100644 -index 0000000000..1bb4fc36e0 ---- /dev/null -+++ b/src/V8NativeScriptExtension.h -@@ -0,0 +1,23 @@ -+#include -+#include "init/v8.h" -+#include "api/api.h" -+ -+namespace v8 { -+ -+ class NativeScriptExtension { -+ public: -+ static unsigned long GetAddress(const v8::Local& obj); -+ -+ static v8::Local* GetClosureObjects(v8::Isolate* isolate, const v8::Local& func, int* length); -+ -+ static void ReleaseClosureObjects(v8::Local* closureObjects); -+ -+ static void GetAssessorPair(v8::Isolate* isolate, const v8::Local& obj, const v8::Local& propName, v8::Local& getter, v8::Local& setter); -+ -+ static std::vector> GetPropertyKeys(v8::Isolate* isolate, const v8::Local& object); -+ -+ static void CpuFeaturesProbe(bool cross_compile); -+ private: -+ NativeScriptExtension(); -+ }; -+} -diff --git a/src/inspector/inspector_protocol_config.json b/src/inspector/inspector_protocol_config.json -index c4aa29ce99..1875eb2898 100644 ---- a/src/inspector/inspector_protocol_config.json -+++ b/src/inspector/inspector_protocol_config.json -@@ -26,6 +26,34 @@ - }, - { - "domain": "HeapProfiler" -+ }, -+ { -+ "domain": "Page", -+ "exclude": ["getNavigationHistory", "navigateToHistoryEntry", "resetNavigationHistory", "captureScreenshot", "screencastFrameAck", "handleJavaScriptDialog", "setColorPickerEnabled", "getAppManifest", "setControlNavigations", "processNavigation", "printToPDF", "bringToFront", "setDownloadBehavior", "navigate", "crash", "close", "setWebLifecycleState", "captureSnapshot"], -+ "async": ["getResourceContent", "searchInResource"], -+ "exclude_events": ["screencastFrame", "screencastVisibilityChanged", "colorPicked", "interstitialShown", "interstitialHidden", "javascriptDialogOpening", "javascriptDialogClosed", "navigationRequested"] -+ }, -+ { -+ "domain": "Network", -+ "exclude": ["clearBrowserCache", "clearBrowserCookies", "getCookies", "getAllCookies", "deleteCookies", "setCookie", "setCookies", "canEmulateNetworkConditions", "setRequestInterception", "continueInterceptedRequest", "getResponseBodyForInterception", "takeResponseBodyForInterceptionAsStream"], -+ "async": ["getResponseBody", "getRequestPostData"] -+ }, -+ { -+ "domain": "DOM" -+ }, -+ { -+ "domain": "CSS", -+ "async": ["enable"] -+ }, -+ { -+ "domain": "Overlay" -+ }, -+ { -+ "domain": "Log" -+ }, -+ { -+ "domain": "Security", -+ "include": [] - } - ] - }, -diff --git a/src/inspector/js_protocol.pdl b/src/inspector/js_protocol.pdl +diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index c4ff51b060..1fee8a50a4 100644 ---- a/src/inspector/js_protocol.pdl -+++ b/src/inspector/js_protocol.pdl +--- a/include/js_protocol.pdl ++++ b/include/js_protocol.pdl @@ -1490,3 +1490,3107 @@ deprecated domain Schema returns # List of supported domains. @@ -3208,204 +2922,490 @@ index c4ff51b060..1fee8a50a4 100644 + # user manually inspects an element. + event inspectNodeRequested + parameters -+ # Id of the node to inspect. -+ DOM.BackendNodeId backendNodeId -+ # Fired when the node should be highlighted. This happens after call to `setInspectMode`. -+ event nodeHighlightRequested ++ # Id of the node to inspect. ++ DOM.BackendNodeId backendNodeId ++ # Fired when the node should be highlighted. This happens after call to `setInspectMode`. ++ event nodeHighlightRequested ++ parameters ++ DOM.NodeId nodeId ++ # Fired when user asks to capture screenshot of some area on the page. ++ event screenshotRequested ++ parameters ++ # Viewport to capture, in device independent pixels (dip). ++ Page.Viewport viewport ++ # Fired when user cancels the inspect mode. ++ event inspectModeCanceled ++ ++# Provides access to log entries. ++domain Log ++ depends on Runtime ++ depends on Network ++ # Log entry. ++ type LogEntry extends object ++ properties ++ # Log entry source. ++ enum source ++ xml ++ javascript ++ network ++ storage ++ appcache ++ rendering ++ security ++ deprecation ++ worker ++ violation ++ intervention ++ recommendation ++ other ++ # Log entry severity. ++ enum level ++ verbose ++ info ++ warning ++ error ++ # Logged text. ++ string text ++ # Timestamp when this entry was added. ++ Runtime.Timestamp timestamp ++ # URL of the resource if known. ++ optional string url ++ # Line number in the resource. ++ optional integer lineNumber ++ # JavaScript stack trace. ++ optional Runtime.StackTrace stackTrace ++ # Identifier of the network request associated with this entry. ++ optional Network.RequestId networkRequestId ++ # Identifier of the worker associated with this entry. ++ optional string workerId ++ # Call arguments. ++ optional array of Runtime.RemoteObject args ++ # Violation configuration setting. ++ type ViolationSetting extends object ++ properties ++ # Violation type. ++ enum name ++ longTask ++ longLayout ++ blockedEvent ++ blockedParser ++ discouragedAPIUse ++ handler ++ recurringHandler ++ # Time threshold to trigger upon. ++ number threshold ++ # Clears the log. ++ command clear ++ # Disables log domain, prevents further log entries from being reported to the client. ++ command disable ++ # Enables log domain, sends the entries collected so far to the client by means of the ++ # `entryAdded` notification. ++ command enable ++ # start violation reporting. ++ command startViolationsReport ++ parameters ++ # Configuration for violations. ++ array of ViolationSetting config ++ # Stop violation reporting. ++ command stopViolationsReport ++ # Issued when new message was logged. ++ event entryAdded ++ parameters ++ # The entry. ++ LogEntry entry ++ ++# Security ++domain Security ++ # An internal certificate ID value. ++ type CertificateId extends integer ++ # A description of mixed content (HTTP resources on HTTPS pages), as defined by ++ # https://www.w3.org/TR/mixed-content/#categories ++ type MixedContentType extends string ++ enum ++ blockable ++ optionally-blockable ++ none ++ # The security level of a page or resource. ++ type SecurityState extends string ++ enum ++ unknown ++ neutral ++ insecure ++ secure ++ info ++ # An explanation of an factor contributing to the security state. ++ type SecurityStateExplanation extends object ++ properties ++ # Security state representing the severity of the factor being explained. ++ SecurityState securityState ++ # Title describing the type of factor. ++ string title ++ # Short phrase describing the type of factor. ++ string summary ++ # Full text explanation of the factor. ++ string description ++ # The type of mixed content described by the explanation. ++ MixedContentType mixedContentType ++ # Page certificate. ++ array of string certificate ++ # Recommendations to fix any issues. ++ optional array of string recommendations ++ # Information about insecure content on the page. ++ type InsecureContentStatus extends object ++ properties ++ # True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts. ++ boolean ranMixedContent ++ # True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images. ++ boolean displayedMixedContent ++ # True if the page was loaded over HTTPS and contained a form targeting an insecure url. ++ boolean containedMixedForm ++ # True if the page was loaded over HTTPS without certificate errors, and ran content such as ++ # scripts that were loaded with certificate errors. ++ boolean ranContentWithCertErrors ++ # True if the page was loaded over HTTPS without certificate errors, and displayed content ++ # such as images that were loaded with certificate errors. ++ boolean displayedContentWithCertErrors ++ # Security state representing a page that ran insecure content. ++ SecurityState ranInsecureContentStyle ++ # Security state representing a page that displayed insecure content. ++ SecurityState displayedInsecureContentStyle ++ # The action to take when a certificate error occurs. continue will continue processing the ++ # request and cancel will cancel the request. ++ type CertificateErrorAction extends string ++ enum ++ continue ++ cancel ++ # Disables tracking security state changes. ++ command disable ++ # Enables tracking security state changes. ++ command enable ++ # Enable/disable whether all certificate errors should be ignored. ++ experimental command setIgnoreCertificateErrors ++ parameters ++ # If true, all certificate errors will be ignored. ++ boolean ignore ++ # Handles a certificate error that fired a certificateError event. ++ deprecated command handleCertificateError ++ parameters ++ # The ID of the event. ++ integer eventId ++ # The action to take on the certificate error. ++ CertificateErrorAction action ++ # Enable/disable overriding certificate errors. If enabled, all certificate error events need to ++ # be handled by the DevTools client and should be answered with `handleCertificateError` commands. ++ deprecated command setOverrideCertificateErrors + parameters -+ DOM.NodeId nodeId -+ # Fired when user asks to capture screenshot of some area on the page. -+ event screenshotRequested ++ # If true, certificate errors will be overridden. ++ boolean override ++ # There is a certificate error. If overriding certificate errors is enabled, then it should be ++ # handled with the `handleCertificateError` command. Note: this event does not fire if the ++ # certificate error has been allowed internally. Only one client per target should override ++ # certificate errors at the same time. ++ deprecated event certificateError + parameters -+ # Viewport to capture, in device independent pixels (dip). -+ Page.Viewport viewport -+ # Fired when user cancels the inspect mode. -+ event inspectModeCanceled ++ # The ID of the event. ++ integer eventId ++ # The type of the error. ++ string errorType ++ # The url that was requested. ++ string requestURL ++ # The security state of the page changed. ++ event securityStateChanged ++ parameters ++ # Security state. ++ SecurityState securityState ++ # True if the page was loaded over cryptographic transport such as HTTPS. ++ boolean schemeIsCryptographic ++ # List of explanations for the security state. If the overall security state is `insecure` or ++ # `warning`, at least one corresponding explanation should be included. ++ array of SecurityStateExplanation explanations ++ # Information about insecure content on the page. ++ InsecureContentStatus insecureContentStatus ++ # Overrides user-visible description of the state. ++ optional string summary +diff --git a/src/V8NativeScriptExtension.cc b/src/V8NativeScriptExtension.cc +new file mode 100644 +index 0000000000..3d4641157a +--- /dev/null ++++ b/src/V8NativeScriptExtension.cc +@@ -0,0 +1,212 @@ ++#include "V8NativeScriptExtension.h" ++#include "objects/objects-inl.h" ++#include "objects/contexts.h" ++#include "objects/keys.h" ++#include "api/api-inl.h" ++#include "common/checks.h" ++#include "common/globals.h" ++#include "handles/handles.h" ++#include "codegen/assembler.h" ++#include ++ ++using namespace v8; ++ ++template ++class unsafe_arr ++{ ++public: ++ unsafe_arr() ++ : m_capacity(16), m_size(0) ++ { ++ m_data = alloc_data(m_capacity); ++ } ++ ++ void push_back(const T& e) ++ { ++ if (m_size == m_capacity) ++ { ++ resize(); ++ } ++ m_data[m_size++] = e; ++ } ++ ++ T* data() const ++ { ++ return m_data; ++ } ++ ++ size_t size() const ++ { ++ return m_size; ++ } ++ ++ static void release_data(T *data) ++ { ++ free(data); ++ } ++ ++private: ++ T* alloc_data(size_t size) ++ { ++ T *data = reinterpret_cast(malloc(size * sizeof(T))); ++ return data; ++ } ++ ++ void resize() ++ { ++ size_t capacity = 2 * m_capacity; ++ T *data = alloc_data(capacity); ++ size_t size = m_size * sizeof(T); ++ memcpy(data, m_data, size); ++ release_data(m_data); ++ m_data = data; ++ m_capacity = capacity; ++ } ++ ++ size_t m_capacity; ++ size_t m_size; ++ T *m_data; ++}; ++ ++ ++NativeScriptExtension::NativeScriptExtension() ++{ ++} ++ ++ ++unsigned long NativeScriptExtension::GetAddress(const Local& obj) ++{ ++ i::Handle h = Utils::OpenHandle(*obj); ++ ++ return h->address(); ++} ++ ++Local* NativeScriptExtension::GetClosureObjects(Isolate* isolate, const Local& func, int* length) ++{ ++ unsafe_arr> arr; ++ ++ i::Handle receiver = Utils::OpenHandle(*func); ++ ++ bool isFunction = receiver->IsJSFunction(); ++ ++ if (!isFunction) { ++ *length = static_cast(arr.size()); ++ return arr.data(); ++ } ++ ++ i::Handle f = i::Handle::cast(receiver); ++ ++ i::Isolate* internal_isolate = reinterpret_cast(isolate); ++ ++ v8::internal::Context cxt = f->context(); ++ ++ i::ContextLookupFlags cxtFlags = i::FOLLOW_CHAINS; ++ ++ if (!cxt.is_null() && !cxt.IsNativeContext()) ++ { ++ v8::internal::ScopeInfo si = cxt.scope_info(); ++ ++ if (!si.is_null() && si.HasContext()) ++ { ++ int len = si.length(); ++ ++ for (int i = 0; i < len; i++) ++ { ++ v8::internal::Object cur = si.get(i); ++ ++ if (!cur.IsNullOrUndefined() && cur.IsString()) ++ { ++ v8::internal::String s = i::String::cast(cur); ++ ++ i::Handle name = i::Handle(s, internal_isolate); ++ ++ i::PropertyAttributes attr; ++ i::InitializationFlag init_flag; ++ i::VariableMode var_mode; ++ int idx; ++ ++ i::Handle cxtHandle = i::Handle(cxt, internal_isolate); ++ i::Handle o = v8::internal::Context::Lookup(cxtHandle, name, cxtFlags, &idx, &attr, &init_flag, &var_mode); ++ ++ if (idx >= 0) ++ { ++ i::Handle hndCxt = i::Handle::cast(o); ++ i::Handle obj = i::Handle(hndCxt->get(idx), internal_isolate); ++ ++ if (!obj.is_null() && obj->IsObject()) ++ { ++ Local local = Utils::ToLocal(obj); ++ ++ arr.push_back(local); ++ } ++ } ++ } ++ } // for ++ } // si != nullptr ++ } ++ ++ *length = static_cast(arr.size()); ++ return arr.data(); ++} ++ ++ ++void NativeScriptExtension::ReleaseClosureObjects(Local* closureObjects) ++{ ++ unsafe_arr>::release_data(closureObjects); ++} ++ ++ ++void NativeScriptExtension::GetAssessorPair(Isolate* isolate, const Local& obj, const Local& propName, Local& getter, Local& setter) ++{ ++ i::Handle o = i::Handle::cast(Utils::OpenHandle(*obj)); ++ ++ i::Handle intname = Utils::OpenHandle(*propName); ++ ++ //Isolate* isolate = object->GetIsolate(); ++ i::Isolate* internal_isolate = reinterpret_cast(isolate); ++ ++ internal::LookupIterator it(internal_isolate, o, intname, internal::LookupIterator::OWN); ++ i::Handle maybe_pair = it.GetAccessors(); ++ ++ // if (maybe_pair->IsAccessorPair()) { ++ i::MaybeHandle g = internal::AccessorPair::GetComponent(internal_isolate, i::Handle::cast(maybe_pair), i::AccessorComponent::ACCESSOR_GETTER); ++ if (!g.is_null()) ++ { ++ getter = Utils::ToLocal(g.ToHandleChecked()); ++ } ++ ++ i::MaybeHandle s = internal::AccessorPair::GetComponent(internal_isolate, i::Handle::cast(maybe_pair), i::AccessorComponent::ACCESSOR_SETTER); ++ if (!s.is_null()) ++ { ++ setter = Utils::ToLocal(s.ToHandleChecked()); ++ } ++ // } ++} ++ ++ ++std::vector> NativeScriptExtension::GetPropertyKeys(Isolate* isolate, const Local& object) ++{ ++ i::Handle obj = i::Handle::cast(Utils::OpenHandle(*object)); ++ i::Isolate* internal_isolate = reinterpret_cast(isolate); ++ ++ i::Handle arr = i::KeyAccumulator::GetOwnEnumPropertyKeys(internal_isolate, obj); ++ ++ int len = arr->length(); ++ ++ std::vector> keys(len); ++ for (int i = 0; i < len; i++) ++ { ++ i::Handle elem = i::Handle(arr->get(i), obj->GetIsolate()); ++ Local val = Utils::ToLocal(elem); ++ if (!val.IsEmpty()) ++ { ++ keys.push_back(val); ++ } ++ } ++ ++ return keys; ++} + -+# Provides access to log entries. -+domain Log -+ depends on Runtime -+ depends on Network -+ # Log entry. -+ type LogEntry extends object -+ properties -+ # Log entry source. -+ enum source -+ xml -+ javascript -+ network -+ storage -+ appcache -+ rendering -+ security -+ deprecation -+ worker -+ violation -+ intervention -+ recommendation -+ other -+ # Log entry severity. -+ enum level -+ verbose -+ info -+ warning -+ error -+ # Logged text. -+ string text -+ # Timestamp when this entry was added. -+ Runtime.Timestamp timestamp -+ # URL of the resource if known. -+ optional string url -+ # Line number in the resource. -+ optional integer lineNumber -+ # JavaScript stack trace. -+ optional Runtime.StackTrace stackTrace -+ # Identifier of the network request associated with this entry. -+ optional Network.RequestId networkRequestId -+ # Identifier of the worker associated with this entry. -+ optional string workerId -+ # Call arguments. -+ optional array of Runtime.RemoteObject args -+ # Violation configuration setting. -+ type ViolationSetting extends object -+ properties -+ # Violation type. -+ enum name -+ longTask -+ longLayout -+ blockedEvent -+ blockedParser -+ discouragedAPIUse -+ handler -+ recurringHandler -+ # Time threshold to trigger upon. -+ number threshold -+ # Clears the log. -+ command clear -+ # Disables log domain, prevents further log entries from being reported to the client. -+ command disable -+ # Enables log domain, sends the entries collected so far to the client by means of the -+ # `entryAdded` notification. -+ command enable -+ # start violation reporting. -+ command startViolationsReport -+ parameters -+ # Configuration for violations. -+ array of ViolationSetting config -+ # Stop violation reporting. -+ command stopViolationsReport -+ # Issued when new message was logged. -+ event entryAdded -+ parameters -+ # The entry. -+ LogEntry entry ++void NativeScriptExtension::CpuFeaturesProbe(bool cross_compile) { ++ i::CpuFeatures::Probe(cross_compile); ++} +diff --git a/src/V8NativeScriptExtension.h b/src/V8NativeScriptExtension.h +new file mode 100644 +index 0000000000..1bb4fc36e0 +--- /dev/null ++++ b/src/V8NativeScriptExtension.h +@@ -0,0 +1,23 @@ ++#include ++#include "init/v8.h" ++#include "api/api.h" + -+# Security -+domain Security -+ # An internal certificate ID value. -+ type CertificateId extends integer -+ # A description of mixed content (HTTP resources on HTTPS pages), as defined by -+ # https://www.w3.org/TR/mixed-content/#categories -+ type MixedContentType extends string -+ enum -+ blockable -+ optionally-blockable -+ none -+ # The security level of a page or resource. -+ type SecurityState extends string -+ enum -+ unknown -+ neutral -+ insecure -+ secure -+ info -+ # An explanation of an factor contributing to the security state. -+ type SecurityStateExplanation extends object -+ properties -+ # Security state representing the severity of the factor being explained. -+ SecurityState securityState -+ # Title describing the type of factor. -+ string title -+ # Short phrase describing the type of factor. -+ string summary -+ # Full text explanation of the factor. -+ string description -+ # The type of mixed content described by the explanation. -+ MixedContentType mixedContentType -+ # Page certificate. -+ array of string certificate -+ # Recommendations to fix any issues. -+ optional array of string recommendations -+ # Information about insecure content on the page. -+ type InsecureContentStatus extends object -+ properties -+ # True if the page was loaded over HTTPS and ran mixed (HTTP) content such as scripts. -+ boolean ranMixedContent -+ # True if the page was loaded over HTTPS and displayed mixed (HTTP) content such as images. -+ boolean displayedMixedContent -+ # True if the page was loaded over HTTPS and contained a form targeting an insecure url. -+ boolean containedMixedForm -+ # True if the page was loaded over HTTPS without certificate errors, and ran content such as -+ # scripts that were loaded with certificate errors. -+ boolean ranContentWithCertErrors -+ # True if the page was loaded over HTTPS without certificate errors, and displayed content -+ # such as images that were loaded with certificate errors. -+ boolean displayedContentWithCertErrors -+ # Security state representing a page that ran insecure content. -+ SecurityState ranInsecureContentStyle -+ # Security state representing a page that displayed insecure content. -+ SecurityState displayedInsecureContentStyle -+ # The action to take when a certificate error occurs. continue will continue processing the -+ # request and cancel will cancel the request. -+ type CertificateErrorAction extends string -+ enum -+ continue -+ cancel -+ # Disables tracking security state changes. -+ command disable -+ # Enables tracking security state changes. -+ command enable -+ # Enable/disable whether all certificate errors should be ignored. -+ experimental command setIgnoreCertificateErrors -+ parameters -+ # If true, all certificate errors will be ignored. -+ boolean ignore -+ # Handles a certificate error that fired a certificateError event. -+ deprecated command handleCertificateError -+ parameters -+ # The ID of the event. -+ integer eventId -+ # The action to take on the certificate error. -+ CertificateErrorAction action -+ # Enable/disable overriding certificate errors. If enabled, all certificate error events need to -+ # be handled by the DevTools client and should be answered with `handleCertificateError` commands. -+ deprecated command setOverrideCertificateErrors -+ parameters -+ # If true, certificate errors will be overridden. -+ boolean override -+ # There is a certificate error. If overriding certificate errors is enabled, then it should be -+ # handled with the `handleCertificateError` command. Note: this event does not fire if the -+ # certificate error has been allowed internally. Only one client per target should override -+ # certificate errors at the same time. -+ deprecated event certificateError -+ parameters -+ # The ID of the event. -+ integer eventId -+ # The type of the error. -+ string errorType -+ # The url that was requested. -+ string requestURL -+ # The security state of the page changed. -+ event securityStateChanged -+ parameters -+ # Security state. -+ SecurityState securityState -+ # True if the page was loaded over cryptographic transport such as HTTPS. -+ boolean schemeIsCryptographic -+ # List of explanations for the security state. If the overall security state is `insecure` or -+ # `warning`, at least one corresponding explanation should be included. -+ array of SecurityStateExplanation explanations -+ # Information about insecure content on the page. -+ InsecureContentStatus insecureContentStatus -+ # Overrides user-visible description of the state. -+ optional string summary ++namespace v8 { ++ ++ class NativeScriptExtension { ++ public: ++ static unsigned long GetAddress(const v8::Local& obj); ++ ++ static v8::Local* GetClosureObjects(v8::Isolate* isolate, const v8::Local& func, int* length); ++ ++ static void ReleaseClosureObjects(v8::Local* closureObjects); ++ ++ static void GetAssessorPair(v8::Isolate* isolate, const v8::Local& obj, const v8::Local& propName, v8::Local& getter, v8::Local& setter); ++ ++ static std::vector> GetPropertyKeys(v8::Isolate* isolate, const v8::Local& object); ++ ++ static void CpuFeaturesProbe(bool cross_compile); ++ private: ++ NativeScriptExtension(); ++ }; ++} +diff --git a/src/inspector/inspector_protocol_config.json b/src/inspector/inspector_protocol_config.json +index 684940c885..077ff61b6d 100644 +--- a/src/inspector/inspector_protocol_config.json ++++ b/src/inspector/inspector_protocol_config.json +@@ -26,6 +26,34 @@ + }, + { + "domain": "HeapProfiler" ++ }, ++ { ++ "domain": "Page", ++ "exclude": ["getNavigationHistory", "navigateToHistoryEntry", "resetNavigationHistory", "captureScreenshot", "screencastFrameAck", "handleJavaScriptDialog", "setColorPickerEnabled", "getAppManifest", "setControlNavigations", "processNavigation", "printToPDF", "bringToFront", "setDownloadBehavior", "navigate", "crash", "close", "setWebLifecycleState", "captureSnapshot"], ++ "async": ["getResourceContent", "searchInResource"], ++ "exclude_events": ["screencastFrame", "screencastVisibilityChanged", "colorPicked", "interstitialShown", "interstitialHidden", "javascriptDialogOpening", "javascriptDialogClosed", "navigationRequested"] ++ }, ++ { ++ "domain": "Network", ++ "exclude": ["clearBrowserCache", "clearBrowserCookies", "getCookies", "getAllCookies", "deleteCookies", "setCookie", "setCookies", "canEmulateNetworkConditions", "setRequestInterception", "continueInterceptedRequest", "getResponseBodyForInterception", "takeResponseBodyForInterceptionAsStream"], ++ "async": ["getResponseBody", "getRequestPostData"] ++ }, ++ { ++ "domain": "DOM" ++ }, ++ { ++ "domain": "CSS", ++ "async": ["enable"] ++ }, ++ { ++ "domain": "Overlay" ++ }, ++ { ++ "domain": "Log" ++ }, ++ { ++ "domain": "Security", ++ "include": [] + } + ] + }, diff --git a/README.md b/README.md index 1993a994f3..b81ec68e32 100644 --- a/README.md +++ b/README.md @@ -54,10 +54,10 @@ solutions = [ target_os = ['android'] ``` -* checkout tag 7.6.303.28 +* checkout tag 7.7.299.11 ``` cd v8 -git checkout 7.6.303.28 +git checkout 7.7.299.11 ``` * Run sync diff --git a/build.sh b/build.sh index c8c8f8b0d7..1541a0acac 100755 --- a/build.sh +++ b/build.sh @@ -52,15 +52,16 @@ for CURRENT_ARCH in ${ARCH_ARR[@]} do ARGS= if [[ $BUILD_TYPE == "debug" ]] ;then - gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=$IS_COMPONENT_BUILD v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_debug=true symbol_level=2 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" if $IS_LINUX; then - gn gen $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=false v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_debug=true symbol_level=2 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" + gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=$IS_COMPONENT_BUILD v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_debug=true symbol_level=2 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" fi + gn gen $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=false v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_debug=true symbol_level=2 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" else - gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=$IS_COMPONENT_BUILD v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_official_build=true use_thin_lto=false is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" if $IS_LINUX; then - gn gen $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=false v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_official_build=true use_thin_lto=false is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" + gn gen $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=$IS_COMPONENT_BUILD v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_official_build=true use_thin_lto=false is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" fi + gn gen $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE --args="is_component_build=false v8_use_snapshot=true v8_use_external_startup_data=true v8_enable_embedded_builtins=true is_official_build=true use_thin_lto=false is_debug=false symbol_level=0 target_cpu=\"$CURRENT_ARCH\" v8_target_cpu=\"$CURRENT_ARCH\" v8_enable_i18n_support=false target_os=\"android\" v8_android_log_stdout=false" + fi done @@ -72,28 +73,31 @@ do V8_FOLDERS=(v8_compiler v8_base_without_compiler v8_libplatform v8_libbase v8_libsampler v8_external_snapshot v8_initializers v8_init torque_generated_initializers) SECONDS=0 - ninja -C $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE ${V8_FOLDERS[@]} inspector if $IS_LINUX; then - ninja -C $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE run_mksnapshot_default + ninja -C $BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE ${V8_FOLDERS[@]} inspector fi + ninja -C $BUILD_DIR_PREFIX/$SNAPSHOT_PREFIX$CURRENT_ARCH-$BUILD_TYPE run_mksnapshot_default + echo "build finished in $SECONDS seconds" DIST="./dist/" mkdir -p $DIST/$CURRENT_ARCH-$BUILD_TYPE - CURRENT_BUILD_TOOL=${NDK_BUILD_TOOLS_ARR[$COUNT]} - COUNT=$COUNT+1 - V8_FOLDERS_LEN=${#V8_FOLDERS[@]} - LAST_PARAM="" - for CURRENT_V8_FOLDER in ${V8_FOLDERS[@]} - do - LAST_PARAM="${LAST_PARAM} ${BUILD_DIR_PREFIX}/${CURRENT_ARCH}-${BUILD_TYPE}/obj/${CURRENT_V8_FOLDER}/*.o" - done - - THIRD_PARTY_OUT=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/buildtools/third_party - LAST_PARAM="${LAST_PARAM} $THIRD_PARTY_OUT/libc++/libc++/*.o $THIRD_PARTY_OUT/libc++abi/libc++abi/*.o" - - eval $CURRENT_BUILD_TOOL/ar r $DIST/$CURRENT_ARCH-$BUILD_TYPE/libv8.a "${LAST_PARAM}" + if $IS_LINUX; then + CURRENT_BUILD_TOOL=${NDK_BUILD_TOOLS_ARR[$COUNT]} + COUNT=$COUNT+1 + V8_FOLDERS_LEN=${#V8_FOLDERS[@]} + LAST_PARAM="" + for CURRENT_V8_FOLDER in ${V8_FOLDERS[@]} + do + LAST_PARAM="${LAST_PARAM} ${BUILD_DIR_PREFIX}/${CURRENT_ARCH}-${BUILD_TYPE}/obj/${CURRENT_V8_FOLDER}/*.o" + done + + THIRD_PARTY_OUT=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/obj/buildtools/third_party + LAST_PARAM="${LAST_PARAM} $THIRD_PARTY_OUT/libc++/libc++/*.o $THIRD_PARTY_OUT/libc++abi/libc++abi/*.o" + + eval $CURRENT_BUILD_TOOL/ar r $DIST/$CURRENT_ARCH-$BUILD_TYPE/libv8.a "${LAST_PARAM}" + fi echo "==================================" echo "==================================" @@ -116,28 +120,30 @@ do cp -r $SOURCE_DIR/mksnapshot $DIST - echo "==================================" - echo "==================================" - echo "Preparing snapshot headers for $CURRENT_ARCH" - echo "==================================" - echo "==================================" - - INCLUDE="$(pwd)/dist/$CURRENT_ARCH-$BUILD_TYPE/include" - mkdir -p $INCLUDE - - SOURCE_DIR= - if [[ $CURRENT_ARCH == "arm64" ]] ;then - SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x64_v8_$CURRENT_ARCH - elif [[ $CURRENT_ARCH == "arm" ]] ;then - SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x86_v8_$CURRENT_ARCH - elif [[ $CURRENT_ARCH == "x86" ]] ;then - SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x86 - elif [[ $CURRENT_ARCH == "x64" ]] ;then - SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x64 + if $IS_LINUX; then + echo "==================================" + echo "==================================" + echo "Preparing snapshot headers for $CURRENT_ARCH" + echo "==================================" + echo "==================================" + + INCLUDE="$(pwd)/dist/$CURRENT_ARCH-$BUILD_TYPE/include" + mkdir -p $INCLUDE + + SOURCE_DIR= + if [[ $CURRENT_ARCH == "arm64" ]] ;then + SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x64_v8_$CURRENT_ARCH + elif [[ $CURRENT_ARCH == "arm" ]] ;then + SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x86_v8_$CURRENT_ARCH + elif [[ $CURRENT_ARCH == "x86" ]] ;then + SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x86 + elif [[ $CURRENT_ARCH == "x64" ]] ;then + SOURCE_DIR=$BUILD_DIR_PREFIX/$CURRENT_ARCH-$BUILD_TYPE/clang_x64 + fi + + pushd $SOURCE_DIR/.. + xxd -i snapshot_blob.bin > $INCLUDE/snapshot_blob.h + xxd -i natives_blob.bin > $INCLUDE/natives_blob.h + popd fi - - pushd $SOURCE_DIR/.. - xxd -i snapshot_blob.bin > $INCLUDE/snapshot_blob.h - xxd -i natives_blob.bin > $INCLUDE/natives_blob.h - popd done