|
Refactor class declaration logic to the parser and runtime.
ClassDeclarations and Expressions had a first-class representation in
the AST, with implementations in all of the backends. This involved a
significant amount of substantially-duplicated code, and made future
changes and maintenance much harder than it needed to be. This CL
modifies the parser to produce a DoExpression which calls out to a
runtime function, DefineClass, which installs the given properties on
the constructor and its prototype. DoExpressions AST nodes gain a new
field to enable function name inference for class expressions.
This comes at a roughly ten percent slowdown in both class parsing and
execution in the worst case. Instantiation is not discernibly affected.
Total comments: 6
Total comments: 3
Total comments: 6
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+455 lines, -1207 lines) |
Patch |
|
M |
src/asmjs/asm-wasm-builder.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/ast/ast.h
|
View
|
1
2
3
4
5
6
|
5 chunks |
+11 lines, -87 lines |
0 comments
|
Download
|
|
M |
src/ast/ast.cc
|
View
|
1
2
3
4
5
6
|
4 chunks |
+6 lines, -37 lines |
1 comment
|
Download
|
|
M |
src/ast/ast-expression-rewriter.cc
|
View
|
|
1 chunk |
+0 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-expression-visitor.cc
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-literal-reindexer.cc
|
View
|
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/ast/ast-numbering.cc
|
View
|
|
1 chunk |
+0 lines, -16 lines |
0 comments
|
Download
|
|
M |
src/ast/prettyprinter.cc
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+0 lines, -18 lines |
0 comments
|
Download
|
|
M |
src/bailout-reason.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
src/compiler/ast-graph-builder.h
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/compiler/ast-graph-builder.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -115 lines |
0 comments
|
Download
|
|
M |
src/compiler/ast-loop-assignment-analyzer.cc
|
View
|
|
1 chunk |
+0 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/crankshaft/hydrogen.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/crankshaft/typing.cc
|
View
|
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/arm/full-codegen-arm.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -56 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/arm64/full-codegen-arm64.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -56 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/full-codegen.h
|
View
|
|
2 chunks |
+0 lines, -22 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/full-codegen.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+0 lines, -47 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/ia32/full-codegen-ia32.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -51 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/mips/full-codegen-mips.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -56 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/mips64/full-codegen-mips64.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -56 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/ppc/full-codegen-ppc.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -56 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/s390/full-codegen-s390.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -55 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/x64/full-codegen-x64.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -54 lines |
0 comments
|
Download
|
|
M |
src/full-codegen/x87/full-codegen-x87.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -51 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.h
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/interpreter/bytecode-generator.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -148 lines |
0 comments
|
Download
|
|
M |
src/parsing/parameter-initializer-rewriter.cc
|
View
|
|
3 chunks |
+11 lines, -26 lines |
0 comments
|
Download
|
|
M |
src/parsing/parser.h
|
View
|
|
3 chunks |
+10 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/parsing/parser.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
8 chunks |
+146 lines, -16 lines |
6 comments
|
Download
|
|
M |
src/parsing/parser-base.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
src/parsing/pattern-rewriter.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
src/parsing/preparser.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
src/parsing/preparser.cc
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime/runtime.h
|
View
|
1
2
3
4
5
6
|
2 chunks |
+7 lines, -1 line |
0 comments
|
Download
|
|
M |
src/runtime/runtime-classes.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+101 lines, -4 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden
|
View
|
1
9
10
|
6 chunks |
+115 lines, -95 lines |
0 comments
|
Download
|
|
M |
test/cctest/interpreter/bytecode_expectations/Generators.golden
|
View
|
1
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
test/cctest/test-parsing.cc
|
View
|
1
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
test/mjsunit/es6/classes.js
|
View
|
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
Total messages: 58 (47 generated)
|