Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #611

Merged
merged 28 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3b06e02
New interpreter engine (#559)
lahma Dec 6, 2018
5fe3b24
Variable statement optimization (#562)
lahma Dec 9, 2018
8832f8f
Revert too eager script expression based caching (#565)
lahma Dec 19, 2018
4337831
Update README.md
sebastienros Dec 19, 2018
8430824
Improve for loops, improve reported reference errors (#566)
lahma Dec 19, 2018
2eddfd8
Spread, rest and default (#563)
lahma Dec 20, 2018
e0701ca
ES6 Math functions (#569)
lahma Dec 22, 2018
9fbcd80
fix regression in StrictlyEqual (#573)
lahma Dec 26, 2018
f65d588
ES6 String Literals (#570)
lahma Dec 26, 2018
3519bc7
Improved method resolution (#576)
lahma Dec 31, 2018
1f8d87a
ES6 Number APIs (#574)
lahma Jan 2, 2019
4692fc1
ES6 destructuring (#578)
lahma Jan 4, 2019
a0c2f1f
Fixing BignumDtoa usage of DtoaBuilder.Length (#580)
sebastienros Jan 4, 2019
4f94558
Enable array-like behavior from ICollection/arrays (#579)
lahma Jan 4, 2019
33ffc99
Empty error message when trying to call an object like a function (#581)
lahma Jan 5, 2019
eb3bcd9
Fixes delegates created from expressions. (#585)
Jan 12, 2019
73f75e8
Added engine parameter to IObjectConverter.TryConvert for context (#331)
mattbrailsford Jan 17, 2019
a3a8e06
System.NullReferenceException caused by RegExp.prototype.toString() f…
steffen-liersch Jan 30, 2019
7b485ec
Latest Esprima beta changes (#595)
sam-lord Feb 22, 2019
823658d
Implemented IXunitSerializable (#604)
sebastienros Mar 3, 2019
01dd580
Better enum support, ObjectWrapper dependencies replaced by IObjectWr…
steffen-liersch Mar 3, 2019
c1f5909
Added full support for interop with methods that have default values …
boennhoff Mar 3, 2019
644795e
Implement arrow functions (#601)
sam-lord Mar 3, 2019
a4e1c55
make Random() thread safety (#596)
sxul Mar 7, 2019
58732d2
Add CLR write allowed option to engine for additional sandboxing capa…
Arshia001 Mar 7, 2019
753030e
ES6 Object Literals (#605)
lahma Mar 7, 2019
28b7ea6
Don't allow changes to shared Undefined property descriptor (#606)
lahma Mar 7, 2019
4808143
upgrade Esprima to 1.0.0-beta-1186 (#610)
lahma Mar 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Jint.Tests/* linguist-vendored
Jint.Tests.Ecma/* linguist-vendored
Jint.Tests.CommonScripts/* linguist-vendored
Jint.Tests/** linguist-vendored
Jint.Tests.Ecma/** linguist-vendored
Jint.Tests.CommonScripts/** linguist-vendored
Jint.Tests.Test262/** linguist-vendored
13 changes: 1 addition & 12 deletions Jint.Benchmark/ArrayStressBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;

namespace Jint.Benchmark
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class ArrayStressBenchmark : SingleScriptBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.ShortRun);
Add(MemoryDiagnoser.Default);
}
}
protected override string Script => "var ret=[],tmp,num=100,i=256;for(var j1=0;j1<i*15;j1++){ret=[];ret.length=i}for(var j2=0;j2<i*10;j2++){ret=new Array(i)}ret=[];for(var j3=0;j3<i;j3++){ret.unshift(j3)}ret=[];for(var j4=0;j4<i;j4++){ret.splice(0,0,j4)}var a=ret.slice();for(var j5=0;j5<i;j5++){tmp=a.shift()}var b=ret.slice();for(var j6=0;j6<i;j6++){tmp=b.splice(0,1)}ret=[];for(var j7=0;j7<i*25;j7++){ret.push(j7)}var c=ret.slice();for(var j8=0;j8<i*25;j8++){tmp=c.pop()}var done = true;";

[Params(20)]
Expand Down
21 changes: 4 additions & 17 deletions Jint.Benchmark/DromaeoBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,20 @@
using System.IO;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;
using Jint;

namespace Esprima.Benchmark
namespace Jint.Benchmark
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class DromaeoBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.MediumRun.WithLaunchCount(1));
Add(MemoryDiagnoser.Default);
}
}

private static readonly Dictionary<string, string> files = new Dictionary<string, string>
public static readonly Dictionary<string, string> files = new Dictionary<string, string>
{
{"dromaeo-3d-cube", null},
{"dromaeo-core-eval", null},
{"dromaeo-object-array", null},
{"dromaeo-object-regexp", null},
{"dromaeo-object-string", null},
{"dromaeo-string-base64", null}
//{"dromaeo-string-base64", null}
};

private Engine engine;
Expand Down
3 changes: 2 additions & 1 deletion Jint.Benchmark/Jint.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<None Include="..\Jint.Tests.CommonScripts\Scripts\**" CopyToOutputDirectory="PreserveNewest" LinkBase="SunSpider" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.2" />
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
<ProjectReference Include="..\Jint\Jint.csproj" />
<PackageReference Include="Jurassic" Version="3.0.0-alpha2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="NiL.JS.NetCore" Version="2.5.1200" />
</ItemGroup>
</Project>
12 changes: 1 addition & 11 deletions Jint.Benchmark/LinqJsBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;

namespace Jint.Benchmark
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class LinqJsBenchmark : SingleScriptBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.ShortRun);
}
}

[Params(10)]
public override int N { get; set; }

Expand Down
5 changes: 4 additions & 1 deletion Jint.Benchmark/MinimalScriptBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Jint.Benchmark
using BenchmarkDotNet.Attributes;

namespace Jint.Benchmark
{
[MemoryDiagnoser]
public class MinimalScriptBenchmark : SingleScriptBenchmark
{
protected override string Script => "var done = true;";
Expand Down
14 changes: 1 addition & 13 deletions Jint.Benchmark/StopwatchBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;

namespace Jint.Benchmark
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class StopwatchBenchmark : SingleScriptBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.ShortRun);
Add(MemoryDiagnoser.Default);
}
}

[Params(1)]
public override int N { get; set; }

Expand Down
39 changes: 39 additions & 0 deletions Jint.Benchmark/StringBuilderBenchmark.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using BenchmarkDotNet.Attributes;

namespace Jint.Benchmark
{
[MemoryDiagnoser]
public class StringBuilderBenchmark
{
private const string script = @"
var x = 'some string';
";

private Engine engine;

[GlobalSetup]
public void Setup()
{
engine = new Engine();
engine.Execute(script);
}

[Benchmark]
public void One()
{
engine.Execute("`hello ${x}`");
}

[Benchmark]
public void Two()
{
engine.Execute("`hello ${x}, hello ${x}`");
}

[Benchmark]
public void Three()
{
engine.Execute("`hello ${x}, hello ${x}, hello ${x}`");
}
}
}
14 changes: 1 addition & 13 deletions Jint.Benchmark/SunSpiderBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@
using System.IO;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;
using Jint;

namespace Esprima.Benchmark
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class SunSpiderBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.ShortRun.WithLaunchCount(1));
Add(MemoryDiagnoser.Default);
}
}

private static readonly Dictionary<string, string> files = new Dictionary<string, string>
{
{"3d-cube", null},
Expand Down
14 changes: 1 addition & 13 deletions Jint.Benchmark/UncacheableExpressionsBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using System.Linq;
using System.Text;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;
using Jint.Native;
using Newtonsoft.Json;
using Undefined = Jint.Native.Undefined;
Expand All @@ -16,18 +13,9 @@ namespace Jint.Benchmark
/// <summary>
/// Test case for situation where object is projected via filter and map, Jint deems code as uncacheable.
/// </summary>
[Config(typeof(Config))]
[MemoryDiagnoser]
public class UncacheableExpressionsBenchmark
{
private class Config : ManualConfig
{
public Config()
{
Add(Job.MediumRun.WithLaunchCount(1));
Add(MemoryDiagnoser.Default);
}
}

private Document doc;

private string targetObject;
Expand Down
26 changes: 24 additions & 2 deletions Jint.Tests.Ecma/EcmaTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Jint.Runtime;
using Newtonsoft.Json.Linq;
using Xunit;
using Xunit.Abstractions;

namespace Jint.Tests.Ecma
{
Expand Down Expand Up @@ -268,8 +269,13 @@ public static IEnumerable<object[]> SourceFiles(string prefix, bool skipped)
return results;
}

public class SourceFile
public class SourceFile : IXunitSerializable
{
public SourceFile()
{

}

public SourceFile(JObject node, string basePath)
{
Skip = node["skip"].Value<bool>();
Expand All @@ -281,7 +287,23 @@ public SourceFile(JObject node, string basePath)
public string Source { get; set; }
public bool Skip { get; set; }
public string Reason { get; set; }
public string BasePath { get; }
public string BasePath { get; set; }

public void Deserialize(IXunitSerializationInfo info)
{
Skip = info.GetValue<bool>(nameof(Skip));
Source = info.GetValue<string>(nameof(Source));
Reason = info.GetValue<string>(nameof(Reason));
BasePath = info.GetValue<string>(nameof(BasePath));
}

public void Serialize(IXunitSerializationInfo info)
{
info.AddValue(nameof(Skip), Skip);
info.AddValue(nameof(Source), Source);
info.AddValue(nameof(Reason), Reason);
info.AddValue(nameof(BasePath), BasePath);
}

public override string ToString()
{
Expand Down