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

Unified Diff: src/full-codegen/ia32/full-codegen-ia32.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/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/ia32/full-codegen-ia32.cc
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc
index 92ef4d42b50147cbd3a469afb023cc1db8922edf..e70bb4ea3222647267b47b81ff15e945b3d0622e 100644
--- a/src/full-codegen/ia32/full-codegen-ia32.cc
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc
@@ -720,12 +720,14 @@ void FullCodeGenerator::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());
break;
-
+ }
case VariableLocation::PARAMETER:
case VariableLocation::LOCAL:
if (hole_init) {
@@ -766,7 +768,9 @@ void FullCodeGenerator::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(), script(), info_);
// Check for stack-overflow exception.
@@ -816,6 +820,8 @@ void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
// Call the runtime to declare the globals.
__ Push(pairs);
__ Push(Smi::FromInt(DeclareGlobalsFlags()));
+ __ EmitLoadTypeFeedbackVector(eax);
+ __ Push(eax);
__ CallRuntime(Runtime::kDeclareGlobals);
// Return value is ignored.
}
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698