| Index: src/full-codegen/x87/full-codegen-x87.cc
|
| diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc
|
| index 50032d62bcaceaa00dacf62038743f3ff2cc23a1..a110491ba800e089be82e8c99c684d5ff874c51b 100644
|
| --- a/src/full-codegen/x87/full-codegen-x87.cc
|
| +++ b/src/full-codegen/x87/full-codegen-x87.cc
|
| @@ -717,12 +717,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) {
|
| @@ -762,7 +764,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.
|
| @@ -808,6 +812,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.
|
| }
|
|
|