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

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

Issue 1452193003: [turbofan] Fix several OSR entries within class literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | src/compiler/ast-loop-assignment-analyzer.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 807d3ac016e278f582cfc3c0d116f7be838b97bc..6a7d82713f3564dce8e8236c9c65203493482fa9 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1555,18 +1555,18 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
// The prototype is ensured to exist by Runtime_DefineClass. No access check
// is needed here since the constructor is created by the class literal.
- Node* proto =
+ Node* prototype =
BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset);
// The class literal and the prototype are both expected on the operand stack
// during evaluation of the method values.
environment()->Push(literal);
- environment()->Push(proto);
+ environment()->Push(prototype);
// Create nodes to store method values into the literal.
for (int i = 0; i < expr->properties()->length(); i++) {
ObjectLiteral::Property* property = expr->properties()->at(i);
- environment()->Push(property->is_static() ? literal : proto);
+ environment()->Push(environment()->Peek(property->is_static() ? 1 : 0));
VisitForValue(property->key());
Node* name = BuildToName(environment()->Pop(), expr->GetIdForProperty(i));
@@ -1619,11 +1619,11 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- environment()->Pop(); // proto
- environment()->Pop(); // literal
+ prototype = environment()->Pop();
+ literal = environment()->Pop();
const Operator* op =
javascript()->CallRuntime(Runtime::kFinalizeClassDefinition, 2);
- literal = NewNode(op, literal, proto);
+ literal = NewNode(op, literal, prototype);
// Assign to class variable.
if (expr->class_variable_proxy() != nullptr) {
« no previous file with comments | « no previous file | src/compiler/ast-loop-assignment-analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698