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

Unified Diff: src/crankshaft/hydrogen.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 | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 8d2d2146247f7b93f5387cf8625d8fe7da0f3a92..bca151bf62c021a64fec9e238593e4c138a22c30 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -12336,7 +12336,8 @@ void HOptimizedGraphBuilder::VisitDeclarations(
isolate()->factory()->NewFixedArray(globals_.length(), TENURED);
for (int i = 0; i < globals_.length(); ++i) array->set(i, *globals_.at(i));
int flags = current_info()->GetDeclareGlobalsFlags();
- Add<HDeclareGlobals>(array, flags);
+ Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
+ Add<HDeclareGlobals>(array, flags, vector);
globals_.Rewind(0);
}
}
@@ -12350,11 +12351,14 @@ void HOptimizedGraphBuilder::VisitVariableDeclaration(
bool hole_init = mode == LET || mode == CONST;
switch (variable->location()) {
case VariableLocation::GLOBAL:
- case VariableLocation::UNALLOCATED:
+ case VariableLocation::UNALLOCATED: {
DCHECK(!variable->binding_needs_init());
- globals_.Add(variable->name(), zone());
+ FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
+ DCHECK(!slot.IsInvalid());
+ globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
globals_.Add(isolate()->factory()->undefined_value(), zone());
return;
+ }
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL:
if (hole_init) {
@@ -12386,7 +12390,9 @@ void HOptimizedGraphBuilder::VisitFunctionDeclaration(
switch (variable->location()) {
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED: {
- globals_.Add(variable->name(), zone());
+ FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
+ DCHECK(!slot.IsInvalid());
+ globals_.Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo(
declaration->fun(), current_info()->script(), top_info());
// Check for stack-overflow exception.
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698