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

Fixed stack overflow bug when calling undefined field #568

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jul 16, 2020

Fixed the stack overflow bug :D

This is the example code that caused it:

let x;
x.y(); // this will overflow
  • Removed check for Symbol when it should only check for Object in GetField/Const , this was from when we did not have symbol primitives (pre-Object specialization #419 ) (this is another bug).
  • Removed the ignore cases for these tests since the either pass or fail, not overflow.
  • Added some tests to ignore Array.prototype.indexOf they don't stop the tester but they "freeze" it (iterate from 0 to a very large number like u32::MAX).

Now it reaches a lot more, but still gets stuck by indexOf in some tests.

@HalidOdat HalidOdat added bug Something isn't working execution Issues or PRs related to code execution labels Jul 16, 2020
@HalidOdat HalidOdat added this to the v0.10.0 milestone Jul 16, 2020
@github-actions
Copy link

Benchmark for 895dc6d

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 358.2±21.72ns 360.0±14.37ns -0.50%
Arithmetic operations (Full) 138.4±6.74µs 136.6±7.76µs +1.32%
Array access (Execution) 11.2±0.70µs 10.9±0.51µs +2.75%
Array access (Full) 168.8±10.11µs 160.7±12.31µs +5.04%
Array creation (Execution) 3.0±0.13ms 3.1±0.10ms -3.23%
Array creation (Full) 3.4±0.13ms 3.3±0.12ms +3.03%
Array pop (Execution) 1132.4±79.91µs 1126.6±63.86µs +0.51%
Array pop (Full) 1673.0±100.38µs 1364.7±73.00µs +22.59%
Boolean Object Access (Execution) 4.6±0.44µs 4.3±0.26µs +6.98%
Boolean Object Access (Full) 154.0±9.09µs 146.1±7.88µs +5.41%
Create Realm 121.2±7.25µs 126.2±8.80µs -3.96%
Dynamic Object Property Access (Execution) 5.7±0.31µs 6.0±0.39µs -5.00%
Dynamic Object Property Access (Full) 155.4±11.67µs 147.5±10.75µs +5.36%
Expression (Lexer) 1713.2±86.45ns N/A N/A
Expression (Parser) 10.6±0.51µs 4.2±0.29µs +152.38%
Fibonacci (Execution) 807.1±42.68µs 800.6±35.91µs +0.81%
Fibonacci (Full) 967.6±33.40µs 963.6±45.26µs +0.42%
For loop (Execution) 18.7±1.07µs 18.3±0.90µs +2.19%
For loop (Full) 175.4±10.48µs 158.8±7.62µs +10.45%
For loop (Lexer) 6.4±0.43µs 4.3±0.22µs +48.84%
For loop (Parser) 31.8±2.28µs 11.1±0.62µs +186.49%
Goal Symbols (Parser) 19.1±1.10µs 7.0±0.54µs +172.86%
Hello World (Lexer) 1024.4±85.24ns 753.1±59.30ns +36.02%
Hello World (Parser) 4.8±0.27µs 1789.6±93.27ns +168.22%
Long file (Parser) 469.2±24.24ns 4.9±0.14ms -99.99%
Number Object Access (Execution) 3.3±0.16µs 3.5±0.35µs -5.71%
Number Object Access (Full) 183.3±11.75µs 180.5±11.36µs +1.55%
Object Creation (Execution) 5.1±0.36µs 5.0±0.26µs +2.00%
Object Creation (Full) 169.0±11.89µs 156.9±7.80µs +7.71%
RegExp (Execution) 58.9±3.01µs 58.3±4.11µs +1.03%
RegExp (Full) 249.4±12.49µs 249.3±23.37µs +0.04%
RegExp Literal (Execution) 60.7±3.48µs 60.9±3.52µs -0.33%
RegExp Literal (Full) 214.7±13.35µs 208.0±9.01µs +3.22%
RegExp Literal Creation (Execution) 58.7±3.76µs 59.0±3.48µs -0.51%
RegExp Literal Creation (Full) 245.4±13.64µs 247.8±16.96µs -0.97%
Static Object Property Access (Execution) 5.3±0.36µs 5.3±0.34µs 0.00%
Static Object Property Access (Full) 152.3±8.72µs 144.4±8.72µs +5.47%
String Object Access (Execution) 7.0±0.46µs 7.0±0.51µs 0.00%
String Object Access (Full) 154.2±7.40µs 154.3±25.15µs -0.06%
String comparison (Execution) 5.6±0.35µs 5.7±0.43µs -1.75%
String comparison (Full) 159.1±11.94µs 146.4±11.11µs +8.67%
String concatenation (Execution) 4.7±0.27µs 4.7±0.21µs 0.00%
String concatenation (Full) 146.5±7.65µs 142.6±9.15µs +2.73%
String copy (Execution) 3.7±0.23µs 3.7±0.21µs 0.00%
String copy (Full) 142.9±8.50µs 138.9±8.05µs +2.88%
Symbols (Execution) 3.4±0.21µs 3.4±0.28µs 0.00%
Symbols (Full) 136.5±8.02µs 133.4±7.02µs +2.32%

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Thanks! :) This one was a tricky one

@Razican Razican merged commit 421d88c into test262 Jul 16, 2020
@HalidOdat HalidOdat changed the title Fixed stack overflow bug Fixed stack overflow bug when calling undefined field Jul 16, 2020
@HalidOdat HalidOdat deleted the fix/stack-overflow branch July 16, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants