Skip to content

Commit

Permalink
Return old recursion limit capabilities (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 30, 2023
1 parent 164470f commit 4272c3b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Jint.Tests/Runtime/EngineLimitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class EngineLimitTests
{

#if RELEASE
const int FunctionNestingCount = 840;
const int FunctionNestingCount = 1010;
#else
const int FunctionNestingCount = 510;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Interpreter/Expressions/JintExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public virtual JsValue GetValue(EvaluationContext context)
return context.Engine.GetValue(reference, true);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)]
public object Evaluate(EvaluationContext context)
{
var oldSyntaxElement = context.LastSyntaxElement;
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Interpreter/JintFunctionDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public JintFunctionDefinition(IFunction function)
/// <summary>
/// https://tc39.es/ecma262/#sec-ordinarycallevaluatebody
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)]
internal Completion EvaluateBody(EvaluationContext context, FunctionInstance functionObject, JsValue[] argumentsList)
{
Completion result;
Expand Down
3 changes: 3 additions & 0 deletions Jint/Runtime/Interpreter/JintStatementList.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
using Esprima.Ast;
using Jint.Native;
using Jint.Native.Error;
Expand Down Expand Up @@ -63,6 +64,8 @@ private void Initialize(EvaluationContext context)
_jintStatements = jintStatements;
}


[MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)]
public Completion Execute(EvaluationContext context)
{
if (!_initialized)
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Interpreter/Statements/JintStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected JintStatement(Statement statement)
_statement = statement;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)]
public Completion Execute(EvaluationContext context)
{
if (_statement.Type != Nodes.BlockStatement)
Expand Down

0 comments on commit 4272c3b

Please sign in to comment.