| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index 3acb57acb25b3072767584a3499d13ffcec299dd..8443cfafac50cf6aff02651acfb4aa55e51fc24e 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -897,6 +897,7 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
|
| environment()->Push(property->is_static() ? literal : proto);
|
|
|
| VisitForValue(property->key());
|
| + environment()->Push(BuildToName(environment()->Pop()));
|
| VisitForValue(property->value());
|
| Node* value = environment()->Pop();
|
| Node* key = environment()->Pop();
|
| @@ -2232,7 +2233,7 @@ Node* AstGraphBuilder::BuildLoadGlobalProxy() {
|
|
|
|
|
| Node* AstGraphBuilder::BuildToBoolean(Node* input) {
|
| - // TODO(titzer): this should be in a JSOperatorReducer.
|
| + // TODO(titzer): This should be in a JSOperatorReducer.
|
| switch (input->opcode()) {
|
| case IrOpcode::kInt32Constant:
|
| return jsgraph_->BooleanConstant(!Int32Matcher(input).Is(0));
|
| @@ -2256,6 +2257,14 @@ Node* AstGraphBuilder::BuildToBoolean(Node* input) {
|
| }
|
|
|
|
|
| +Node* AstGraphBuilder::BuildToName(Node* input) {
|
| + // TODO(turbofan): Possible optimization is to NOP on name constants. But the
|
| + // same caveat as with BuildToBoolean applies, and it should be factored out
|
| + // into a JSOperatorReducer.
|
| + return NewNode(javascript()->ToName(), input);
|
| +}
|
| +
|
| +
|
| Node* AstGraphBuilder::BuildThrowReferenceError(Variable* variable,
|
| BailoutId bailout_id) {
|
| // TODO(mstarzinger): Should be unified with the VisitThrow implementation.
|
|
|