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

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

Issue 1198983002: [turbofan] Revive the VectorSlotPair and also put feedback on JSCallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Try to address compilation error. Created 5 years, 6 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-operator.h » ('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 22ef8518249f825d5abf93fc5518c535b61af302..44f2276ee6513231af2bcdd29fa6023323fbcd52 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1365,9 +1365,10 @@ void AstGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
test_value.Else();
{
// Bind value and do loop body.
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(stmt->EachFeedbackSlot());
- VisitForInAssignment(stmt->each(), value, slot, stmt->AssignmentId());
+ VectorSlotPair feedback =
+ CreateVectorSlotPair(stmt->EachFeedbackSlot());
+ VisitForInAssignment(stmt->each(), value, feedback,
+ stmt->AssignmentId());
VisitIterationBody(stmt, &for_loop);
}
test_value.End();
@@ -1611,9 +1612,9 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
Node* value = environment()->Pop();
Node* key = environment()->Pop();
Node* receiver = environment()->Pop();
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(
+ VectorSlotPair feedback = CreateVectorSlotPair(
expr->SlotForHomeObject(property->value(), &store_slot_index));
- BuildSetHomeObject(value, receiver, property->value(), slot);
+ BuildSetHomeObject(value, receiver, property->value(), feedback);
switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT:
@@ -1653,10 +1654,10 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
DCHECK_NOT_NULL(expr->class_variable_proxy());
Variable* var = expr->class_variable_proxy()->var();
FrameStateBeforeAndAfter states(this, BailoutId::None());
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(
+ VectorSlotPair feedback = CreateVectorSlotPair(
FLAG_vector_stores ? expr->GetNthSlot(store_slot_index++)
: FeedbackVectorICSlot::Invalid());
- BuildVariableAssignment(var, literal, Token::INIT_CONST, slot,
+ BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback,
BailoutId::None(), states);
}
@@ -1684,9 +1685,9 @@ void AstGraphBuilder::VisitConditional(Conditional* expr) {
void AstGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(expr->VariableFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(expr->VariableFeedbackSlot());
FrameStateBeforeAndAfter states(this, BeforeId(expr));
- Node* value = BuildVariableLoad(expr->var(), expr->id(), states, slot,
+ Node* value = BuildVariableLoad(expr->var(), expr->id(), states, pair,
ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
}
@@ -1758,17 +1759,18 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
FrameStateBeforeAndAfter states(this, property->value()->id());
Node* value = environment()->Pop();
Handle<Name> name = key->AsPropertyName();
- ResolvedFeedbackSlot slot =
+ VectorSlotPair feedback =
FLAG_vector_stores
- ? ResolveFeedbackSlot(expr->GetNthSlot(store_slot_index++))
- : ResolvedFeedbackSlot();
- Node* store = BuildNamedStore(literal, name, value, slot,
+ ? CreateVectorSlotPair(expr->GetNthSlot(store_slot_index++))
+ : VectorSlotPair();
+ Node* store = BuildNamedStore(literal, name, value, feedback,
TypeFeedbackId::None());
states.AddToNode(store, key->id(),
OutputFrameStateCombine::Ignore());
- ResolvedFeedbackSlot home_slot = ResolveFeedbackSlot(
+ VectorSlotPair home_feedback = CreateVectorSlotPair(
expr->SlotForHomeObject(property->value(), &store_slot_index));
- BuildSetHomeObject(value, literal, property->value(), home_slot);
+ BuildSetHomeObject(value, literal, property->value(),
+ home_feedback);
} else {
VisitForEffect(property->value());
}
@@ -1787,9 +1789,9 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
Node* set_property = NewNode(op, receiver, key, value, language);
// SetProperty should not lazy deopt on an object literal.
PrepareFrameState(set_property, BailoutId::None());
- ResolvedFeedbackSlot home_slot = ResolveFeedbackSlot(
+ VectorSlotPair home_feedback = CreateVectorSlotPair(
expr->SlotForHomeObject(property->value(), &store_slot_index));
- BuildSetHomeObject(value, receiver, property->value(), home_slot);
+ BuildSetHomeObject(value, receiver, property->value(), home_feedback);
}
break;
}
@@ -1825,15 +1827,15 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
it != accessor_table.end(); ++it) {
VisitForValue(it->first);
VisitForValueOrNull(it->second->getter);
- ResolvedFeedbackSlot slot_getter = ResolveFeedbackSlot(
+ VectorSlotPair feedback_getter = CreateVectorSlotPair(
expr->SlotForHomeObject(it->second->getter, &store_slot_index));
BuildSetHomeObject(environment()->Top(), literal, it->second->getter,
- slot_getter);
+ feedback_getter);
VisitForValueOrNull(it->second->setter);
- ResolvedFeedbackSlot slot_setter = ResolveFeedbackSlot(
+ VectorSlotPair feedback_setter = CreateVectorSlotPair(
expr->SlotForHomeObject(it->second->getter, &store_slot_index));
BuildSetHomeObject(environment()->Top(), literal, it->second->setter,
- slot_setter);
+ feedback_setter);
Node* setter = environment()->Pop();
Node* getter = environment()->Pop();
Node* name = environment()->Pop();
@@ -1878,9 +1880,9 @@ void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
Node* value = environment()->Pop();
Node* key = environment()->Pop();
Node* receiver = environment()->Pop();
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(
+ VectorSlotPair feedback = CreateVectorSlotPair(
expr->SlotForHomeObject(property->value(), &store_slot_index));
- BuildSetHomeObject(value, receiver, property->value(), slot);
+ BuildSetHomeObject(value, receiver, property->value(), feedback);
switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT:
case ObjectLiteral::Property::COMPUTED:
@@ -1962,9 +1964,8 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
FrameStateBeforeAndAfter states(this, subexpr->id());
Node* value = environment()->Pop();
Node* index = jsgraph()->Constant(array_index);
- Node* store =
- BuildKeyedStore(literal, index, value, ResolvedFeedbackSlot(),
- TypeFeedbackId::None());
+ Node* store = BuildKeyedStore(literal, index, value, VectorSlotPair(),
+ TypeFeedbackId::None());
states.AddToNode(store, expr->GetIdForElement(array_index),
OutputFrameStateCombine::Ignore());
}
@@ -2008,7 +2009,7 @@ void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
- const ResolvedFeedbackSlot& slot,
+ const VectorSlotPair& feedback,
BailoutId bailout_id) {
DCHECK(expr->IsValidReferenceExpression());
@@ -2021,7 +2022,7 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
case VARIABLE: {
Variable* var = expr->AsVariableProxy()->var();
FrameStateBeforeAndAfter states(this, BailoutId::None());
- BuildVariableAssignment(var, value, Token::ASSIGN, slot, bailout_id,
+ BuildVariableAssignment(var, value, Token::ASSIGN, feedback, bailout_id,
states);
break;
}
@@ -2032,8 +2033,8 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
Node* object = environment()->Pop();
value = environment()->Pop();
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- Node* store =
- BuildNamedStore(object, name, value, slot, TypeFeedbackId::None());
+ Node* store = BuildNamedStore(object, name, value, feedback,
+ TypeFeedbackId::None());
states.AddToNode(store, bailout_id, OutputFrameStateCombine::Ignore());
break;
}
@@ -2046,7 +2047,7 @@ void AstGraphBuilder::VisitForInAssignment(Expression* expr, Node* value,
Node* object = environment()->Pop();
value = environment()->Pop();
Node* store =
- BuildKeyedStore(object, key, value, slot, TypeFeedbackId::None());
+ BuildKeyedStore(object, key, value, feedback, TypeFeedbackId::None());
states.AddToNode(store, bailout_id, OutputFrameStateCombine::Ignore());
break;
}
@@ -2128,21 +2129,21 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
switch (assign_type) {
case VARIABLE: {
VariableProxy* proxy = expr->target()->AsVariableProxy();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(proxy->VariableFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(proxy->VariableFeedbackSlot());
FrameStateBeforeAndAfter states(this, BeforeId(proxy));
old_value =
- BuildVariableLoad(proxy->var(), expr->target()->id(), states, slot,
+ BuildVariableLoad(proxy->var(), expr->target()->id(), states, pair,
OutputFrameStateCombine::Push());
break;
}
case NAMED_PROPERTY: {
Node* object = environment()->Top();
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
FrameStateBeforeAndAfter states(this, property->obj()->id());
- old_value = BuildNamedLoad(object, name, slot);
+ old_value = BuildNamedLoad(object, name, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
break;
@@ -2150,10 +2151,10 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
case KEYED_PROPERTY: {
Node* key = environment()->Top();
Node* object = environment()->Peek(1);
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
FrameStateBeforeAndAfter states(this, property->key()->id());
- old_value = BuildKeyedLoad(object, key, slot);
+ old_value = BuildKeyedLoad(object, key, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
break;
@@ -2162,10 +2163,10 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
Node* home_object = environment()->Top();
Node* receiver = environment()->Peek(1);
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
FrameStateBeforeAndAfter states(this, property->obj()->id());
- old_value = BuildNamedSuperLoad(receiver, home_object, name, slot);
+ old_value = BuildNamedSuperLoad(receiver, home_object, name, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
break;
@@ -2174,10 +2175,10 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
Node* key = environment()->Top();
Node* home_object = environment()->Peek(1);
Node* receiver = environment()->Peek(2);
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
FrameStateBeforeAndAfter states(this, property->key()->id());
- old_value = BuildKeyedSuperLoad(receiver, home_object, key, slot);
+ old_value = BuildKeyedSuperLoad(receiver, home_object, key, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
break;
@@ -2208,18 +2209,18 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
FrameStateBeforeAndAfter store_states(this, before_store_id);
// Store the value.
Node* value = environment()->Pop();
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(expr->AssignmentSlot());
+ VectorSlotPair feedback = CreateVectorSlotPair(expr->AssignmentSlot());
switch (assign_type) {
case VARIABLE: {
Variable* variable = expr->target()->AsVariableProxy()->var();
- BuildVariableAssignment(variable, value, expr->op(), slot, expr->id(),
+ BuildVariableAssignment(variable, value, expr->op(), feedback, expr->id(),
store_states, ast_context()->GetStateCombine());
break;
}
case NAMED_PROPERTY: {
Node* object = environment()->Pop();
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- Node* store = BuildNamedStore(object, name, value, slot,
+ Node* store = BuildNamedStore(object, name, value, feedback,
expr->AssignmentFeedbackId());
store_states.AddToNode(store, expr->id(),
ast_context()->GetStateCombine());
@@ -2228,7 +2229,7 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
case KEYED_PROPERTY: {
Node* key = environment()->Pop();
Node* object = environment()->Pop();
- Node* store = BuildKeyedStore(object, key, value, slot,
+ Node* store = BuildKeyedStore(object, key, value, feedback,
expr->AssignmentFeedbackId());
store_states.AddToNode(store, expr->id(),
ast_context()->GetStateCombine());
@@ -2278,7 +2279,7 @@ void AstGraphBuilder::VisitThrow(Throw* expr) {
void AstGraphBuilder::VisitProperty(Property* expr) {
Node* value = nullptr;
LhsKind property_kind = Property::GetAssignType(expr);
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(expr->PropertyFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(expr->PropertyFeedbackSlot());
switch (property_kind) {
case VARIABLE:
UNREACHABLE();
@@ -2288,7 +2289,7 @@ void AstGraphBuilder::VisitProperty(Property* expr) {
FrameStateBeforeAndAfter states(this, expr->obj()->id());
Node* object = environment()->Pop();
Handle<Name> name = expr->key()->AsLiteral()->AsPropertyName();
- value = BuildNamedLoad(object, name, slot);
+ value = BuildNamedLoad(object, name, pair);
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
break;
}
@@ -2298,7 +2299,7 @@ void AstGraphBuilder::VisitProperty(Property* expr) {
FrameStateBeforeAndAfter states(this, expr->key()->id());
Node* key = environment()->Pop();
Node* object = environment()->Pop();
- value = BuildKeyedLoad(object, key, slot);
+ value = BuildKeyedLoad(object, key, pair);
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
break;
}
@@ -2309,7 +2310,7 @@ void AstGraphBuilder::VisitProperty(Property* expr) {
Node* home_object = environment()->Pop();
Node* receiver = environment()->Pop();
Handle<Name> name = expr->key()->AsLiteral()->AsPropertyName();
- value = BuildNamedSuperLoad(receiver, home_object, name, slot);
+ value = BuildNamedSuperLoad(receiver, home_object, name, pair);
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
break;
}
@@ -2321,7 +2322,7 @@ void AstGraphBuilder::VisitProperty(Property* expr) {
Node* key = environment()->Pop();
Node* home_object = environment()->Pop();
Node* receiver = environment()->Pop();
- value = BuildKeyedSuperLoad(receiver, home_object, key, slot);
+ value = BuildKeyedSuperLoad(receiver, home_object, key, pair);
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
break;
}
@@ -2343,12 +2344,11 @@ void AstGraphBuilder::VisitCall(Call* expr) {
switch (call_type) {
case Call::GLOBAL_CALL: {
VariableProxy* proxy = callee->AsVariableProxy();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(proxy->VariableFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(proxy->VariableFeedbackSlot());
FrameStateBeforeAndAfter states(this, BeforeId(proxy));
callee_value =
BuildVariableLoad(proxy->var(), expr->expression()->id(), states,
- slot, OutputFrameStateCombine::Push());
+ pair, OutputFrameStateCombine::Push());
receiver_value = jsgraph()->UndefinedConstant();
break;
}
@@ -2368,8 +2368,8 @@ void AstGraphBuilder::VisitCall(Call* expr) {
}
case Call::PROPERTY_CALL: {
Property* property = callee->AsProperty();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
if (!property->IsSuperAccess()) {
VisitForValue(property->obj());
Node* object = environment()->Top();
@@ -2377,14 +2377,14 @@ void AstGraphBuilder::VisitCall(Call* expr) {
if (property->key()->IsPropertyName()) {
FrameStateBeforeAndAfter states(this, property->obj()->id());
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- callee_value = BuildNamedLoad(object, name, slot);
+ callee_value = BuildNamedLoad(object, name, pair);
states.AddToNode(callee_value, property->LoadId(),
OutputFrameStateCombine::Push());
} else {
VisitForValue(property->key());
FrameStateBeforeAndAfter states(this, property->key()->id());
Node* key = environment()->Pop();
- callee_value = BuildKeyedLoad(object, key, slot);
+ callee_value = BuildKeyedLoad(object, key, pair);
states.AddToNode(callee_value, property->LoadId(),
OutputFrameStateCombine::Push());
}
@@ -2405,7 +2405,7 @@ void AstGraphBuilder::VisitCall(Call* expr) {
FrameStateBeforeAndAfter states(this, property->obj()->id());
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
callee_value =
- BuildNamedSuperLoad(receiver_value, home_object, name, slot);
+ BuildNamedSuperLoad(receiver_value, home_object, name, pair);
states.AddToNode(callee_value, property->LoadId(),
OutputFrameStateCombine::Push());
@@ -2414,7 +2414,7 @@ void AstGraphBuilder::VisitCall(Call* expr) {
FrameStateBeforeAndAfter states(this, property->key()->id());
Node* key = environment()->Pop();
callee_value =
- BuildKeyedSuperLoad(receiver_value, home_object, key, slot);
+ BuildKeyedSuperLoad(receiver_value, home_object, key, pair);
states.AddToNode(callee_value, property->LoadId(),
OutputFrameStateCombine::Push());
}
@@ -2473,8 +2473,9 @@ void AstGraphBuilder::VisitCall(Call* expr) {
}
// Create node to perform the function call.
- const Operator* call =
- javascript()->CallFunction(args->length() + 2, flags, language_mode());
+ VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot());
+ const Operator* call = javascript()->CallFunction(args->length() + 2, flags,
+ language_mode(), feedback);
Node* value = ProcessArguments(call, args->length() + 2);
PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
@@ -2503,11 +2504,10 @@ void AstGraphBuilder::VisitCallJSRuntime(CallRuntime* expr) {
// before arguments are being evaluated.
CallFunctionFlags flags = NO_CALL_FUNCTION_FLAGS;
Node* receiver_value = BuildLoadBuiltinsObject();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(expr->CallRuntimeFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(expr->CallRuntimeFeedbackSlot());
// TODO(jarin): bailout ids for runtime calls.
FrameStateBeforeAndAfter states(this, BailoutId::None());
- Node* callee_value = BuildNamedLoad(receiver_value, name, slot);
+ Node* callee_value = BuildNamedLoad(receiver_value, name, pair);
states.AddToNode(callee_value, BailoutId::None(),
OutputFrameStateCombine::Push());
environment()->Push(callee_value);
@@ -2585,12 +2585,11 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
switch (assign_type) {
case VARIABLE: {
VariableProxy* proxy = expr->expression()->AsVariableProxy();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(proxy->VariableFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(proxy->VariableFeedbackSlot());
FrameStateBeforeAndAfter states(this, BeforeId(proxy));
old_value =
BuildVariableLoad(proxy->var(), expr->expression()->id(), states,
- slot, OutputFrameStateCombine::Push());
+ pair, OutputFrameStateCombine::Push());
stack_depth = 0;
break;
}
@@ -2599,9 +2598,9 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
FrameStateBeforeAndAfter states(this, property->obj()->id());
Node* object = environment()->Top();
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
- old_value = BuildNamedLoad(object, name, slot);
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
+ old_value = BuildNamedLoad(object, name, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
stack_depth = 1;
@@ -2613,9 +2612,9 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
FrameStateBeforeAndAfter states(this, property->key()->id());
Node* key = environment()->Top();
Node* object = environment()->Peek(1);
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
- old_value = BuildKeyedLoad(object, key, slot);
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
+ old_value = BuildKeyedLoad(object, key, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
stack_depth = 2;
@@ -2628,9 +2627,9 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
Node* home_object = environment()->Top();
Node* receiver = environment()->Peek(1);
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
- old_value = BuildNamedSuperLoad(receiver, home_object, name, slot);
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
+ old_value = BuildNamedSuperLoad(receiver, home_object, name, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
stack_depth = 2;
@@ -2644,9 +2643,9 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
Node* key = environment()->Top();
Node* home_object = environment()->Peek(1);
Node* receiver = environment()->Peek(2);
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(property->PropertyFeedbackSlot());
- old_value = BuildKeyedSuperLoad(receiver, home_object, key, slot);
+ VectorSlotPair pair =
+ CreateVectorSlotPair(property->PropertyFeedbackSlot());
+ old_value = BuildKeyedSuperLoad(receiver, home_object, key, pair);
states.AddToNode(old_value, property->LoadId(),
OutputFrameStateCombine::Push());
stack_depth = 3;
@@ -2680,12 +2679,12 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
}
// Store the value.
- ResolvedFeedbackSlot slot = ResolveFeedbackSlot(expr->CountSlot());
+ VectorSlotPair feedback = CreateVectorSlotPair(expr->CountSlot());
switch (assign_type) {
case VARIABLE: {
Variable* variable = expr->expression()->AsVariableProxy()->var();
environment()->Push(value);
- BuildVariableAssignment(variable, value, expr->op(), slot,
+ BuildVariableAssignment(variable, value, expr->op(), feedback,
expr->AssignmentId(), store_states);
environment()->Pop();
break;
@@ -2693,7 +2692,7 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY: {
Node* object = environment()->Pop();
Handle<Name> name = property->key()->AsLiteral()->AsPropertyName();
- Node* store = BuildNamedStore(object, name, value, slot,
+ Node* store = BuildNamedStore(object, name, value, feedback,
expr->CountStoreFeedbackId());
environment()->Push(value);
store_states.AddToNode(store, expr->AssignmentId(),
@@ -2704,7 +2703,7 @@ void AstGraphBuilder::VisitCountOperation(CountOperation* expr) {
case KEYED_PROPERTY: {
Node* key = environment()->Pop();
Node* object = environment()->Pop();
- Node* store = BuildKeyedStore(object, key, value, slot,
+ Node* store = BuildKeyedStore(object, key, value, feedback,
expr->CountStoreFeedbackId());
environment()->Push(value);
store_states.AddToNode(store, expr->AssignmentId(),
@@ -2927,11 +2926,10 @@ void AstGraphBuilder::VisitTypeof(UnaryOperation* expr) {
// Typeof does not throw a reference error on global variables, hence we
// perform a non-contextual load in case the operand is a variable proxy.
VariableProxy* proxy = expr->expression()->AsVariableProxy();
- ResolvedFeedbackSlot slot =
- ResolveFeedbackSlot(proxy->VariableFeedbackSlot());
+ VectorSlotPair pair = CreateVectorSlotPair(proxy->VariableFeedbackSlot());
FrameStateBeforeAndAfter states(this, BeforeId(proxy));
operand =
- BuildVariableLoad(proxy->var(), expr->expression()->id(), states, slot,
+ BuildVariableLoad(proxy->var(), expr->expression()->id(), states, pair,
OutputFrameStateCombine::Push(), NOT_CONTEXTUAL);
} else {
VisitForValue(expr->expression());
@@ -2992,10 +2990,9 @@ LanguageMode AstGraphBuilder::language_mode() const {
}
-ResolvedFeedbackSlot AstGraphBuilder::ResolveFeedbackSlot(
+VectorSlotPair AstGraphBuilder::CreateVectorSlotPair(
FeedbackVectorICSlot slot) const {
- return ResolvedFeedbackSlot(handle(info()->shared_info()->feedback_vector()),
- slot);
+ return VectorSlotPair(handle(info()->shared_info()->feedback_vector()), slot);
}
@@ -3146,8 +3143,8 @@ Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) {
DCHECK(arguments->IsContextSlot() || arguments->IsStackAllocated());
// This should never lazy deopt, so it is fine to send invalid bailout id.
FrameStateBeforeAndAfter states(this, BailoutId::None());
- ResolvedFeedbackSlot slot;
- BuildVariableAssignment(arguments, object, Token::ASSIGN, slot,
+ VectorSlotPair feedback;
+ BuildVariableAssignment(arguments, object, Token::ASSIGN, feedback,
BailoutId::None(), states);
return object;
@@ -3166,9 +3163,9 @@ Node* AstGraphBuilder::BuildRestArgumentsArray(Variable* rest, int index) {
DCHECK(rest->IsContextSlot() || rest->IsStackAllocated());
// This should never lazy deopt, so it is fine to send invalid bailout id.
FrameStateBeforeAndAfter states(this, BailoutId::None());
- ResolvedFeedbackSlot slot;
- BuildVariableAssignment(rest, object, Token::ASSIGN, slot, BailoutId::None(),
- states);
+ VectorSlotPair feedback;
+ BuildVariableAssignment(rest, object, Token::ASSIGN, feedback,
+ BailoutId::None(), states);
return object;
}
@@ -3179,9 +3176,9 @@ Node* AstGraphBuilder::BuildThisFunctionVar(Variable* this_function_var) {
Node* this_function = GetFunctionClosure();
FrameStateBeforeAndAfter states(this, BailoutId::None());
- ResolvedFeedbackSlot slot;
+ VectorSlotPair feedback;
BuildVariableAssignment(this_function_var, this_function, Token::INIT_CONST,
- slot, BailoutId::None(), states);
+ feedback, BailoutId::None(), states);
return this_function;
}
@@ -3232,7 +3229,7 @@ Node* AstGraphBuilder::BuildThrowIfStaticPrototype(Node* name,
Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
BailoutId bailout_id,
FrameStateBeforeAndAfter& states,
- const ResolvedFeedbackSlot& feedback,
+ const VectorSlotPair& feedback,
OutputFrameStateCombine combine,
ContextualMode contextual_mode) {
Node* the_hole = jsgraph()->TheHoleConstant();
@@ -3367,7 +3364,7 @@ Node* AstGraphBuilder::BuildVariableDelete(Variable* variable,
Node* AstGraphBuilder::BuildVariableAssignment(
Variable* variable, Node* value, Token::Value op,
- const ResolvedFeedbackSlot& slot, BailoutId bailout_id,
+ const VectorSlotPair& feedback, BailoutId bailout_id,
FrameStateBeforeAndAfter& states, OutputFrameStateCombine combine) {
Node* the_hole = jsgraph()->TheHoleConstant();
VariableMode mode = variable->mode();
@@ -3376,8 +3373,8 @@ Node* AstGraphBuilder::BuildVariableAssignment(
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Handle<Name> name = variable->name();
- Node* store =
- BuildNamedStore(global, name, value, slot, TypeFeedbackId::None());
+ Node* store = BuildNamedStore(global, name, value, feedback,
+ TypeFeedbackId::None());
states.AddToNode(store, bailout_id, combine);
return store;
}
@@ -3492,7 +3489,7 @@ static inline Node* Record(JSTypeFeedbackTable* js_type_feedback, Node* node,
Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key,
- const ResolvedFeedbackSlot& feedback) {
+ const VectorSlotPair& feedback) {
const Operator* op = javascript()->LoadProperty(feedback);
return Record(js_type_feedback_,
NewNode(op, object, key, GetFeedbackVector()), feedback.slot());
@@ -3500,7 +3497,7 @@ Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key,
Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name,
- const ResolvedFeedbackSlot& feedback,
+ const VectorSlotPair& feedback,
ContextualMode mode) {
const Operator* op =
javascript()->LoadNamed(MakeUnique(name), feedback, mode);
@@ -3510,7 +3507,7 @@ Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name,
Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value,
- const ResolvedFeedbackSlot& feedback,
+ const VectorSlotPair& feedback,
TypeFeedbackId id) {
const Operator* op = javascript()->StoreProperty(language_mode(), feedback);
return Record(js_type_feedback_, NewNode(op, object, key, value), id);
@@ -3519,7 +3516,7 @@ Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value,
Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name,
Node* value,
- const ResolvedFeedbackSlot& feedback,
+ const VectorSlotPair& feedback,
TypeFeedbackId id) {
const Operator* op =
javascript()->StoreNamed(language_mode(), MakeUnique(name), feedback);
@@ -3527,9 +3524,9 @@ Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name,
}
-Node* AstGraphBuilder::BuildNamedSuperLoad(
- Node* receiver, Node* home_object, Handle<Name> name,
- const ResolvedFeedbackSlot& feedback) {
+Node* AstGraphBuilder::BuildNamedSuperLoad(Node* receiver, Node* home_object,
+ Handle<Name> name,
+ const VectorSlotPair& feedback) {
Node* name_node = jsgraph()->Constant(name);
const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper, 3);
Node* value = NewNode(op, receiver, home_object, name_node);
@@ -3537,9 +3534,9 @@ Node* AstGraphBuilder::BuildNamedSuperLoad(
}
-Node* AstGraphBuilder::BuildKeyedSuperLoad(
- Node* receiver, Node* home_object, Node* key,
- const ResolvedFeedbackSlot& feedback) {
+Node* AstGraphBuilder::BuildKeyedSuperLoad(Node* receiver, Node* home_object,
+ Node* key,
+ const VectorSlotPair& feedback) {
const Operator* op =
javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
Node* value = NewNode(op, receiver, home_object, key);
@@ -3668,12 +3665,12 @@ Node* AstGraphBuilder::BuildToObject(Node* input, BailoutId bailout_id) {
Node* AstGraphBuilder::BuildSetHomeObject(Node* value, Node* home_object,
Expression* expr,
- const ResolvedFeedbackSlot& slot) {
+ const VectorSlotPair& feedback) {
if (!FunctionLiteral::NeedsHomeObject(expr)) return value;
Handle<Name> name = isolate()->factory()->home_object_symbol();
FrameStateBeforeAndAfter states(this, BailoutId::None());
- Node* store =
- BuildNamedStore(value, name, home_object, slot, TypeFeedbackId::None());
+ Node* store = BuildNamedStore(value, name, home_object, feedback,
+ TypeFeedbackId::None());
states.AddToNode(store, BailoutId::None(), OutputFrameStateCombine::Ignore());
return store;
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698