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

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

Issue 1626423003: Support computed properties for ES2015 Function.name (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge to trunk, disable bytecode generator class test Created 4 years, 10 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/ast/ast.h ('k') | src/compiler/linkage.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 8138142a01dbd57facc5f8bcc74ac995a662e5e6..b8b0f4360ae60a86ea3c8cc3c85b278413e13de0 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1606,9 +1606,12 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
case ObjectLiteral::Property::PROTOTYPE:
UNREACHABLE();
case ObjectLiteral::Property::COMPUTED: {
+ Node* attr = jsgraph()->Constant(DONT_ENUM);
+ Node* set_function_name =
+ jsgraph()->Constant(property->NeedsSetFunctionName());
const Operator* op =
- javascript()->CallRuntime(Runtime::kDefineClassMethod);
- NewNode(op, receiver, key, value);
+ javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral);
+ NewNode(op, receiver, key, value, attr, set_function_name);
break;
}
case ObjectLiteral::Property::GETTER: {
@@ -1855,10 +1858,11 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::COMPUTED:
case ObjectLiteral::Property::MATERIALIZED_LITERAL: {
Node* attr = jsgraph()->Constant(NONE);
+ Node* set_function_name =
+ jsgraph()->Constant(property->NeedsSetFunctionName());
const Operator* op =
- javascript()->CallRuntime(Runtime::kDefineDataPropertyUnchecked);
- Node* call = NewNode(op, receiver, key, value, attr);
- PrepareFrameState(call, BailoutId::None());
+ javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral);
+ NewNode(op, receiver, key, value, attr, set_function_name);
break;
}
case ObjectLiteral::Property::PROTOTYPE:
« no previous file with comments | « src/ast/ast.h ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698