Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 861713004: Computed property names for class literals in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-8
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698