From 3661fca1388cd08344a87f0968b781e01b62f15c Mon Sep 17 00:00:00 2001 From: ClearScript Date: Sat, 8 Apr 2023 14:24:38 -0400 Subject: [PATCH] Version 7.4.1: Performance improvements: .NET method arguments and property/field values are now passed pre-decoded, eliminating decoding hops; property, field, and constructor bind caching accelerates re-invocation. Further refined HeapExpansionMultiplier handling; miscellaneous NuGet package updates. Tested with V8 11.2.214.13. --- ClearScript/Exports/VersionSymbols.h | 6 +- ClearScript/HostItem.InvokeMethod.cs | 6 +- ClearScript/HostItem.cs | 124 +- ClearScript/HostObject.cs | 2 +- ClearScript/HostSettings.cs | 2 +- ClearScript/Properties/AssemblyInfo.Core.cs | 10 +- .../Properties/AssemblyInfo.V8.ICUData.cs | 6 +- ClearScript/Properties/AssemblyInfo.V8.cs | 6 +- .../Properties/AssemblyInfo.Windows.Core.cs | 6 +- .../Properties/AssemblyInfo.Windows.cs | 6 +- ClearScript/ScriptEngine.cs | 77 +- ClearScript/Util/ArrayHelpers.cs | 2 +- ClearScript/Util/MemberComparer.cs | 2 +- ClearScript/Util/SpecialMemberNames.cs | 6 +- ClearScript/Util/SpecialParamNames.cs | 2 +- ClearScript/Util/TypeHelpers.cs | 17 +- .../V8/SplitProxy/IV8SplitProxyNative.cs | 2 +- .../V8/SplitProxy/V8SplitProxyHelpers.cs | 161 +- .../V8/SplitProxy/V8SplitProxyManaged.Net5.cs | 20 +- .../V8/SplitProxy/V8SplitProxyManaged.cs | 26 +- .../SplitProxy/V8SplitProxyNative.Common.tt | 11 +- .../V8SplitProxyNative.Generated.cs | 88 +- .../V8SplitProxyNative.UWP.Generated.cs | 33 +- ClearScript/V8/V8Runtime.cs | 4 +- .../ClearScriptBenchmarks.Unix.cs | 2 +- .../ClearScriptBenchmarks.Windows.cs | 2 +- .../Properties/AssemblyInfo.cs | 6 +- ClearScriptConsole/ClearScriptConsole.cs | 9 + ClearScriptConsole/Properties/AssemblyInfo.cs | 6 +- ClearScriptTest/BugFixTest.cs | 2 +- ClearScriptTest/Properties/AssemblyInfo.cs | 6 +- ClearScriptTest/V8ScriptEngineTest.cs | 55 + ClearScriptV8/HostObjectUtil.cpp | 52 +- ClearScriptV8/V8IsolateImpl.cpp | 21 +- ClearScriptV8/V8SplitProxyManaged.h | 8 +- ClearScriptV8/V8SplitProxyNative.cpp | 156 +- ClearScriptV8/V8SplitProxyNative.h | 2 +- ClearScriptV8/V8Value.h | 44 +- NuGet/files/License.txt | 1509 ++++++++++++++++- ReadMe.md | 2 +- Unix/V8Update.sh | 2 +- V8/V8Patch.txt | 107 +- V8Update.cmd | 2 +- Version.tt | 2 +- docs/Gemfile.lock | 45 +- 45 files changed, 2197 insertions(+), 468 deletions(-) diff --git a/ClearScript/Exports/VersionSymbols.h b/ClearScript/Exports/VersionSymbols.h index 125af0aa..af3e48c9 100644 --- a/ClearScript/Exports/VersionSymbols.h +++ b/ClearScript/Exports/VersionSymbols.h @@ -5,7 +5,7 @@ #pragma once -#define CLEARSCRIPT_VERSION_STRING "7.4.0" -#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,4,0 -#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.4.0" +#define CLEARSCRIPT_VERSION_STRING "7.4.1" +#define CLEARSCRIPT_VERSION_COMMA_SEPARATED 7,4,1 +#define CLEARSCRIPT_VERSION_STRING_INFORMATIONAL "7.4.1" #define CLEARSCRIPT_FILE_FLAGS 0L diff --git a/ClearScript/HostItem.InvokeMethod.cs b/ClearScript/HostItem.InvokeMethod.cs index 21246ae3..80c9a47a 100644 --- a/ClearScript/HostItem.InvokeMethod.cs +++ b/ClearScript/HostItem.InvokeMethod.cs @@ -111,7 +111,7 @@ namespace Microsoft.ClearScript var signature = new BindSignature(AccessContext, bindFlags, Target, name, typeArgs, bindArgs); MethodBindResult result; - if (Engine.TryGetCachedBindResult(signature, out var rawResult)) + if (Engine.TryGetCachedMethodBindResult(signature, out var rawResult)) { result = MethodBindResult.Create(name, bindFlags, rawResult, Target, args); } @@ -154,7 +154,7 @@ namespace Microsoft.ClearScript } } - Engine.CacheBindResult(signature, result.RawResult); + Engine.CacheMethodBindResult(signature, result.RawResult); } return result; @@ -422,7 +422,7 @@ namespace Microsoft.ClearScript #region unit test support - internal static void ResetCoreBindCache() + internal static void ClearCoreBindCache() { coreBindCache.Clear(); Interlocked.Exchange(ref coreBindCount, 0); diff --git a/ClearScript/HostItem.cs b/ClearScript/HostItem.cs index 967ffcd9..8e46ca26 100644 --- a/ClearScript/HostItem.cs +++ b/ClearScript/HostItem.cs @@ -1235,7 +1235,7 @@ namespace Microsoft.ClearScript return DelegateFactory.CreateDelegate(Engine, args[0], specificType); } - return specificType.CreateInstance(this, AccessContext, DefaultAccess, args, bindArgs); + return specificType.CreateInstance(this, Target, args, bindArgs); } } @@ -1255,7 +1255,7 @@ namespace Microsoft.ClearScript return DelegateFactory.CreateDelegate(Engine, args[0], type); } - return type.CreateInstance(this, AccessContext, DefaultAccess, args, bindArgs); + return type.CreateInstance(this, Target, args, bindArgs); } if (TargetDynamicMetaObject != null) @@ -1386,12 +1386,26 @@ namespace Microsoft.ClearScript { isCacheable = false; + var signature = new BindSignature(AccessContext, invokeFlags, Target, name, ArrayHelpers.GetEmptyArray(), bindArgs); + if (Engine.TryGetCachedPropertyGetBindResult(signature, out var boundMember)) + { + if (boundMember is PropertyInfo boundProperty) + { + return GetHostPropertyWorker(boundProperty, boundProperty.GetMethod, args); + } + + if (boundMember is FieldInfo boundField) + { + return GetHostFieldWorker(boundField, out isCacheable); + } + } + if (name == SpecialMemberNames.Default) { var defaultProperty = Target.Type.GetScriptableDefaultProperty(invokeFlags, args, bindArgs, AccessContext, DefaultAccess); if (defaultProperty != null) { - return GetHostProperty(defaultProperty, invokeFlags, args); + return GetHostProperty(signature, defaultProperty, invokeFlags, args); } if (TargetDynamicMetaObject != null) @@ -1476,7 +1490,7 @@ namespace Microsoft.ClearScript var property = Target.Type.GetScriptableProperty(name, invokeFlags, args, bindArgs, AccessContext, DefaultAccess); if (property != null) { - return GetHostProperty(property, invokeFlags, args); + return GetHostProperty(signature, property, invokeFlags, args); } if (args.Length > 0) @@ -1494,9 +1508,7 @@ namespace Microsoft.ClearScript var field = Target.Type.GetScriptableField(name, invokeFlags, AccessContext, DefaultAccess); if (field != null) { - var result = field.GetValue(Target.InvokeTarget); - isCacheable = (TargetDynamicMetaObject == null) && (field.IsLiteral || field.IsInitOnly); - return Engine.PrepareResult(result, field.FieldType, field.GetScriptMemberFlags(), false); + return GetHostField(signature, field, out isCacheable); } if (includeBoundMembers) @@ -1539,7 +1551,7 @@ namespace Microsoft.ClearScript return Nonexistent.Value; } - private object GetHostProperty(PropertyInfo property, BindingFlags invokeFlags, object[] args) + private object GetHostProperty(BindSignature signature, PropertyInfo property, BindingFlags invokeFlags, object[] args) { if (reflectionProperties.Contains(property, MemberComparer.Instance)) { @@ -1569,11 +1581,46 @@ namespace Microsoft.ClearScript throw new UnauthorizedAccessException("The property get method is unavailable or inaccessible"); } + var result = GetHostPropertyWorker(property, getMethod, args); + Engine.CachePropertyGetBindResult(signature, property); + return result; + } + + private object GetHostPropertyWorker(PropertyInfo property, MethodInfo getMethod, object[] args) + { return InvokeHelpers.InvokeMethod(this, getMethod, Target.InvokeTarget, args, property.GetScriptMemberFlags()); } + private object GetHostField(BindSignature signature, FieldInfo field, out bool isCacheable) + { + var result = GetHostFieldWorker(field, out isCacheable); + Engine.CachePropertyGetBindResult(signature, field); + return result; + } + + private object GetHostFieldWorker(FieldInfo field, out bool isCacheable) + { + var result = field.GetValue(Target.InvokeTarget); + isCacheable = (TargetDynamicMetaObject == null) && (field.IsLiteral || field.IsInitOnly); + return Engine.PrepareResult(result, field.FieldType, field.GetScriptMemberFlags(), false); + } + private object SetHostProperty(string name, BindingFlags invokeFlags, object[] args, object[] bindArgs) { + var signature = new BindSignature(AccessContext, invokeFlags, Target, name, ArrayHelpers.GetEmptyArray(), bindArgs); + if (Engine.TryGetCachedPropertySetBindResult(signature, out var boundMember)) + { + if (boundMember is PropertyInfo boundProperty) + { + return SetHostPropertyWorker(boundProperty, boundProperty.SetMethod, args, bindArgs); + } + + if (boundMember is FieldInfo boundField) + { + return SetHostFieldWorker(boundField, args); + } + } + if (name == SpecialMemberNames.Default) { if (args.Length < 1) @@ -1586,7 +1633,7 @@ namespace Microsoft.ClearScript var defaultProperty = Target.Type.GetScriptableDefaultProperty(invokeFlags, args.Take(args.Length - 1).ToArray(), bindArgs.Take(bindArgs.Length - 1).ToArray(), AccessContext, DefaultAccess); if (defaultProperty != null) { - return SetHostProperty(defaultProperty, args, bindArgs); + return SetHostProperty(signature, defaultProperty, args, bindArgs); } if (args.Length < 2) @@ -1641,36 +1688,19 @@ namespace Microsoft.ClearScript var property = Target.Type.GetScriptableProperty(name, invokeFlags, args.Take(args.Length - 1).ToArray(), bindArgs.Take(bindArgs.Length - 1).ToArray(), AccessContext, DefaultAccess); if (property != null) { - return SetHostProperty(property, args, bindArgs); + return SetHostProperty(signature, property, args, bindArgs); } var field = Target.Type.GetScriptableField(name, invokeFlags, AccessContext, DefaultAccess); if (field != null) { - if (args.Length == 1) - { - if (field.IsLiteral || field.IsInitOnly || field.IsReadOnlyForScript(DefaultAccess)) - { - throw new UnauthorizedAccessException("The field is read-only"); - } - - var value = args[0]; - if (field.FieldType.IsAssignableFromValue(ref value)) - { - field.SetValue(Target.InvokeTarget, value); - return value; - } - - throw new ArgumentException("Invalid field assignment"); - } - - throw new InvalidOperationException("Invalid argument count"); + return SetHostField(signature, field, args); } throw new MissingMemberException(MiscHelpers.FormatInvariant("The object has no suitable property or field named '{0}'", name)); } - private object SetHostProperty(PropertyInfo property, object[] args, object[] bindArgs) + private object SetHostProperty(BindSignature signature, PropertyInfo property, object[] args, object[] bindArgs) { var scriptAccess = property.GetScriptAccess(DefaultAccess); if (scriptAccess == ScriptAccess.ReadOnly) @@ -1684,6 +1714,13 @@ namespace Microsoft.ClearScript throw new UnauthorizedAccessException("The property set method is unavailable or inaccessible"); } + var result = SetHostPropertyWorker(property, setMethod, args, bindArgs); + Engine.CachePropertySetBindResult(signature, property); + return result; + } + + private object SetHostPropertyWorker(PropertyInfo property, MethodInfo setMethod, object[] args, object[] bindArgs) + { var value = args[args.Length - 1]; var argCount = args.Length - 1; @@ -1741,6 +1778,35 @@ namespace Microsoft.ClearScript throw new ArgumentException("Invalid property assignment"); } + private object SetHostField(BindSignature signature, FieldInfo field, object[] args) + { + if (args.Length != 1) + { + throw new InvalidOperationException("Invalid argument count"); + } + + if (field.IsLiteral || field.IsInitOnly || field.IsReadOnlyForScript(DefaultAccess)) + { + throw new UnauthorizedAccessException("The field is read-only"); + } + + var result = SetHostFieldWorker(field, args); + Engine.CachePropertySetBindResult(signature, field); + return result; + } + + private object SetHostFieldWorker(FieldInfo field, object[] args) + { + var value = args[0]; + if (field.FieldType.IsAssignableFromValue(ref value)) + { + field.SetValue(Target.InvokeTarget, value); + return value; + } + + throw new ArgumentException("Invalid field assignment"); + } + private static object CreateScriptableEnumerator(IEnumerable enumerable) { return HostObject.Wrap(new ScriptableEnumeratorOnEnumerator(enumerable.GetEnumerator()), typeof(IScriptableEnumerator)); diff --git a/ClearScript/HostObject.cs b/ClearScript/HostObject.cs index ecc6a1cb..7ebec17a 100644 --- a/ClearScript/HostObject.cs +++ b/ClearScript/HostObject.cs @@ -149,7 +149,7 @@ namespace Microsoft.ClearScript private static class NullWrapper { - public static HostObject Value { get; } = new HostObject(null, typeof(T)); + public static readonly HostObject Value = new HostObject(null, typeof(T)); } // ReSharper restore UnusedMember.Local diff --git a/ClearScript/HostSettings.cs b/ClearScript/HostSettings.cs index f712397a..ece2d822 100644 --- a/ClearScript/HostSettings.cs +++ b/ClearScript/HostSettings.cs @@ -51,6 +51,6 @@ namespace Microsoft.ClearScript } } - internal static CustomAttributeLoader DefaultCustomAttributeLoader { get; } = new CustomAttributeLoader(); + internal static readonly CustomAttributeLoader DefaultCustomAttributeLoader = new CustomAttributeLoader(); } } diff --git a/ClearScript/Properties/AssemblyInfo.Core.cs b/ClearScript/Properties/AssemblyInfo.Core.cs index fb1b012a..828b2f00 100644 --- a/ClearScript/Properties/AssemblyInfo.Core.cs +++ b/ClearScript/Properties/AssemblyInfo.Core.cs @@ -18,15 +18,15 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("ClearScriptTest")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] namespace Microsoft.ClearScript.Properties { internal static class ClearScriptVersion { - public const string Triad = "7.4.0"; - public const string Informational = "7.4.0"; + public const string Triad = "7.4.1"; + public const string Informational = "7.4.1"; } } diff --git a/ClearScript/Properties/AssemblyInfo.V8.ICUData.cs b/ClearScript/Properties/AssemblyInfo.V8.ICUData.cs index 893e207d..3f5f7094 100644 --- a/ClearScript/Properties/AssemblyInfo.V8.ICUData.cs +++ b/ClearScript/Properties/AssemblyInfo.V8.ICUData.cs @@ -15,6 +15,6 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("ClearScript.V8")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScript/Properties/AssemblyInfo.V8.cs b/ClearScript/Properties/AssemblyInfo.V8.cs index 204cd3a4..5f91758a 100644 --- a/ClearScript/Properties/AssemblyInfo.V8.cs +++ b/ClearScript/Properties/AssemblyInfo.V8.cs @@ -15,6 +15,6 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("ClearScriptTest")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScript/Properties/AssemblyInfo.Windows.Core.cs b/ClearScript/Properties/AssemblyInfo.Windows.Core.cs index 36097471..8cf51700 100644 --- a/ClearScript/Properties/AssemblyInfo.Windows.Core.cs +++ b/ClearScript/Properties/AssemblyInfo.Windows.Core.cs @@ -16,6 +16,6 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("ClearScriptTest")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScript/Properties/AssemblyInfo.Windows.cs b/ClearScript/Properties/AssemblyInfo.Windows.cs index b04f3901..92f79ea2 100644 --- a/ClearScript/Properties/AssemblyInfo.Windows.cs +++ b/ClearScript/Properties/AssemblyInfo.Windows.cs @@ -15,6 +15,6 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("ClearScriptTest")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScript/ScriptEngine.cs b/ClearScript/ScriptEngine.cs index e84a599a..d51f07ef 100644 --- a/ClearScript/ScriptEngine.cs +++ b/ClearScript/ScriptEngine.cs @@ -143,7 +143,7 @@ namespace Microsoft.ClearScript if (newExtensionMethodTable != extensionMethodTable) { extensionMethodTable = newExtensionMethodTable; - bindCache.Clear(); + ClearMethodBindCache(); OnAccessSettingsChanged(); } }); @@ -626,6 +626,8 @@ namespace Microsoft.ClearScript internal virtual void OnAccessSettingsChanged() { + ClearConstructorBindCache(); + ClearPropertyBindCache(); } #endregion @@ -760,7 +762,7 @@ namespace Microsoft.ClearScript { if (extensionMethodTable.ProcessType(type, AccessContext, DefaultAccess)) { - bindCache.Clear(); + ClearMethodBindCache(); } } } @@ -777,18 +779,77 @@ namespace Microsoft.ClearScript #endregion - #region bind cache + #region constructor bind cache - private readonly Dictionary bindCache = new Dictionary(); + private readonly Dictionary constructorBindCache = new Dictionary(); - internal void CacheBindResult(BindSignature signature, object result) + internal void CacheConstructorBindResult(BindSignature signature, ConstructorInfo result) { - bindCache.Add(signature, result); + constructorBindCache.Add(signature, result); } - internal bool TryGetCachedBindResult(BindSignature signature, out object result) + internal bool TryGetCachedConstructorBindResult(BindSignature signature, out ConstructorInfo result) { - return bindCache.TryGetValue(signature, out result); + return constructorBindCache.TryGetValue(signature, out result); + } + + private void ClearConstructorBindCache() + { + constructorBindCache.Clear(); + } + + #endregion + + #region method bind cache + + private readonly Dictionary methodBindCache = new Dictionary(); + + internal void CacheMethodBindResult(BindSignature signature, object result) + { + methodBindCache.Add(signature, result); + } + + internal bool TryGetCachedMethodBindResult(BindSignature signature, out object result) + { + return methodBindCache.TryGetValue(signature, out result); + } + + private void ClearMethodBindCache() + { + methodBindCache.Clear(); + } + + #endregion + + #region property bind cache + + private readonly Dictionary propertyGetBindCache = new Dictionary(); + private readonly Dictionary propertySetBindCache = new Dictionary(); + + internal void CachePropertyGetBindResult(BindSignature signature, MemberInfo property) + { + propertyGetBindCache.Add(signature, property); + } + + internal bool TryGetCachedPropertyGetBindResult(BindSignature signature, out MemberInfo property) + { + return propertyGetBindCache.TryGetValue(signature, out property); + } + + internal void CachePropertySetBindResult(BindSignature signature, MemberInfo property) + { + propertySetBindCache.Add(signature, property); + } + + internal bool TryGetCachedPropertySetBindResult(BindSignature signature, out MemberInfo property) + { + return propertySetBindCache.TryGetValue(signature, out property); + } + + private void ClearPropertyBindCache() + { + propertyGetBindCache.Clear(); + propertySetBindCache.Clear(); } #endregion diff --git a/ClearScript/Util/ArrayHelpers.cs b/ClearScript/Util/ArrayHelpers.cs index 9e5a0fa4..a4672793 100644 --- a/ClearScript/Util/ArrayHelpers.cs +++ b/ClearScript/Util/ArrayHelpers.cs @@ -47,7 +47,7 @@ namespace Microsoft.ClearScript.Util private static class EmptyArray { - public static T[] Value { get; } = new T[0]; + public static readonly T[] Value = new T[0]; } #endregion diff --git a/ClearScript/Util/MemberComparer.cs b/ClearScript/Util/MemberComparer.cs index f8b9e6b7..7d9372a8 100644 --- a/ClearScript/Util/MemberComparer.cs +++ b/ClearScript/Util/MemberComparer.cs @@ -8,7 +8,7 @@ namespace Microsoft.ClearScript.Util { internal sealed class MemberComparer : EqualityComparer where T : MemberInfo { - public static MemberComparer Instance { get; } = new MemberComparer(); + public static readonly MemberComparer Instance = new MemberComparer(); private MemberComparer() { diff --git a/ClearScript/Util/SpecialMemberNames.cs b/ClearScript/Util/SpecialMemberNames.cs index 8bd47579..099a1f95 100644 --- a/ClearScript/Util/SpecialMemberNames.cs +++ b/ClearScript/Util/SpecialMemberNames.cs @@ -5,8 +5,8 @@ namespace Microsoft.ClearScript.Util { internal static class SpecialMemberNames { - public static string Default = MiscHelpers.GetDispIDName(SpecialDispIDs.Default); - public static string NewEnum = MiscHelpers.GetDispIDName(SpecialDispIDs.NewEnum); - public static string NewAsyncEnum = MiscHelpers.GetDispIDName(SpecialDispIDs.NewAsyncEnum); + public static readonly string Default = MiscHelpers.GetDispIDName(SpecialDispIDs.Default); + public static readonly string NewEnum = MiscHelpers.GetDispIDName(SpecialDispIDs.NewEnum); + public static readonly string NewAsyncEnum = MiscHelpers.GetDispIDName(SpecialDispIDs.NewAsyncEnum); } } diff --git a/ClearScript/Util/SpecialParamNames.cs b/ClearScript/Util/SpecialParamNames.cs index 47f37865..e24419a1 100644 --- a/ClearScript/Util/SpecialParamNames.cs +++ b/ClearScript/Util/SpecialParamNames.cs @@ -5,6 +5,6 @@ namespace Microsoft.ClearScript.Util { internal static class SpecialParamNames { - public static string This = MiscHelpers.GetDispIDName(SpecialDispIDs.This); + public static readonly string This = MiscHelpers.GetDispIDName(SpecialDispIDs.This); } } diff --git a/ClearScript/Util/TypeHelpers.cs b/ClearScript/Util/TypeHelpers.cs index a1b66909..1630f2a6 100644 --- a/ClearScript/Util/TypeHelpers.cs +++ b/ClearScript/Util/TypeHelpers.cs @@ -485,7 +485,7 @@ namespace Microsoft.ClearScript.Util return type.InvokeMember(string.Empty, BindingFlags.CreateInstance | BindingFlags.Instance | (flags & ~BindingFlags.Static), null, null, args, CultureInfo.InvariantCulture); } - public static object CreateInstance(this Type type, IHostInvokeContext invokeContext, Type accessContext, ScriptAccess defaultAccess, object[] args, object[] bindArgs) + public static object CreateInstance(this Type type, IHostInvokeContext invokeContext, HostTarget target, object[] args, object[] bindArgs) { if (type.IsCOMObject || (type.IsValueType && (args.Length < 1))) { @@ -493,19 +493,26 @@ namespace Microsoft.ClearScript.Util } const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - var candidates = type.GetConstructors(flags).Where(testConstructor => testConstructor.IsAccessible(accessContext) && !testConstructor.IsBlockedFromScript(defaultAccess)).ToArray(); + + var signature = new BindSignature(invokeContext.AccessContext, flags, target, type.TypeHandle.Value.ToString(), ArrayHelpers.GetEmptyArray(), bindArgs); + if (invokeContext.Engine.TryGetCachedConstructorBindResult(signature, out var boundConstructor)) + { + return InvokeHelpers.InvokeConstructor(invokeContext, boundConstructor, args); + } + + var candidates = type.GetConstructors(flags).Where(testConstructor => testConstructor.IsAccessible(invokeContext.AccessContext) && !testConstructor.IsBlockedFromScript(invokeContext.DefaultAccess)).ToArray(); if (candidates.Length < 1) { throw new MissingMethodException(MiscHelpers.FormatInvariant("Type '{0}' has no constructor that matches the specified arguments", type.GetFullFriendlyName())); } - ConstructorInfo constructor = BindToMember(candidates, flags, args, bindArgs); - + var constructor = BindToMember(candidates, flags, args, bindArgs); if (constructor == null) { throw new MissingMethodException(MiscHelpers.FormatInvariant("Type '{0}' has no constructor that matches the specified arguments", type.GetFullFriendlyName())); } + invokeContext.Engine.CacheConstructorBindResult(signature, constructor); return InvokeHelpers.InvokeConstructor(invokeContext, constructor, args); } @@ -1171,7 +1178,7 @@ namespace Microsoft.ClearScript.Util private sealed class PropertySignatureComparer : IEqualityComparer { - public static PropertySignatureComparer Instance { get; } = new PropertySignatureComparer(); + public static readonly PropertySignatureComparer Instance = new PropertySignatureComparer(); #region IEqualityComparer implementation diff --git a/ClearScript/V8/SplitProxy/IV8SplitProxyNative.cs b/ClearScript/V8/SplitProxy/IV8SplitProxyNative.cs index 418a3123..e191429c 100644 --- a/ClearScript/V8/SplitProxy/IV8SplitProxyNative.cs +++ b/ClearScript/V8/SplitProxy/IV8SplitProxyNative.cs @@ -110,7 +110,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy void V8Value_SetBigInt(V8Value.Ptr pV8Value, int signBit, byte[] bytes); void V8Value_SetV8Object(V8Value.Ptr pV8Value, V8Object.Handle hObject, V8Value.Subtype subtype, V8Value.Flags flags); void V8Value_SetHostObject(V8Value.Ptr pV8Value, IntPtr pObject); - V8Value.Type V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle); + void V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded); void V8Value_Delete(V8Value.Ptr pV8Value); #endregion diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyHelpers.cs b/ClearScript/V8/SplitProxy/V8SplitProxyHelpers.cs index 2f69301f..5ab2317d 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyHelpers.cs +++ b/ClearScript/V8/SplitProxy/V8SplitProxyHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. using System; @@ -897,49 +897,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy public static object Get(Ptr pV8Value) { - var intValue = 0; - var uintValue = 0U; - var doubleValue = 0D; - var ptrOrHandle = IntPtr.Zero; - - switch (V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle))) - { - case Type.Nonexistent: - return Nonexistent.Value; - - case Type.Null: - return DBNull.Value; - - case Type.Boolean: - return intValue != 0; - - case Type.Number: - return doubleValue; - - case Type.Int32: - return intValue; - - case Type.UInt32: - return uintValue; - - case Type.String: - return Marshal.PtrToStringUni(ptrOrHandle, intValue); - - case Type.DateTime: - return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + TimeSpan.FromMilliseconds(doubleValue); - - case Type.BigInt: - return TryGetBigInteger(intValue, (int)uintValue, ptrOrHandle, out var result) ? (object)result : null; - - case Type.V8Object: - return new V8ObjectImpl((V8Object.Handle)ptrOrHandle, (Subtype)(uintValue & 0xFFFFU), (Flags)(uintValue >> 16), intValue); - - case Type.HostObject: - return V8ProxyHelpers.GetHostObject(ptrOrHandle); - - default: - return null; - } + var decoded = default(Decoded); + V8SplitProxyNative.InvokeNoThrow(instance => instance.V8Value_Decode(pV8Value, out decoded)); + return decoded.Get(); } private static bool TryGetBigInteger(int signBit, int wordCount, IntPtr pWords, out BigInteger result) @@ -1039,7 +999,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy #region Nested type: Type - public enum Type : ushort + public enum Type : byte { // IMPORTANT: maintain bitwise equivalence with native enum V8Value::Type Nonexistent, @@ -1060,7 +1020,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy #region Nested type: Subtype - public enum Subtype : ushort + public enum Subtype : byte { // IMPORTANT: maintain bitwise equivalence with native enum V8Value::Subtype None, @@ -1101,7 +1061,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy #region Nested type: Ptr - internal readonly struct Ptr + public readonly struct Ptr { private readonly IntPtr bits; @@ -1124,8 +1084,113 @@ namespace Microsoft.ClearScript.V8.SplitProxy } #endregion - } + #region Nested type: Decoded + + [StructLayout(LayoutKind.Explicit)] + public struct Decoded + { + // IMPORTANT: maintain bitwise equivalence with native struct V8Value::Decoded + [FieldOffset(0)] public Type Type; + [FieldOffset(1)] public Subtype Subtype; + [FieldOffset(2)] public Flags Flags; + [FieldOffset(2)] public short SignBit; + [FieldOffset(4)] public int Length; + [FieldOffset(4)] public int IdentityHash; + [FieldOffset(8)] public int Int32Value; + [FieldOffset(8)] public uint UInt32Value; + [FieldOffset(8)] public double DoubleValue; + [FieldOffset(8)] public IntPtr PtrOrHandle; + + public object Get() + { + switch (Type) + { + case Type.Nonexistent: + return Nonexistent.Value; + + case Type.Null: + return DBNull.Value; + + case Type.Boolean: + return Int32Value != 0; + + case Type.Number: + return DoubleValue; + + case Type.Int32: + return Int32Value; + + case Type.UInt32: + return UInt32Value; + + case Type.String: + return Marshal.PtrToStringUni(PtrOrHandle, Length); + + case Type.DateTime: + return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc) + TimeSpan.FromMilliseconds(DoubleValue); + + case Type.BigInt: + return TryGetBigInteger(SignBit, Length, PtrOrHandle, out var result) ? (object)result : null; + + case Type.V8Object: + return new V8ObjectImpl((V8Object.Handle)PtrOrHandle, Subtype, Flags, IdentityHash); + + case Type.HostObject: + return V8ProxyHelpers.GetHostObject(PtrOrHandle); + + default: + return null; + } + } + + public static unsafe object Get(Ptr pValues, int index) + { + return ((Decoded*)(IntPtr)pValues + index)->Get(); + } + + public static object[] ToArray(int count, Ptr pValues) + { + var array = new object[count]; + + for (var index = 0; index < count; index++) + { + array[index] = Get(pValues, index); + } + + return array; + } + + #region Nested type: Ptr + + // ReSharper disable once MemberHidesStaticFromOuterClass + public readonly struct Ptr + { + private readonly IntPtr bits; + + private Ptr(IntPtr bits) => this.bits = bits; + + public static readonly Ptr Null = new Ptr(IntPtr.Zero); + + public static bool operator ==(Ptr left, Ptr right) => left.bits == right.bits; + public static bool operator !=(Ptr left, Ptr right) => left.bits != right.bits; + + public static explicit operator IntPtr(Ptr ptr) => ptr.bits; + public static explicit operator Ptr(IntPtr bits) => new Ptr(bits); + + #region Object overrides + + public override bool Equals(object obj) => (obj is Ptr ptr) && (this == ptr); + public override int GetHashCode() => bits.GetHashCode(); + + #endregion + } + + #endregion + } + + #endregion + } internal static class V8CpuProfile { public static void ProcessProfile(V8Entity.Handle hEntity, Ptr pProfile, V8.V8CpuProfile profile) diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyManaged.Net5.cs b/ClearScript/V8/SplitProxy/V8SplitProxyManaged.Net5.cs index cf658613..6989ae15 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyManaged.Net5.cs +++ b/ClearScript/V8/SplitProxy/V8SplitProxyManaged.Net5.cs @@ -153,12 +153,12 @@ namespace Microsoft.ClearScript.V8.SplitProxy get { [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] - static void Thunk(IntPtr pObject, StdString.Ptr pName, V8Value.Ptr pValue) + static void Thunk(IntPtr pObject, StdString.Ptr pName, V8Value.Decoded.Ptr pValue) { SetHostObjectNamedProperty(pObject, pName, pValue); } - delegate* unmanaged[Stdcall] pThunk = &Thunk; + delegate* unmanaged[Stdcall] pThunk = &Thunk; return (IntPtr)pThunk; } } @@ -183,12 +183,12 @@ namespace Microsoft.ClearScript.V8.SplitProxy get { [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] - static void Thunk(IntPtr pObject, int index, V8Value.Ptr pValue) + static void Thunk(IntPtr pObject, int index, V8Value.Decoded.Ptr pValue) { SetHostObjectIndexedProperty(pObject, index, pValue); } - delegate* unmanaged[Stdcall] pThunk = &Thunk; + delegate* unmanaged[Stdcall] pThunk = &Thunk; return (IntPtr)pThunk; } } @@ -198,12 +198,12 @@ namespace Microsoft.ClearScript.V8.SplitProxy get { [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] - static void Thunk(IntPtr pObject, StdBool asConstructor, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult) + static void Thunk(IntPtr pObject, StdBool asConstructor, int argCount, V8Value.Decoded.Ptr pArgs, V8Value.Ptr pResult) { - InvokeHostObject(pObject, asConstructor, pArgs, pResult); + InvokeHostObject(pObject, asConstructor, argCount, pArgs, pResult); } - delegate* unmanaged[Stdcall] pThunk = &Thunk; + delegate* unmanaged[Stdcall] pThunk = &Thunk; return (IntPtr)pThunk; } } @@ -213,12 +213,12 @@ namespace Microsoft.ClearScript.V8.SplitProxy get { [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] - static void Thunk(IntPtr pObject, StdString.Ptr pName, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult) + static void Thunk(IntPtr pObject, StdString.Ptr pName, int argCount, V8Value.Decoded.Ptr pArgs, V8Value.Ptr pResult) { - InvokeHostObjectMethod(pObject, pName, pArgs, pResult); + InvokeHostObjectMethod(pObject, pName, argCount, pArgs, pResult); } - delegate* unmanaged[Stdcall] pThunk = &Thunk; + delegate* unmanaged[Stdcall] pThunk = &Thunk; return (IntPtr)pThunk; } } diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyManaged.cs b/ClearScript/V8/SplitProxy/V8SplitProxyManaged.cs index e9e16b4f..76db884a 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyManaged.cs +++ b/ClearScript/V8/SplitProxy/V8SplitProxyManaged.cs @@ -190,7 +190,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy private delegate void RawSetHostObjectNamedProperty( [In] IntPtr pObject, [In] StdString.Ptr pName, - [In] V8Value.Ptr pValue + [In] V8Value.Decoded.Ptr pValue ); [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -217,7 +217,7 @@ namespace Microsoft.ClearScript.V8.SplitProxy private delegate void RawSetHostObjectIndexedProperty( [In] IntPtr pObject, [In] int index, - [In] V8Value.Ptr pValue + V8Value.Decoded.Ptr pValue ); [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -237,7 +237,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy private delegate void RawInvokeHostObject( [In] IntPtr pObject, [In] [MarshalAs(UnmanagedType.I1)] bool asConstructor, - [In] StdV8ValueArray.Ptr pArgs, + [In] int argCount, + [In] V8Value.Decoded.Ptr pArgs, [In] V8Value.Ptr pResult ); @@ -245,7 +246,8 @@ namespace Microsoft.ClearScript.V8.SplitProxy private delegate void RawInvokeHostObjectMethod( [In] IntPtr pObject, [In] StdString.Ptr pName, - [In] StdV8ValueArray.Ptr pArgs, + [In] int argCount, + [In] V8Value.Decoded.Ptr pArgs, [In] V8Value.Ptr pResult ); @@ -636,11 +638,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy } } - private static void SetHostObjectNamedProperty(IntPtr pObject, StdString.Ptr pName, V8Value.Ptr pValue) + private static void SetHostObjectNamedProperty(IntPtr pObject, StdString.Ptr pName, V8Value.Decoded.Ptr pValue) { try { - V8ProxyHelpers.SetHostObjectProperty(pObject, StdString.GetValue(pName), V8Value.Get(pValue)); + V8ProxyHelpers.SetHostObjectProperty(pObject, StdString.GetValue(pName), V8Value.Decoded.Get(pValue, 0)); } catch (Exception exception) { @@ -689,11 +691,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy } } - private static void SetHostObjectIndexedProperty(IntPtr pObject, int index, V8Value.Ptr pValue) + private static void SetHostObjectIndexedProperty(IntPtr pObject, int index, V8Value.Decoded.Ptr pValue) { try { - V8ProxyHelpers.SetHostObjectProperty(pObject, index, V8Value.Get(pValue)); + V8ProxyHelpers.SetHostObjectProperty(pObject, index, V8Value.Decoded.Get(pValue, 0)); } catch (Exception exception) { @@ -730,11 +732,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy StdInt32Array.CopyFromArray(pIndices, indices); } - private static void InvokeHostObject(IntPtr pObject, bool asConstructor, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult) + private static void InvokeHostObject(IntPtr pObject, bool asConstructor, int argCount, V8Value.Decoded.Ptr pArgs, V8Value.Ptr pResult) { try { - V8Value.Set(pResult, V8ProxyHelpers.InvokeHostObject(pObject, asConstructor, StdV8ValueArray.ToArray(pArgs))); + V8Value.Set(pResult, V8ProxyHelpers.InvokeHostObject(pObject, asConstructor, V8Value.Decoded.ToArray(argCount, pArgs))); } catch (Exception exception) { @@ -742,11 +744,11 @@ namespace Microsoft.ClearScript.V8.SplitProxy } } - private static void InvokeHostObjectMethod(IntPtr pObject, StdString.Ptr pName, StdV8ValueArray.Ptr pArgs, V8Value.Ptr pResult) + private static void InvokeHostObjectMethod(IntPtr pObject, StdString.Ptr pName, int argCount, V8Value.Decoded.Ptr pArgs, V8Value.Ptr pResult) { try { - V8Value.Set(pResult, V8ProxyHelpers.InvokeHostObjectMethod(pObject, StdString.GetValue(pName), StdV8ValueArray.ToArray(pArgs))); + V8Value.Set(pResult, V8ProxyHelpers.InvokeHostObjectMethod(pObject, StdString.GetValue(pName), V8Value.Decoded.ToArray(argCount, pArgs))); } catch (Exception exception) { diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyNative.Common.tt b/ClearScript/V8/SplitProxy/V8SplitProxyNative.Common.tt index 1bafa7e7..865a746b 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyNative.Common.tt +++ b/ClearScript/V8/SplitProxy/V8SplitProxyNative.Common.tt @@ -378,9 +378,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -1440,12 +1440,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("<#= fileName #>", CallingConvention = CallingConvention.StdCall)] diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyNative.Generated.cs b/ClearScript/V8/SplitProxy/V8SplitProxyNative.Generated.cs index dcee2939..a2277bee 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyNative.Generated.cs +++ b/ClearScript/V8/SplitProxy/V8SplitProxyNative.Generated.cs @@ -420,9 +420,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -1482,12 +1482,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)] @@ -2482,9 +2479,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -3544,12 +3541,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)] @@ -4544,9 +4538,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -5606,12 +5600,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)] @@ -6606,9 +6597,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -7668,12 +7659,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.linux-x64.so", CallingConvention = CallingConvention.StdCall)] @@ -8668,9 +8656,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -9730,12 +9718,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.linux-arm64.so", CallingConvention = CallingConvention.StdCall)] @@ -10730,9 +10715,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -11792,12 +11777,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.linux-arm.so", CallingConvention = CallingConvention.StdCall)] @@ -12792,9 +12774,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -13854,12 +13836,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.osx-x64.dylib", CallingConvention = CallingConvention.StdCall)] @@ -14854,9 +14833,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -15916,12 +15895,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.osx-arm64.dylib", CallingConvention = CallingConvention.StdCall)] diff --git a/ClearScript/V8/SplitProxy/V8SplitProxyNative.UWP.Generated.cs b/ClearScript/V8/SplitProxy/V8SplitProxyNative.UWP.Generated.cs index a9b15f23..4bf5dc88 100644 --- a/ClearScript/V8/SplitProxy/V8SplitProxyNative.UWP.Generated.cs +++ b/ClearScript/V8/SplitProxy/V8SplitProxyNative.UWP.Generated.cs @@ -376,9 +376,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -1438,12 +1438,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-x86.dll", CallingConvention = CallingConvention.StdCall)] @@ -2438,9 +2435,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -3500,12 +3497,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-x64.dll", CallingConvention = CallingConvention.StdCall)] @@ -4500,9 +4494,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy V8Value_SetHostObject(pV8Value, pObject); } - V8Value.Type IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out int intValue, out uint uintValue, out double doubleValue, out IntPtr ptrOrHandle) + void IV8SplitProxyNative.V8Value_Decode(V8Value.Ptr pV8Value, out V8Value.Decoded decoded) { - return V8Value_Decode(pV8Value, out intValue, out uintValue, out doubleValue, out ptrOrHandle); + V8Value_Decode(pV8Value, out decoded); } void IV8SplitProxyNative.V8Value_Delete(V8Value.Ptr pV8Value) @@ -5562,12 +5556,9 @@ namespace Microsoft.ClearScript.V8.SplitProxy ); [DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)] - private static extern V8Value.Type V8Value_Decode( + private static extern void V8Value_Decode( [In] V8Value.Ptr pV8Value, - [Out] out int intValue, - [Out] out uint uintValue, - [Out] out double doubleValue, - [Out] out IntPtr ptrOrHandle + [Out] out V8Value.Decoded decoded ); [DllImport("ClearScriptV8.win-arm64.dll", CallingConvention = CallingConvention.StdCall)] diff --git a/ClearScript/V8/V8Runtime.cs b/ClearScript/V8/V8Runtime.cs index 48137991..3c878f53 100644 --- a/ClearScript/V8/V8Runtime.cs +++ b/ClearScript/V8/V8Runtime.cs @@ -847,9 +847,9 @@ namespace Microsoft.ClearScript.V8 #region internal members - internal IUniqueNameManager DocumentNameManager { get; } = new UniqueFileNameManager(); + internal readonly UniqueFileNameManager DocumentNameManager = new UniqueFileNameManager(); - internal HostItemCollateral HostItemCollateral { get; } = new HostItemCollateral(); + internal readonly HostItemCollateral HostItemCollateral = new HostItemCollateral(); internal V8IsolateProxy IsolateProxy { diff --git a/ClearScriptBenchmarks/ClearScriptBenchmarks.Unix.cs b/ClearScriptBenchmarks/ClearScriptBenchmarks.Unix.cs index c9e6b118..f8f76b59 100644 --- a/ClearScriptBenchmarks/ClearScriptBenchmarks.Unix.cs +++ b/ClearScriptBenchmarks/ClearScriptBenchmarks.Unix.cs @@ -22,7 +22,7 @@ namespace Microsoft.ClearScript.Test var burn = (args.Length == 2) && (args[0] == "-b") && uint.TryParse(args[1], out choice) && (choice >= 1) && (choice <= 2); Console.Clear(); - if (!burn) Console.WriteLine("ClearScript Benchmarks ({0}, {1}, {2} {3})\n", RuntimeInformation.FrameworkDescription, RuntimeInformation.OSDescription, RuntimeInformation.ProcessArchitecture, flavor); + if (!burn) Console.WriteLine("ClearScript Benchmarks ({0}, {1}, {2} {3})\n", RuntimeInformation.FrameworkDescription.Trim(), RuntimeInformation.OSDescription.Trim(), RuntimeInformation.ProcessArchitecture, flavor); var count = 0UL; diff --git a/ClearScriptBenchmarks/ClearScriptBenchmarks.Windows.cs b/ClearScriptBenchmarks/ClearScriptBenchmarks.Windows.cs index 50f9d856..52c9498a 100644 --- a/ClearScriptBenchmarks/ClearScriptBenchmarks.Windows.cs +++ b/ClearScriptBenchmarks/ClearScriptBenchmarks.Windows.cs @@ -23,7 +23,7 @@ namespace Microsoft.ClearScript.Test var burn = (args.Length == 2) && (args[0] == "-b") && uint.TryParse(args[1], out choice) && (choice >= 1) && (choice <= 3); Console.Clear(); - if (!burn) Console.WriteLine("ClearScript Benchmarks ({0}, {1}, {2} {3})\n", RuntimeInformation.FrameworkDescription, RuntimeInformation.OSDescription, RuntimeInformation.ProcessArchitecture, flavor); + if (!burn) Console.WriteLine("ClearScript Benchmarks ({0}, {1}, {2} {3})\n", RuntimeInformation.FrameworkDescription.Trim(), RuntimeInformation.OSDescription.Trim(), RuntimeInformation.ProcessArchitecture, flavor); var count = 0UL; diff --git a/ClearScriptBenchmarks/Properties/AssemblyInfo.cs b/ClearScriptBenchmarks/Properties/AssemblyInfo.cs index 9aaaecfa..60438740 100644 --- a/ClearScriptBenchmarks/Properties/AssemblyInfo.cs +++ b/ClearScriptBenchmarks/Properties/AssemblyInfo.cs @@ -11,6 +11,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("(c) Microsoft Corporation")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScriptConsole/ClearScriptConsole.cs b/ClearScriptConsole/ClearScriptConsole.cs index d876e878..644ee721 100644 --- a/ClearScriptConsole/ClearScriptConsole.cs +++ b/ClearScriptConsole/ClearScriptConsole.cs @@ -6,12 +6,19 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using Microsoft.ClearScript.V8; namespace Microsoft.ClearScript.Test { internal static class ClearScriptConsole { + #if DEBUG + private const string flavor = "Debug"; + #else + private const string flavor = "Release"; + #endif + public static void Main(string[] args) { if ((args.Length == 2) && (args[0] == "-t")) @@ -20,6 +27,8 @@ namespace Microsoft.ClearScript.Test return; } + Console.WriteLine("ClearScript Console ({0}, {1}, {2} {3})", RuntimeInformation.FrameworkDescription.Trim(), RuntimeInformation.OSDescription.Trim(), RuntimeInformation.ProcessArchitecture, flavor); + using (var engine = new V8ScriptEngine(nameof(ClearScriptConsole), V8ScriptEngineFlags.EnableDebugging)) { engine.AddHostObject("host", new ExtendedHostFunctions()); diff --git a/ClearScriptConsole/Properties/AssemblyInfo.cs b/ClearScriptConsole/Properties/AssemblyInfo.cs index 8874ea23..ad70f0ad 100644 --- a/ClearScriptConsole/Properties/AssemblyInfo.cs +++ b/ClearScriptConsole/Properties/AssemblyInfo.cs @@ -11,6 +11,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("(c) Microsoft Corporation")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScriptTest/BugFixTest.cs b/ClearScriptTest/BugFixTest.cs index 2bef71d3..76c95de0 100644 --- a/ClearScriptTest/BugFixTest.cs +++ b/ClearScriptTest/BugFixTest.cs @@ -299,7 +299,7 @@ namespace Microsoft.ClearScript.Test [TestMethod, TestCategory("BugFix")] public void BugFix_CoreBindCache() { - HostItem.ResetCoreBindCache(); + HostItem.ClearCoreBindCache(); engine.Dispose(); for (var i = 0; i < 10; i++) diff --git a/ClearScriptTest/Properties/AssemblyInfo.cs b/ClearScriptTest/Properties/AssemblyInfo.cs index 1fa0e35b..d67ab21e 100644 --- a/ClearScriptTest/Properties/AssemblyInfo.cs +++ b/ClearScriptTest/Properties/AssemblyInfo.cs @@ -11,6 +11,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("(c) Microsoft Corporation")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("7.4.0")] -[assembly: AssemblyFileVersion("7.4.0")] -[assembly: AssemblyInformationalVersion("7.4.0")] +[assembly: AssemblyVersion("7.4.1")] +[assembly: AssemblyFileVersion("7.4.1")] +[assembly: AssemblyInformationalVersion("7.4.1")] diff --git a/ClearScriptTest/V8ScriptEngineTest.cs b/ClearScriptTest/V8ScriptEngineTest.cs index 0d474af0..0169d037 100644 --- a/ClearScriptTest/V8ScriptEngineTest.cs +++ b/ClearScriptTest/V8ScriptEngineTest.cs @@ -4613,6 +4613,39 @@ namespace Microsoft.ClearScript.Test Assert.AreEqual((JavaScriptObjectKind.TypedArray, JavaScriptObjectFlags.Shared), Inspect("new Float64Array(new SharedArrayBuffer(256))")); } + [TestMethod, TestCategory("V8ScriptEngine")] + public void V8ScriptEngine_ConstructorBinding() + { + engine.AddHostType("Foo", typeof(ConstructorBindingTest)); + dynamic test = engine.Evaluate(@"(function(length) { + const a = new Array(length); + for (let i = 0; i < length; ++i) + a[i] = new Foo(123); + const b = new Array(length); + for (let i = 0; i < length; ++i) + b[i] = new Foo('qux'); + const c = new Array(length); + for (let i = 0; i < length; ++i) + c[i] = new Foo(456.789); + return { a, b, c }; + })"); + + const int length = 1000; + var result = (IDictionary)test(length); + + var a = (IList)result["a"]; + var b = (IList)result["b"]; + var c = (IList)result["c"]; + + Assert.AreEqual(length, a.Count); + Assert.AreEqual(length, b.Count); + Assert.AreEqual(length, c.Count); + + Assert.IsTrue(a.All(value => ((ConstructorBindingTest)value).A == 123)); + Assert.IsTrue(b.All(value => ((ConstructorBindingTest)value).A == 456)); + Assert.IsTrue(c.All(value => ((ConstructorBindingTest)value).A == 789)); + } + // ReSharper restore InconsistentNaming #endregion @@ -4958,6 +4991,28 @@ namespace Microsoft.ClearScript.Test // ReSharper restore UnusedMember.Local + public class ConstructorBindingTest + { + public int A; + public string B; + public double C; + + public ConstructorBindingTest(int a, string b = "foo", double c = 456.789) + { + A = a; B = b; C = c; + } + + public ConstructorBindingTest(string b, int a = 456, double c = 789.987) + { + A = a; B = b; C = c; + } + + public ConstructorBindingTest(double c, int a = 789, string b = "bar") + { + A = a; B = b; C = c; + } + } + #endregion } } diff --git a/ClearScriptV8/HostObjectUtil.cpp b/ClearScriptV8/HostObjectUtil.cpp index a8dd837a..4bdcef49 100644 --- a/ClearScriptV8/HostObjectUtil.cpp +++ b/ClearScriptV8/HostObjectUtil.cpp @@ -47,7 +47,9 @@ public: virtual void SetProperty(void* pvObject, const StdString& name, const V8Value& value) override { - V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(SetHostObjectNamedProperty, pvObject, name, value); + V8Value::Decoded decodedValue; + value.Decode(decodedValue); + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(SetHostObjectNamedProperty, pvObject, name, decodedValue); } virtual bool DeleteProperty(void* pvObject, const StdString& name) override @@ -69,7 +71,9 @@ public: virtual void SetProperty(void* pvObject, int32_t index, const V8Value& value) override { - V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(SetHostObjectIndexedProperty, pvObject, index, value); + V8Value::Decoded decodedValue; + value.Decode(decodedValue); + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(SetHostObjectIndexedProperty, pvObject, index, decodedValue); } virtual bool DeleteProperty(void* pvObject, int32_t index) override @@ -85,14 +89,54 @@ public: virtual V8Value Invoke(void* pvObject, bool asConstructor, const std::vector& args) override { V8Value result(V8Value::Nonexistent); - V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObject, pvObject, asConstructor, args, result); + + auto argCount = args.size(); + if (argCount < 1) + { + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObject, pvObject, asConstructor, 0, nullptr, result); + } + else + { + auto pArgs = args.data(); + + auto upDecodedArgs = std::make_unique(argCount); + auto pDecodedArgs = upDecodedArgs.get(); + + for (size_t index = 0; index < argCount; index++) + { + pArgs[index].Decode(pDecodedArgs[index]); + } + + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObject, pvObject, asConstructor, static_cast(argCount), pDecodedArgs, result); + } + return result; } virtual V8Value InvokeMethod(void* pvObject, const StdString& name, const std::vector& args) override { V8Value result(V8Value::Nonexistent); - V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObjectMethod, pvObject, name, args, result); + + auto argCount = args.size(); + if (argCount < 1) + { + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObjectMethod, pvObject, name, 0, nullptr, result); + } + else + { + auto pArgs = args.data(); + + auto upDecodedArgs = std::make_unique(argCount); + auto pDecodedArgs = upDecodedArgs.get(); + + for (size_t index = 0; index < argCount; index++) + { + pArgs[index].Decode(pDecodedArgs[index]); + } + + V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(InvokeHostObjectMethod, pvObject, name, static_cast(argCount), pDecodedArgs, result); + } + return result; } diff --git a/ClearScriptV8/V8IsolateImpl.cpp b/ClearScriptV8/V8IsolateImpl.cpp index 433b471b..3dc1083f 100644 --- a/ClearScriptV8/V8IsolateImpl.cpp +++ b/ClearScriptV8/V8IsolateImpl.cpp @@ -2109,28 +2109,15 @@ void V8IsolateImpl::FlushContext(V8ContextImpl& contextImpl) size_t V8IsolateImpl::HeapExpansionCallback(void* pvData, size_t currentLimit, size_t /*initialLimit*/) { + const size_t minBump = 1024 * 1024; + if (pvData) { auto multiplier = static_cast(pvData)->m_HeapExpansionMultiplier; if (multiplier > 1.0) { - multiplier = std::max(multiplier, 1.001); - const size_t minBump = 1024 * 1024; - - auto newLimit = static_cast(currentLimit); - while ((static_cast(newLimit) - currentLimit) < minBump) - { - auto tempLimit = multiplier * newLimit; - if (tempLimit > newLimit) - { - newLimit = tempLimit; - continue; - } - - break; - } - - return std::max(static_cast(newLimit), currentLimit); + auto newLimit = static_cast(static_cast(currentLimit) * multiplier); + return std::max(newLimit, currentLimit + minBump); } } diff --git a/ClearScriptV8/V8SplitProxyManaged.h b/ClearScriptV8/V8SplitProxyManaged.h index 7c271e19..3071f343 100644 --- a/ClearScriptV8/V8SplitProxyManaged.h +++ b/ClearScriptV8/V8SplitProxyManaged.h @@ -41,17 +41,17 @@ \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectNamedProperty, void* pvObject, const StdString& name, V8Value& value) \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectNamedPropertyWithCacheability, void* pvObject, const StdString& name, V8Value& value, StdBool& isCacheable) \ - V8_SPLIT_PROXY_MANAGED_METHOD(void, SetHostObjectNamedProperty, void* pvObject, const StdString& name, const V8Value& value) \ + V8_SPLIT_PROXY_MANAGED_METHOD(void, SetHostObjectNamedProperty, void* pvObject, const StdString& name, const V8Value::Decoded& value) \ V8_SPLIT_PROXY_MANAGED_METHOD(StdBool, DeleteHostObjectNamedProperty, void* pvObject, const StdString& name) \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectPropertyNames, void* pvObject, std::vector& names) \ \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectIndexedProperty, void* pvObject, int32_t index, V8Value& value) \ - V8_SPLIT_PROXY_MANAGED_METHOD(void, SetHostObjectIndexedProperty, void* pvObject, int32_t index, const V8Value& value) \ + V8_SPLIT_PROXY_MANAGED_METHOD(void, SetHostObjectIndexedProperty, void* pvObject, int32_t index, const V8Value::Decoded& value) \ V8_SPLIT_PROXY_MANAGED_METHOD(StdBool, DeleteHostObjectIndexedProperty, void* pvObject, int32_t index) \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectPropertyIndices, void* pvObject, std::vector& indices) \ \ - V8_SPLIT_PROXY_MANAGED_METHOD(void, InvokeHostObject, void* pvObject, StdBool asConstructor, const std::vector& args, V8Value& result) \ - V8_SPLIT_PROXY_MANAGED_METHOD(void, InvokeHostObjectMethod, void* pvObject, const StdString& name, const std::vector& args, V8Value& result) \ + V8_SPLIT_PROXY_MANAGED_METHOD(void, InvokeHostObject, void* pvObject, StdBool asConstructor, int32_t argCount, const V8Value::Decoded* pArgs, V8Value& result) \ + V8_SPLIT_PROXY_MANAGED_METHOD(void, InvokeHostObjectMethod, void* pvObject, const StdString& name, int32_t argCount, const V8Value::Decoded* pArgs, V8Value& result) \ \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectEnumerator, void* pvObject, V8Value& result) \ V8_SPLIT_PROXY_MANAGED_METHOD(void, GetHostObjectAsyncEnumerator, void* pvObject, V8Value& result) \ diff --git a/ClearScriptV8/V8SplitProxyNative.cpp b/ClearScriptV8/V8SplitProxyNative.cpp index e8d21da4..39c08113 100644 --- a/ClearScriptV8/V8SplitProxyNative.cpp +++ b/ClearScriptV8/V8SplitProxyNative.cpp @@ -65,19 +65,6 @@ static void ProcessCpuProfile(const v8::CpuProfile& profile, void* pvAction) } } -//----------------------------------------------------------------------------- - -static uint32_t PackV8ObjectInfo(V8Value::Subtype subtype, V8Value::Flags flags) -{ - static_assert(sizeof(subtype) == 2); - uint32_t subtypeBits = static_cast>(subtype); - - static_assert(sizeof(flags) == 2); - uint32_t flagsBits = static_cast>(flags); - - return subtypeBits | (flagsBits << 16); -} - //----------------------------------------------------------------------------- // V8Exception implementation //----------------------------------------------------------------------------- @@ -119,6 +106,57 @@ void V8EntityHandleBase::ScheduleInvalidOperationException(const StdString& mess V8_SPLIT_PROXY_MANAGED_INVOKE_VOID(ScheduleInvalidOperationException, message); } +//----------------------------------------------------------------------------- +// V8Value (implementation) +//----------------------------------------------------------------------------- + +void V8Value::Decode(Decoded& decoded) const +{ + decoded.Type = m_Type; + if (m_Type == Type::Boolean) + { + decoded.Int32Value = m_Data.BooleanValue; + } + else if (m_Type == Type::Number) + { + decoded.DoubleValue = m_Data.DoubleValue; + } + else if (m_Type == Type::Int32) + { + decoded.Int32Value = m_Data.Int32Value; + } + else if (m_Type == Type::UInt32) + { + decoded.UInt32Value = m_Data.UInt32Value; + } + else if (m_Type == Type::String) + { + decoded.pvData = m_Data.pString->ToCString(); + decoded.Length = static_cast(m_Data.pString->GetLength()); + } + else if (m_Type == Type::DateTime) + { + decoded.DoubleValue = m_Data.DoubleValue; + } + else if (m_Type == Type::BigInt) + { + decoded.pvData = m_Data.pBigInt->GetWords().data(); + decoded.Length = static_cast(m_Data.pBigInt->GetWords().size()); + decoded.SignBit = static_cast(m_Data.pBigInt->GetSignBit()); + } + else if (m_Type == Type::V8Object) + { + decoded.pvData = new V8ObjectHandle(m_Data.pV8ObjectHolder->Clone()); + decoded.Subtype = m_Subtype; + decoded.Flags = m_Flags; + decoded.IdentityHash = m_Data.pV8ObjectHolder->GetIdentityHash(); + } + else if (m_Type == Type::HostObject) + { + decoded.pvData = m_Data.pHostObjectHolder->GetObject(); + } +} + //----------------------------------------------------------------------------- // V8 split proxy native entry points (implementation) //----------------------------------------------------------------------------- @@ -528,97 +566,9 @@ NATIVE_ENTRY_POINT(void) V8Value_SetHostObject(V8Value* pV8Value, void* pvObject //----------------------------------------------------------------------------- -NATIVE_ENTRY_POINT(V8Value::Type) V8Value_Decode(const V8Value& value, int32_t& intValue, uint32_t& uintValue, double& doubleValue, const void*& pvData) noexcept +NATIVE_ENTRY_POINT(void) V8Value_Decode(const V8Value& value, V8Value::Decoded& decoded) noexcept { - { - bool result; - if (value.AsBoolean(result)) - { - intValue = result; - return V8Value::Type::Boolean; - } - } - - { - double result; - if (value.AsNumber(result)) - { - doubleValue = result; - return V8Value::Type::Number; - } - } - - { - int32_t result; - if (value.AsInt32(result)) - { - intValue = result; - return V8Value::Type::Int32; - } - } - - { - uint32_t result; - if (value.AsUInt32(result)) - { - uintValue = result; - return V8Value::Type::UInt32; - } - } - - { - const StdString* pString; - if (value.AsString(pString)) - { - pvData = pString->ToCString(); - intValue = pString->GetLength(); - return V8Value::Type::String; - } - } - - { - double result; - if (value.AsDateTime(result)) - { - doubleValue = result; - return V8Value::Type::DateTime; - } - } - - { - const V8BigInt* pBigInt; - if (value.AsBigInt(pBigInt)) - { - intValue = pBigInt->GetSignBit(); - pvData = pBigInt->GetWords().data(); - uintValue = static_cast(pBigInt->GetWords().size()); - return V8Value::Type::BigInt; - } - } - - { - V8ObjectHolder* pHolder; - V8Value::Subtype subtype; - V8Value::Flags flags; - if (value.AsV8Object(pHolder, subtype, flags)) - { - pvData = new V8ObjectHandle(pHolder->Clone()); - uintValue = PackV8ObjectInfo(subtype, flags); - intValue = pHolder->GetIdentityHash(); - return V8Value::Type::V8Object; - } - } - - { - HostObjectHolder* pHolder; - if (value.AsHostObject(pHolder)) - { - pvData = pHolder->GetObject(); - return V8Value::Type::HostObject; - } - } - - return value.GetType(); + value.Decode(decoded); } //----------------------------------------------------------------------------- diff --git a/ClearScriptV8/V8SplitProxyNative.h b/ClearScriptV8/V8SplitProxyNative.h index 852bdcfa..8ce34cfc 100644 --- a/ClearScriptV8/V8SplitProxyNative.h +++ b/ClearScriptV8/V8SplitProxyNative.h @@ -221,7 +221,7 @@ NATIVE_ENTRY_POINT(void) V8Value_SetDateTime(V8Value* pV8Value, double value) no NATIVE_ENTRY_POINT(void) V8Value_SetBigInt(V8Value* pV8Value, int32_t signBit, const uint8_t* pBytes, int32_t length) noexcept; NATIVE_ENTRY_POINT(void) V8Value_SetV8Object(V8Value* pV8Value, const V8ObjectHandle& handle, V8Value::Subtype subtype, V8Value::Flags flags) noexcept; NATIVE_ENTRY_POINT(void) V8Value_SetHostObject(V8Value* pV8Value, void* pvObject) noexcept; -NATIVE_ENTRY_POINT(V8Value::Type) V8Value_Decode(const V8Value& value, int32_t& intValue, uint32_t& uintValue, double& doubleValue, const void*& pvData) noexcept; +NATIVE_ENTRY_POINT(void) V8Value_Decode(const V8Value& value, V8Value::Decoded& decoded) noexcept; NATIVE_ENTRY_POINT(void) V8Value_Delete(V8Value* pV8Value) noexcept; NATIVE_ENTRY_POINT(void) V8CpuProfile_GetInfo(const v8::CpuProfile& profile, const V8EntityHandleBase& entityHandle, StdString& name, uint64_t& startTimestamp, uint64_t& endTimestamp, int32_t& sampleCount, const v8::CpuProfileNode*& pRootNode) noexcept; diff --git a/ClearScriptV8/V8Value.h b/ClearScriptV8/V8Value.h index 9faa6fe5..92a6e71a 100644 --- a/ClearScriptV8/V8Value.h +++ b/ClearScriptV8/V8Value.h @@ -95,7 +95,7 @@ public: DateTime }; - enum class Type: uint16_t + enum class Type: uint8_t { // IMPORTANT: maintain bitwise equivalence with managed enum V8.SplitProxy.V8Value.Type Nonexistent, @@ -112,7 +112,7 @@ public: HostObject }; - enum class Subtype: uint16_t + enum class Subtype: uint8_t { // IMPORTANT: maintain bitwise equivalence with managed enum V8.SplitProxy.V8Value.Subtype None, @@ -144,6 +144,42 @@ public: Generator = 0x0004 }; + struct Decoded + { + // IMPORTANT: maintain bitwise equivalence with managed struct V8.SplitProxy.V8Value.Decoded + Type Type; + Subtype Subtype; + union + { + Flags Flags; + int16_t SignBit; + }; + union + { + int32_t Length; + int32_t IdentityHash; + }; + union + { + int32_t Int32Value; + uint32_t UInt32Value; + double DoubleValue; + const void* pvData; + }; + }; + + static_assert(sizeof(Decoded) == 16, "The managed SplitProxy code assumes that sizeof(Decoded) is 16 on all platforms."); + static_assert(offsetof(Decoded, Type) == 0, "The managed SplitProxy code assumes that offsetof(Decoded, Type) is 0 on all platforms."); + static_assert(offsetof(Decoded, Subtype) == 1, "The managed SplitProxy code assumes that offsetof(Decoded, Subtype) is 1 on all platforms."); + static_assert(offsetof(Decoded, Flags) == 2, "The managed SplitProxy code assumes that offsetof(Decoded, Flags) is 2 on all platforms."); + static_assert(offsetof(Decoded, SignBit) == 2, "The managed SplitProxy code assumes that offsetof(Decoded, SignBit) is 2 on all platforms."); + static_assert(offsetof(Decoded, Length) == 4, "The managed SplitProxy code assumes that offsetof(Decoded, Length) is 4 on all platforms."); + static_assert(offsetof(Decoded, IdentityHash) == 4, "The managed SplitProxy code assumes that offsetof(Decoded, IdentityHash) is 4 on all platforms."); + static_assert(offsetof(Decoded, Int32Value) == 8, "The managed SplitProxy code assumes that offsetof(Decoded, Int32Value) is 8 on all platforms."); + static_assert(offsetof(Decoded, UInt32Value) == 8, "The managed SplitProxy code assumes that offsetof(Decoded, UInt32Value) is 8 on all platforms."); + static_assert(offsetof(Decoded, DoubleValue) == 8, "The managed SplitProxy code assumes that offsetof(Decoded, DoubleValue) is 8 on all platforms."); + static_assert(offsetof(Decoded, pvData) == 8, "The managed SplitProxy code assumes that offsetof(Decoded, pvData) is 8 on all platforms."); + explicit V8Value(NonexistentInitializer): m_Type(Type::Nonexistent) { @@ -360,6 +396,8 @@ public: return m_Type; } + void Decode(Decoded& decoded) const; + ~V8Value() { Dispose(); @@ -455,7 +493,7 @@ private: Type m_Type; Subtype m_Subtype; Flags m_Flags; - int16_t m_Padding; + int32_t m_Padding; Data m_Data; }; diff --git a/NuGet/files/License.txt b/NuGet/files/License.txt index 46437bc9..fa35ec2c 100644 --- a/NuGet/files/License.txt +++ b/NuGet/files/License.txt @@ -29,7 +29,7 @@ SOFTWARE. V8 =============================================================================== -Copyright 2006-2011, the V8 project authors. All rights reserved. +Copyright 2014, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -79,15 +79,15 @@ modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. - Redistribution in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - Neither the name of Sun Microsystems or the names of contributors may -be used to endorse or promote products derived from this software without -specific prior written permission. + be used to endorse or promote products derived from this software without + specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, @@ -101,6 +101,1491 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +=============================================================================== +GNU C Library +=============================================================================== + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + +=============================================================================== +International Components for Unicode +=============================================================================== + +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +See Terms of Use +for definitions of Unicode Inc.’s Data Files and Software. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2022 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Time Zone Database + + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + +---------------------------------------------------------------------- + +Google double-conversion + +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. + + +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. + +=============================================================================== +Inspector Protocol +=============================================================================== + +Copyright 2016 The Chromium Authors + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=============================================================================== +JsonCpp +=============================================================================== + +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +=============================================================================== +ProtoBuf +=============================================================================== + +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +=============================================================================== +Wasm C/C++ API +=============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +=============================================================================== +zlib +=============================================================================== + +Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +=============================================================================== +SipHash +=============================================================================== + +CC0 1.0 Universal + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later +claims of infringement build upon, modify, incorporate in other works, reuse +and redistribute as freely as possible in any form whatsoever and for any +purposes, including without limitation commercial purposes. These owners may +contribute to the Commons to promote the ideal of a free culture and the +further production of creative, cultural and scientific works, or to gain +reputation or greater distribution for their Work in part through the use and +efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with a +Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not limited +to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, communicate, + and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + + iii. publicity and privacy rights pertaining to a person's image or likeness + depicted in a Work; + + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + + v. rights protecting the extraction, dissemination, use and reuse of data in + a Work; + + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation thereof, + including any amended or successor version of such directive); and + + vii. other similar, equivalent or corresponding rights throughout the world + based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time +extensions), (iii) in any current or future medium and for any number of +copies, and (iv) for any purpose whatsoever, including without limitation +commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes +the Waiver for the benefit of each member of the public at large and to the +detriment of Affirmer's heirs and successors, fully intending that such Waiver +shall not be subject to revocation, rescission, cancellation, termination, or +any other legal or equitable action to disrupt the quiet enjoyment of the Work +by the public as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account +Affirmer's express Statement of Purpose. In addition, to the extent the Waiver +is so judged Affirmer hereby grants to each affected person a royalty-free, +non transferable, non sublicensable, non exclusive, irrevocable and +unconditional license to exercise Affirmer's Copyright and Related Rights in +the Work (i) in all territories worldwide, (ii) for the maximum duration +provided by applicable law or treaty (including future time extensions), (iii) +in any current or future medium and for any number of copies, and (iv) for any +purpose whatsoever, including without limitation commercial, advertising or +promotional purposes (the "License"). The License shall be deemed effective as +of the date CC0 was applied by Affirmer to the Work. Should any part of the +License for any reason be judged legally invalid or ineffective under +applicable law, such partial invalidity or ineffectiveness shall not +invalidate the remainder of the License, and in such case Affirmer hereby +affirms that he or she will not (i) exercise any of his or her remaining +Copyright and Related Rights in the Work or (ii) assert any associated claims +and causes of action with respect to the Work, in either case contrary to +Affirmer's express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + + b. Affirmer offers the Work as-is and makes no representations or warranties + of any kind concerning the Work, express, implied, statutory or otherwise, + including without limitation warranties of title, merchantability, fitness + for a particular purpose, non infringement, or the absence of latent or + other defects, accuracy, or the present or absence of errors, whether or not + discoverable, all to the greatest extent permissible under applicable law. + + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without limitation + any person's Copyright and Related Rights in the Work. Further, Affirmer + disclaims responsibility for obtaining any necessary consents, permissions + or other rights required for any use of the Work. + + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to this + CC0 or use of the Work. + +For more information, please see + + +=============================================================================== +DFA UTF-8 Decoder +=============================================================================== + +Copyright (c) 2008-2009 Bjoern Hoehrmann + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +=============================================================================== +VTune +=============================================================================== + +This file is provided under a dual BSD/GPLv2 license. When using or +redistributing this file, you may do so under either license. + +GPL LICENSE SUMMARY + +Copyright (c) 2005-2012 Intel Corporation. All rights reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +The full GNU General Public License is included in this distribution +in the file called LICENSE.GPL. + +Contact Information: +http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/ + +BSD LICENSE + +Copyright (c) 2005-2012 Intel Corporation. All rights reserved. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + =============================================================================== valgrind.h =============================================================================== @@ -108,7 +1593,7 @@ valgrind.h This file is part of Valgrind, a dynamic binary instrumentation framework. -Copyright (C) 2000-2007 Julian Seward. All rights reserved. +Copyright (C) 2000-2010 Julian Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -117,16 +1602,16 @@ are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS diff --git a/ReadMe.md b/ReadMe.md index 2bc7a279..82bccdd7 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -[![Banner](https://github.com/microsoft/ClearScript/blob/master/docs/ClearScript7-ReadMe.png)](https://microsoft.github.io/ClearScript/) +[![Banner](https://raw.githubusercontent.com/microsoft/ClearScript/master/docs/ClearScript7-ReadMe.png)](https://microsoft.github.io/ClearScript/) [![Twitter Follow](https://img.shields.io/badge/Follow-%40ClearScriptLib-white?logo=twitter&style=social)](https://twitter.com/ClearScriptLib) diff --git a/Unix/V8Update.sh b/Unix/V8Update.sh index 0923031f..39d31a19 100644 --- a/Unix/V8Update.sh +++ b/Unix/V8Update.sh @@ -1,6 +1,6 @@ #!/bin/bash -v8testedrev=11.1.277.14 +v8testedrev=11.2.214.13 v8testedcommit= v8cherrypicks= v8linuxbuildcommit=3d9590754d5d23e62d15472c5baf6777ca59df20 diff --git a/V8/V8Patch.txt b/V8/V8Patch.txt index 70b74a9a..5e0c480e 100644 --- a/V8/V8Patch.txt +++ b/V8/V8Patch.txt @@ -1,8 +1,8 @@ diff --git a/BUILD.gn b/BUILD.gn -index 316bcb4d3c..65833d40b6 100644 +index 277f47717d..9589c54e60 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -1119,7 +1119,7 @@ config("toolchain") { +@@ -1121,7 +1121,7 @@ config("toolchain") { visibility = [ "./*" ] defines = [] @@ -36,6 +36,19 @@ index d3e35d6ec5..2d2fb458fe 100644 /** * Initialize the ICU library bundled with V8. The embedder should only +diff --git a/include/v8-platform.h b/include/v8-platform.h +index 750131d4c9..c390d801ed 100644 +--- a/include/v8-platform.h ++++ b/include/v8-platform.h +@@ -1089,7 +1089,7 @@ class Platform { + * required. + */ + virtual int64_t CurrentClockTimeMilliseconds() { +- return floor(CurrentClockTimeMillis()); ++ return static_cast(floor(CurrentClockTimeMillis())); + } + + /** diff --git a/include/v8-template.h b/include/v8-template.h index 11296cd488..0f090446dc 100644 --- a/include/v8-template.h @@ -51,10 +64,10 @@ index 11296cd488..0f090446dc 100644 * Support for TC39 "dynamic code brand checks" proposal. * diff --git a/include/v8config.h b/include/v8config.h -index b44995e7cd..cb7928b515 100644 +index 9410eb4135..b9bdc7a6a0 100644 --- a/include/v8config.h +++ b/include/v8config.h -@@ -524,7 +524,7 @@ path. Add it with -I to the command line +@@ -531,7 +531,7 @@ path. Add it with -I to the command line // Use like: // V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod(); #if V8_HAS_ATTRIBUTE_PRESERVE_MOST @@ -78,10 +91,10 @@ index 05a883f2d5..3ea0b8ce62 100644 // Keep prototypes in slow-mode. Let them be lazily turned fast later on. // TODO(dcarney): is this necessary? diff --git a/src/api/api.cc b/src/api/api.cc -index 81c7d1e3f9..da9e93fa17 100644 +index fac24bae12..0c558589ea 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -2043,6 +2043,17 @@ void ObjectTemplate::SetImmutableProto() { +@@ -2057,6 +2057,17 @@ void ObjectTemplate::SetImmutableProto() { self->set_immutable_proto(true); } @@ -99,7 +112,7 @@ index 81c7d1e3f9..da9e93fa17 100644 bool ObjectTemplate::IsCodeLike() const { return Utils::OpenHandle(this)->code_like(); } -@@ -6466,6 +6477,10 @@ bool v8::V8::InitializeICU(const char* icu_data_file) { +@@ -6445,6 +6456,10 @@ bool v8::V8::InitializeICU(const char* icu_data_file) { return i::InitializeICU(icu_data_file); } @@ -127,7 +140,7 @@ index 34a26d9c26..f995a2fc64 100644 MatchLiteralCompareTypeof(right_, op(), left_, expr, literal); } diff --git a/src/base/platform/platform.h b/src/base/platform/platform.h -index 88d35540b1..20863d6f5b 100644 +index b9b734dac8..b577e3e01a 100644 --- a/src/base/platform/platform.h +++ b/src/base/platform/platform.h @@ -52,6 +52,8 @@ @@ -154,10 +167,10 @@ index 417e6f1dfa..108dc20972 100644 // The evaluation of async module can not throwing a JavaScript observable // exception. diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc -index 7d47afa2c9..cc95781cbc 100644 +index 1091943889..dbc699384c 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc -@@ -2006,6 +2006,10 @@ TNode CodeStubAssembler::LoadMapBitField3(TNode map) { +@@ -2027,6 +2027,10 @@ TNode CodeStubAssembler::LoadMapBitField3(TNode map) { return LoadObjectField(map, Map::kBitField3Offset); } @@ -168,7 +181,7 @@ index 7d47afa2c9..cc95781cbc 100644 TNode CodeStubAssembler::LoadMapInstanceType(TNode map) { return LoadObjectField(map, Map::kInstanceTypeOffset); } -@@ -14308,6 +14312,11 @@ TNode CodeStubAssembler::Typeof(TNode value) { +@@ -14364,6 +14368,11 @@ TNode CodeStubAssembler::Typeof(TNode value) { GotoIf(InstanceTypeEqual(instance_type, ODDBALL_TYPE), &if_oddball); @@ -181,7 +194,7 @@ index 7d47afa2c9..cc95781cbc 100644 Word32And(LoadMapBitField(map), Int32Constant(Map::Bits1::IsCallableBit::kMask | diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h -index fdd6da6017..c4eb41496c 100644 +index d4d6e12bae..890a6cf249 100644 --- a/src/codegen/code-stub-assembler.h +++ b/src/codegen/code-stub-assembler.h @@ -1409,6 +1409,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler @@ -194,7 +207,7 @@ index fdd6da6017..c4eb41496c 100644 TNode LoadMapInstanceType(TNode map); // Load the ElementsKind of a map. diff --git a/src/common/globals.h b/src/common/globals.h -index d379cbfc61..d11438763b 100644 +index 34d0c01cb6..bda045dece 100644 --- a/src/common/globals.h +++ b/src/common/globals.h @@ -270,7 +270,7 @@ const size_t kShortBuiltinCallsOldSpaceSizeThreshold = size_t{2} * GB; @@ -207,7 +220,7 @@ index d379cbfc61..d11438763b 100644 #define V8_HEAP_USE_PTHREAD_JIT_WRITE_PROTECT false #endif diff --git a/src/diagnostics/unwinding-info-win64.cc b/src/diagnostics/unwinding-info-win64.cc -index 767eb015ab..acd70f7167 100644 +index a71b866135..4f1d26676c 100644 --- a/src/diagnostics/unwinding-info-win64.cc +++ b/src/diagnostics/unwinding-info-win64.cc @@ -462,6 +462,14 @@ void InitUnwindingRecord(Record* record, size_t code_size_in_bytes) { @@ -286,7 +299,7 @@ index 767eb015ab..acd70f7167 100644 // Unprotect reserved page. DWORD old_protect; diff --git a/src/execution/isolate-inl.h b/src/execution/isolate-inl.h -index 026e7cfd71..c833440dff 100644 +index 8edeb5dfb8..9189c32794 100644 --- a/src/execution/isolate-inl.h +++ b/src/execution/isolate-inl.h @@ -35,7 +35,6 @@ V8_INLINE Isolate* Isolate::TryGetCurrent() { return g_current_isolate_; } @@ -298,7 +311,7 @@ index 026e7cfd71..c833440dff 100644 } diff --git a/src/execution/stack-guard.cc b/src/execution/stack-guard.cc -index 2b4af70bc0..2607f22922 100644 +index ff64beb8b2..b26b3fe323 100644 --- a/src/execution/stack-guard.cc +++ b/src/execution/stack-guard.cc @@ -218,8 +218,10 @@ void StackGuard::FreeThreadResources() { @@ -314,10 +327,10 @@ index 2b4af70bc0..2607f22922 100644 set_jslimit(SimulatorStack::JsLimitFromCLimit(isolate, limit)); real_climit_ = limit; diff --git a/src/heap/factory.cc b/src/heap/factory.cc -index caab258158..398cd2bf6c 100644 +index 4c868825d7..a84535f103 100644 --- a/src/heap/factory.cc +++ b/src/heap/factory.cc -@@ -2063,6 +2063,7 @@ Map Factory::InitializeMap(Map map, InstanceType type, int instance_size, +@@ -2079,6 +2079,7 @@ Map Factory::InitializeMap(Map map, InstanceType type, int instance_size, Map::Bits3::ConstructionCounterBits::encode(Map::kNoSlackTracking) | Map::Bits3::IsExtensibleBit::encode(true); map.set_bit_field3(bit_field3); @@ -325,25 +338,11 @@ index caab258158..398cd2bf6c 100644 map.set_instance_type(type); ReadOnlyRoots ro_roots(roots); map.init_prototype_and_constructor_or_back_pointer(ro_roots); -diff --git a/src/heap/memory-chunk-layout.h b/src/heap/memory-chunk-layout.h -index 67e3a7b9dd..ff68856972 100644 ---- a/src/heap/memory-chunk-layout.h -+++ b/src/heap/memory-chunk-layout.h -@@ -73,6 +73,9 @@ class V8_EXPORT_PRIVATE MemoryChunkLayout { - FIELD(FreeListCategory**, Categories), - FIELD(CodeObjectRegistry*, CodeObjectRegistry), - FIELD(PossiblyEmptyBuckets, PossiblyEmptyBuckets), -+#if defined(V8_TARGET_OS_WIN) && defined(V8_TARGET_ARCH_IA32) -+ FIELD(int32_t, WinIa32Padding), -+#endif // V8_TARGET_OS_WIN && V8_TARGET_ARCH_IA32 - FIELD(ActiveSystemPages, ActiveSystemPages), - #ifdef V8_ENABLE_INNER_POINTER_RESOLUTION_OSB - FIELD(ObjectStartBitmap, ObjectStartBitmap), diff --git a/src/heap/setup-heap-internal.cc b/src/heap/setup-heap-internal.cc -index 60ef0cc4b0..245ea249de 100644 +index 5f352d1349..10020d538c 100644 --- a/src/heap/setup-heap-internal.cc +++ b/src/heap/setup-heap-internal.cc -@@ -240,6 +240,7 @@ AllocationResult Heap::AllocatePartialMap(InstanceType instance_type, +@@ -241,6 +241,7 @@ AllocationResult Heap::AllocatePartialMap(InstanceType instance_type, Map::Bits3::OwnsDescriptorsBit::encode(true) | Map::Bits3::ConstructionCounterBits::encode(Map::kNoSlackTracking); map.set_bit_field3(bit_field3); @@ -431,10 +430,10 @@ index 2bbbb7e1f4..5cbd5e8c43 100644 IdleTaskSupport idle_task_support, InProcessStackDumping in_process_stack_dumping, diff --git a/src/objects/js-objects.cc b/src/objects/js-objects.cc -index 682e77ec24..3b9ec4525b 100644 +index 7bb2558cec..65b547b0fd 100644 --- a/src/objects/js-objects.cc +++ b/src/objects/js-objects.cc -@@ -5203,6 +5203,13 @@ void JSObject::SetImmutableProto(Handle object) { +@@ -5246,6 +5246,13 @@ void JSObject::SetImmutableProto(Handle object) { object->set_map(*new_map, kReleaseStore); } @@ -449,10 +448,10 @@ index 682e77ec24..3b9ec4525b 100644 JavaScriptArguments* args, uint32_t arg_count, diff --git a/src/objects/js-objects.h b/src/objects/js-objects.h -index 06489c2b7b..927d68d926 100644 +index f83083cdbc..f9f274eadb 100644 --- a/src/objects/js-objects.h +++ b/src/objects/js-objects.h -@@ -740,6 +740,8 @@ class JSObject : public TorqueGeneratedJSObject { +@@ -745,6 +745,8 @@ class JSObject : public TorqueGeneratedJSObject { // Never called from JavaScript static void SetImmutableProto(Handle object); @@ -462,10 +461,10 @@ index 06489c2b7b..927d68d926 100644 // the caller to initialize object header. Fill the pre-allocated fields with // undefined_value and the rest with filler_map. diff --git a/src/objects/map-inl.h b/src/objects/map-inl.h -index bc25dd1117..661972f6c0 100644 +index 2c42cf2ee6..5fc4e46ba9 100644 --- a/src/objects/map-inl.h +++ b/src/objects/map-inl.h -@@ -124,6 +124,9 @@ BIT_FIELD_ACCESSORS(Map, bit_field3, may_have_interesting_symbols, +@@ -125,6 +125,9 @@ BIT_FIELD_ACCESSORS(Map, bit_field3, may_have_interesting_symbols, BIT_FIELD_ACCESSORS(Map, relaxed_bit_field3, construction_counter, Map::Bits3::ConstructionCounterBits) @@ -476,10 +475,10 @@ index bc25dd1117..661972f6c0 100644 DCHECK(has_named_interceptor()); FunctionTemplateInfo info = GetFunctionTemplateInfo(cage_base); diff --git a/src/objects/map.cc b/src/objects/map.cc -index b29db773e4..92cb13f012 100644 +index ea57d93925..34763a37ef 100644 --- a/src/objects/map.cc +++ b/src/objects/map.cc -@@ -1179,6 +1179,7 @@ Handle Map::RawCopy(Isolate* isolate, Handle src_handle, +@@ -1185,6 +1185,7 @@ Handle Map::RawCopy(Isolate* isolate, Handle src_handle, } // Same as bit_field comment above. raw.set_bit_field3(new_bit_field3); @@ -487,7 +486,7 @@ index b29db773e4..92cb13f012 100644 raw.clear_padding(); } Handle prototype(src_handle->prototype(), isolate); -@@ -1305,6 +1306,12 @@ Handle Map::TransitionToImmutableProto(Isolate* isolate, Handle map) { +@@ -1311,6 +1312,12 @@ Handle Map::TransitionToImmutableProto(Isolate* isolate, Handle map) { return new_map; } @@ -501,10 +500,10 @@ index b29db773e4..92cb13f012 100644 void EnsureInitialMap(Isolate* isolate, Handle map) { #ifdef DEBUG diff --git a/src/objects/map.h b/src/objects/map.h -index 4f2462c715..cd6cec6b2c 100644 +index bdc10ee2ba..838f81cd5d 100644 --- a/src/objects/map.h +++ b/src/objects/map.h -@@ -319,6 +319,11 @@ class Map : public TorqueGeneratedMap { +@@ -321,6 +321,11 @@ class Map : public TorqueGeneratedMap { static_assert(kSlackTrackingCounterStart <= Bits3::ConstructionCounterBits::kMax); @@ -516,7 +515,7 @@ index 4f2462c715..cd6cec6b2c 100644 // Inobject slack tracking is the way to reclaim unused inobject space. // // The instance size is initially determined by adding some slack to -@@ -662,6 +667,8 @@ class Map : public TorqueGeneratedMap { +@@ -666,6 +671,8 @@ class Map : public TorqueGeneratedMap { DECL_BOOLEAN_ACCESSORS(is_immutable_proto) @@ -525,7 +524,7 @@ index 4f2462c715..cd6cec6b2c 100644 // This counter is used for in-object slack tracking. // The in-object slack tracking is considered enabled when the counter is // non zero. The counter only has a valid count for initial maps. For -@@ -830,6 +837,8 @@ class Map : public TorqueGeneratedMap { +@@ -834,6 +841,8 @@ class Map : public TorqueGeneratedMap { static Handle TransitionToImmutableProto(Isolate* isolate, Handle map); @@ -561,10 +560,10 @@ index a8b367ff82..98637087ee 100644 prototype: JSReceiver|Null; constructor_or_back_pointer_or_native_context: Object; diff --git a/src/objects/objects.cc b/src/objects/objects.cc -index b5f0260f4b..4d41e4f62f 100644 +index 26a8d59b34..108b20ee8b 100644 --- a/src/objects/objects.cc +++ b/src/objects/objects.cc -@@ -882,6 +882,12 @@ Handle Object::TypeOf(Isolate* isolate, Handle object) { +@@ -886,6 +886,12 @@ Handle Object::TypeOf(Isolate* isolate, Handle object) { if (object->IsString()) return isolate->factory()->string_string(); if (object->IsSymbol()) return isolate->factory()->symbol_string(); if (object->IsBigInt()) return isolate->factory()->bigint_string(); @@ -578,10 +577,10 @@ index b5f0260f4b..4d41e4f62f 100644 return isolate->factory()->object_string(); } diff --git a/src/objects/source-text-module.cc b/src/objects/source-text-module.cc -index fbb89b4617..915d4a450c 100644 +index 070788138b..2ac555d1c6 100644 --- a/src/objects/source-text-module.cc +++ b/src/objects/source-text-module.cc -@@ -747,7 +747,7 @@ MaybeHandle SourceTextModule::Evaluate( +@@ -746,7 +746,7 @@ MaybeHandle SourceTextModule::Evaluate( if (!module->IsAsyncEvaluating()) { // i. Perform ! Call(capability.[[Resolve]], undefined, // «undefined»). @@ -590,7 +589,7 @@ index fbb89b4617..915d4a450c 100644 .ToHandleChecked(); } -@@ -760,7 +760,7 @@ MaybeHandle SourceTextModule::Evaluate( +@@ -759,7 +759,7 @@ MaybeHandle SourceTextModule::Evaluate( } Maybe SourceTextModule::AsyncModuleExecutionFulfilled( @@ -599,7 +598,7 @@ index fbb89b4617..915d4a450c 100644 // 1. If module.[[Status]] is evaluated, then if (module->status() == kErrored) { // a. Assert: module.[[EvaluationError]] is not empty. -@@ -784,7 +784,7 @@ Maybe SourceTextModule::AsyncModuleExecutionFulfilled( +@@ -783,7 +783,7 @@ Maybe SourceTextModule::AsyncModuleExecutionFulfilled( // «undefined»). Handle capability( JSPromise::cast(module->top_level_capability()), isolate); @@ -608,7 +607,7 @@ index fbb89b4617..915d4a450c 100644 .ToHandleChecked(); } -@@ -850,7 +850,7 @@ Maybe SourceTextModule::AsyncModuleExecutionFulfilled( +@@ -849,7 +849,7 @@ Maybe SourceTextModule::AsyncModuleExecutionFulfilled( // undefined, «undefined»). Handle capability( JSPromise::cast(m->top_level_capability()), isolate); diff --git a/V8Update.cmd b/V8Update.cmd index a15c6b25..f2083c94 100644 --- a/V8Update.cmd +++ b/V8Update.cmd @@ -1,7 +1,7 @@ @echo off setlocal -set v8testedrev=11.1.277.14 +set v8testedrev=11.2.214.13 set v8testedcommit= if not "%v8testedcommit%"=="" goto ProcessArgs diff --git a/Version.tt b/Version.tt index 4835bad4..d5e6149a 100644 --- a/Version.tt +++ b/Version.tt @@ -1,5 +1,5 @@ <# - var version = new Version(7, 4, 0); + var version = new Version(7, 4, 1); var versionSuffix = string.Empty; new Random(versionSuffix.Length); // suppress "versionSuffix not used" warning #> diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index bcdd7982..45b6289b 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,12 +1,11 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.6.1) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) coffee-script (2.4.1) @@ -14,8 +13,8 @@ GEM execjs coffee-script-source (1.11.1) colorator (1.1.0) - commonmarker (0.23.7) - concurrent-ruby (1.2.0) + commonmarker (0.23.8) + concurrent-ruby (1.2.2) dnsruby (1.61.9) simpleidn (~> 0.1) em-websocket (0.5.3) @@ -32,12 +31,12 @@ GEM ffi (1.15.5) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (227) + github-pages (228) github-pages-health-check (= 1.17.9) - jekyll (= 3.9.2) + jekyll (= 3.9.3) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.2.0) + jekyll-commonmark-ghpages (= 0.4.0) jekyll-default-layout (= 0.1.4) jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) @@ -71,7 +70,7 @@ GEM jemoji (= 0.12.0) kramdown (= 2.3.2) kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.3) + liquid (= 4.0.4) mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.13.6, < 2.0) @@ -87,13 +86,13 @@ GEM activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (0.9.5) + i18n (1.12.0) concurrent-ruby (~> 1.0) - jekyll (3.9.2) + jekyll (3.9.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (~> 0.7) + i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 2.0) kramdown (>= 1.17, < 3) @@ -109,11 +108,11 @@ GEM coffee-script-source (~> 1.11.1) jekyll-commonmark (1.4.0) commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.2.0) - commonmarker (~> 0.23.4) + jekyll-commonmark-ghpages (0.4.0) + commonmarker (~> 0.23.7) jekyll (~> 3.9.0) jekyll-commonmark (~> 1.4.0) - rouge (>= 2.0, < 4.0) + rouge (>= 2.0, < 5.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) jekyll-feed (0.15.1) @@ -201,7 +200,7 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) + liquid (4.0.4) listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -210,8 +209,8 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.17.0) - nokogiri (1.14.0-x86_64-linux) + minitest (5.18.0) + nokogiri (1.14.2-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) @@ -240,16 +239,14 @@ GEM unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.10) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.8.2) unicode-display_width (1.8.0) - zeitwerk (2.6.6) PLATFORMS x86_64-linux