Changeset 186959 in webkit
- Timestamp:
- Jul 17, 2015, 11:48:30 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r186957 r186959 1 2015-07-17 Saam barati <saambarati1@gmail.com> 2 3 Function parameters should be parsed in the same parser arena as the function body 4 https://bugs.webkit.org/show_bug.cgi?id=145995 5 6 Reviewed by Yusuke Suzuki. 7 8 * fast/profiler/anonymous-event-handler-expected.txt: 9 * fast/profiler/anonymous-function-called-from-different-contexts-expected.txt: 10 * fast/profiler/anonymous-function-calls-built-in-functions-expected.txt: 11 * fast/profiler/anonymous-function-calls-eval-expected.txt: 12 * fast/profiler/anonymous-functions-with-display-names-expected.txt: 13 * fast/profiler/apply-expected.txt: 14 * fast/profiler/built-in-function-calls-anonymous-expected.txt: 15 * fast/profiler/built-in-function-calls-user-defined-function-expected.txt: 16 * fast/profiler/call-expected.txt: 17 * fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt: 18 * fast/profiler/compare-multiple-profiles-expected.txt: 19 * fast/profiler/constructor-expected.txt: 20 * fast/profiler/dead-time-expected.txt: 21 * fast/profiler/document-dot-write-expected.txt: 22 * fast/profiler/event-handler-expected.txt: 23 * fast/profiler/execution-context-and-eval-on-same-line-expected.txt: 24 * fast/profiler/inline-event-handler-expected.txt: 25 * fast/profiler/many-calls-in-the-same-scope-expected.txt: 26 * fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt: 27 * fast/profiler/multiple-and-different-scoped-function-calls-expected.txt: 28 * fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt: 29 * fast/profiler/multiple-frames-expected.txt: 30 * fast/profiler/named-functions-with-display-names-expected.txt: 31 * fast/profiler/nested-anonymous-functon-expected.txt: 32 * fast/profiler/nested-start-and-stop-profiler-expected.txt: 33 * fast/profiler/one-execution-context-expected.txt: 34 * fast/profiler/profile-calls-in-included-file-expected.txt: 35 * fast/profiler/profile-with-no-title-expected.txt: 36 * fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt: 37 * fast/profiler/profiling-from-a-nested-location-expected.txt: 38 * fast/profiler/simple-event-call-expected.txt: 39 * fast/profiler/simple-no-level-change-expected.txt: 40 * fast/profiler/start-and-stop-profiler-multiple-times-expected.txt: 41 * fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt: 42 * fast/profiler/stop-profiling-after-setTimeout-expected.txt: 43 * fast/profiler/stop-then-function-call-expected.txt: 44 * fast/profiler/two-execution-contexts-expected.txt: 45 * fast/profiler/user-defined-function-calls-built-in-functions-expected.txt: 46 * fast/profiler/window-dot-eval-expected.txt: 47 * js/dom/script-start-end-locations-expected.txt: 48 1 49 2015-07-17 Benjamin Poulain <bpoulain@apple.com> 2 50 -
trunk/LayoutTests/fast/profiler/anonymous-event-handler-expected.txt
r163140 r186959 5 5 Profile title: Anonymous event handler 6 6 Thread_1 (no file) (line 0:0) 7 startTest anonymous-event-handler.html (line 1 1:1)7 startTest anonymous-event-handler.html (line 10:19) 8 8 getElementById (no file) (line 0:0) 9 9 click (no file) (line 0:0) 10 onclick anonymous-event-handler.html (line 15:5 4)11 insertNewText profiler-test-JS-resources.js (line 17:2 6)10 onclick anonymous-event-handler.html (line 15:51) 11 insertNewText profiler-test-JS-resources.js (line 17:23) 12 12 createElement (no file) (line 0:0) 13 13 createTextNode (no file) (line 0:0) 14 14 appendChild (no file) (line 0:0) 15 15 getElementById (no file) (line 0:0) 16 endTest profiler-test-JS-resources.js (line 1: 20)16 endTest profiler-test-JS-resources.js (line 1:17) 17 17 18 18 -
trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt
r163140 r186959 5 5 Profile title: Same anonymous function called from different contexts 6 6 Thread_1 (no file) (line 0:0) 7 startTest anonymous-function-called-from-different-contexts.html (line 1 1:1)8 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest anonymous-function-called-from-different-contexts.html (line 10:19) 8 anonymousFunction profiler-test-JS-resources.js (line 29:34) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) … … 14 14 eval (no file) (line 0:0) 15 15 (program) (no file) (line 1:1) 16 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)17 insertNewText profiler-test-JS-resources.js (line 17:2 6)16 anonymousFunction profiler-test-JS-resources.js (line 29:34) 17 insertNewText profiler-test-JS-resources.js (line 17:23) 18 18 createElement (no file) (line 0:0) 19 19 createTextNode (no file) (line 0:0) 20 20 appendChild (no file) (line 0:0) 21 21 getElementById (no file) (line 0:0) 22 endTest profiler-test-JS-resources.js (line 1: 20)22 endTest profiler-test-JS-resources.js (line 1:17) 23 23 24 24 -
trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt
r163140 r186959 5 5 Profile title: Anonymous function calls built-in functions 6 6 Thread_1 (no file) (line 0:0) 7 startTest anonymous-function-calls-built-in-functions.html (line 1 1:1)8 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest anonymous-function-calls-built-in-functions.html (line 10:19) 8 anonymousFunction profiler-test-JS-resources.js (line 29:34) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 endTest profiler-test-JS-resources.js (line 1: 20)14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt
r163140 r186959 5 5 Profile title: Anonymous function calles eval 6 6 Thread_1 (no file) (line 0:0) 7 startTest anonymous-function-calls-eval.html (line 1 1:1)8 variableThatPointsToAnAnonymousFunction anonymous-function-calls-eval.html (line 14: 62)7 startTest anonymous-function-calls-eval.html (line 10:19) 8 variableThatPointsToAnAnonymousFunction anonymous-function-calls-eval.html (line 14:59) 9 9 eval (no file) (line 0:0) 10 10 (program) (no file) (line 1:1) 11 insertNewText profiler-test-JS-resources.js (line 17:2 6)11 insertNewText profiler-test-JS-resources.js (line 17:23) 12 12 createElement (no file) (line 0:0) 13 13 createTextNode (no file) (line 0:0) 14 14 appendChild (no file) (line 0:0) 15 15 getElementById (no file) (line 0:0) 16 endTest profiler-test-JS-resources.js (line 1: 20)16 endTest profiler-test-JS-resources.js (line 1:17) 17 17 18 18 -
trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt
r163140 r186959 5 5 Profile title: Anonymous functions with display names 6 6 Thread_1 (no file) (line 0:0) 7 startTest anonymous-functions-with-display-names.html (line 2 3:1)8 anonymousFunctionGenerator anonymous-functions-with-display-names.html (line 1 1:1)9 0 iterations function anonymous-functions-with-display-names.html (line 1 3:5)10 1 iterations function anonymous-functions-with-display-names.html (line 1 3:5)11 2 iterations function anonymous-functions-with-display-names.html (line 1 3:5)12 20 iterations function anonymous-functions-with-display-names.html (line 1 3:5)13 1000 iterations function anonymous-functions-with-display-names.html (line 1 3:5)14 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest anonymous-functions-with-display-names.html (line 22:19) 8 anonymousFunctionGenerator anonymous-functions-with-display-names.html (line 10:36) 9 0 iterations function anonymous-functions-with-display-names.html (line 12:59) 10 1 iterations function anonymous-functions-with-display-names.html (line 12:59) 11 2 iterations function anonymous-functions-with-display-names.html (line 12:59) 12 20 iterations function anonymous-functions-with-display-names.html (line 12:59) 13 1000 iterations function anonymous-functions-with-display-names.html (line 12:59) 14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/fast/profiler/apply-expected.txt
r163140 r186959 5 5 Profile title: Using the apply() method 6 6 Thread_1 (no file) (line 0:0) 7 startTest apply.html (line 1 1:1)8 fakeObject apply.html (line 1 8:1)9 fakeInteriorFunction apply.html (line 2 4:1)10 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest apply.html (line 10:19) 8 fakeObject apply.html (line 17:21) 9 fakeInteriorFunction apply.html (line 23:30) 10 endTest profiler-test-JS-resources.js (line 1:17) 11 11 12 12 -
trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt
r186300 r186959 5 5 Profile title: Built-in function calls an anonymous function 6 6 Thread_1 (no file) (line 0:0) 7 startTest built-in-function-calls-anonymous.html (line 1 1:1)7 startTest built-in-function-calls-anonymous.html (line 10:19) 8 8 Array (no file) (line 0:0) 9 9 map (no file) (line 0:0) … … 13 13 Number (no file) (line 0:0) 14 14 (anonymous function) (no file) (line 0:0) 15 myFunction built-in-function-calls-anonymous.html (line 14: 45)16 arrayOperatorFunction profiler-test-JS-resources.js (line 25: 46)17 endTest profiler-test-JS-resources.js (line 1: 20)15 myFunction built-in-function-calls-anonymous.html (line 14:30) 16 arrayOperatorFunction profiler-test-JS-resources.js (line 25:31) 17 endTest profiler-test-JS-resources.js (line 1:17) 18 18 19 19 -
trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt
r186300 r186959 5 5 Profile title: Built-in function calls a user defined function 6 6 Thread_1 (no file) (line 0:0) 7 startTest built-in-function-calls-user-defined-function.html (line 1 1:1)7 startTest built-in-function-calls-user-defined-function.html (line 10:19) 8 8 Array (no file) (line 0:0) 9 9 map (no file) (line 0:0) … … 13 13 Number (no file) (line 0:0) 14 14 (anonymous function) (no file) (line 0:0) 15 arrayOperatorFunction profiler-test-JS-resources.js (line 25: 46)16 endTest profiler-test-JS-resources.js (line 1: 20)15 arrayOperatorFunction profiler-test-JS-resources.js (line 25:31) 16 endTest profiler-test-JS-resources.js (line 1:17) 17 17 18 18 -
trunk/LayoutTests/fast/profiler/call-expected.txt
r163140 r186959 5 5 Profile title: Using the call() method 6 6 Thread_1 (no file) (line 0:0) 7 startTest call.html (line 1 1:1)8 fakeObject call.html (line 20:1)9 fakeInteriorFunction call.html (line 2 6:1)10 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest call.html (line 10:19) 8 fakeObject call.html (line 19:21) 9 fakeInteriorFunction call.html (line 25:30) 10 endTest profiler-test-JS-resources.js (line 1:17) 11 11 12 12 -
trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt
r163140 r186959 5 5 Profile title: Calling the same function where the profile started from another function 6 6 Thread_1 (no file) (line 0:0) 7 indirection calling-the-function-that-started-the-profiler-from-another-scope.html (line 1 8:1)8 functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 2 4:1)9 functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 2 4:1)10 endTest profiler-test-JS-resources.js (line 1: 20)7 indirection calling-the-function-that-started-the-profiler-from-another-scope.html (line 17:21) 8 functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 23:47) 9 functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 23:47) 10 endTest profiler-test-JS-resources.js (line 1:17) 11 11 12 12 -
trunk/LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt
r163140 r186959 5 5 Profile title: Test 6 6 Thread_1 (no file) (line 0:0) 7 startTest compare-multiple-profiles.html (line 2 3:1)8 test compare-multiple-profiles.html (line 11: 20)9 test2 compare-multiple-profiles.html (line 17: 21)7 startTest compare-multiple-profiles.html (line 22:19) 8 test compare-multiple-profiles.html (line 11:14) 9 test2 compare-multiple-profiles.html (line 17:15) 10 10 11 11 Profile title: Test 12 12 Thread_1 (no file) (line 0:0) 13 startTest compare-multiple-profiles.html (line 2 3:1)14 test compare-multiple-profiles.html (line 11: 20)15 test2 compare-multiple-profiles.html (line 17: 21)13 startTest compare-multiple-profiles.html (line 22:19) 14 test compare-multiple-profiles.html (line 11:14) 15 test2 compare-multiple-profiles.html (line 17:15) 16 16 17 17 -
trunk/LayoutTests/fast/profiler/constructor-expected.txt
r163140 r186959 5 5 Profile title: Using a constructor. 6 6 Thread_1 (no file) (line 0:0) 7 startTest constructor.html (line 1 1:1)8 fakeObject constructor.html (line 20:1)7 startTest constructor.html (line 10:19) 8 fakeObject constructor.html (line 19:21) 9 9 Array (no file) (line 0:0) 10 endTest profiler-test-JS-resources.js (line 1: 20)10 endTest profiler-test-JS-resources.js (line 1:17) 11 11 12 12 -
trunk/LayoutTests/fast/profiler/dead-time-expected.txt
r182034 r186959 5 5 Profile title: Dead time in profile. 6 6 Thread_1 (no file) (line 0:0) 7 onload dead-time.html (line 21: 52)8 startTest dead-time.html (line 1 3:1)7 onload dead-time.html (line 21:44) 8 startTest dead-time.html (line 12:19) 9 9 setTimeout (no file) (line 0:0) 10 10 (program) dead-time.html (line 1:1) 11 endTest profiler-test-JS-resources.js (line 1: 20)11 endTest profiler-test-JS-resources.js (line 1:17) 12 12 13 13 -
trunk/LayoutTests/fast/profiler/document-dot-write-expected.txt
r163140 r186959 2 2 Profile title: Call Document.write() 3 3 Thread_1 (no file) (line 0:0) 4 startTest document-dot-write.html (line 1 1:1)4 startTest document-dot-write.html (line 10:19) 5 5 write (no file) (line 0:0) 6 endTest profiler-test-JS-resources.js (line 1: 20)6 endTest profiler-test-JS-resources.js (line 1:17) 7 7 8 8 -
trunk/LayoutTests/fast/profiler/event-handler-expected.txt
r163140 r186959 5 5 Profile title: Event handler 6 6 Thread_1 (no file) (line 0:0) 7 startTest event-handler.html (line 1 1:1)7 startTest event-handler.html (line 10:19) 8 8 getElementById (no file) (line 0:0) 9 9 addEventListener (no file) (line 0:0) 10 10 click (no file) (line 0:0) 11 insertNewText profiler-test-JS-resources.js (line 17:2 6)11 insertNewText profiler-test-JS-resources.js (line 17:23) 12 12 createElement (no file) (line 0:0) 13 13 createTextNode (no file) (line 0:0) 14 14 appendChild (no file) (line 0:0) 15 15 getElementById (no file) (line 0:0) 16 endTest profiler-test-JS-resources.js (line 1: 20)16 endTest profiler-test-JS-resources.js (line 1:17) 17 17 18 18 -
trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt
r163140 r186959 5 5 Profile title: Two Execution Contexts on the same line 6 6 Thread_1 (no file) (line 0:0) 7 startTest execution-context-and-eval-on-same-line.html (line 1 1:1)8 evalFunction (no file) (line 1:2 5)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest execution-context-and-eval-on-same-line.html (line 10:19) 8 evalFunction (no file) (line 1:22) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 endTest profiler-test-JS-resources.js (line 1: 20)14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/fast/profiler/inline-event-handler-expected.txt
r182034 r186959 5 5 Profile title: Inline event handler 6 6 Thread_1 (no file) (line 0:0) 7 startTest inline-event-handler.html (line 1 1:1)7 startTest inline-event-handler.html (line 10:19) 8 8 getElementById (no file) (line 0:0) 9 9 click (no file) (line 0:0) 10 onclick inline-event-handler.html (line 31:1 35)11 eventListener inline-event-handler.html (line 17:2 6)12 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)13 insertNewText profiler-test-JS-resources.js (line 17:2 6)10 onclick inline-event-handler.html (line 31:127) 11 eventListener inline-event-handler.html (line 17:23) 12 anonymousFunction profiler-test-JS-resources.js (line 29:34) 13 insertNewText profiler-test-JS-resources.js (line 17:23) 14 14 createElement (no file) (line 0:0) 15 15 createTextNode (no file) (line 0:0) 16 16 appendChild (no file) (line 0:0) 17 17 getElementById (no file) (line 0:0) 18 endTest profiler-test-JS-resources.js (line 1: 20)18 endTest profiler-test-JS-resources.js (line 1:17) 19 19 20 20 -
trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt
r163140 r186959 5 5 Profile title: Many Calls In The Same Scope 6 6 Thread_1 (no file) (line 0:0) 7 startTest many-calls-in-the-same-scope.html (line 1 1:1)8 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest many-calls-in-the-same-scope.html (line 10:19) 8 insertNewText profiler-test-JS-resources.js (line 17:23) 9 9 createElement (no file) (line 0:0) 10 10 createTextNode (no file) (line 0:0) 11 11 appendChild (no file) (line 0:0) 12 12 getElementById (no file) (line 0:0) 13 insertGivenText profiler-test-JS-resources.js (line 9: 32)13 insertGivenText profiler-test-JS-resources.js (line 9:25) 14 14 createElement (no file) (line 0:0) 15 15 createTextNode (no file) (line 0:0) 16 16 appendChild (no file) (line 0:0) 17 17 getElementById (no file) (line 0:0) 18 arrayOperatorFunction profiler-test-JS-resources.js (line 25: 46)19 intermediaryFunction profiler-test-JS-resources.js (line 3 3:1)20 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)21 insertNewText profiler-test-JS-resources.js (line 17:2 6)18 arrayOperatorFunction profiler-test-JS-resources.js (line 25:31) 19 intermediaryFunction profiler-test-JS-resources.js (line 32:30) 20 anonymousFunction profiler-test-JS-resources.js (line 29:34) 21 insertNewText profiler-test-JS-resources.js (line 17:23) 22 22 createElement (no file) (line 0:0) 23 23 createTextNode (no file) (line 0:0) 24 24 appendChild (no file) (line 0:0) 25 25 getElementById (no file) (line 0:0) 26 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)27 insertNewText profiler-test-JS-resources.js (line 17:2 6)26 anonymousFunction profiler-test-JS-resources.js (line 29:34) 27 insertNewText profiler-test-JS-resources.js (line 17:23) 28 28 createElement (no file) (line 0:0) 29 29 createTextNode (no file) (line 0:0) 30 30 appendChild (no file) (line 0:0) 31 31 getElementById (no file) (line 0:0) 32 end many-calls-in-the-same-scope.html (line 2 7:1)33 endT many-calls-in-the-same-scope.html (line 3 2:1)34 endTest profiler-test-JS-resources.js (line 1: 20)32 end many-calls-in-the-same-scope.html (line 26:13) 33 endT many-calls-in-the-same-scope.html (line 31:14) 34 endTest profiler-test-JS-resources.js (line 1:17) 35 35 36 36 -
trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt
r163140 r186959 5 5 Profile title: Multiple and different scoped calls to the same anonymous function 6 6 Thread_1 (no file) (line 0:0) 7 startTest multiple-and-different-scoped-anonymous-function-calls.html (line 1 1:1)8 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest multiple-and-different-scoped-anonymous-function-calls.html (line 10:19) 8 anonymousFunction profiler-test-JS-resources.js (line 29:34) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 intermediaryFunction profiler-test-JS-resources.js (line 3 3:1)15 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)16 insertNewText profiler-test-JS-resources.js (line 17:2 6)14 intermediaryFunction profiler-test-JS-resources.js (line 32:30) 15 anonymousFunction profiler-test-JS-resources.js (line 29:34) 16 insertNewText profiler-test-JS-resources.js (line 17:23) 17 17 createElement (no file) (line 0:0) 18 18 createTextNode (no file) (line 0:0) 19 19 appendChild (no file) (line 0:0) 20 20 getElementById (no file) (line 0:0) 21 endTest profiler-test-JS-resources.js (line 1: 20)21 endTest profiler-test-JS-resources.js (line 1:17) 22 22 23 23 -
trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt
r163140 r186959 5 5 Profile title: Multiple and different scoped calls to the same function 6 6 Thread_1 (no file) (line 0:0) 7 startTest multiple-and-different-scoped-function-calls.html (line 1 1:1)8 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest multiple-and-different-scoped-function-calls.html (line 10:19) 8 insertNewText profiler-test-JS-resources.js (line 17:23) 9 9 createElement (no file) (line 0:0) 10 10 createTextNode (no file) (line 0:0) 11 11 appendChild (no file) (line 0:0) 12 12 getElementById (no file) (line 0:0) 13 intermediaryFunction profiler-test-JS-resources.js (line 3 3:1)14 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)15 insertNewText profiler-test-JS-resources.js (line 17:2 6)13 intermediaryFunction profiler-test-JS-resources.js (line 32:30) 14 anonymousFunction profiler-test-JS-resources.js (line 29:34) 15 insertNewText profiler-test-JS-resources.js (line 17:23) 16 16 createElement (no file) (line 0:0) 17 17 createTextNode (no file) (line 0:0) 18 18 appendChild (no file) (line 0:0) 19 19 getElementById (no file) (line 0:0) 20 endTest profiler-test-JS-resources.js (line 1: 20)20 endTest profiler-test-JS-resources.js (line 1:17) 21 21 22 22 -
trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt
r163140 r186959 5 5 Profile title: Multiple calls to different anonymous functions 6 6 Thread_1 (no file) (line 0:0) 7 startTest multiple-anonymous-functions-called-from-the-same-function.html (line 1 1:1)8 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest multiple-anonymous-functions-called-from-the-same-function.html (line 10:19) 8 anonymousFunction profiler-test-JS-resources.js (line 29:34) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 anotherAnonymousFunction profiler-test-JS-resources.js (line 30:4 4)15 insertGivenText profiler-test-JS-resources.js (line 9: 32)14 anotherAnonymousFunction profiler-test-JS-resources.js (line 30:41) 15 insertGivenText profiler-test-JS-resources.js (line 9:25) 16 16 createElement (no file) (line 0:0) 17 17 createTextNode (no file) (line 0:0) 18 18 appendChild (no file) (line 0:0) 19 19 getElementById (no file) (line 0:0) 20 endTest profiler-test-JS-resources.js (line 1: 20)20 endTest profiler-test-JS-resources.js (line 1:17) 21 21 22 22 -
trunk/LayoutTests/fast/profiler/multiple-frames-expected.txt
r163140 r186959 5 5 Profile title: Other window executing JavaScript 6 6 Thread_1 (no file) (line 0:0) 7 startTest multiple-frames.html (line 1 1:1)7 startTest multiple-frames.html (line 10:19) 8 8 getElementById (no file) (line 0:0) 9 functionInOtherFrame other-frame.html (line 4:3 3)10 functionInParentFrame multiple-frames.html (line 21:3 4)11 insertGivenText profiler-test-JS-resources.js (line 9: 32)9 functionInOtherFrame other-frame.html (line 4:30) 10 functionInParentFrame multiple-frames.html (line 21:31) 11 insertGivenText profiler-test-JS-resources.js (line 9:25) 12 12 createElement (no file) (line 0:0) 13 13 createTextNode (no file) (line 0:0) 14 14 appendChild (no file) (line 0:0) 15 15 getElementById (no file) (line 0:0) 16 endTest profiler-test-JS-resources.js (line 1: 20)16 endTest profiler-test-JS-resources.js (line 1:17) 17 17 18 18 -
trunk/LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt
r163140 r186959 5 5 Profile title: Named functions with display names 6 6 Thread_1 (no file) (line 0:0) 7 startTest named-functions-with-display-names.html (line 5 4:1)8 0 iterations function named-functions-with-display-names.html (line 1 1:1)9 1 iteration function named-functions-with-display-names.html (line 1 8:1)10 2 iterations function named-functions-with-display-names.html (line 2 5:1)11 20 iterations function named-functions-with-display-names.html (line 3 2:1)12 1000 iterations function named-functions-with-display-names.html (line 3 9:1)13 bogusDisplayNameFunction named-functions-with-display-names.html (line 4 7:1)14 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest named-functions-with-display-names.html (line 53:19) 8 0 iterations function named-functions-with-display-names.html (line 10:19) 9 1 iteration function named-functions-with-display-names.html (line 17:19) 10 2 iterations function named-functions-with-display-names.html (line 24:19) 11 20 iterations function named-functions-with-display-names.html (line 31:20) 12 1000 iterations function named-functions-with-display-names.html (line 38:22) 13 bogusDisplayNameFunction named-functions-with-display-names.html (line 46:34) 14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt
r163140 r186959 5 5 Profile title: Nested anonymous functions called 6 6 Thread_1 (no file) (line 0:0) 7 startTest nested-anonymous-functon.html (line 1 1:1)8 AnonymousFunctionWichCallsAnAnonymousFunction nested-anonymous-functon.html (line 14:6 8)9 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)10 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest nested-anonymous-functon.html (line 10:19) 8 AnonymousFunctionWichCallsAnAnonymousFunction nested-anonymous-functon.html (line 14:65) 9 anonymousFunction profiler-test-JS-resources.js (line 29:34) 10 insertNewText profiler-test-JS-resources.js (line 17:23) 11 11 createElement (no file) (line 0:0) 12 12 createTextNode (no file) (line 0:0) 13 13 appendChild (no file) (line 0:0) 14 14 getElementById (no file) (line 0:0) 15 endTest profiler-test-JS-resources.js (line 1: 20)15 endTest profiler-test-JS-resources.js (line 1:17) 16 16 17 17 -
trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt
r163140 r186959 5 5 Profile title: Start the profiler the third time. 6 6 Thread_1 (no file) (line 0:0) 7 startTest nested-start-and-stop-profiler.html (line 1 1:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest nested-start-and-stop-profiler.html (line 10:19) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 11 11 Profile title: Start the profiler the third time. 12 12 Thread_1 (no file) (line 0:0) 13 startTest nested-start-and-stop-profiler.html (line 1 1:1)14 endTest profiler-test-JS-resources.js (line 1: 20)13 startTest nested-start-and-stop-profiler.html (line 10:19) 14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 Profile title: Start the profiler the second time. 17 17 Thread_1 (no file) (line 0:0) 18 startTest nested-start-and-stop-profiler.html (line 1 1:1)19 endTest profiler-test-JS-resources.js (line 1: 20)18 startTest nested-start-and-stop-profiler.html (line 10:19) 19 endTest profiler-test-JS-resources.js (line 1:17) 20 20 profileEnd (no file) (line 0:0) 21 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 6 3:1)21 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38) 22 22 createElement (no file) (line 0:0) 23 23 createTextNode (no file) (line 0:0) 24 24 appendChild (no file) (line 0:0) 25 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)25 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 26 26 replace (no file) (line 0:0) 27 27 createTextNode (no file) (line 0:0) 28 28 appendChild (no file) (line 0:0) 29 29 children (no file) (line 0:0) 30 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)30 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 31 31 replace (no file) (line 0:0) 32 32 createTextNode (no file) (line 0:0) 33 33 appendChild (no file) (line 0:0) 34 34 children (no file) (line 0:0) 35 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)35 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 36 36 replace (no file) (line 0:0) 37 37 createTextNode (no file) (line 0:0) … … 44 44 Profile title: Start the profiler the third time. 45 45 Thread_1 (no file) (line 0:0) 46 startTest nested-start-and-stop-profiler.html (line 1 1:1)47 endTest profiler-test-JS-resources.js (line 1: 20)46 startTest nested-start-and-stop-profiler.html (line 10:19) 47 endTest profiler-test-JS-resources.js (line 1:17) 48 48 49 49 Profile title: Start the profiler the second time. 50 50 Thread_1 (no file) (line 0:0) 51 startTest nested-start-and-stop-profiler.html (line 1 1:1)52 endTest profiler-test-JS-resources.js (line 1: 20)51 startTest nested-start-and-stop-profiler.html (line 10:19) 52 endTest profiler-test-JS-resources.js (line 1:17) 53 53 profileEnd (no file) (line 0:0) 54 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 6 3:1)54 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38) 55 55 createElement (no file) (line 0:0) 56 56 createTextNode (no file) (line 0:0) 57 57 appendChild (no file) (line 0:0) 58 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)58 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 59 59 replace (no file) (line 0:0) 60 60 createTextNode (no file) (line 0:0) 61 61 appendChild (no file) (line 0:0) 62 62 children (no file) (line 0:0) 63 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)63 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 64 64 replace (no file) (line 0:0) 65 65 createTextNode (no file) (line 0:0) 66 66 appendChild (no file) (line 0:0) 67 67 children (no file) (line 0:0) 68 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)68 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 69 69 replace (no file) (line 0:0) 70 70 createTextNode (no file) (line 0:0) … … 76 76 Profile title: Start the profiler the first time. 77 77 Thread_1 (no file) (line 0:0) 78 startTest nested-start-and-stop-profiler.html (line 1 1:1)79 endTest profiler-test-JS-resources.js (line 1: 20)78 startTest nested-start-and-stop-profiler.html (line 10:19) 79 endTest profiler-test-JS-resources.js (line 1:17) 80 80 profileEnd (no file) (line 0:0) 81 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 6 3:1)81 printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38) 82 82 createElement (no file) (line 0:0) 83 83 createTextNode (no file) (line 0:0) 84 84 appendChild (no file) (line 0:0) 85 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)85 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 86 86 replace (no file) (line 0:0) 87 87 createTextNode (no file) (line 0:0) 88 88 appendChild (no file) (line 0:0) 89 89 children (no file) (line 0:0) 90 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)90 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 91 91 replace (no file) (line 0:0) 92 92 createTextNode (no file) (line 0:0) 93 93 appendChild (no file) (line 0:0) 94 94 children (no file) (line 0:0) 95 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)95 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 96 96 replace (no file) (line 0:0) 97 97 createTextNode (no file) (line 0:0) 98 98 appendChild (no file) (line 0:0) 99 99 children (no file) (line 0:0) 100 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)100 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 101 101 replace (no file) (line 0:0) 102 102 createTextNode (no file) (line 0:0) 103 103 appendChild (no file) (line 0:0) 104 104 children (no file) (line 0:0) 105 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)105 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 106 106 replace (no file) (line 0:0) 107 107 createTextNode (no file) (line 0:0) 108 108 appendChild (no file) (line 0:0) 109 109 children (no file) (line 0:0) 110 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)110 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 111 111 replace (no file) (line 0:0) 112 112 createTextNode (no file) (line 0:0) 113 113 appendChild (no file) (line 0:0) 114 114 children (no file) (line 0:0) 115 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)115 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 116 116 replace (no file) (line 0:0) 117 117 createTextNode (no file) (line 0:0) 118 118 appendChild (no file) (line 0:0) 119 119 children (no file) (line 0:0) 120 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 7 8:1)120 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37) 121 121 replace (no file) (line 0:0) 122 122 createTextNode (no file) (line 0:0) -
trunk/LayoutTests/fast/profiler/one-execution-context-expected.txt
r163140 r186959 5 5 Profile title: One Execution Context 6 6 Thread_1 (no file) (line 0:0) 7 startTest one-execution-context.html (line 1 1:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest one-execution-context.html (line 10:19) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt
r163140 r186959 5 5 Profile title: Profile call in included file 6 6 Thread_1 (no file) (line 0:0) 7 startProfile profiler-test-JS-resources.js (line 4 3:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 startProfile profiler-test-JS-resources.js (line 42:22) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/profile-with-no-title-expected.txt
r171195 r186959 5 5 Profile title: 6 6 Thread_1 (no file) (line 0:0) 7 startTest profile-with-no-title.html (line 1 1:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest profile-with-no-title.html (line 10:19) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt
r163140 r186959 5 5 Profile title: Profiling From A Nested Location But Stop Profiling Outside The Nesting 6 6 Thread_1 (no file) (line 0:0) 7 functionWichStartsTheProfiler profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html (line 1 7:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 functionWichStartsTheProfiler profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html (line 16:39) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt
r163140 r186959 5 5 Profile title: Profiling From A Nested Location 6 6 Thread_1 (no file) (line 0:0) 7 functionWichStartsAndStopsTheProfiler profiling-from-a-nested-location.html (line 1 6:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 functionWichStartsAndStopsTheProfiler profiling-from-a-nested-location.html (line 15:47) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/simple-event-call-expected.txt
r163140 r186959 5 5 Profile title: A simple profile test where an event happens. 6 6 Thread_1 (no file) (line 0:0) 7 startTest simple-event-call.html (line 1 1:1)8 endTest profiler-test-JS-resources.js (line 1: 20)7 startTest simple-event-call.html (line 10:19) 8 endTest profiler-test-JS-resources.js (line 1:17) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/simple-no-level-change-expected.txt
r163140 r186959 5 5 Profile title: A simple profile test where no scope chagnes 6 6 Thread_1 (no file) (line 0:0) 7 functionWichStartsAndStopsTheProfiler simple-no-level-change.html (line 1 6:1)7 functionWichStartsAndStopsTheProfiler simple-no-level-change.html (line 15:47) 8 8 getElementById (no file) (line 0:0) 9 9 -
trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt
r163140 r186959 5 5 Profile title: Start the profiler the first time. 6 6 Thread_1 (no file) (line 0:0) 7 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)8 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 8 anonymousFunction profiler-test-JS-resources.js (line 29:34) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 endTest profiler-test-JS-resources.js (line 1: 20)14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 17 17 Profile title: Start the profiler the first time. 18 18 Thread_1 (no file) (line 0:0) 19 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)20 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)21 insertNewText profiler-test-JS-resources.js (line 17:2 6)19 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 20 anonymousFunction profiler-test-JS-resources.js (line 29:34) 21 insertNewText profiler-test-JS-resources.js (line 17:23) 22 22 createElement (no file) (line 0:0) 23 23 createTextNode (no file) (line 0:0) 24 24 appendChild (no file) (line 0:0) 25 25 getElementById (no file) (line 0:0) 26 endTest profiler-test-JS-resources.js (line 1: 20)26 endTest profiler-test-JS-resources.js (line 1:17) 27 27 28 28 Profile title: Start the profiler the second time. 29 29 Thread_1 (no file) (line 0:0) 30 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)31 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)32 insertNewText profiler-test-JS-resources.js (line 17:2 6)30 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 31 anonymousFunction profiler-test-JS-resources.js (line 29:34) 32 insertNewText profiler-test-JS-resources.js (line 17:23) 33 33 createElement (no file) (line 0:0) 34 34 createTextNode (no file) (line 0:0) 35 35 appendChild (no file) (line 0:0) 36 36 getElementById (no file) (line 0:0) 37 endTest profiler-test-JS-resources.js (line 1: 20)37 endTest profiler-test-JS-resources.js (line 1:17) 38 38 39 39 40 40 Profile title: Start the profiler the first time. 41 41 Thread_1 (no file) (line 0:0) 42 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)43 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)44 insertNewText profiler-test-JS-resources.js (line 17:2 6)42 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 43 anonymousFunction profiler-test-JS-resources.js (line 29:34) 44 insertNewText profiler-test-JS-resources.js (line 17:23) 45 45 createElement (no file) (line 0:0) 46 46 createTextNode (no file) (line 0:0) 47 47 appendChild (no file) (line 0:0) 48 48 getElementById (no file) (line 0:0) 49 endTest profiler-test-JS-resources.js (line 1: 20)49 endTest profiler-test-JS-resources.js (line 1:17) 50 50 51 51 Profile title: Start the profiler the second time. 52 52 Thread_1 (no file) (line 0:0) 53 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)54 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)55 insertNewText profiler-test-JS-resources.js (line 17:2 6)53 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 54 anonymousFunction profiler-test-JS-resources.js (line 29:34) 55 insertNewText profiler-test-JS-resources.js (line 17:23) 56 56 createElement (no file) (line 0:0) 57 57 createTextNode (no file) (line 0:0) 58 58 appendChild (no file) (line 0:0) 59 59 getElementById (no file) (line 0:0) 60 endTest profiler-test-JS-resources.js (line 1: 20)60 endTest profiler-test-JS-resources.js (line 1:17) 61 61 62 62 Profile title: Start the profiler the third time. 63 63 Thread_1 (no file) (line 0:0) 64 startTest start-and-stop-profiler-multiple-times.html (line 1 1:1)65 anonymousFunction profiler-test-JS-resources.js (line 29:3 7)66 insertNewText profiler-test-JS-resources.js (line 17:2 6)64 startTest start-and-stop-profiler-multiple-times.html (line 10:19) 65 anonymousFunction profiler-test-JS-resources.js (line 29:34) 66 insertNewText profiler-test-JS-resources.js (line 17:23) 67 67 createElement (no file) (line 0:0) 68 68 createTextNode (no file) (line 0:0) 69 69 appendChild (no file) (line 0:0) 70 70 getElementById (no file) (line 0:0) 71 endTest profiler-test-JS-resources.js (line 1: 20)71 endTest profiler-test-JS-resources.js (line 1:17) 72 72 73 73 -
trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt
r163140 r186959 5 5 Profile title: Profiling From A Nested Location 6 6 Thread_1 (no file) (line 0:0) 7 startTest start-and-stop-profiling-in-the-same-function.html (line 1 1:1)8 functionWichStopsTheProfiler start-and-stop-profiling-in-the-same-function.html (line 1 8:1)7 startTest start-and-stop-profiling-in-the-same-function.html (line 10:19) 8 functionWichStopsTheProfiler start-and-stop-profiling-in-the-same-function.html (line 17:38) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt
r182034 r186959 5 5 Profile title: Stop profiling from a timeout 6 6 Thread_1 (no file) (line 0:0) 7 onload stop-profiling-after-setTimeout.html (line 21: 52)8 startTest stop-profiling-after-setTimeout.html (line 1 3:1)7 onload stop-profiling-after-setTimeout.html (line 21:44) 8 startTest stop-profiling-after-setTimeout.html (line 12:19) 9 9 setTimeout (no file) (line 0:0) 10 10 (program) stop-profiling-after-setTimeout.html (line 1:1) 11 endTest profiler-test-JS-resources.js (line 1: 20)11 endTest profiler-test-JS-resources.js (line 1:17) 12 12 13 13 -
trunk/LayoutTests/fast/profiler/stop-then-function-call-expected.txt
r163140 r186959 6 6 Thread_1 (no file) (line 0:0) 7 7 (program) (no file) (line 1:16) 8 test stop-then-function-call.html (line 11: 20)8 test stop-then-function-call.html (line 11:14) 9 9 10 10 -
trunk/LayoutTests/fast/profiler/two-execution-contexts-expected.txt
r163140 r186959 5 5 Profile title: Two Execution Contexts 6 6 Thread_1 (no file) (line 0:0) 7 startTest two-execution-contexts.html (line 1 1:1)8 intermediaryFunction two-execution-contexts.html (line 1 8:1)9 testEnd two-execution-contexts.html (line 33: 20)7 startTest two-execution-contexts.html (line 10:19) 8 intermediaryFunction two-execution-contexts.html (line 17:30) 9 testEnd two-execution-contexts.html (line 33:17) 10 10 11 11 -
trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt
r163140 r186959 7 7 Profile title: User defined function calles built-in functions 8 8 Thread_1 (no file) (line 0:0) 9 startTest user-defined-function-calls-built-in-functions.html (line 1 1:1)9 startTest user-defined-function-calls-built-in-functions.html (line 10:19) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 endTest profiler-test-JS-resources.js (line 1: 20)14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/fast/profiler/window-dot-eval-expected.txt
r163140 r186959 5 5 Profile title: Call window.eval() 6 6 Thread_1 (no file) (line 0:0) 7 startTest window-dot-eval.html (line 1 1:1)8 evalFunction (no file) (line 1:2 5)9 insertNewText profiler-test-JS-resources.js (line 17:2 6)7 startTest window-dot-eval.html (line 10:19) 8 evalFunction (no file) (line 1:22) 9 insertNewText profiler-test-JS-resources.js (line 17:23) 10 10 createElement (no file) (line 0:0) 11 11 createTextNode (no file) (line 0:0) 12 12 appendChild (no file) (line 0:0) 13 13 getElementById (no file) (line 0:0) 14 endTest profiler-test-JS-resources.js (line 1: 20)14 endTest profiler-test-JS-resources.js (line 1:17) 15 15 16 16 -
trunk/LayoutTests/js/dom/script-start-end-locations-expected.txt
r181810 r186959 6 6 program { 25:9 - 26:1 } 7 7 program { 27:13 - 28:1 } 8 function "hf1" { 30:2 4- 30:38 }9 function "hf2" { 31:2 8- 31:42 }10 function "hf3" { 32: 32- 32:46 }11 function "hf4" { 34:2 4- 36:9 }12 function "hf5" { 37:2 8- 39:9 }13 function "hf6" { 40: 32- 42:9 }14 function "hf7" { 45:1 6- 47:5 }15 function "hf8" { 49:3 5- 49:45 }16 function "hf9" { 49:9 7- 49:107 }8 function "hf1" { 30:21 - 30:38 } 9 function "hf2" { 31:25 - 31:42 } 10 function "hf3" { 32:29 - 32:46 } 11 function "hf4" { 34:21 - 36:9 } 12 function "hf5" { 37:25 - 39:9 } 13 function "hf6" { 40:29 - 42:9 } 14 function "hf7" { 45:13 - 47:5 } 15 function "hf8" { 49:32 - 49:45 } 16 function "hf9" { 49:94 - 49:107 } 17 17 18 18 program { 1:1 - 474:1 } 19 19 20 20 On first line: 21 function "f0" { 1:11 5- 1:266 }22 function "f0a" { 1:1 42- 1:257 }23 function "f0b" { 1:1 70- 1:248 }24 eval { 1:1 - 1:56 } 25 function "x0" { 1:29 8- 1:476 }26 function "x0a" { 1:3 30- 1:466 }27 function "x0b" { 1:36 4- 1:456 }21 function "f0" { 1:112 - 1:266 } 22 function "f0a" { 1:139 - 1:257 } 23 function "f0b" { 1:167 - 1:248 } 24 eval { 1:1 - 1:56 } 25 function "x0" { 1:292 - 1:476 } 26 function "x0a" { 1:327 - 1:466 } 27 function "x0b" { 1:361 - 1:456 } 28 28 eval { 1:1 - 1:56 } 29 29 30 30 Functions Declarations in a function: 31 function "f1" { 9: 22- 9:113 }32 eval { 1:1 - 1:56 } 33 function "f2" { 12: 22- 16:5 }34 function "f2a" { 14:2 4- 14:116 }35 eval { 1:1 - 1:56 } 36 function "f3" { 19: 22- 31:5 }37 function "f3a" { 21:2 4- 29:9 }38 function "f3b" { 23:2 8- 27:13 }39 eval { 1:1 - 1:56 } 40 function "f4" { 34: 22- 34:71 }41 function "f4a" { 34:4 9- 34:50 }42 function "f5" { 36: 22- 36:151 }43 function "f5a" { 36:4 9- 36:141 }44 eval { 1:1 - 1:56 } 45 function "f6" { 38: 22- 38:189 }46 function "f6a" { 38:4 9- 38:179 }47 function "f6b" { 38:7 7- 38:169 }31 function "f1" { 9:16 - 9:113 } 32 eval { 1:1 - 1:56 } 33 function "f2" { 12:16 - 16:5 } 34 function "f2a" { 14:21 - 14:116 } 35 eval { 1:1 - 1:56 } 36 function "f3" { 19:16 - 31:5 } 37 function "f3a" { 21:21 - 29:9 } 38 function "f3b" { 23:25 - 27:13 } 39 eval { 1:1 - 1:56 } 40 function "f4" { 34:16 - 34:71 } 41 function "f4a" { 34:46 - 34:50 } 42 function "f5" { 36:16 - 36:151 } 43 function "f5a" { 36:46 - 36:141 } 44 eval { 1:1 - 1:56 } 45 function "f6" { 38:16 - 38:189 } 46 function "f6a" { 38:46 - 38:179 } 47 function "f6b" { 38:74 - 38:169 } 48 48 eval { 1:1 - 1:56 } 49 49 50 50 Indented Functions Declarations in a function: 51 function "fi1" { 43:2 7- 43:119 }52 eval { 1:1 - 1:56 } 53 function "fi2" { 46:2 7- 50:9 }54 function "fi2a" { 48:2 9- 48:122 }55 eval { 1:1 - 1:56 } 56 function "fi3" { 53:2 7- 65:9 }57 function "fi3a" { 55:2 9- 63:13 }58 function "fi3b" { 57:3 3- 61:17 }59 eval { 1:1 - 1:56 } 60 function "fi4" { 68:2 7- 68:80 }61 function "fi4a" { 68:5 6- 68:57 }62 function "fi5" { 70:2 7- 70:160 }63 function "fi5a" { 70:5 6- 70:149 }64 eval { 1:1 - 1:56 } 65 function "fi6" { 72:2 7- 72:201 }66 function "fi6a" { 72:5 6- 72:190 }67 function "fi6b" { 72:8 6- 72:179 }51 function "fi1" { 43:21 - 43:119 } 52 eval { 1:1 - 1:56 } 53 function "fi2" { 46:21 - 50:9 } 54 function "fi2a" { 48:26 - 48:122 } 55 eval { 1:1 - 1:56 } 56 function "fi3" { 53:21 - 65:9 } 57 function "fi3a" { 55:26 - 63:13 } 58 function "fi3b" { 57:30 - 61:17 } 59 eval { 1:1 - 1:56 } 60 function "fi4" { 68:21 - 68:80 } 61 function "fi4a" { 68:53 - 68:57 } 62 function "fi5" { 70:21 - 70:160 } 63 function "fi5a" { 70:53 - 70:149 } 64 eval { 1:1 - 1:56 } 65 function "fi6" { 72:21 - 72:201 } 66 function "fi6a" { 72:53 - 72:190 } 67 function "fi6b" { 72:83 - 72:179 } 68 68 eval { 1:1 - 1:56 } 69 69 70 70 Functions Expressions in a function: 71 function "x1" { 77:2 8- 77:119 }72 eval { 1:1 - 1:56 } 73 function "x2" { 80:2 8- 84:5 }74 function "x2a" { 82: 30- 82:122 }75 eval { 1:1 - 1:56 } 76 function "x3" { 87:2 8- 99:5 }77 function "x3a" { 89: 30- 97:9 }78 function "x3b" { 91:3 4- 95:13 }79 eval { 1:1 - 1:56 } 80 function "x4" { 102:2 8- 102:83 }81 function "x4a" { 102: 61- 102:62 }82 function "x5" { 104:2 8- 104:163 }83 function "x5a" { 104: 61- 104:153 }84 eval { 1:1 - 1:56 } 85 function "x6" { 106:2 8- 106:207 }86 function "x6a" { 106: 61- 106:197 }87 function "x6b" { 106:9 5- 106:187 }71 function "x1" { 77:22 - 77:119 } 72 eval { 1:1 - 1:56 } 73 function "x2" { 80:22 - 84:5 } 74 function "x2a" { 82:27 - 82:122 } 75 eval { 1:1 - 1:56 } 76 function "x3" { 87:22 - 99:5 } 77 function "x3a" { 89:27 - 97:9 } 78 function "x3b" { 91:31 - 95:13 } 79 eval { 1:1 - 1:56 } 80 function "x4" { 102:22 - 102:83 } 81 function "x4a" { 102:58 - 102:62 } 82 function "x5" { 104:22 - 104:163 } 83 function "x5a" { 104:58 - 104:153 } 84 eval { 1:1 - 1:56 } 85 function "x6" { 106:22 - 106:207 } 86 function "x6a" { 106:58 - 106:197 } 87 function "x6b" { 106:92 - 106:187 } 88 88 eval { 1:1 - 1:56 } 89 89 90 90 Indented Functions Expressions in a function: 91 function "xi1" { 111: 33- 111:125 }92 eval { 1:1 - 1:56 } 93 function "xi2" { 114: 33- 118:9 }94 function "xi2a" { 116:3 5- 116:128 }95 eval { 1:1 - 1:56 } 96 function "xi3" { 121: 33- 133:9 }97 function "xi3a" { 123:3 5- 131:13 }98 function "xi3b" { 125:3 9- 129:17 }99 eval { 1:1 - 1:56 } 100 function "xi4" { 136: 33- 136:92 }101 function "xi4a" { 136:6 8- 136:69 }102 function "xi5" { 138: 33- 138:172 }103 function "xi5a" { 138:6 8- 138:161 }104 eval { 1:1 - 1:56 } 105 function "xi6" { 140: 33- 140:219 }106 function "xi6a" { 140:6 8- 140:208 }107 function "xi6b" { 140:10 4- 140:197 }91 function "xi1" { 111:27 - 111:125 } 92 eval { 1:1 - 1:56 } 93 function "xi2" { 114:27 - 118:9 } 94 function "xi2a" { 116:32 - 116:128 } 95 eval { 1:1 - 1:56 } 96 function "xi3" { 121:27 - 133:9 } 97 function "xi3a" { 123:32 - 131:13 } 98 function "xi3b" { 125:36 - 129:17 } 99 eval { 1:1 - 1:56 } 100 function "xi4" { 136:27 - 136:92 } 101 function "xi4a" { 136:65 - 136:69 } 102 function "xi5" { 138:27 - 138:172 } 103 function "xi5a" { 138:65 - 138:161 } 104 eval { 1:1 - 1:56 } 105 function "xi6" { 140:27 - 140:219 } 106 function "xi6a" { 140:65 - 140:208 } 107 function "xi6b" { 140:101 - 140:197 } 108 108 eval { 1:1 - 1:56 } 109 109 110 110 Anonymous Function Declaration in a function: 111 function "" { 146:5 8- 151:5 }111 function "" { 146:52 - 151:5 } 112 112 eval { 1:1 - 1:56 } 113 113 … … 116 116 117 117 Global Functions Declarations: 118 function "gf1" { 161:1 9- 161:111 }119 eval { 1:1 - 1:56 } 120 function "gf2" { 164:1 9- 168:1 }121 function "gf2a" { 166: 21- 166:114 }122 eval { 1:1 - 1:56 } 123 function "gf3" { 171:1 9- 183:1 }124 function "gf3a" { 173: 21- 181:5 }125 function "gf3b" { 175:2 5- 179:9 }126 eval { 1:1 - 1:56 } 127 function "gf4" { 186:1 9- 186:72 }128 function "gf4a" { 186:4 8- 186:49 }129 function "gf5" { 188:1 9- 188:152 }130 function "gf5a" { 188:4 8- 188:141 }131 eval { 1:1 - 1:56 } 132 function "gf6" { 190:1 9- 190:193 }133 function "gf6a" { 190:4 8- 190:182 }134 function "gf6b" { 190:7 8- 190:171 }118 function "gf1" { 161:13 - 161:111 } 119 eval { 1:1 - 1:56 } 120 function "gf2" { 164:13 - 168:1 } 121 function "gf2a" { 166:18 - 166:114 } 122 eval { 1:1 - 1:56 } 123 function "gf3" { 171:13 - 183:1 } 124 function "gf3a" { 173:18 - 181:5 } 125 function "gf3b" { 175:22 - 179:9 } 126 eval { 1:1 - 1:56 } 127 function "gf4" { 186:13 - 186:72 } 128 function "gf4a" { 186:45 - 186:49 } 129 function "gf5" { 188:13 - 188:152 } 130 function "gf5a" { 188:45 - 188:141 } 131 eval { 1:1 - 1:56 } 132 function "gf6" { 190:13 - 190:193 } 133 function "gf6a" { 190:45 - 190:182 } 134 function "gf6b" { 190:75 - 190:171 } 135 135 eval { 1:1 - 1:56 } 136 136 137 137 Indented Global Functions Declarations: 138 function "gfi1" { 195: 24- 195:117 }139 eval { 1:1 - 1:56 } 140 function "gfi2" { 198: 24- 202:5 }141 function "gfi2a" { 200:2 6- 200:120 }142 eval { 1:1 - 1:56 } 143 function "gfi3" { 205: 24- 217:5 }144 function "gfi3a" { 207:2 6- 215:9 }145 function "gfi3b" { 209: 30- 213:13 }146 eval { 1:1 - 1:56 } 147 function "gfi4" { 220: 24- 220:81 }148 function "gfi4a" { 220:5 5- 220:56 }149 function "gfi5" { 222: 24- 222:161 }150 function "gfi5a" { 222:5 5- 222:149 }151 eval { 1:1 - 1:56 } 152 function "gfi6" { 224: 24- 224:205 }153 function "gfi6a" { 224:5 5- 224:193 }154 function "gfi6b" { 224:8 7- 224:181 }138 function "gfi1" { 195:18 - 195:117 } 139 eval { 1:1 - 1:56 } 140 function "gfi2" { 198:18 - 202:5 } 141 function "gfi2a" { 200:23 - 200:120 } 142 eval { 1:1 - 1:56 } 143 function "gfi3" { 205:18 - 217:5 } 144 function "gfi3a" { 207:23 - 215:9 } 145 function "gfi3b" { 209:27 - 213:13 } 146 eval { 1:1 - 1:56 } 147 function "gfi4" { 220:18 - 220:81 } 148 function "gfi4a" { 220:52 - 220:56 } 149 function "gfi5" { 222:18 - 222:161 } 150 function "gfi5a" { 222:52 - 222:149 } 151 eval { 1:1 - 1:56 } 152 function "gfi6" { 224:18 - 224:205 } 153 function "gfi6a" { 224:52 - 224:193 } 154 function "gfi6b" { 224:84 - 224:181 } 155 155 eval { 1:1 - 1:56 } 156 156 157 157 Global Functions Expressions: 158 function "gx1" { 229: 25- 229:117 }159 eval { 1:1 - 1:56 } 160 function "gx2" { 232: 25- 236:1 }161 function "gx2a" { 234:2 7- 234:120 }162 eval { 1:1 - 1:56 } 163 function "gx3" { 239: 25- 251:1 }164 function "gx3a" { 241:2 7- 249:5 }165 function "gx3b" { 243: 31- 247:9 }166 eval { 1:1 - 1:56 } 167 function "gx4" { 254: 25- 254:84 }168 function "gx4a" { 254: 60- 254:61 }169 function "gx5" { 256: 25- 256:164 }170 function "gx5a" { 256: 60- 256:153 }171 eval { 1:1 - 1:56 } 172 function "gx6" { 258: 25- 258:211 }173 function "gx6a" { 258: 60- 258:200 }174 function "gx6b" { 258:9 6- 258:189 }158 function "gx1" { 229:19 - 229:117 } 159 eval { 1:1 - 1:56 } 160 function "gx2" { 232:19 - 236:1 } 161 function "gx2a" { 234:24 - 234:120 } 162 eval { 1:1 - 1:56 } 163 function "gx3" { 239:19 - 251:1 } 164 function "gx3a" { 241:24 - 249:5 } 165 function "gx3b" { 243:28 - 247:9 } 166 eval { 1:1 - 1:56 } 167 function "gx4" { 254:19 - 254:84 } 168 function "gx4a" { 254:57 - 254:61 } 169 function "gx5" { 256:19 - 256:164 } 170 function "gx5a" { 256:57 - 256:153 } 171 eval { 1:1 - 1:56 } 172 function "gx6" { 258:19 - 258:211 } 173 function "gx6a" { 258:57 - 258:200 } 174 function "gx6b" { 258:93 - 258:189 } 175 175 eval { 1:1 - 1:56 } 176 176 177 177 Indented Functions Declarations: 178 function "gxi1" { 263: 30- 263:123 }179 eval { 1:1 - 1:56 } 180 function "gxi2" { 266: 30- 270:5 }181 function "gxi2a" { 268: 32- 268:126 }182 eval { 1:1 - 1:56 } 183 function "gxi3" { 273: 30- 285:5 }184 function "gxi3a" { 275: 32- 283:9 }185 function "gxi3b" { 277:3 6- 281:13 }186 eval { 1:1 - 1:56 } 187 function "gxi4" { 288: 30- 288:93 }188 function "gxi4a" { 288:6 7- 288:68 }189 function "gxi5" { 290: 30- 290:173 }190 function "gxi5a" { 290:6 7- 290:161 }191 eval { 1:1 - 1:56 } 192 function "gxi6" { 292: 30- 292:223 }193 function "gxi6a" { 292:6 7- 292:211 }194 function "gxi6b" { 292:10 5- 292:199 }178 function "gxi1" { 263:24 - 263:123 } 179 eval { 1:1 - 1:56 } 180 function "gxi2" { 266:24 - 270:5 } 181 function "gxi2a" { 268:29 - 268:126 } 182 eval { 1:1 - 1:56 } 183 function "gxi3" { 273:24 - 285:5 } 184 function "gxi3a" { 275:29 - 283:9 } 185 function "gxi3b" { 277:33 - 281:13 } 186 eval { 1:1 - 1:56 } 187 function "gxi4" { 288:24 - 288:93 } 188 function "gxi4a" { 288:64 - 288:68 } 189 function "gxi5" { 290:24 - 290:173 } 190 function "gxi5a" { 290:64 - 290:161 } 191 eval { 1:1 - 1:56 } 192 function "gxi6" { 292:24 - 292:223 } 193 function "gxi6a" { 292:64 - 292:211 } 194 function "gxi6b" { 292:102 - 292:199 } 195 195 eval { 1:1 - 1:56 } 196 196 197 197 Anonymous Global Function Declarations: 198 function "" { 299:5 6- 304:1 }198 function "" { 299:50 - 304:1 } 199 199 eval { 1:1 - 1:56 } 200 200 201 201 Function Declarations in an eval: 202 202 eval { 1:1 - 16:7 } 203 function "ef1" { 3: 20- 14:5 }204 function "ef1a" { 5:2 5- 12:9 }205 function "ef1b" { 7:2 9- 10:13 }203 function "ef1" { 3:17 - 14:5 } 204 function "ef1a" { 5:22 - 12:9 } 205 function "ef1b" { 7:26 - 10:13 } 206 206 eval { 1:1 - 1:56 } 207 207 eval { 1:1 - 1:225 } 208 function "ef2" { 1:5 9- 1:217 }209 function "ef2a" { 1:8 8- 1:207 }210 function "ef2b" { 1:11 8- 1:197 }208 function "ef2" { 1:56 - 1:217 } 209 function "ef2a" { 1:85 - 1:207 } 210 function "ef2b" { 1:115 - 1:197 } 211 211 eval { 1:1 - 1:56 } 212 212 eval { 1:1 - 17:8 } 213 function "efi1" { 4: 21- 15:5 }214 function "efi1a" { 6:2 6- 13:9 }215 function "efi1b" { 8: 30- 11:13 }213 function "efi1" { 4:18 - 15:5 } 214 function "efi1a" { 6:23 - 13:9 } 215 function "efi1b" { 8:27 - 11:13 } 216 216 eval { 1:1 - 1:56 } 217 217 eval { 1:1 - 1:234 } 218 function "efi2" { 1: 60- 1:225 }219 function "efi2a" { 1: 91- 1:214 }220 function "efi2b" { 1:12 3- 1:203 }218 function "efi2" { 1:57 - 1:225 } 219 function "efi2a" { 1:88 - 1:214 } 220 function "efi2b" { 1:120 - 1:203 } 221 221 eval { 1:1 - 1:56 } 222 222 223 223 Function Expressions in an eval: 224 224 eval { 1:1 - 16:7 } 225 function "ex1" { 3:2 6- 14:5 }226 function "ex1a" { 5: 31- 12:9 }227 function "ex1b" { 7:3 5- 10:13 }225 function "ex1" { 3:23 - 14:5 } 226 function "ex1a" { 5:28 - 12:9 } 227 function "ex1b" { 7:32 - 10:13 } 228 228 eval { 1:1 - 1:56 } 229 229 eval { 1:1 - 1:246 } 230 function "ex2" { 1:6 5- 1:237 }231 function "ex2a" { 1: 100- 1:226 }232 function "ex2b" { 1:13 6- 1:215 }230 function "ex2" { 1:62 - 1:237 } 231 function "ex2a" { 1:97 - 1:226 } 232 function "ex2b" { 1:133 - 1:215 } 233 233 eval { 1:1 - 1:56 } 234 234 eval { 1:1 - 17:8 } 235 function "exi1" { 4:2 7- 15:5 }236 function "exi1a" { 6: 32- 13:9 }237 function "exi1b" { 8:3 6- 11:13 }235 function "exi1" { 4:24 - 15:5 } 236 function "exi1a" { 6:29 - 13:9 } 237 function "exi1b" { 8:33 - 11:13 } 238 238 eval { 1:1 - 1:56 } 239 239 eval { 1:1 - 1:255 } 240 function "exi2" { 1:6 6- 1:245 }241 function "exi2a" { 1:10 3- 1:233 }242 function "exi2b" { 1:1 41- 1:221 }240 function "exi2" { 1:63 - 1:245 } 241 function "exi2a" { 1:100 - 1:233 } 242 function "exi2b" { 1:138 - 1:221 } 243 243 eval { 1:1 - 1:56 } 244 244 245 245 new Function Object: 246 function "anonymous" { 1:2 7- 2:228 }247 function "nf1a" { 2: 60- 2:219 }248 function "nf1b" { 2: 90- 2:209 }249 function "nf1c" { 2:1 20- 2:199 }250 eval { 1:1 - 1:56 } 251 function "anonymous" { 1:2 7- 18:8 }252 function "nf2a" { 5: 21- 16:5 }253 function "nf2b" { 7:2 5- 14:9 }254 function "nf2c" { 9:2 9- 12:13 }255 eval { 1:1 - 1:56 } 256 function "anonymous" { 1:2 7- 2:228 }257 function "nf1a" { 2: 60- 2:219 }258 function "nf1b" { 2: 90- 2:209 }259 function "nf1c" { 2:1 20- 2:199 }260 eval { 1:1 - 1:56 } 261 function "anonymous" { 1:2 7- 2:237 }262 function "nfi1a" { 2: 61- 2:227 }263 function "nfi1b" { 2:9 3- 2:216 }264 function "nfi1c" { 2:12 5- 2:205 }265 eval { 1:1 - 1:56 } 266 function "anonymous" { 1:2 7- 18:8 }267 function "nf2a" { 5: 21- 16:5 }268 function "nf2b" { 7:2 5- 14:9 }269 function "nf2c" { 9:2 9- 12:13 }270 eval { 1:1 - 1:56 } 271 function "anonymous" { 1:2 7- 18:9 }272 function "nfi2a" { 5: 22- 16:5 }273 function "nfi2b" { 7:2 6- 14:9 }274 function "nfi2c" { 9: 30- 12:13 }246 function "anonymous" { 1:20 - 2:228 } 247 function "nf1a" { 2:57 - 2:219 } 248 function "nf1b" { 2:87 - 2:209 } 249 function "nf1c" { 2:117 - 2:199 } 250 eval { 1:1 - 1:56 } 251 function "anonymous" { 1:20 - 18:8 } 252 function "nf2a" { 5:18 - 16:5 } 253 function "nf2b" { 7:22 - 14:9 } 254 function "nf2c" { 9:26 - 12:13 } 255 eval { 1:1 - 1:56 } 256 function "anonymous" { 1:20 - 2:228 } 257 function "nf1a" { 2:57 - 2:219 } 258 function "nf1b" { 2:87 - 2:209 } 259 function "nf1c" { 2:117 - 2:199 } 260 eval { 1:1 - 1:56 } 261 function "anonymous" { 1:20 - 2:237 } 262 function "nfi1a" { 2:58 - 2:227 } 263 function "nfi1b" { 2:90 - 2:216 } 264 function "nfi1c" { 2:122 - 2:205 } 265 eval { 1:1 - 1:56 } 266 function "anonymous" { 1:20 - 18:8 } 267 function "nf2a" { 5:18 - 16:5 } 268 function "nf2b" { 7:22 - 14:9 } 269 function "nf2c" { 9:26 - 12:13 } 270 eval { 1:1 - 1:56 } 271 function "anonymous" { 1:20 - 18:9 } 272 function "nfi2a" { 5:19 - 16:5 } 273 function "nfi2b" { 7:23 - 14:9 } 274 function "nfi2c" { 9:27 - 12:13 } 275 275 eval { 1:1 - 1:56 } 276 276 -
trunk/Source/JavaScriptCore/API/JSScriptRef.cpp
r185608 r186959 71 71 { 72 72 return !!JSC::parse<JSC::ProgramNode>( 73 vm, source, 0,Identifier(), JSParserBuiltinMode::NotBuiltin,73 vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, 74 74 JSParserStrictMode::NotStrict, JSParserCodeType::Program, 75 75 error); -
trunk/Source/JavaScriptCore/ChangeLog
r186923 r186959 1 2015-07-17 Saam barati <saambarati1@gmail.com> 2 3 Function parameters should be parsed in the same parser arena as the function body 4 https://bugs.webkit.org/show_bug.cgi?id=145995 5 6 Reviewed by Yusuke Suzuki. 7 8 This patch changes how functions are parsed in JSC. A function's 9 parameters are now parsed in the same arena as the function itself. 10 This allows us to arena allocate all destructuring AST nodes and 11 the FunctionParameters node. This will help make implementing ES6 12 default parameter values sane. 13 14 A source code that represents a function now includes the text of the function's 15 parameters. The starting offset is at the opening parenthesis of the parameter 16 list or at the starting character of the identifier for arrow functions that 17 have single arguments and don't start with parenthesis. 18 19 For example: 20 21 "function (param1, param2) { ... }" 22 ^ 23 | This offset used to be the starting offset of a function's SourceCode 24 ^ 25 | This is the new starting offset for a function's SourceCode. 26 27 This requires us to change how some offsets are calculated 28 and also requires us to report some different line numbers for internal 29 metrics that use a SourceCode's starting line and column numbers. 30 31 This patch also does a bit of cleanup with regards to how 32 functions are parsed in general (especially arrow functions). 33 It removes some unnecessary #ifdefs and the likes for arrow 34 to make things clearer and more deliberate. 35 36 * API/JSScriptRef.cpp: 37 (parseScript): 38 * builtins/BuiltinExecutables.cpp: 39 (JSC::BuiltinExecutables::createExecutableInternal): 40 * bytecode/UnlinkedCodeBlock.cpp: 41 (JSC::generateFunctionCodeBlock): 42 (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): 43 (JSC::UnlinkedFunctionExecutable::visitChildren): 44 (JSC::UnlinkedFunctionExecutable::parameterCount): Deleted. 45 * bytecode/UnlinkedCodeBlock.h: 46 * bytecompiler/NodesCodegen.cpp: 47 (JSC::DestructuringAssignmentNode::emitBytecode): 48 (JSC::assignDefaultValueIfUndefined): 49 (JSC::ArrayPatternNode::collectBoundIdentifiers): 50 (JSC::DestructuringPatternNode::~DestructuringPatternNode): Deleted. 51 * parser/ASTBuilder.h: 52 (JSC::ASTBuilder::createClassExpr): 53 (JSC::ASTBuilder::createFunctionExpr): 54 (JSC::ASTBuilder::createFunctionBody): 55 (JSC::ASTBuilder::createArrowFunctionExpr): 56 (JSC::ASTBuilder::createGetterOrSetterProperty): 57 (JSC::ASTBuilder::createElementList): 58 (JSC::ASTBuilder::createFormalParameterList): 59 (JSC::ASTBuilder::appendParameter): 60 (JSC::ASTBuilder::createClause): 61 (JSC::ASTBuilder::createClauseList): 62 (JSC::ASTBuilder::createFuncDeclStatement): 63 (JSC::ASTBuilder::createForInLoop): 64 (JSC::ASTBuilder::createForOfLoop): 65 (JSC::ASTBuilder::isResolve): 66 (JSC::ASTBuilder::createDestructuringAssignment): 67 (JSC::ASTBuilder::createArrayPattern): 68 (JSC::ASTBuilder::appendArrayPatternSkipEntry): 69 (JSC::ASTBuilder::appendArrayPatternEntry): 70 (JSC::ASTBuilder::appendArrayPatternRestEntry): 71 (JSC::ASTBuilder::finishArrayPattern): 72 (JSC::ASTBuilder::createObjectPattern): 73 (JSC::ASTBuilder::appendObjectPatternEntry): 74 (JSC::ASTBuilder::createBindingLocation): 75 (JSC::ASTBuilder::setEndOffset): 76 * parser/Lexer.cpp: 77 (JSC::Lexer<T>::Lexer): 78 (JSC::Lexer<T>::nextTokenIsColon): 79 (JSC::Lexer<T>::setTokenPosition): 80 (JSC::Lexer<T>::lex): 81 (JSC::Lexer<T>::clear): 82 * parser/Lexer.h: 83 (JSC::Lexer::setIsReparsingFunction): 84 (JSC::Lexer::isReparsingFunction): 85 (JSC::Lexer::lineNumber): 86 (JSC::Lexer::setIsReparsing): Deleted. 87 (JSC::Lexer::isReparsing): Deleted. 88 * parser/NodeConstructors.h: 89 (JSC::TryNode::TryNode): 90 (JSC::FunctionParameters::FunctionParameters): 91 (JSC::FuncExprNode::FuncExprNode): 92 (JSC::FuncDeclNode::FuncDeclNode): 93 (JSC::ArrayPatternNode::ArrayPatternNode): 94 (JSC::ObjectPatternNode::ObjectPatternNode): 95 (JSC::BindingNode::BindingNode): 96 (JSC::DestructuringAssignmentNode::DestructuringAssignmentNode): 97 (JSC::ParameterNode::ParameterNode): Deleted. 98 (JSC::ArrayPatternNode::create): Deleted. 99 (JSC::ObjectPatternNode::create): Deleted. 100 (JSC::BindingNode::create): Deleted. 101 * parser/Nodes.cpp: 102 (JSC::ProgramNode::ProgramNode): 103 (JSC::EvalNode::EvalNode): 104 (JSC::FunctionBodyNode::FunctionBodyNode): 105 (JSC::FunctionBodyNode::finishParsing): 106 (JSC::FunctionNode::FunctionNode): 107 (JSC::FunctionNode::finishParsing): 108 (JSC::FunctionParameters::create): Deleted. 109 (JSC::FunctionParameters::FunctionParameters): Deleted. 110 (JSC::FunctionParameters::~FunctionParameters): Deleted. 111 * parser/Nodes.h: 112 (JSC::ProgramNode::startColumn): 113 (JSC::ProgramNode::endColumn): 114 (JSC::EvalNode::startColumn): 115 (JSC::EvalNode::endColumn): 116 (JSC::FunctionParameters::size): 117 (JSC::FunctionParameters::at): 118 (JSC::FunctionParameters::append): 119 (JSC::FuncExprNode::body): 120 (JSC::DestructuringPatternNode::~DestructuringPatternNode): 121 (JSC::DestructuringPatternNode::isBindingNode): 122 (JSC::DestructuringPatternNode::emitDirectBinding): 123 (JSC::ArrayPatternNode::appendIndex): 124 (JSC::ObjectPatternNode::appendEntry): 125 (JSC::BindingNode::boundProperty): 126 (JSC::BindingNode::divotStart): 127 (JSC::BindingNode::divotEnd): 128 (JSC::DestructuringAssignmentNode::bindings): 129 (JSC::FuncDeclNode::body): 130 (JSC::ParameterNode::pattern): Deleted. 131 (JSC::ParameterNode::nextParam): Deleted. 132 (JSC::FunctionParameters::patterns): Deleted. 133 * parser/Parser.cpp: 134 (JSC::Parser<LexerType>::Parser): 135 (JSC::Parser<LexerType>::~Parser): 136 (JSC::Parser<LexerType>::parseInner): 137 (JSC::Parser<LexerType>::allowAutomaticSemicolon): 138 (JSC::Parser<LexerType>::parseSourceElements): 139 (JSC::Parser<LexerType>::createBindingPattern): 140 (JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBodySourceElements): 141 (JSC::Parser<LexerType>::tryParseDestructuringPatternExpression): 142 (JSC::Parser<LexerType>::parseSwitchClauses): 143 (JSC::Parser<LexerType>::parseSwitchDefaultClause): 144 (JSC::Parser<LexerType>::parseBlockStatement): 145 (JSC::Parser<LexerType>::parseStatement): 146 (JSC::Parser<LexerType>::parseFormalParameters): 147 (JSC::Parser<LexerType>::parseFunctionBody): 148 (JSC::stringForFunctionMode): 149 (JSC::Parser<LexerType>::parseFunctionParameters): 150 (JSC::Parser<LexerType>::parseFunctionInfo): 151 (JSC::Parser<LexerType>::parseFunctionDeclaration): 152 (JSC::Parser<LexerType>::parseClass): 153 (JSC::Parser<LexerType>::parsePrimaryExpression): 154 (JSC::Parser<LexerType>::parseMemberExpression): 155 (JSC::Parser<LexerType>::parseArrowFunctionExpression): 156 (JSC::operatorString): 157 (JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBody): Deleted. 158 * parser/Parser.h: 159 (JSC::Parser::positionBeforeLastNewline): 160 (JSC::Parser::locationBeforeLastToken): 161 (JSC::Parser::findCachedFunctionInfo): 162 (JSC::Parser::isofToken): 163 (JSC::Parser::isEndOfArrowFunction): 164 (JSC::Parser::isArrowFunctionParamters): 165 (JSC::Parser::tokenStart): 166 (JSC::Parser::isLETMaskedAsIDENT): 167 (JSC::Parser::autoSemiColon): 168 (JSC::Parser::setEndOfStatement): 169 (JSC::Parser::canRecurse): 170 (JSC::Parser<LexerType>::parse): 171 (JSC::parse): 172 * parser/ParserFunctionInfo.h: 173 * parser/ParserModes.h: 174 (JSC::functionNameIsInScope): 175 * parser/SourceCode.h: 176 (JSC::makeSource): 177 (JSC::SourceCode::subExpression): 178 (JSC::SourceCode::subArrowExpression): Deleted. 179 * parser/SourceProviderCache.h: 180 (JSC::SourceProviderCache::get): 181 * parser/SourceProviderCacheItem.h: 182 (JSC::SourceProviderCacheItem::endFunctionToken): 183 (JSC::SourceProviderCacheItem::usedVariables): 184 (JSC::SourceProviderCacheItem::writtenVariables): 185 (JSC::SourceProviderCacheItem::SourceProviderCacheItem): 186 * parser/SyntaxChecker.h: 187 (JSC::SyntaxChecker::SyntaxChecker): 188 (JSC::SyntaxChecker::createClassExpr): 189 (JSC::SyntaxChecker::createFunctionExpr): 190 (JSC::SyntaxChecker::createFunctionBody): 191 (JSC::SyntaxChecker::createArrowFunctionExpr): 192 (JSC::SyntaxChecker::setFunctionNameStart): 193 (JSC::SyntaxChecker::createArguments): 194 (JSC::SyntaxChecker::createPropertyList): 195 (JSC::SyntaxChecker::createElementList): 196 (JSC::SyntaxChecker::createFormalParameterList): 197 (JSC::SyntaxChecker::appendParameter): 198 (JSC::SyntaxChecker::createClause): 199 (JSC::SyntaxChecker::createClauseList): 200 * runtime/CodeCache.cpp: 201 (JSC::CodeCache::getGlobalCodeBlock): 202 (JSC::CodeCache::getFunctionExecutableFromGlobalCode): 203 * runtime/Completion.cpp: 204 (JSC::checkSyntax): 205 * runtime/Executable.cpp: 206 (JSC::ProgramExecutable::checkSyntax): 207 * tests/controlFlowProfiler/conditional-expression.js: 208 (testConditionalFunctionCall): 209 1 210 2015-07-16 Filip Pizlo <fpizlo@apple.com> 2 211 -
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r186860 r186959 70 70 RefPtr<SourceProvider> sourceOverride = isParsingDefaultConstructor ? source.provider() : nullptr; 71 71 std::unique_ptr<ProgramNode> program = parse<ProgramNode>( 72 &m_vm, source, 0, Identifier(), builtinMode, 73 JSParserStrictMode::NotStrict, 74 JSParserCodeType::Program, 75 error, &positionBeforeLastNewline, constructorKind); 72 &m_vm, source, Identifier(), builtinMode, 73 JSParserStrictMode::NotStrict, JSParserCodeType::Program, error, 74 &positionBeforeLastNewline, FunctionParseMode::NotAFunctionMode, constructorKind); 76 75 77 76 if (!program) { -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
r186860 r186959 61 61 JSParserStrictMode strictMode = executable->isInStrictContext() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict; 62 62 std::unique_ptr<FunctionNode> function = parse<FunctionNode>( 63 &vm, source, executable-> parameters(), executable->name(), builtinMode,64 strictMode, JSParserCodeType::Function, error, 0);63 &vm, source, executable->name(), builtinMode, strictMode, 64 JSParserCodeType::Function, error, nullptr, executable->parseMode()); 65 65 66 66 if (!function) { … … 69 69 } 70 70 71 function->finishParsing(executable-> parameters(), executable->name(), executable->functionMode());71 function->finishParsing(executable->name(), executable->functionMode()); 72 72 executable->recordParse(function->features(), function->hasCapturedVariables()); 73 73 … … 85 85 , m_name(node->ident()) 86 86 , m_inferredName(node->inferredName()) 87 , m_parameters(node->parameters())88 87 , m_sourceOverride(WTF::move(sourceOverride)) 89 88 , m_firstLineOffset(node->firstLine() - source.firstLine()) … … 97 96 , m_typeProfilingStartOffset(node->functionKeywordStart()) 98 97 , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1) 98 , m_parameterCount(node->parameterCount()) 99 , m_parseMode(node->parseMode()) 99 100 , m_features(0) 100 101 , m_isInStrictContext(node->isInStrictContext()) … … 106 107 ASSERT(m_constructorKind == static_cast<unsigned>(node->constructorKind())); 107 108 m_parentScopeTDZVariables.swap(parentScopeTDZVariables); 108 }109 110 size_t UnlinkedFunctionExecutable::parameterCount() const111 {112 return m_parameters->size();113 109 } 114 110 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
r186860 r186959 50 50 class FunctionBodyNode; 51 51 class FunctionExecutable; 52 class FunctionParameters;53 52 class JSScope; 54 53 class ParserError; … … 124 123 return (kind == CodeForCall) ? m_symbolTableForCall.get() : m_symbolTableForConstruct.get(); 125 124 } 126 size_t parameterCount() const; 125 unsigned parameterCount() const { return m_parameterCount; }; 126 FunctionParseMode parseMode() const { return m_parseMode; }; 127 127 bool isInStrictContext() const { return m_isInStrictContext; } 128 128 FunctionMode functionMode() const { return static_cast<FunctionMode>(m_functionMode); } … … 156 156 } 157 157 158 FunctionParameters* parameters() { return m_parameters.get(); }159 160 158 void recordParse(CodeFeatures features, bool hasCapturedVariables) 161 159 { … … 184 182 WriteBarrier<SymbolTable> m_symbolTableForCall; 185 183 WriteBarrier<SymbolTable> m_symbolTableForConstruct; 186 RefPtr<FunctionParameters> m_parameters;187 184 RefPtr<SourceProvider> m_sourceOverride; 188 185 VariableEnvironment m_parentScopeTDZVariables; … … 197 194 unsigned m_typeProfilingStartOffset; 198 195 unsigned m_typeProfilingEndOffset; 196 unsigned m_parameterCount; 197 FunctionParseMode m_parseMode; 199 198 200 199 CodeFeatures m_features; -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r186860 r186959 3190 3190 } 3191 3191 3192 DestructuringPatternNode::~DestructuringPatternNode()3193 {3194 }3195 3196 3192 static void assignDefaultValueIfUndefined(BytecodeGenerator& generator, RegisterID* maybeUndefined, ExpressionNode* defaultValue) 3197 3193 { … … 3351 3347 { 3352 3348 for (size_t i = 0; i < m_targetPatterns.size(); i++) { 3353 if (DestructuringPatternNode* node = m_targetPatterns[i].pattern .get())3349 if (DestructuringPatternNode* node = m_targetPatterns[i].pattern) 3354 3350 node->collectBoundIdentifiers(identifiers); 3355 3351 } -
trunk/Source/JavaScriptCore/parser/ASTBuilder.h
r186860 r186959 95 95 96 96 97 typedef SyntaxChecker FunctionBodyBuilder;98 99 97 typedef ExpressionNode* Expression; 100 98 typedef JSC::SourceElements* SourceElements; … … 111 109 typedef TemplateLiteralNode* TemplateLiteral; 112 110 #endif 113 typedef ParameterNode* FormalParameterList;111 typedef FunctionParameters* FormalParameterList; 114 112 typedef FunctionBodyNode* FunctionBody; 115 113 #if ENABLE(ES6_CLASS_SYNTAX) … … 121 119 typedef ConstDeclNode* ConstDeclList; 122 120 typedef std::pair<ExpressionNode*, BinaryOpInfo> BinaryOperand; 123 typedef RefPtr<DestructuringPatternNode>DestructuringPattern;124 typedef RefPtr<ArrayPatternNode>ArrayPattern;125 typedef RefPtr<ObjectPatternNode>ObjectPattern;126 typedef RefPtr<BindingNode>BindingPattern;121 typedef DestructuringPatternNode* DestructuringPattern; 122 typedef ArrayPatternNode* ArrayPattern; 123 typedef ObjectPatternNode* ObjectPattern; 124 typedef BindingNode* BindingPattern; 127 125 static const bool CreatesAST = true; 128 126 static const bool NeedsFreeVariableInfo = true; … … 345 343 #endif 346 344 347 ExpressionNode* createFunctionExpr(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& info)348 { 349 FuncExprNode* result = new (m_parserArena) FuncExprNode(location, * info.name, info.body,350 m_sourceCode->subExpression( info.startFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters);351 info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);345 ExpressionNode* createFunctionExpr(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& functionInfo) 346 { 347 FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *functionInfo.name, functionInfo.body, 348 m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn)); 349 functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset); 352 350 return result; 353 351 } … … 357 355 unsigned startColumn, unsigned endColumn, int functionKeywordStart, 358 356 int functionNameStart, int parametersStart, bool inStrictContext, 359 ConstructorKind constructorKind )357 ConstructorKind constructorKind, unsigned parameterCount, FunctionParseMode mode) 360 358 { 361 359 return new (m_parserArena) FunctionBodyNode( 362 360 m_parserArena, startLocation, endLocation, startColumn, endColumn, 363 361 functionKeywordStart, functionNameStart, parametersStart, 364 inStrictContext, constructorKind); 365 } 366 367 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 368 ExpressionNode* createArrowFunctionExpr(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& info) 369 { 370 SourceCode source = info.functionBodyType == ArrowFunctionBodyExpression 371 ? m_sourceCode->subArrowExpression(info.arrowFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn) 372 : m_sourceCode->subExpression(info.startFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn); 373 374 FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *info.name, info.body, source, info.parameters); 375 info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset); 376 return result; 377 } 378 #endif 362 inStrictContext, constructorKind, parameterCount, mode); 363 } 364 365 ExpressionNode* createArrowFunctionExpr(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& functionInfo) 366 { 367 SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn); 368 369 FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *functionInfo.name, functionInfo.body, source); 370 functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset); 371 return result; 372 } 379 373 380 374 NEVER_INLINE PropertyNode* createGetterOrSetterProperty(const JSTokenLocation& location, PropertyNode::Type type, bool, 381 const Identifier* name, const ParserFunctionInfo<ASTBuilder>& info, SuperBinding superBinding)375 const Identifier* name, const ParserFunctionInfo<ASTBuilder>& functionInfo, SuperBinding superBinding) 382 376 { 383 377 ASSERT(name); 384 info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);385 info.body->setInferredName(*name);386 SourceCode source = m_sourceCode->subExpression( info.startFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn);387 FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, info.body, source, info.parameters);378 functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset); 379 functionInfo.body->setInferredName(*name); 380 SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn); 381 FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, m_vm->propertyNames->nullIdentifier, functionInfo.body, source); 388 382 return new (m_parserArena) PropertyNode(*name, funcExpr, type, PropertyNode::Unknown, superBinding); 389 383 } 390 384 391 385 NEVER_INLINE PropertyNode* createGetterOrSetterProperty(VM* vm, ParserArena& parserArena, const JSTokenLocation& location, PropertyNode::Type type, bool, 392 double name, const ParserFunctionInfo<ASTBuilder>& info, SuperBinding superBinding)393 { 394 info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);386 double name, const ParserFunctionInfo<ASTBuilder>& functionInfo, SuperBinding superBinding) 387 { 388 functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset); 395 389 const Identifier& ident = parserArena.identifierArena().makeNumericIdentifier(vm, name); 396 SourceCode source = m_sourceCode->subExpression( info.startFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn);397 FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, vm->propertyNames->nullIdentifier, info.body, source, info.parameters);390 SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn); 391 FuncExprNode* funcExpr = new (m_parserArena) FuncExprNode(location, vm->propertyNames->nullIdentifier, functionInfo.body, source); 398 392 return new (m_parserArena) PropertyNode(ident, funcExpr, type, PropertyNode::Unknown, superBinding); 399 393 } … … 421 415 ElementNode* createElementList(ElementNode* elems, int elisions, ExpressionNode* expr) { return new (m_parserArena) ElementNode(elems, elisions, expr); } 422 416 423 ParameterNode* createFormalParameterList(DestructuringPattern pattern) { return new (m_parserArena) ParameterNode(pattern); }424 ParameterNode* createFormalParameterList(ParameterNode* list, DestructuringPattern pattern) { return new (m_parserArena) ParameterNode(list,pattern); }417 FormalParameterList createFormalParameterList() { return new (m_parserArena) FunctionParameters(); } 418 void appendParameter(FormalParameterList list, DestructuringPattern pattern) { list->append(pattern); } 425 419 426 420 CaseClauseNode* createClause(ExpressionNode* expr, JSC::SourceElements* statements) { return new (m_parserArena) CaseClauseNode(expr, statements); } … … 428 422 ClauseListNode* createClauseList(ClauseListNode* tail, CaseClauseNode* clause) { return new (m_parserArena) ClauseListNode(tail, clause); } 429 423 430 StatementNode* createFuncDeclStatement(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& info)431 { 432 FuncDeclNode* decl = new (m_parserArena) FuncDeclNode(location, * info.name, info.body,433 m_sourceCode->subExpression( info.startFunctionOffset, info.endFunctionOffset, info.bodyStartLine, info.bodyStartColumn), info.parameters);434 if (* info.name == m_vm->propertyNames->arguments)424 StatementNode* createFuncDeclStatement(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& functionInfo) 425 { 426 FuncDeclNode* decl = new (m_parserArena) FuncDeclNode(location, *functionInfo.name, functionInfo.body, 427 m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.endOffset, functionInfo.startLine, functionInfo.bodyStartColumn)); 428 if (*functionInfo.name == m_vm->propertyNames->arguments) 435 429 usesArguments(); 436 430 m_scope.m_funcDeclarations.append(decl->body()); 437 info.body->setLoc(info.bodyStartLine, info.bodyEndLine, location.startOffset, location.lineStartOffset);431 functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset); 438 432 return decl; 439 433 } … … 487 481 } 488 482 489 StatementNode* createForInLoop(const JSTokenLocation& location, PassRefPtr<DestructuringPatternNode>pattern, ExpressionNode* iter, StatementNode* statements, const JSTextPosition& eStart, const JSTextPosition& eDivot, const JSTextPosition& eEnd, int start, int end, VariableEnvironment& lexicalVariables)490 { 491 auto lexpr = new (m_parserArena) DestructuringAssignmentNode(location, pattern .get(), 0);483 StatementNode* createForInLoop(const JSTokenLocation& location, DestructuringPatternNode* pattern, ExpressionNode* iter, StatementNode* statements, const JSTextPosition& eStart, const JSTextPosition& eDivot, const JSTextPosition& eEnd, int start, int end, VariableEnvironment& lexicalVariables) 484 { 485 auto lexpr = new (m_parserArena) DestructuringAssignmentNode(location, pattern, 0); 492 486 return createForInLoop(location, lexpr, iter, statements, eStart, eDivot, eEnd, start, end, lexicalVariables); 493 487 } … … 501 495 } 502 496 503 StatementNode* createForOfLoop(const JSTokenLocation& location, PassRefPtr<DestructuringPatternNode>pattern, ExpressionNode* iter, StatementNode* statements, const JSTextPosition& eStart, const JSTextPosition& eDivot, const JSTextPosition& eEnd, int start, int end, VariableEnvironment& lexicalVariables)504 { 505 auto lexpr = new (m_parserArena) DestructuringAssignmentNode(location, pattern .get(), 0);497 StatementNode* createForOfLoop(const JSTokenLocation& location, DestructuringPatternNode* pattern, ExpressionNode* iter, StatementNode* statements, const JSTextPosition& eStart, const JSTextPosition& eDivot, const JSTextPosition& eEnd, int start, int end, VariableEnvironment& lexicalVariables) 498 { 499 auto lexpr = new (m_parserArena) DestructuringAssignmentNode(location, pattern, 0); 506 500 return createForOfLoop(location, lexpr, iter, statements, eStart, eDivot, eEnd, start, end, lexicalVariables); 507 501 } … … 746 740 bool isResolve(ExpressionNode* expr) const { return expr->isResolveNode(); } 747 741 748 ExpressionNode* createDestructuringAssignment(const JSTokenLocation& location, PassRefPtr<DestructuringPatternNode>pattern, ExpressionNode* initializer)749 { 750 return new (m_parserArena) DestructuringAssignmentNode(location, pattern .get(), initializer);742 ExpressionNode* createDestructuringAssignment(const JSTokenLocation& location, DestructuringPattern pattern, ExpressionNode* initializer) 743 { 744 return new (m_parserArena) DestructuringAssignmentNode(location, pattern, initializer); 751 745 } 752 746 753 747 ArrayPattern createArrayPattern(const JSTokenLocation&) 754 748 { 755 return ArrayPatternNode::create();749 return new (m_parserArena) ArrayPatternNode(); 756 750 } 757 751 … … 763 757 void appendArrayPatternEntry(ArrayPattern node, const JSTokenLocation& location, DestructuringPattern pattern, ExpressionNode* defaultValue) 764 758 { 765 node->appendIndex(ArrayPatternNode::BindingType::Element, location, pattern .get(), defaultValue);759 node->appendIndex(ArrayPatternNode::BindingType::Element, location, pattern, defaultValue); 766 760 } 767 761 768 762 void appendArrayPatternRestEntry(ArrayPattern node, const JSTokenLocation& location, DestructuringPattern pattern) 769 763 { 770 node->appendIndex(ArrayPatternNode::BindingType::RestElement, location, pattern .get(), nullptr);764 node->appendIndex(ArrayPatternNode::BindingType::RestElement, location, pattern, nullptr); 771 765 } 772 766 773 767 void finishArrayPattern(ArrayPattern node, const JSTextPosition& divotStart, const JSTextPosition& divot, const JSTextPosition& divotEnd) 774 768 { 775 setExceptionLocation(node .get(), divotStart, divot, divotEnd);769 setExceptionLocation(node, divotStart, divot, divotEnd); 776 770 } 777 771 778 772 ObjectPattern createObjectPattern(const JSTokenLocation&) 779 773 { 780 return ObjectPatternNode::create();774 return new (m_parserArena) ObjectPatternNode(); 781 775 } 782 776 783 777 void appendObjectPatternEntry(ObjectPattern node, const JSTokenLocation& location, bool wasString, const Identifier& identifier, DestructuringPattern pattern, ExpressionNode* defaultValue) 784 778 { 785 node->appendEntry(location, identifier, wasString, pattern .get(), defaultValue);779 node->appendEntry(location, identifier, wasString, pattern, defaultValue); 786 780 } 787 781 788 782 BindingPattern createBindingLocation(const JSTokenLocation&, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext context) 789 783 { 790 return BindingNode::create(boundProperty, start, end, context);784 return new (m_parserArena) BindingNode(boundProperty, start, end, context); 791 785 } 792 786 -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r185989 r186959 495 495 template <typename T> 496 496 Lexer<T>::Lexer(VM* vm, JSParserBuiltinMode builtinMode) 497 : m_isReparsing (false)497 : m_isReparsingFunction(false) 498 498 , m_vm(vm) 499 499 , m_parsingBuiltinFunction(builtinMode == JSParserBuiltinMode::Builtin) … … 1716 1716 } 1717 1717 1718 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)1719 1718 template <typename T> 1720 1719 void Lexer<T>::setTokenPosition(JSToken* tokenRecord) … … 1726 1725 ASSERT(tokenData->offset >= tokenData->lineStartOffset); 1727 1726 } 1728 #endif1729 1727 1730 1728 template <typename T> … … 2412 2410 m_bufferForRawTemplateString16.swap(newBufferForRawTemplateString16); 2413 2411 2414 m_isReparsing = false;2412 m_isReparsingFunction = false; 2415 2413 } 2416 2414 -
trunk/Source/JavaScriptCore/parser/Lexer.h
r185989 r186959 85 85 // Functions to set up parsing. 86 86 void setCode(const SourceCode&, ParserArena*); 87 void setIsReparsing() { m_isReparsing = true; } 88 bool isReparsing() const { return m_isReparsing; } 89 90 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 87 void setIsReparsingFunction() { m_isReparsingFunction = true; } 88 bool isReparsingFunction() const { return m_isReparsingFunction; } 89 91 90 void setTokenPosition(JSToken* tokenRecord); 92 #endif93 91 JSTokenType lex(JSToken*, unsigned, bool strictMode); 94 92 bool nextTokenIsColon(); … … 225 223 JSTextPosition m_positionBeforeLastNewline; 226 224 JSTokenLocation m_lastTockenLocation; 227 bool m_isReparsing ;225 bool m_isReparsingFunction; 228 226 bool m_atLineStart; 229 227 bool m_error; -
trunk/Source/JavaScriptCore/parser/NodeConstructors.h
r186860 r186959 829 829 } 830 830 831 inline ParameterNode::ParameterNode(PassRefPtr<DestructuringPatternNode> pattern) 832 : m_pattern(pattern) 833 , m_next(0) 834 { 835 ASSERT(m_pattern); 836 } 837 838 inline ParameterNode::ParameterNode(ParameterNode* previous, PassRefPtr<DestructuringPatternNode> pattern) 839 : m_pattern(pattern) 840 , m_next(0) 841 { 842 previous->m_next = this; 843 ASSERT(m_pattern); 844 ASSERT(previous->m_pattern); 845 } 846 847 inline FuncExprNode::FuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source, ParameterNode* parameter) 831 inline FunctionParameters::FunctionParameters() 832 { 833 } 834 835 inline FuncExprNode::FuncExprNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source) 848 836 : ExpressionNode(location) 849 837 , m_body(body) 850 838 { 851 m_body->finishParsing(source, parameter,ident, FunctionExpression);852 } 853 854 inline FuncDeclNode::FuncDeclNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source , ParameterNode* parameter)839 m_body->finishParsing(source, ident, FunctionExpression); 840 } 841 842 inline FuncDeclNode::FuncDeclNode(const JSTokenLocation& location, const Identifier& ident, FunctionBodyNode* body, const SourceCode& source) 855 843 : StatementNode(location) 856 844 , m_body(body) 857 845 { 858 m_body->finishParsing(source, parameter,ident, FunctionDeclaration);846 m_body->finishParsing(source, ident, FunctionDeclaration); 859 847 } 860 848 … … 955 943 } 956 944 957 inline Ref<ArrayPatternNode> ArrayPatternNode::create()958 {959 return adoptRef(*new ArrayPatternNode);960 }961 962 945 inline ObjectPatternNode::ObjectPatternNode() 963 946 : DestructuringPatternNode() 964 947 { 965 }966 967 inline Ref<ObjectPatternNode> ObjectPatternNode::create()968 {969 return adoptRef(*new ObjectPatternNode);970 }971 972 inline Ref<BindingNode> BindingNode::create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext context)973 {974 return adoptRef(*new BindingNode(boundProperty, start, end, context));975 948 } 976 949 … … 984 957 } 985 958 986 inline DestructuringAssignmentNode::DestructuringAssignmentNode(const JSTokenLocation& location, PassRefPtr<DestructuringPatternNode>bindings, ExpressionNode* initializer)959 inline DestructuringAssignmentNode::DestructuringAssignmentNode(const JSTokenLocation& location, DestructuringPatternNode* bindings, ExpressionNode* initializer) 987 960 : ExpressionNode(location) 988 961 , m_bindings(bindings) -
trunk/Source/JavaScriptCore/parser/Nodes.cpp
r186860 r186959 118 118 // ------------------------------ ProgramNode ----------------------------- 119 119 120 ProgramNode::ProgramNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, const SourceCode& source, CodeFeatures features, int numConstants)120 ProgramNode::ProgramNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, FunctionParameters*, const SourceCode& source, CodeFeatures features, int numConstants) 121 121 : ScopeNode(parserArena, startLocation, endLocation, source, children, varEnvironment, funcStack, lexicalVariables, features, numConstants) 122 122 , m_startColumn(startColumn) … … 132 132 // ------------------------------ EvalNode ----------------------------- 133 133 134 EvalNode::EvalNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, const SourceCode& source, CodeFeatures features, int numConstants)134 EvalNode::EvalNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, FunctionParameters*, const SourceCode& source, CodeFeatures features, int numConstants) 135 135 : ScopeNode(parserArena, startLocation, endLocation, source, children, varEnvironment, funcStack, lexicalVariables, features, numConstants) 136 136 , m_endColumn(endColumn) … … 140 140 // ------------------------------ FunctionBodyNode ----------------------------- 141 141 142 Ref<FunctionParameters> FunctionParameters::create(ParameterNode* firstParameter)143 {144 unsigned parameterCount = 0;145 for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam())146 ++parameterCount;147 148 size_t objectSize = sizeof(FunctionParameters) - sizeof(void*) + sizeof(DestructuringPatternNode*) * parameterCount;149 void* slot = fastMalloc(objectSize);150 return adoptRef(*new (slot) FunctionParameters(firstParameter, parameterCount));151 }152 153 FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size)154 : m_size(size)155 {156 unsigned i = 0;157 for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) {158 auto pattern = parameter->pattern();159 pattern->ref();160 patterns()[i++] = pattern;161 }162 }163 164 FunctionParameters::~FunctionParameters()165 {166 for (unsigned i = 0; i < m_size; ++i)167 patterns()[i]->deref();168 }169 170 142 FunctionBodyNode::FunctionBodyNode( 171 143 ParserArena&, const JSTokenLocation& startLocation, 172 144 const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, 173 int functionKeywordStart, int functionNameStart, int parametersStart, 174 bool isInStrictContext, ConstructorKind constructorKind)145 int functionKeywordStart, int functionNameStart, int parametersStart, bool isInStrictContext, 146 ConstructorKind constructorKind, unsigned parameterCount, FunctionParseMode mode) 175 147 : StatementNode(endLocation) 176 148 , m_startColumn(startColumn) … … 180 152 , m_parametersStart(parametersStart) 181 153 , m_startStartOffset(startLocation.startOffset) 154 , m_parameterCount(parameterCount) 155 , m_parseMode(mode) 182 156 , m_isInStrictContext(isInStrictContext) 183 157 , m_constructorKind(static_cast<unsigned>(constructorKind)) … … 186 160 } 187 161 188 void FunctionBodyNode::finishParsing(const SourceCode& source, ParameterNode* firstParameter,const Identifier& ident, enum FunctionMode functionMode)162 void FunctionBodyNode::finishParsing(const SourceCode& source, const Identifier& ident, enum FunctionMode functionMode) 189 163 { 190 164 m_source = source; 191 m_parameters = FunctionParameters::create(firstParameter);192 165 m_ident = ident; 193 166 m_functionMode = functionMode; … … 202 175 // ------------------------------ FunctionNode ----------------------------- 203 176 204 FunctionNode::FunctionNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, const SourceCode& sourceCode, CodeFeatures features, int numConstants)177 FunctionNode::FunctionNode(ParserArena& parserArena, const JSTokenLocation& startLocation, const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn, SourceElements* children, VariableEnvironment& varEnvironment, FunctionStack& funcStack, VariableEnvironment& lexicalVariables, FunctionParameters* parameters, const SourceCode& sourceCode, CodeFeatures features, int numConstants) 205 178 : ScopeNode(parserArena, startLocation, endLocation, sourceCode, children, varEnvironment, funcStack, lexicalVariables, features, numConstants) 179 , m_parameters(parameters) 206 180 , m_startColumn(startColumn) 207 181 , m_endColumn(endColumn) … … 209 183 } 210 184 211 void FunctionNode::finishParsing( PassRefPtr<FunctionParameters> parameters,const Identifier& ident, enum FunctionMode functionMode)185 void FunctionNode::finishParsing(const Identifier& ident, enum FunctionMode functionMode) 212 186 { 213 187 ASSERT(!source().isNull()); 214 m_parameters = parameters;215 188 m_ident = ident; 216 189 m_functionMode = functionMode; -
trunk/Source/JavaScriptCore/parser/Nodes.h
r186860 r186959 43 43 class BytecodeGenerator; 44 44 class FunctionBodyNode; 45 class FunctionParameters; 45 46 class Label; 46 47 class PropertyListNode; … … 1542 1543 }; 1543 1544 1544 class ParameterNode : public ParserArenaDeletable {1545 public:1546 ParameterNode(PassRefPtr<DestructuringPatternNode>);1547 ParameterNode(ParameterNode*, PassRefPtr<DestructuringPatternNode>);1548 1549 DestructuringPatternNode* pattern() const { return m_pattern.get(); }1550 ParameterNode* nextParam() const { return m_next; }1551 1552 private:1553 RefPtr<DestructuringPatternNode> m_pattern;1554 ParameterNode* m_next;1555 };1556 1557 1545 class ScopeNode : public StatementNode, public ParserArenaRoot, public VariableEnvironmentNode { 1558 1546 public: … … 1620 1608 class ProgramNode : public ScopeNode { 1621 1609 public: 1622 ProgramNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, const SourceCode&, CodeFeatures, int numConstants);1610 ProgramNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, FunctionParameters*, const SourceCode&, CodeFeatures, int numConstants); 1623 1611 1624 1612 unsigned startColumn() const { return m_startColumn; } … … 1639 1627 class EvalNode : public ScopeNode { 1640 1628 public: 1641 EvalNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, const SourceCode&, CodeFeatures, int numConstants);1629 EvalNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, FunctionParameters*, const SourceCode&, CodeFeatures, int numConstants); 1642 1630 1643 1631 ALWAYS_INLINE unsigned startColumn() const { return 0; } … … 1652 1640 }; 1653 1641 1654 class FunctionParameters : public RefCounted<FunctionParameters> { 1655 WTF_MAKE_FAST_ALLOCATED; 1656 WTF_MAKE_NONCOPYABLE(FunctionParameters); 1657 public: 1658 static Ref<FunctionParameters> create(ParameterNode*); 1659 ~FunctionParameters(); 1660 1661 unsigned size() const { return m_size; } 1662 DestructuringPatternNode* at(unsigned index) { ASSERT(index < m_size); return patterns()[index]; } 1663 1664 private: 1665 FunctionParameters(ParameterNode*, unsigned size); 1666 1667 DestructuringPatternNode** patterns() { return &m_storage; } 1668 1669 unsigned m_size; 1670 DestructuringPatternNode* m_storage; 1642 class FunctionParameters : public ParserArenaDeletable { 1643 public: 1644 FunctionParameters(); 1645 ALWAYS_INLINE unsigned size() const { return m_patterns.size(); } 1646 ALWAYS_INLINE DestructuringPatternNode* at(unsigned index) { return m_patterns[index]; } 1647 ALWAYS_INLINE void append(DestructuringPatternNode* pattern) { ASSERT(pattern); m_patterns.append(pattern); } 1648 1649 private: 1650 1651 Vector<DestructuringPatternNode*, 3> m_patterns; 1671 1652 }; 1672 1653 … … 1679 1660 unsigned startColumn, unsigned endColumn, int functionKeywordStart, 1680 1661 int functionNameStart, int parametersStart, bool isInStrictContext, 1681 ConstructorKind); 1682 1683 FunctionParameters* parameters() const { return m_parameters.get(); } 1684 1685 virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1686 1687 void finishParsing(const SourceCode&, ParameterNode*, const Identifier&, FunctionMode); 1662 ConstructorKind, unsigned, FunctionParseMode); 1663 1664 virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1665 1666 void finishParsing(const SourceCode&, const Identifier&, FunctionMode); 1688 1667 1689 1668 void overrideName(const Identifier& ident) { m_ident = ident; } … … 1699 1678 unsigned startColumn() const { return m_startColumn; } 1700 1679 unsigned endColumn() const { return m_endColumn; } 1680 unsigned parameterCount() const { return m_parameterCount; } 1681 FunctionParseMode parseMode() const { return m_parseMode; } 1701 1682 1702 1683 void setEndPosition(JSTextPosition); … … 1712 1693 Identifier m_inferredName; 1713 1694 FunctionMode m_functionMode; 1714 RefPtr<FunctionParameters> m_parameters;1715 1695 unsigned m_startColumn; 1716 1696 unsigned m_endColumn; … … 1720 1700 SourceCode m_source; 1721 1701 int m_startStartOffset; 1702 unsigned m_parameterCount; 1703 FunctionParseMode m_parseMode; 1722 1704 unsigned m_isInStrictContext : 1; 1723 1705 unsigned m_constructorKind : 2; … … 1726 1708 class FunctionNode final : public ScopeNode { 1727 1709 public: 1728 FunctionNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, const SourceCode&, CodeFeatures, int numConstants);1729 1730 FunctionParameters* parameters() const { return m_parameters .get(); }1731 1732 virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1733 1734 void finishParsing( PassRefPtr<FunctionParameters>,const Identifier&, FunctionMode);1710 FunctionNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VariableEnvironment&, FunctionStack&, VariableEnvironment&, FunctionParameters*, const SourceCode&, CodeFeatures, int numConstants); 1711 1712 FunctionParameters* parameters() const { return m_parameters; } 1713 1714 virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1715 1716 void finishParsing(const Identifier&, FunctionMode); 1735 1717 1736 1718 const Identifier& ident() { return m_ident; } … … 1746 1728 Identifier m_ident; 1747 1729 FunctionMode m_functionMode; 1748 RefPtr<FunctionParameters>m_parameters;1730 FunctionParameters* m_parameters; 1749 1731 unsigned m_startColumn; 1750 1732 unsigned m_endColumn; … … 1753 1735 class FuncExprNode : public ExpressionNode { 1754 1736 public: 1755 FuncExprNode(const JSTokenLocation&, const Identifier&, FunctionBodyNode*, const SourceCode& , ParameterNode* = 0);1737 FuncExprNode(const JSTokenLocation&, const Identifier&, FunctionBodyNode*, const SourceCode&); 1756 1738 1757 1739 FunctionBodyNode* body() { return m_body; } … … 1784 1766 #endif 1785 1767 1786 class DestructuringPatternNode : public RefCounted<DestructuringPatternNode> { 1787 WTF_MAKE_NONCOPYABLE(DestructuringPatternNode); 1788 WTF_MAKE_FAST_ALLOCATED; 1789 1790 public: 1768 class DestructuringPatternNode : public ParserArenaDeletable { 1769 public: 1770 virtual ~DestructuringPatternNode() { } 1791 1771 virtual void collectBoundIdentifiers(Vector<Identifier>&) const = 0; 1792 1772 virtual void bindValue(BytecodeGenerator&, RegisterID* source) const = 0; … … 1796 1776 virtual RegisterID* emitDirectBinding(BytecodeGenerator&, RegisterID*, ExpressionNode*) { return 0; } 1797 1777 1798 virtual ~DestructuringPatternNode() = 0;1799 1800 1778 protected: 1801 1779 DestructuringPatternNode(); … … 1804 1782 class ArrayPatternNode : public DestructuringPatternNode, public ThrowableExpressionData { 1805 1783 public: 1784 ArrayPatternNode(); 1806 1785 enum class BindingType { 1807 1786 Elision, … … 1810 1789 }; 1811 1790 1812 static Ref<ArrayPatternNode> create();1813 1791 void appendIndex(BindingType bindingType, const JSTokenLocation&, DestructuringPatternNode* node, ExpressionNode* defaultValue) 1814 1792 { … … 1819 1797 struct Entry { 1820 1798 BindingType bindingType; 1821 RefPtr<DestructuringPatternNode>pattern;1799 DestructuringPatternNode* pattern; 1822 1800 ExpressionNode* defaultValue; 1823 1801 }; 1824 ArrayPatternNode();1825 1802 virtual void collectBoundIdentifiers(Vector<Identifier>&) const override; 1826 1803 virtual void bindValue(BytecodeGenerator&, RegisterID*) const override; … … 1833 1810 class ObjectPatternNode : public DestructuringPatternNode { 1834 1811 public: 1835 static Ref<ObjectPatternNode> create();1812 ObjectPatternNode(); 1836 1813 void appendEntry(const JSTokenLocation&, const Identifier& identifier, bool wasString, DestructuringPatternNode* pattern, ExpressionNode* defaultValue) 1837 1814 { … … 1840 1817 1841 1818 private: 1842 ObjectPatternNode();1843 1819 virtual void collectBoundIdentifiers(Vector<Identifier>&) const override; 1844 1820 virtual void bindValue(BytecodeGenerator&, RegisterID*) const override; … … 1847 1823 Identifier propertyName; 1848 1824 bool wasString; 1849 RefPtr<DestructuringPatternNode>pattern;1825 DestructuringPatternNode* pattern; 1850 1826 ExpressionNode* defaultValue; 1851 1827 }; … … 1855 1831 class BindingNode : public DestructuringPatternNode { 1856 1832 public: 1857 static Ref<BindingNode> create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext);1833 BindingNode(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext); 1858 1834 const Identifier& boundProperty() const { return m_boundProperty; } 1859 1835 … … 1862 1838 1863 1839 private: 1864 BindingNode(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end, AssignmentContext);1865 1866 1840 virtual void collectBoundIdentifiers(Vector<Identifier>&) const override; 1867 1841 virtual void bindValue(BytecodeGenerator&, RegisterID*) const override; … … 1878 1852 class DestructuringAssignmentNode : public ExpressionNode, public ParserArenaDeletable { 1879 1853 public: 1880 DestructuringAssignmentNode(const JSTokenLocation&, PassRefPtr<DestructuringPatternNode>, ExpressionNode*);1881 DestructuringPatternNode* bindings() { return m_bindings .get(); }1854 DestructuringAssignmentNode(const JSTokenLocation&, DestructuringPatternNode*, ExpressionNode*); 1855 DestructuringPatternNode* bindings() { return m_bindings; } 1882 1856 1883 1857 using ParserArenaDeletable::operator new; … … 1888 1862 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1889 1863 1890 RefPtr<DestructuringPatternNode>m_bindings;1864 DestructuringPatternNode* m_bindings; 1891 1865 ExpressionNode* m_initializer; 1892 1866 }; … … 1894 1868 class FuncDeclNode : public StatementNode { 1895 1869 public: 1896 FuncDeclNode(const JSTokenLocation&, const Identifier&, FunctionBodyNode*, const SourceCode& , ParameterNode* = 0);1870 FuncDeclNode(const JSTokenLocation&, const Identifier&, FunctionBodyNode*, const SourceCode&); 1897 1871 1898 1872 virtual bool isFuncDeclNode() const override { return true; } … … 1990 1964 }; 1991 1965 1992 struct ParameterList {1993 ParameterNode* head;1994 ParameterNode* tail;1995 };1996 1997 1966 struct ClauseList { 1998 1967 ClauseListNode* head; -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r186860 r186959 192 192 template <typename LexerType> 193 193 Parser<LexerType>::Parser( 194 VM* vm, const SourceCode& source, FunctionParameters* parameters, 195 const Identifier& name, JSParserBuiltinMode builtinMode, 194 VM* vm, const SourceCode& source, JSParserBuiltinMode builtinMode, 196 195 JSParserStrictMode strictMode, JSParserCodeType codeType, 197 196 ConstructorKind defaultConstructorKind, ThisTDZMode thisTDZMode) … … 224 223 if (strictMode == JSParserStrictMode::Strict) 225 224 scope->setStrictMode(); 226 if (parameters) { 227 bool hadBindingParameters = false; 228 for (unsigned i = 0; i < parameters->size(); i++) { 229 auto parameter = parameters->at(i); 230 if (!parameter->isBindingNode()) { 231 hadBindingParameters = true; 232 continue; 233 } 234 scope->declareParameter(&static_cast<BindingNode*>(parameter)->boundProperty()); 235 } 236 if (hadBindingParameters) { 237 Vector<Identifier> boundParameterNames; 238 for (unsigned i = 0; i < parameters->size(); i++) { 239 auto parameter = parameters->at(i); 240 if (parameter->isBindingNode()) 241 continue; 242 parameter->collectBoundIdentifiers(boundParameterNames); 243 } 244 for (auto& boundParameterName : boundParameterNames) 245 scope->declareVariable(&boundParameterName); 246 } 247 } 248 if (!name.isNull()) 249 scope->declareCallee(&name); 225 250 226 next(); 251 227 } … … 257 233 258 234 template <typename LexerType> 259 String Parser<LexerType>::parseInner( )235 String Parser<LexerType>::parseInner(const Identifier& calleeName, FunctionParseMode parseMode) 260 236 { 261 237 String parseError = String(); 262 238 263 239 ASTBuilder context(const_cast<VM*>(m_vm), m_parserArena, const_cast<SourceCode*>(m_source)); 264 if (m_lexer->isReparsing())265 m_statementDepth--;266 240 ScopeRef scope = currentScope(); 267 241 scope->setIsLexicalScope(); 268 242 269 SourceElements* sourceElements = parseSourceElements(context, CheckForStrictMode, StandardFunctionParseType); 270 if (!sourceElements || !consume(EOFTOK)) { 243 bool isArrowFunctionBodyExpression = false; 244 if (m_lexer->isReparsingFunction()) { 245 ParserFunctionInfo<ASTBuilder> functionInfo; 246 parseFunctionParameters(context, parseMode, functionInfo); 247 m_parameters = functionInfo.parameters; 248 249 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 250 if (parseMode == ArrowFunctionMode && !hasError()) { 251 // The only way we could have an error wile reparsing is if we run out of stack space. 252 RELEASE_ASSERT(match(ARROWFUNCTION)); 253 next(); 254 isArrowFunctionBodyExpression = !match(OPENBRACE); 255 } 256 #endif 257 } 258 259 if (!calleeName.isNull()) 260 scope->declareCallee(&calleeName); 261 262 if (m_lexer->isReparsingFunction()) 263 m_statementDepth--; 264 265 SourceElements* sourceElements = nullptr; 266 // The only way we can error this early is if we reparse a function and we run out of stack space. 267 if (!hasError()) { 268 if (isArrowFunctionBodyExpression) 269 sourceElements = parseArrowFunctionSingleExpressionBodySourceElements(context); 270 else 271 sourceElements = parseSourceElements(context, CheckForStrictMode); 272 } 273 274 bool validEnding; 275 if (isArrowFunctionBodyExpression) { 276 ASSERT(m_lexer->isReparsingFunction()); 277 // When we reparse and stack overflow, we're not guaranteed a valid ending. If we don't run out of stack space, 278 // then of course this will always be valid because we already parsed for syntax errors. But we must 279 // be cautious in case we run out of stack space. 280 validEnding = isEndOfArrowFunction(); 281 } else 282 validEnding = consume(EOFTOK); 283 284 if (!sourceElements || !validEnding) { 271 285 if (hasError()) 272 286 parseError = m_errorMessage; … … 347 361 348 362 template <typename LexerType> 349 template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseSourceElements(TreeBuilder& context, SourceElementsMode mode , FunctionParseType functionParseType)363 template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseSourceElements(TreeBuilder& context, SourceElementsMode mode) 350 364 { 351 365 const unsigned lengthOfUseStrictLiteral = 12; // "use strict".length … … 356 370 auto savePoint = createSavePoint(); 357 371 bool hasSetStrict = false; 358 359 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)360 if (match(ARROWFUNCTION)) {361 TreeStatement arrowfunctionStatement = parseArrowFunctionSingleExpressionBody(context, functionParseType);362 363 if (arrowfunctionStatement) {364 context.setEndOffset(arrowfunctionStatement, m_lastTokenEndPosition.offset);365 context.appendStatement(sourceElements, arrowfunctionStatement);366 }367 368 propagateError();369 return sourceElements;370 }371 #else372 UNUSED_PARAM(functionParseType);373 #endif374 372 375 373 while (TreeStatement statement = parseStatementListItem(context, directive, &directiveLiteralLength)) { … … 663 661 } 664 662 665 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 666 template <typename LexerType> 667 template <class TreeBuilder> TreeStatement Parser<LexerType>::parseArrowFunctionSingleExpressionBody(TreeBuilder& context, FunctionParseType parseType) 668 { 669 ASSERT(match(ARROWFUNCTION)); 670 671 // When reparsing phase, parseType becomes StandardFunctionParseType even if the function is arrow function. 672 // This condition considers the following situations. 673 // (1): If we are in the reparsing phase, this arrow function is already parsed once, so there is no syntax error. 674 // (2): But if we are not in the reparsing phase, we should check this function is called in the context of the arrow function. 675 if (!m_lexer->isReparsing() && parseType != ArrowFunctionParseType) 676 failDueToUnexpectedToken(); 677 663 template <typename LexerType> 664 template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseArrowFunctionSingleExpressionBodySourceElements(TreeBuilder& context) 665 { 666 ASSERT(!match(OPENBRACE)); 667 678 668 JSTokenLocation location(tokenLocation()); 679 669 JSTextPosition start = tokenStartPosition(); 680 JSTextPosition end = tokenEndPosition();681 682 next();683 670 684 671 failIfStackOverflow(); … … 690 677 failIfFalse(isEndOfArrowFunction(), "Expected a ';', ']', '}', ')', ',', line terminator or EOF following a arrow function statement"); 691 678 692 end = tokenEndPosition();679 JSTextPosition end = tokenEndPosition(); 693 680 694 681 if (!m_lexer->prevTerminator()) 695 682 setEndOfStatement(); 696 683 697 return context.createReturnStatement(location, expr, start, end); 698 } 699 #endif 684 TreeSourceElements sourceElements = context.createSourceElements(); 685 TreeStatement body = context.createReturnStatement(location, expr, start, end); 686 context.setEndOffset(body, m_lastTokenEndPosition.offset); 687 context.appendStatement(sourceElements, body); 688 689 return sourceElements; 690 } 700 691 701 692 template <typename LexerType> … … 1230 1221 failIfFalse(condition, "Cannot parse switch clause"); 1231 1222 consumeOrFail(COLON, "Expected a ':' after switch clause expression"); 1232 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode , StandardFunctionParseType);1223 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); 1233 1224 failIfFalse(statements, "Cannot parse the body of a switch clause"); 1234 1225 TreeClause clause = context.createClause(condition, statements); … … 1243 1234 failIfFalse(condition, "Cannot parse switch case expression"); 1244 1235 consumeOrFail(COLON, "Expected a ':' after switch clause expression"); 1245 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode , StandardFunctionParseType);1236 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); 1246 1237 failIfFalse(statements, "Cannot parse the body of a switch clause"); 1247 1238 clause = context.createClause(condition, statements); … … 1260 1251 next(); 1261 1252 consumeOrFail(COLON, "Expected a ':' after switch default clause"); 1262 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode , StandardFunctionParseType);1253 TreeSourceElements statements = parseSourceElements(context, DontCheckForStrictMode); 1263 1254 failIfFalse(statements, "Cannot parse the body of a switch default clause"); 1264 1255 TreeClause result = context.createClause(0, statements); … … 1359 1350 return result; 1360 1351 } 1361 TreeSourceElements subtree = parseSourceElements(context, DontCheckForStrictMode , StandardFunctionParseType);1352 TreeSourceElements subtree = parseSourceElements(context, DontCheckForStrictMode); 1362 1353 failIfFalse(subtree, "Cannot parse the body of the block statement"); 1363 1354 matchOrFail(CLOSEBRACE, "Expected a closing '}' at the end of a block statement"); … … 1467 1458 1468 1459 template <typename LexerType> 1469 template <class TreeBuilder> TreeFormalParameterList Parser<LexerType>::parseFormalParameters(TreeBuilder& context)1460 template <class TreeBuilder> bool Parser<LexerType>::parseFormalParameters(TreeBuilder& context, TreeFormalParameterList list, unsigned& parameterCount) 1470 1461 { 1471 1462 auto parameter = parseDestructuringPattern(context, DestructureToParameters); 1472 1463 failIfFalse(parameter, "Cannot parse parameter pattern"); 1473 TreeFormalParameterList list = context.createFormalParameterList(parameter);1474 TreeFormalParameterList tail = list;1464 context.appendParameter(list, parameter); 1465 parameterCount++; 1475 1466 while (consume(COMMA)) { 1476 1467 parameter = parseDestructuringPattern(context, DestructureToParameters); 1477 1468 failIfFalse(parameter, "Cannot parse parameter pattern"); 1478 tail = context.createFormalParameterList(tail, parameter); 1479 } 1480 return list; 1469 context.appendParameter(list, parameter); 1470 parameterCount++; 1471 } 1472 return true; 1481 1473 } 1482 1474 1483 1475 template <typename LexerType> 1484 1476 template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBody( 1485 TreeBuilder& context, int functionKeywordStart, int functionNameStart, 1486 int parametersStart, ConstructorKind constructorKind, FunctionParseType parseType) 1487 { 1488 JSTokenLocation startLocation(tokenLocation()); 1489 unsigned startColumn = tokenColumn(); 1490 1491 if (parseType == StandardFunctionParseType) { 1477 TreeBuilder& context, const JSTokenLocation& startLocation, int startColumn, int functionKeywordStart, int functionNameStart, int parametersStart, 1478 ConstructorKind constructorKind, FunctionBodyType bodyType, unsigned parameterCount, FunctionParseMode parseMode) 1479 { 1480 if (bodyType == StandardFunctionBodyBlock || bodyType == ArrowFunctionBodyBlock) { 1492 1481 next(); 1493 1482 if (match(CLOSEBRACE)) { 1494 1483 unsigned endColumn = tokenColumn(); 1495 return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart, strictMode(), constructorKind );1484 return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart, strictMode(), constructorKind, parameterCount, parseMode); 1496 1485 } 1497 1486 } … … 1499 1488 DepthManager statementDepth(&m_statementDepth); 1500 1489 m_statementDepth = 0; 1501 typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_cast<VM*>(m_vm), m_lexer.get()); 1502 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1503 failIfFalse(parseSourceElements(bodyBuilder, CheckForStrictMode, parseType), parseType == StandardFunctionParseType ? "Cannot parse body of this function" : "Cannot parse body of this arrow function"); 1504 #else 1505 failIfFalse(parseSourceElements(bodyBuilder, CheckForStrictMode, StandardFunctionParseType), "Cannot parse body of this function"); 1506 #endif 1490 SyntaxChecker syntaxChecker(const_cast<VM*>(m_vm), m_lexer.get()); 1491 if (bodyType == ArrowFunctionBodyExpression) 1492 failIfFalse(parseArrowFunctionSingleExpressionBodySourceElements(syntaxChecker), "Cannot parse body of this arrow function"); 1493 else 1494 failIfFalse(parseSourceElements(syntaxChecker, CheckForStrictMode), bodyType == StandardFunctionBodyBlock ? "Cannot parse body of this function" : "Cannot parse body of this arrow function"); 1507 1495 unsigned endColumn = tokenColumn(); 1508 return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart, strictMode(), constructorKind );1496 return context.createFunctionBody(startLocation, tokenLocation(), startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart, strictMode(), constructorKind, parameterCount, parseMode); 1509 1497 } 1510 1498 … … 1516 1504 case SetterMode: 1517 1505 return "setter"; 1518 case FunctionMode:1506 case NormalFunctionMode: 1519 1507 return "function"; 1520 1508 case MethodMode: 1521 1509 return "method"; 1522 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)1523 1510 case ArrowFunctionMode: 1524 1511 return "arrow function"; 1525 #endif 1512 case NotAFunctionMode: 1513 RELEASE_ASSERT_NOT_REACHED(); 1514 return ""; 1526 1515 } 1527 1516 RELEASE_ASSERT_NOT_REACHED(); … … 1529 1518 } 1530 1519 1531 template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, FunctionParseMode mode, ParserFunctionInfo<TreeBuilder>& info) 1532 { 1520 template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, FunctionParseMode mode, ParserFunctionInfo<TreeBuilder>& functionInfo) 1521 { 1522 RELEASE_ASSERT(mode != NotAFunctionMode); 1533 1523 int parametersStart = m_token.m_location.startOffset; 1534 1535 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1524 TreeFormalParameterList parameterList = context.createFormalParameterList(); 1525 functionInfo.parameters = parameterList; 1526 functionInfo.startOffset = parametersStart; 1527 1536 1528 if (mode == ArrowFunctionMode) { 1537 1529 if (!match(IDENT) && !match(OPENPAREN)) { … … 1542 1534 next(); 1543 1535 1544 if ( !match(CLOSEPAREN)) {1545 info.parameters = parseFormalParameters(context);1546 failIfFalse(info.parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode));1547 }1536 if (match(CLOSEPAREN)) 1537 functionInfo.parameterCount = 0; 1538 else 1539 failIfFalse(parseFormalParameters(context, parameterList, functionInfo.parameterCount), "Cannot parse parameters for this ", stringForFunctionMode(mode)); 1548 1540 1549 1541 consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration"); 1550 1542 } else { 1543 functionInfo.parameterCount = 1; 1551 1544 auto parameter = parseDestructuringPattern(context, DestructureToParameters); 1552 1545 failIfFalse(parameter, "Cannot parse parameter pattern"); 1553 info.parameters = context.createFormalParameterList(parameter); 1554 failIfFalse(info.parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode)); 1546 context.appendParameter(parameterList, parameter); 1555 1547 } 1556 1548 } 1557 1549 1558 1550 return parametersStart; 1559 1551 } 1560 #endif 1561 1552 1562 1553 if (!consume(OPENPAREN)) { 1563 1554 semanticFailureDueToKeyword(stringForFunctionMode(mode), " name"); … … 1565 1556 } 1566 1557 1567 if (mode == GetterMode) 1558 if (mode == GetterMode) { 1568 1559 consumeOrFail(CLOSEPAREN, "getter functions must have no parameters"); 1569 else if (mode == SetterMode) { 1560 functionInfo.parameterCount = 0; 1561 } else if (mode == SetterMode) { 1570 1562 failIfTrue(match(CLOSEPAREN), "setter functions must have one parameter"); 1571 1563 auto parameter = parseDestructuringPattern(context, DestructureToParameters); 1572 1564 failIfFalse(parameter, "setter functions must have one parameter"); 1573 info.parameters = context.createFormalParameterList(parameter); 1565 context.appendParameter(parameterList, parameter); 1566 functionInfo.parameterCount = 1; 1574 1567 failIfTrue(match(COMMA), "setter functions must have one parameter"); 1575 1568 consumeOrFail(CLOSEPAREN, "Expected a ')' after a parameter declaration"); 1576 1569 } else { 1577 if ( !match(CLOSEPAREN)) {1578 info.parameters = parseFormalParameters(context);1579 failIfFalse(info.parameters, "Cannot parse parameters for this ", stringForFunctionMode(mode));1580 }1570 if (match(CLOSEPAREN)) 1571 functionInfo.parameterCount = 0; 1572 else 1573 failIfFalse(parseFormalParameters(context, parameterList, functionInfo.parameterCount), "Cannot parse parameters for this ", stringForFunctionMode(mode)); 1581 1574 consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration"); 1582 1575 } 1583 1576 1584 1577 return parametersStart; 1585 1578 } 1586 1579 1587 1580 template <typename LexerType> 1588 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& info, FunctionParseType parseType) 1589 { 1581 template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionParseType parseType) 1582 { 1583 RELEASE_ASSERT(mode != NotAFunctionMode); 1584 1590 1585 AutoPopScopeRef functionScope(this, pushScope()); 1591 1586 functionScope->setIsFunction(); … … 1594 1589 m_lastFunctionName = nullptr; 1595 1590 int parametersStart; 1591 JSTokenLocation startLocation; 1592 int startColumn; 1593 FunctionBodyType functionBodyType; 1596 1594 1597 1595 switch (parseType) { 1598 1596 case StandardFunctionParseType: { 1597 RELEASE_ASSERT(mode != ArrowFunctionMode); 1599 1598 if (match(IDENT) || isLETMaskedAsIDENT()) { 1600 info.name = m_token.m_data.ident;1601 m_lastFunctionName = info.name;1599 functionInfo.name = m_token.m_data.ident; 1600 m_lastFunctionName = functionInfo.name; 1602 1601 next(); 1603 1602 if (!nameIsInContainingScope) 1604 failIfFalseIfStrict(functionScope->declareVariable( info.name), "'", info.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");1603 failIfFalseIfStrict(functionScope->declareVariable(functionInfo.name), "'", functionInfo.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode"); 1605 1604 } else if (requirements == FunctionNeedsName) { 1606 if (match(OPENPAREN) && mode == FunctionMode)1605 if (match(OPENPAREN) && mode == NormalFunctionMode) 1607 1606 semanticFail("Function statements must have a name"); 1608 1607 semanticFailureDueToKeyword(stringForFunctionMode(mode), " name"); … … 1610 1609 return false; 1611 1610 } 1612 1613 parametersStart = parseFunctionParameters(context, mode, info); 1611 1612 startLocation = tokenLocation(); 1613 functionInfo.startLine = tokenLine(); 1614 startColumn = tokenColumn(); 1615 1616 parametersStart = parseFunctionParameters(context, mode, functionInfo); 1614 1617 propagateError(); 1615 1618 … … 1623 1626 expectedSuperBinding = m_defaultConstructorKind == ConstructorKind::Derived ? SuperBinding::Needed : SuperBinding::NotNeeded; 1624 1627 } 1625 1626 info.startFunctionOffset = m_token.m_data.offset;1628 1629 functionBodyType = StandardFunctionBodyBlock; 1627 1630 1628 1631 break; … … 1630 1633 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1631 1634 case ArrowFunctionParseType: { 1632 parametersStart = parseFunctionParameters(context, ArrowFunctionMode, info); 1635 RELEASE_ASSERT(mode == ArrowFunctionMode); 1636 1637 startLocation = tokenLocation(); 1638 functionInfo.startLine = tokenLine(); 1639 startColumn = tokenColumn(); 1640 1641 parametersStart = parseFunctionParameters(context, mode, functionInfo); 1633 1642 propagateError(); 1634 1643 … … 1640 1649 ASSERT(constructorKind == ConstructorKind::None); 1641 1650 1642 info.arrowFunctionOffset = m_token.m_data.offset;1643 1651 // Check if arrow body start with {. If it true it mean that arrow function is Fat arrow function 1644 1652 // and we need use common approach to parse function body 1645 SavePoint savePoint = createSavePoint(); 1653 next(); 1654 functionBodyType = match(OPENBRACE) ? ArrowFunctionBodyBlock : ArrowFunctionBodyExpression; 1646 1655 1647 next(); 1648 info.functionBodyType = match(OPENBRACE) ? ArrowFunctionBodyBlock : ArrowFunctionBodyExpression; 1649 info.startFunctionOffset = (info.functionBodyType == ArrowFunctionBodyBlock) ? m_token.m_data.offset : info.arrowFunctionOffset; 1650 1651 restoreSavePoint(savePoint); 1652 1653 break; 1654 } 1656 break; 1657 } 1658 #else 1659 default: 1660 RELEASE_ASSERT_NOT_REACHED(); 1655 1661 #endif 1656 1662 } … … 1658 1664 bool isClassConstructor = constructorKind != ConstructorKind::None; 1659 1665 1660 info.bodyStartLine = tokenLine(); 1661 info.bodyStartColumn = m_token.m_data.offset - m_token.m_data.lineStartOffset; 1662 JSTokenLocation startLocation(tokenLocation()); 1666 functionInfo.bodyStartColumn = startColumn; 1663 1667 1664 1668 // If we know about this function already, we can use the cached info and skip the parser to the end of the function. 1665 if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo( info.startFunctionOffset) : 0) {1669 if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(functionInfo.startOffset) : 0) { 1666 1670 // If we're in a strict context, the cached function info must say it was strict too. 1667 1671 ASSERT(!strictMode() || cachedInfo->strictMode); … … 1672 1676 endLocation.lineStartOffset = cachedInfo->lastTockenLineStartOffset; 1673 1677 1674 bool endColumnIsOnStartLine = (endLocation.line == info.bodyStartLine);1678 bool endColumnIsOnStartLine = (endLocation.line == functionInfo.startLine); 1675 1679 ASSERT(endLocation.startOffset >= endLocation.lineStartOffset); 1676 1680 unsigned bodyEndColumn = endColumnIsOnStartLine ? … … 1679 1683 unsigned currentLineStartOffset = m_token.m_location.lineStartOffset; 1680 1684 1681 info.body = context.createFunctionBody(1682 startLocation, endLocation, info.bodyStartColumn, bodyEndColumn,1685 functionInfo.body = context.createFunctionBody( 1686 startLocation, endLocation, functionInfo.bodyStartColumn, bodyEndColumn, 1683 1687 functionKeywordStart, functionNameStart, parametersStart, 1684 cachedInfo->strictMode, constructorKind );1688 cachedInfo->strictMode, constructorKind, cachedInfo->parameterCount, mode); 1685 1689 1686 1690 functionScope->restoreFromSourceProviderCache(cachedInfo); … … 1694 1698 m_lexer->setOffset(m_token.m_location.endOffset, m_token.m_location.lineStartOffset); 1695 1699 m_lexer->setLineNumber(m_token.m_location.line); 1696 info.endFunctionOffset = cachedInfo->endFunctionOffset;1697 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1700 functionInfo.endOffset = cachedInfo->endFunctionOffset; 1701 1698 1702 if (parseType == ArrowFunctionParseType) 1699 info.functionBodyType = cachedInfo->isBodyArrowExpression ? ArrowFunctionBodyExpression : ArrowFunctionBodyBlock;1703 functionBodyType = cachedInfo->isBodyArrowExpression ? ArrowFunctionBodyExpression : ArrowFunctionBodyBlock; 1700 1704 else 1701 info.functionBodyType = StandardFunctionBodyBlock;1705 functionBodyType = StandardFunctionBodyBlock; 1702 1706 1703 switch ( info.functionBodyType) {1707 switch (functionBodyType) { 1704 1708 case ArrowFunctionBodyExpression: 1705 1709 next(); 1706 context.setEndOffset( info.body, m_lexer->currentOffset());1710 context.setEndOffset(functionInfo.body, m_lexer->currentOffset()); 1707 1711 break; 1708 1712 case ArrowFunctionBodyBlock: 1709 1713 case StandardFunctionBodyBlock: 1710 context.setEndOffset( info.body, m_lexer->currentOffset());1714 context.setEndOffset(functionInfo.body, m_lexer->currentOffset()); 1711 1715 next(); 1712 1716 break; 1713 1717 } 1714 #else 1715 context.setEndOffset(info.body, m_lexer->currentOffset()); 1716 next(); 1717 #endif 1718 info.bodyEndLine = m_lastTokenEndPosition.line; 1718 functionInfo.endLine = m_lastTokenEndPosition.line; 1719 1719 return true; 1720 1720 } … … 1723 1723 ParserState oldState = saveState(); 1724 1724 1725 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1726 switch (info.functionBodyType) { 1727 case ArrowFunctionBodyBlock: { 1728 // Consume => in case of arrow function block e.g. x => { return x; } 1729 next(); 1730 1731 info.bodyStartLine = tokenLine(); 1732 info.bodyStartColumn = m_token.m_data.offset - m_token.m_data.lineStartOffset; 1733 1734 info.body = parseFunctionBody(context, functionKeywordStart, functionNameStart, parametersStart, constructorKind, StandardFunctionParseType); 1735 break; 1736 } 1737 case StandardFunctionBodyBlock: 1738 case ArrowFunctionBodyExpression : { 1739 info.body = parseFunctionBody(context, functionKeywordStart, functionNameStart, parametersStart, constructorKind, parseType); 1740 break; 1741 } 1742 } 1743 #else 1744 info.body = parseFunctionBody(context, functionKeywordStart, functionNameStart, parametersStart, constructorKind, StandardFunctionParseType); 1745 #endif 1725 functionInfo.body = parseFunctionBody(context, startLocation, startColumn, functionKeywordStart, functionNameStart, parametersStart, constructorKind, functionBodyType, functionInfo.parameterCount, mode); 1746 1726 1747 1727 restoreState(oldState); 1748 failIfFalse( info.body, "Cannot parse the body of this ", stringForFunctionMode(mode));1749 context.setEndOffset( info.body, m_lexer->currentOffset());1750 if (functionScope->strictMode() && info.name) {1751 RELEASE_ASSERT(mode == FunctionMode || mode == MethodMode);1752 semanticFailIfTrue(m_vm->propertyNames->arguments == * info.name, "'", info.name->impl(), "' is not a valid function name in strict mode");1753 semanticFailIfTrue(m_vm->propertyNames->eval == * info.name, "'", info.name->impl(), "' is not a valid function name in strict mode");1728 failIfFalse(functionInfo.body, "Cannot parse the body of this ", stringForFunctionMode(mode)); 1729 context.setEndOffset(functionInfo.body, m_lexer->currentOffset()); 1730 if (functionScope->strictMode() && functionInfo.name) { 1731 RELEASE_ASSERT(mode == NormalFunctionMode || mode == MethodMode); 1732 semanticFailIfTrue(m_vm->propertyNames->arguments == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode"); 1733 semanticFailIfTrue(m_vm->propertyNames->eval == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode"); 1754 1734 } 1755 1735 if (functionScope->hasDirectSuper()) { … … 1761 1741 1762 1742 JSTokenLocation location = JSTokenLocation(m_token.m_location); 1763 info.endFunctionOffset = m_token.m_data.offset; 1764 1765 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1766 if (info.functionBodyType == ArrowFunctionBodyExpression) { 1743 functionInfo.endOffset = m_token.m_data.offset; 1744 1745 if (functionBodyType == ArrowFunctionBodyExpression) { 1767 1746 location = locationBeforeLastToken(); 1768 info.endFunctionOffset = location.endOffset; 1769 } 1770 #endif 1747 functionInfo.endOffset = location.endOffset; 1748 } 1771 1749 1772 1750 // Cache the tokenizer state and the function scope the first time the function is parsed. … … 1774 1752 static const int minimumFunctionLengthToCache = 16; 1775 1753 std::unique_ptr<SourceProviderCacheItem> newInfo; 1776 int functionLength = info.endFunctionOffset - info.startFunctionOffset;1754 int functionLength = functionInfo.endOffset - functionInfo.startOffset; 1777 1755 if (TreeBuilder::CanUseFunctionCache && m_functionCache && functionLength > minimumFunctionLengthToCache) { 1778 1756 SourceProviderCacheItemCreationParameters parameters; 1779 parameters.endFunctionOffset = info.endFunctionOffset;1757 parameters.endFunctionOffset = functionInfo.endOffset; 1780 1758 parameters.functionNameStart = functionNameStart; 1781 1759 parameters.lastTockenLine = location.line; … … 1783 1761 parameters.lastTockenEndOffset = location.endOffset; 1784 1762 parameters.lastTockenLineStartOffset = location.lineStartOffset; 1785 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1786 if ( info.functionBodyType == ArrowFunctionBodyExpression) {1763 parameters.parameterCount = functionInfo.parameterCount; 1764 if (functionBodyType == ArrowFunctionBodyExpression) { 1787 1765 parameters.isBodyArrowExpression = true; 1788 1766 parameters.tokenType = m_token.m_type; 1789 1767 } 1790 #endif1791 1768 functionScope->fillParametersForSourceProviderCache(parameters); 1792 1769 newInfo = SourceProviderCacheItem::create(parameters); … … 1795 1772 popScope(functionScope, TreeBuilder::NeedsFreeVariableInfo); 1796 1773 1797 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 1798 if (info.functionBodyType == ArrowFunctionBodyExpression) 1774 if (functionBodyType == ArrowFunctionBodyExpression) 1799 1775 failIfFalse(isEndOfArrowFunction(), "Expected the closing ';' ',' ']' ')' '}', line terminator or EOF after arrow function"); 1800 1776 else { … … 1802 1778 next(); 1803 1779 } 1804 #else1805 matchOrFail(CLOSEBRACE, "Expected a closing '}' after a ", stringForFunctionMode(mode), " body");1806 next();1807 #endif1808 1780 1809 1781 if (newInfo) 1810 m_functionCache->add( info.startFunctionOffset, WTF::move(newInfo));1811 1812 info.bodyEndLine = m_lastTokenEndPosition.line;1782 m_functionCache->add(functionInfo.startOffset, WTF::move(newInfo)); 1783 1784 functionInfo.endLine = m_lastTokenEndPosition.line; 1813 1785 return true; 1814 1786 } … … 1821 1793 unsigned functionKeywordStart = tokenStart(); 1822 1794 next(); 1823 ParserFunctionInfo<TreeBuilder> info;1824 failIfFalse((parseFunctionInfo(context, FunctionNeedsName, FunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded,1825 functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse this function");1826 failIfFalse( info.name, "Function statements must have a name");1827 failIfFalseIfStrict(declareVariable( info.name), "Cannot declare a function named '", info.name->impl(), "' in strict mode");1828 return context.createFuncDeclStatement(location, info);1795 ParserFunctionInfo<TreeBuilder> functionInfo; 1796 failIfFalse((parseFunctionInfo(context, FunctionNeedsName, NormalFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, 1797 functionKeywordStart, functionInfo, StandardFunctionParseType)), "Cannot parse this function"); 1798 failIfFalse(functionInfo.name, "Function statements must have a name"); 1799 failIfFalseIfStrict(declareVariable(functionInfo.name), "Cannot declare a function named '", functionInfo.name->impl(), "' in strict mode"); 1800 return context.createFuncDeclStatement(location, functionInfo); 1829 1801 } 1830 1802 … … 1940 1912 ParserFunctionInfo<TreeBuilder> methodInfo; 1941 1913 bool isConstructor = !isStaticMethod && *ident == propertyNames.constructor; 1942 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, isStaticMethod ? FunctionMode : MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");1914 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, isStaticMethod ? NormalFunctionMode : MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method"); 1943 1915 failIfFalse(ident && declareVariable(ident), "Cannot declare a method named '", methodInfo.name->impl(), "'"); 1944 1916 methodInfo.name = isConstructor ? className : ident; … … 2758 2730 ParserFunctionInfo<TreeBuilder> info; 2759 2731 info.name = &m_vm->propertyNames->nullIdentifier; 2760 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression");2732 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, NormalFunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression"); 2761 2733 return context.createFunctionExpr(location, info); 2762 2734 } … … 3003 2975 } 3004 2976 3005 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)3006 2977 template <typename LexerType> 3007 2978 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArrowFunctionExpression(TreeBuilder& context) … … 3013 2984 ParserFunctionInfo<TreeBuilder> info; 3014 2985 info.name = &m_vm->propertyNames->nullIdentifier; 3015 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, FunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression");2986 failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression"); 3016 2987 3017 2988 return context.createArrowFunctionExpr(location, info); 3018 2989 } 3019 #endif3020 2990 3021 2991 static const char* operatorString(bool prefix, unsigned tok) -
trunk/Source/JavaScriptCore/parser/Parser.h
r186860 r186959 82 82 83 83 enum SourceElementsMode { CheckForStrictMode, DontCheckForStrictMode }; 84 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)85 84 enum FunctionParseType { StandardFunctionParseType, ArrowFunctionParseType }; 86 #else 87 enum FunctionParseType { StandardFunctionParseType}; 88 #endif 85 enum FunctionBodyType { ArrowFunctionBodyExpression, ArrowFunctionBodyBlock, StandardFunctionBodyBlock }; 89 86 enum FunctionRequirements { FunctionNoRequirements, FunctionNeedsName }; 90 enum FunctionParseMode {91 FunctionMode,92 GetterMode,93 SetterMode,94 MethodMode,95 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)96 ArrowFunctionMode97 #endif98 };99 87 enum DestructuringKind { 100 88 DestructureToVariables, … … 538 526 public: 539 527 Parser( 540 VM*, const SourceCode&, FunctionParameters*, const Identifier&, 541 JSParserBuiltinMode, JSParserStrictMode, JSParserCodeType, 528 VM*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, JSParserCodeType, 542 529 ConstructorKind defaultConstructorKind = ConstructorKind::None, ThisTDZMode = ThisTDZMode::CheckIfNeeded); 543 530 ~Parser(); 544 531 545 532 template <class ParsedNode> 546 std::unique_ptr<ParsedNode> parse(ParserError& );533 std::unique_ptr<ParsedNode> parse(ParserError&, const Identifier&, FunctionParseMode); 547 534 548 535 JSTextPosition positionBeforeLastNewline() const { return m_lexer->positionBeforeLastNewline(); } … … 740 727 741 728 Parser(); 742 String parseInner( );729 String parseInner(const Identifier&, FunctionParseMode); 743 730 744 731 void didFinishParsing(SourceElements*, DeclarationStacks::FunctionStack&, VariableEnvironment&, CodeFeatures, int, const Vector<RefPtr<UniquedStringImpl>>&&); … … 797 784 } 798 785 786 ALWAYS_INLINE bool isEndOfArrowFunction() 787 { 788 return match(SEMICOLON) || match(COMMA) || match(CLOSEPAREN) || match(CLOSEBRACE) || match(CLOSEBRACKET) || match(EOFTOK) || m_lexer->prevTerminator(); 789 } 790 791 ALWAYS_INLINE bool isArrowFunctionParamters() 792 { 799 793 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 800 ALWAYS_INLINE bool isEndOfArrowFunction()801 {802 return match(SEMICOLON) || match(COMMA) || match(CLOSEPAREN) || match(CLOSEBRACE) || match(CLOSEBRACKET) || match(EOFTOK) || m_lexer->prevTerminator();803 }804 805 ALWAYS_INLINE bool isArrowFunctionParamters()806 {807 794 bool isArrowFunction = false; 808 795 … … 835 822 836 823 return isArrowFunction; 837 } 824 #else 825 return false; 838 826 #endif 827 } 839 828 840 829 ALWAYS_INLINE unsigned tokenStart() … … 947 936 } 948 937 949 template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode , FunctionParseType);938 template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode); 950 939 template <class TreeBuilder> TreeStatement parseStatementListItem(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength); 951 940 template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0); … … 988 977 template <class TreeBuilder> TreeExpression parsePropertyMethod(TreeBuilder& context, const Identifier* methodName); 989 978 template <class TreeBuilder> TreeProperty parseGetterSetter(TreeBuilder&, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind = ConstructorKind::None, SuperBinding = SuperBinding::NotNeeded); 990 template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, FunctionParseType);991 template <class TreeBuilder> ALWAYS_INLINE TreeFormalParameterList parseFormalParameters(TreeBuilder&);979 template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&, const JSTokenLocation&, int, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, FunctionBodyType, unsigned, FunctionParseMode); 980 template <class TreeBuilder> ALWAYS_INLINE bool parseFormalParameters(TreeBuilder&, TreeFormalParameterList, unsigned&); 992 981 enum VarDeclarationListContext { ForLoopContext, VarDeclarationContext }; 993 982 template <class TreeBuilder> TreeExpression parseVariableDeclarationList(TreeBuilder&, int& declarations, TreeDestructuringPattern& lastPattern, TreeExpression& lastInitializer, JSTextPosition& identStart, JSTextPosition& initStart, JSTextPosition& initEnd, VarDeclarationListContext, DeclarationType); 994 983 template <class TreeBuilder> NEVER_INLINE TreeConstDeclList parseConstDeclarationList(TreeBuilder&); 995 996 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 997 template <class TreeBuilder> TreeStatement parseArrowFunctionSingleExpressionBody(TreeBuilder&, FunctionParseType); 984 template <class TreeBuilder> TreeSourceElements parseArrowFunctionSingleExpressionBodySourceElements(TreeBuilder&); 998 985 template <class TreeBuilder> TreeExpression parseArrowFunctionExpression(TreeBuilder&); 999 #endif1000 1001 986 template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern createBindingPattern(TreeBuilder&, DestructuringKind, const Identifier&, int depth, JSToken, AssignmentContext); 1002 987 template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern parseDestructuringPattern(TreeBuilder&, DestructuringKind, AssignmentContext = AssignmentContext::DeclarationStatement, int depth = 0); … … 1031 1016 } 1032 1017 1033 1034 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)1035 1018 void setEndOfStatement() 1036 1019 { 1037 1020 m_lexer->setTokenPosition(&m_token); 1038 1021 } 1039 #endif1040 1022 1041 1023 bool canRecurse() … … 1109 1091 ParserArena m_parserArena; 1110 1092 std::unique_ptr<LexerType> m_lexer; 1093 FunctionParameters* m_parameters { nullptr }; 1111 1094 1112 1095 bool m_hasStackOverflow; … … 1154 1137 template <typename LexerType> 1155 1138 template <class ParsedNode> 1156 std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error )1139 std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const Identifier& calleeName, FunctionParseMode parseMode) 1157 1140 { 1158 1141 int errLine; … … 1160 1143 1161 1144 if (ParsedNode::scopeIsFunction) 1162 m_lexer->setIsReparsing ();1145 m_lexer->setIsReparsingFunction(); 1163 1146 1164 1147 m_sourceElements = 0; … … 1171 1154 unsigned startColumn = m_source->startColumn() - 1; 1172 1155 1173 String parseError = parseInner( );1156 String parseError = parseInner(calleeName, parseMode); 1174 1157 1175 1158 int lineNumber = m_lexer->lineNumber(); … … 1201 1184 m_funcDeclarations, 1202 1185 currentScope()->finalizeLexicalEnvironment(), 1186 m_parameters, 1203 1187 *m_source, 1204 1188 m_features, … … 1234 1218 template <class ParsedNode> 1235 1219 std::unique_ptr<ParsedNode> parse( 1236 VM* vm, const SourceCode& source, FunctionParameters* parameters,1220 VM* vm, const SourceCode& source, 1237 1221 const Identifier& name, JSParserBuiltinMode builtinMode, 1238 1222 JSParserStrictMode strictMode, JSParserCodeType codeType, 1239 ParserError& error, JSTextPosition* positionBeforeLastNewline = 0, 1240 ConstructorKind defaultConstructorKind = ConstructorKind::None, ThisTDZMode thisTDZMode = ThisTDZMode::CheckIfNeeded) 1223 ParserError& error, JSTextPosition* positionBeforeLastNewline = nullptr, 1224 FunctionParseMode parseMode = NotAFunctionMode, ConstructorKind defaultConstructorKind = ConstructorKind::None, 1225 ThisTDZMode thisTDZMode = ThisTDZMode::CheckIfNeeded) 1241 1226 { 1242 1227 SamplingRegion samplingRegion("Parsing"); … … 1244 1229 ASSERT(!source.provider()->source().isNull()); 1245 1230 if (source.provider()->source().is8Bit()) { 1246 Parser<Lexer<LChar>> parser(vm, source, parameters, name,builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode);1247 std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error );1231 Parser<Lexer<LChar>> parser(vm, source, builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode); 1232 std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode); 1248 1233 if (positionBeforeLastNewline) 1249 1234 *positionBeforeLastNewline = parser.positionBeforeLastNewline(); … … 1257 1242 } 1258 1243 ASSERT_WITH_MESSAGE(defaultConstructorKind == ConstructorKind::None, "BuiltinExecutables::createDefaultConstructor should always use a 8-bit string"); 1259 Parser<Lexer<UChar>> parser(vm, source, parameters, name,builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode);1260 std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error );1244 Parser<Lexer<UChar>> parser(vm, source, builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode); 1245 std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode); 1261 1246 if (positionBeforeLastNewline) 1262 1247 *positionBeforeLastNewline = parser.positionBeforeLastNewline(); -
trunk/Source/JavaScriptCore/parser/ParserFunctionInfo.h
r185989 r186959 29 29 namespace JSC { 30 30 31 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)32 enum FunctionBodyType { ArrowFunctionBodyExpression, ArrowFunctionBodyBlock, StandardFunctionBodyBlock };33 #endif34 35 31 template <class TreeBuilder> 36 32 struct ParserFunctionInfo { … … 38 34 typename TreeBuilder::FormalParameterList parameters = 0; 39 35 typename TreeBuilder::FunctionBody body = 0; 40 unsigned startFunctionOffset = 0; 41 unsigned endFunctionOffset = 0; 42 int bodyStartLine = 0; 43 int bodyEndLine = 0; 36 unsigned parameterCount = 0; 37 unsigned startOffset = 0; 38 unsigned endOffset = 0; 39 int startLine = 0; 40 int endLine = 0; 44 41 unsigned bodyStartColumn = 0; 45 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)46 unsigned arrowFunctionOffset = 0;47 unsigned arrowFunctionNextTockenEndOffset = 0;48 bool isArrowFunction { false };49 bool isEndByTerminator { false };50 FunctionBodyType functionBodyType { StandardFunctionBodyBlock };51 #endif52 42 }; 53 43 -
trunk/Source/JavaScriptCore/parser/ParserModes.h
r182198 r186959 45 45 enum FunctionMode { FunctionExpression, FunctionDeclaration }; 46 46 47 enum FunctionParseMode { 48 NormalFunctionMode, 49 GetterMode, 50 SetterMode, 51 MethodMode, 52 NotAFunctionMode, 53 ArrowFunctionMode 54 }; 55 47 56 inline bool functionNameIsInScope(const Identifier& name, FunctionMode functionMode) 48 57 { -
trunk/Source/JavaScriptCore/parser/SourceCode.h
r185989 r186959 106 106 SourceCode subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn); 107 107 108 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)109 SourceCode subArrowExpression(unsigned startArrowFunction, unsigned endArrowFunction, int firstLine, int startColumn);110 #endif111 108 private: 112 109 RefPtr<SourceProvider> m_provider; … … 122 119 } 123 120 124 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)125 inline SourceCode SourceCode::subArrowExpression(unsigned startArrowFunction, unsigned endArrowFunction, int firstLine, int startColumn)126 {127 ASSERT(provider()->source()[startArrowFunction] == '=' && provider()->source()[startArrowFunction + 1] == '>');128 129 startColumn += 1; // Convert to base 1.130 return SourceCode(provider(), startArrowFunction, endArrowFunction, firstLine, startColumn);131 }132 #endif133 134 121 inline SourceCode SourceCode::subExpression(unsigned openBrace, unsigned closeBrace, int firstLine, int startColumn) 135 122 { 136 ASSERT(provider()->source()[openBrace] == '{');137 ASSERT(provider()->source()[closeBrace] == '}');138 123 startColumn += 1; // Convert to base 1. 139 124 return SourceCode(provider(), openBrace, closeBrace + 1, firstLine, startColumn); -
trunk/Source/JavaScriptCore/parser/SourceProviderCache.h
r177130 r186959 44 44 45 45 private: 46 HashMap<int, std::unique_ptr<SourceProviderCacheItem> > m_map;46 HashMap<int, std::unique_ptr<SourceProviderCacheItem>, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>> m_map; 47 47 }; 48 48 -
trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
r185989 r186959 41 41 unsigned lastTockenLineStartOffset; 42 42 unsigned endFunctionOffset; 43 unsigned parameterCount; 43 44 bool needsFullActivation; 44 45 bool usesEval; … … 46 47 Vector<RefPtr<UniquedStringImpl>> usedVariables; 47 48 Vector<RefPtr<UniquedStringImpl>> writtenVariables; 48 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)49 49 bool isBodyArrowExpression { false }; 50 50 JSTokenType tokenType { CLOSEBRACE }; 51 #endif52 51 }; 53 52 … … 66 65 { 67 66 JSToken token; 68 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)69 67 token.m_type = isBodyArrowExpression ? tokenType : CLOSEBRACE; 70 #else71 token.m_type = CLOSEBRACE;72 #endif73 68 token.m_data.offset = lastTockenStartOffset; 74 69 token.m_location.startOffset = lastTockenStartOffset; … … 88 83 unsigned lastTockenStartOffset : 31; 89 84 unsigned lastTockenEndOffset: 31; 85 unsigned parameterCount; 90 86 91 87 bool usesEval : 1; … … 99 95 UniquedStringImpl** usedVariables() const { return const_cast<UniquedStringImpl**>(m_variables); } 100 96 UniquedStringImpl** writtenVariables() const { return const_cast<UniquedStringImpl**>(&m_variables[usedVariablesCount]); } 101 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)102 97 bool isBodyArrowExpression; 103 98 JSTokenType tokenType; 104 #endif105 99 106 100 private: … … 131 125 , lastTockenStartOffset(parameters.lastTockenStartOffset) 132 126 , lastTockenEndOffset(parameters.lastTockenEndOffset) 127 , parameterCount(parameters.parameterCount) 133 128 , usesEval(parameters.usesEval) 134 129 , strictMode(parameters.strictMode) … … 136 131 , usedVariablesCount(parameters.usedVariables.size()) 137 132 , writtenVariablesCount(parameters.writtenVariables.size()) 138 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)139 133 , isBodyArrowExpression(parameters.isBodyArrowExpression) 140 134 , tokenType(parameters.tokenType) 141 #endif142 135 { 143 136 unsigned j = 0; -
trunk/Source/JavaScriptCore/parser/SyntaxChecker.h
r186860 r186959 70 70 } 71 71 72 typedef SyntaxChecker FunctionBodyBuilder;73 72 enum { NoneExpr = 0, 74 73 ResolveEvalExpr, ResolveExpr, IntegerExpr, DoubleExpr, StringExpr, … … 180 179 #endif 181 180 ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; } 182 int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind) { return FunctionBodyResult; } 183 #if ENABLE(ES6_ARROWFUNCTION_SYNTAX) 181 int createFunctionBody(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, int) { return FunctionBodyResult; } 184 182 ExpressionType createArrowFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; } 185 #endif186 183 void setFunctionNameStart(int, int) { } 187 184 int createArguments() { return ArgumentsResult; } … … 222 219 int createElementList(int, int) { return ElementsListResult; } 223 220 int createElementList(int, int, int) { return ElementsListResult; } 224 int createFormalParameterList( DestructuringPattern) { return FormalParameterListResult; }225 int createFormalParameterList(int, DestructuringPattern) { return FormalParameterListResult;}221 int createFormalParameterList() { return FormalParameterListResult; } 222 void appendParameter(int, DestructuringPattern) { } 226 223 int createClause(int, int) { return ClauseResult; } 227 224 int createClauseList(int) { return ClauseListResult; } -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r186860 r186959 95 95 typedef typename CacheTypes<UnlinkedCodeBlockType>::RootNode RootNode; 96 96 std::unique_ptr<RootNode> rootNode = parse<RootNode>( 97 &vm, source, 0,Identifier(), builtinMode, strictMode,98 JSParserCodeType::Program, error, 0, ConstructorKind::None, thisTDZMode);97 &vm, source, Identifier(), builtinMode, strictMode, 98 JSParserCodeType::Program, error, nullptr, FunctionParseMode::NotAFunctionMode, ConstructorKind::None, thisTDZMode); 99 99 if (!rootNode) 100 100 return nullptr; … … 146 146 JSTextPosition positionBeforeLastNewline; 147 147 std::unique_ptr<ProgramNode> program = parse<ProgramNode>( 148 &vm, source, 0,Identifier(), JSParserBuiltinMode::NotBuiltin,148 &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, 149 149 JSParserStrictMode::NotStrict, JSParserCodeType::Program, 150 150 error, &positionBeforeLastNewline); -
trunk/Source/JavaScriptCore/runtime/Completion.cpp
r185608 r186959 58 58 RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); 59 59 return !!parse<ProgramNode>( 60 &vm, source, 0,Identifier(), JSParserBuiltinMode::NotBuiltin,60 &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, 61 61 JSParserStrictMode::NotStrict, JSParserCodeType::Program, error); 62 62 } -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r186860 r186959 476 476 JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject(); 477 477 std::unique_ptr<ProgramNode> programNode = parse<ProgramNode>( 478 vm, m_source, 0,Identifier(), JSParserBuiltinMode::NotBuiltin,478 vm, m_source, Identifier(), JSParserBuiltinMode::NotBuiltin, 479 479 JSParserStrictMode::NotStrict, JSParserCodeType::Program, error); 480 480 if (programNode) -
trunk/Source/JavaScriptCore/tests/controlFlowProfiler/conditional-expression.js
r180518 r186959 25 25 } 26 26 testConditionalFunctionCall(false, false); 27 checkBasicBlock(testConditionalFunctionCall, "x ", ShouldHaveExecuted);27 checkBasicBlock(testConditionalFunctionCall, "x ?", ShouldHaveExecuted); 28 28 checkBasicBlock(testConditionalFunctionCall, "? y", ShouldHaveExecuted); 29 29 checkBasicBlock(testConditionalFunctionCall, "bar", ShouldHaveExecuted); 30 30 checkBasicBlock(testConditionalFunctionCall, ": bar", ShouldHaveExecuted); 31 checkBasicBlock(testConditionalFunctionCall, "y ", ShouldNotHaveExecuted);31 checkBasicBlock(testConditionalFunctionCall, "y ?", ShouldNotHaveExecuted); 32 32 checkBasicBlock(testConditionalFunctionCall, "? foo", ShouldNotHaveExecuted); 33 33 checkBasicBlock(testConditionalFunctionCall, "foo", ShouldNotHaveExecuted); … … 35 35 36 36 testConditionalFunctionCall(true, false); 37 checkBasicBlock(testConditionalFunctionCall, "y ", ShouldHaveExecuted);37 checkBasicBlock(testConditionalFunctionCall, "y ?", ShouldHaveExecuted); 38 38 checkBasicBlock(testConditionalFunctionCall, "? foo", ShouldHaveExecuted); 39 39 checkBasicBlock(testConditionalFunctionCall, ": baz", ShouldHaveExecuted);
Note:
See TracChangeset
for help on using the changeset viewer.