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

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: Mostly working Created 4 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
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index abf594454db21046fef6d0e70f135b7352f1b4ab..f82b28048271e3db76b7c11ccecf4477476bfabc 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1606,9 +1606,13 @@ 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);
+ Node* call = NewNode(op, receiver, key, value, attr, set_function_name);
+ PrepareFrameState(call, BailoutId::None());
break;
}
case ObjectLiteral::Property::GETTER: {
@@ -1855,9 +1859,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);
+ javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral);
+ Node* call = NewNode(op, receiver, key, value, attr, set_function_name);
PrepareFrameState(call, BailoutId::None());
break;
}
« no previous file with comments | « src/ast/ast.h ('k') | src/compiler/linkage.cc » ('j') | src/compiler/linkage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698