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

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

Issue 2107193002: [ic] Initialize feedback slots for LoadGlobalIC in Runtime::kDeclareGlobals when possible to ... (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing on top of Issue 2127583002 Patch 120001 Created 4 years, 5 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 | « no previous file | src/crankshaft/arm/lithium-codegen-arm.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 2aec9158334ff7d3d724ab126121fb5c99d15b1a..f640c962920c116fcf22e192ac0d270aef24f9e1 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1112,11 +1112,14 @@ void AstGraphBuilder::VisitVariableDeclaration(VariableDeclaration* decl) {
bool hole_init = mode == CONST || mode == LET;
switch (variable->location()) {
case VariableLocation::GLOBAL:
- case VariableLocation::UNALLOCATED:
+ case VariableLocation::UNALLOCATED: {
DCHECK(!variable->binding_needs_init());
- globals()->push_back(variable->name());
+ FeedbackVectorSlot slot = decl->proxy()->VariableFeedbackSlot();
+ DCHECK(!slot.IsInvalid());
+ globals()->push_back(handle(Smi::FromInt(slot.ToInt()), isolate()));
globals()->push_back(isolate()->factory()->undefined_value());
break;
+ }
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL:
if (hole_init) {
@@ -1152,7 +1155,9 @@ void AstGraphBuilder::VisitFunctionDeclaration(FunctionDeclaration* decl) {
decl->fun(), info()->script(), info());
// Check for stack-overflow exception.
if (function.is_null()) return SetStackOverflow();
- globals()->push_back(variable->name());
+ FeedbackVectorSlot slot = decl->proxy()->VariableFeedbackSlot();
+ DCHECK(!slot.IsInvalid());
+ globals()->push_back(handle(Smi::FromInt(slot.ToInt()), isolate()));
globals()->push_back(function);
break;
}
@@ -2976,14 +2981,17 @@ void AstGraphBuilder::VisitDeclarations(ZoneList<Declaration*>* declarations) {
AstVisitor::VisitDeclarations(declarations);
if (globals()->empty()) return;
int array_index = 0;
+ Handle<TypeFeedbackVector> feedback_vector(
+ info()->closure()->feedback_vector());
Handle<FixedArray> data = isolate()->factory()->NewFixedArray(
static_cast<int>(globals()->size()), TENURED);
for (Handle<Object> obj : *globals()) data->set(array_index++, *obj);
int encoded_flags = info()->GetDeclareGlobalsFlags();
Node* flags = jsgraph()->Constant(encoded_flags);
Node* pairs = jsgraph()->Constant(data);
+ Node* vector = jsgraph()->Constant(feedback_vector);
const Operator* op = javascript()->CallRuntime(Runtime::kDeclareGlobals);
- Node* call = NewNode(op, pairs, flags);
+ Node* call = NewNode(op, pairs, flags, vector);
PrepareFrameState(call, BailoutId::Declarations());
globals()->clear();
}
« no previous file with comments | « no previous file | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698