Please sign in to comment.
…ng constructors Merge pull request #6253 from boingoing:defer_parse_class_members Enable defer parse for class members including constructors We have the ability to defer parse any function except for class members (which includes explicit class constructors). Class members are basically parsed in the same way as object literal methods so it isn't very hard to support defer parsing for them since we already support defer parsing for object literal methods. The main complication here is supporting the unusual text extents for class constructors. The class constructor function itself is what we will eventually bind to the name of the class. However, calling toString on the class name should print the text of the entire class. We also need to know the exact text extents for the constructor method in order to defer parse it. There's already a mechanism we use to adjust the beginning of the text extents for async methods so I've extended this to support adjusting the length of the extents as well. We used to keep track of an extra uint tacked-on to FunctionBody but I moved this into a struct of two uints stored in the AuxPtr array instead. This struct is only allocated for objects with unusual text extents. Besides the text extents work, the remainder is mostly just bookkeeping various flags to let us know we're parsing a class constructor, derived constructor, class member, etc.
- Loading branch information...
Showing with 23,678 additions and 23,405 deletions.
- +30 −19 lib/Parser/Parse.cpp
- +20 −18 lib/Parser/ParseFlags.h
- +1 −0 lib/Parser/ptree.h
- +42 −6 lib/Runtime/Base/FunctionBody.cpp
- +10 −2 lib/Runtime/Base/FunctionBody.h
- +21 −1 lib/Runtime/ByteCode/ByteCodeSerializer.cpp
- +3 −0 lib/Runtime/ByteCode/ScopeInfo.cpp
- +21 −1 lib/Runtime/ByteCode/ScopeInfo.h
- +859 −863 lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js.bc.32b.h
- +859 −863 lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js.bc.64b.h
- +771 −775 lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js.nojit.bc.32b.h
- +771 −775 lib/Runtime/Library/JsBuiltIn/JsBuiltIn.js.nojit.bc.64b.h
- +11 −5 lib/Runtime/Library/ScriptFunction.cpp
- +269 −0 test/es7/deferparseclass.js
- +6 −0 test/es7/rlexe.xml
Oops, something went wrong.