| Index: src/x64/codegen-x64.cc
|
| diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
|
| index 91d9ff0278c1a9d0f60b6848f818e66c76a192d9..581e7ee93db090661004ffe208f1046da1c5ebba 100644
|
| --- a/src/x64/codegen-x64.cc
|
| +++ b/src/x64/codegen-x64.cc
|
| @@ -248,7 +248,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
| // the function.
|
| for (int i = 0; i < scope()->num_parameters(); i++) {
|
| Variable* par = scope()->parameter(i);
|
| - Slot* slot = par->slot();
|
| + Slot* slot = par->AsSlot();
|
| if (slot != NULL && slot->type() == Slot::CONTEXT) {
|
| // The use of SlotOperand below is safe in unspilled code
|
| // because the slot is guaranteed to be a context slot.
|
| @@ -284,7 +284,7 @@ void CodeGenerator::Generate(CompilationInfo* info) {
|
| // Initialize ThisFunction reference if present.
|
| if (scope()->is_function_scope() && scope()->function() != NULL) {
|
| frame_->Push(Factory::the_hole_value());
|
| - StoreToSlot(scope()->function()->slot(), NOT_CONST_INIT);
|
| + StoreToSlot(scope()->function()->AsSlot(), NOT_CONST_INIT);
|
| }
|
|
|
| // Initialize the function return target after the locals are set
|
| @@ -601,10 +601,10 @@ void CodeGenerator::LoadTypeofExpression(Expression* expr) {
|
| Property property(&global, &key, RelocInfo::kNoPosition);
|
| Reference ref(this, &property);
|
| ref.GetValue();
|
| - } else if (variable != NULL && variable->slot() != NULL) {
|
| + } else if (variable != NULL && variable->AsSlot() != NULL) {
|
| // For a variable that rewrites to a slot, we signal it is the immediate
|
| // subexpression of a typeof.
|
| - LoadFromSlotCheckForArguments(variable->slot(), INSIDE_TYPEOF);
|
| + LoadFromSlotCheckForArguments(variable->AsSlot(), INSIDE_TYPEOF);
|
| } else {
|
| // Anything else can be handled normally.
|
| Load(expr);
|
| @@ -643,17 +643,17 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
| frame_->Push(&result);
|
| }
|
|
|
| - Variable* arguments = scope()->arguments()->var();
|
| - Variable* shadow = scope()->arguments_shadow()->var();
|
| - ASSERT(arguments != NULL && arguments->slot() != NULL);
|
| - ASSERT(shadow != NULL && shadow->slot() != NULL);
|
| + Variable* arguments = scope()->arguments();
|
| + Variable* shadow = scope()->arguments_shadow();
|
| + ASSERT(arguments != NULL && arguments->AsSlot() != NULL);
|
| + ASSERT(shadow != NULL && shadow->AsSlot() != NULL);
|
| JumpTarget done;
|
| bool skip_arguments = false;
|
| if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) {
|
| // We have to skip storing into the arguments slot if it has
|
| // already been written to. This can happen if the a function
|
| // has a local variable named 'arguments'.
|
| - LoadFromSlot(arguments->slot(), NOT_INSIDE_TYPEOF);
|
| + LoadFromSlot(arguments->AsSlot(), NOT_INSIDE_TYPEOF);
|
| Result probe = frame_->Pop();
|
| if (probe.is_constant()) {
|
| // We have to skip updating the arguments object if it has
|
| @@ -666,10 +666,10 @@ Result CodeGenerator::StoreArgumentsObject(bool initial) {
|
| }
|
| }
|
| if (!skip_arguments) {
|
| - StoreToSlot(arguments->slot(), NOT_CONST_INIT);
|
| + StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT);
|
| if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind();
|
| }
|
| - StoreToSlot(shadow->slot(), NOT_CONST_INIT);
|
| + StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT);
|
| return frame_->Pop();
|
| }
|
|
|
| @@ -726,7 +726,7 @@ void CodeGenerator::LoadReference(Reference* ref) {
|
| LoadGlobal();
|
| ref->set_type(Reference::NAMED);
|
| } else {
|
| - ASSERT(var->slot() != NULL);
|
| + ASSERT(var->AsSlot() != NULL);
|
| ref->set_type(Reference::SLOT);
|
| }
|
| } else {
|
| @@ -2496,7 +2496,7 @@ void CodeGenerator::CallApplyLazy(Expression* applicand,
|
| // Load the receiver and the existing arguments object onto the
|
| // expression stack. Avoid allocating the arguments object here.
|
| Load(receiver);
|
| - LoadFromSlot(scope()->arguments()->var()->slot(), NOT_INSIDE_TYPEOF);
|
| + LoadFromSlot(scope()->arguments()->AsSlot(), NOT_INSIDE_TYPEOF);
|
|
|
| // Emit the source position information after having loaded the
|
| // receiver and the arguments.
|
| @@ -2757,7 +2757,7 @@ void CodeGenerator::VisitDeclaration(Declaration* node) {
|
| Comment cmnt(masm_, "[ Declaration");
|
| Variable* var = node->proxy()->var();
|
| ASSERT(var != NULL); // must have been resolved
|
| - Slot* slot = var->slot();
|
| + Slot* slot = var->AsSlot();
|
|
|
| // If it was not possible to allocate the variable at compile time,
|
| // we need to "declare" it at runtime to make sure it actually
|
| @@ -3435,7 +3435,7 @@ void CodeGenerator::GenerateFastSmiLoop(ForStatement* node) {
|
| // Set number type of the loop variable to smi.
|
| CheckStack(); // TODO(1222600): ignore if body contains calls.
|
|
|
| - SetTypeForStackSlot(loop_var->slot(), TypeInfo::Smi());
|
| + SetTypeForStackSlot(loop_var->AsSlot(), TypeInfo::Smi());
|
| Visit(node->body());
|
|
|
| if (node->continue_target()->is_linked()) {
|
| @@ -3444,7 +3444,7 @@ void CodeGenerator::GenerateFastSmiLoop(ForStatement* node) {
|
|
|
| if (has_valid_frame()) {
|
| CodeForStatementPosition(node);
|
| - Slot* loop_var_slot = loop_var->slot();
|
| + Slot* loop_var_slot = loop_var->AsSlot();
|
| if (loop_var_slot->type() == Slot::LOCAL) {
|
| frame_->TakeLocalAt(loop_var_slot->index());
|
| } else {
|
| @@ -3918,8 +3918,8 @@ void CodeGenerator::VisitTryCatchStatement(TryCatchStatement* node) {
|
|
|
| // Store the caught exception in the catch variable.
|
| Variable* catch_var = node->catch_var()->var();
|
| - ASSERT(catch_var != NULL && catch_var->slot() != NULL);
|
| - StoreToSlot(catch_var->slot(), NOT_CONST_INIT);
|
| + ASSERT(catch_var != NULL && catch_var->AsSlot() != NULL);
|
| + StoreToSlot(catch_var->AsSlot(), NOT_CONST_INIT);
|
|
|
| // Remove the exception from the stack.
|
| frame_->Drop();
|
| @@ -4517,7 +4517,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
|
| done->Jump(result);
|
|
|
| } else if (slot->var()->mode() == Variable::DYNAMIC_LOCAL) {
|
| - Slot* potential_slot = slot->var()->local_if_not_shadowed()->slot();
|
| + Slot* potential_slot = slot->var()->local_if_not_shadowed()->AsSlot();
|
| Expression* rewrite = slot->var()->local_if_not_shadowed()->rewrite();
|
| if (potential_slot != NULL) {
|
| // Generate fast case for locals that rewrite to slots.
|
| @@ -4552,7 +4552,7 @@ void CodeGenerator::EmitDynamicLoadFromSlotFastCase(Slot* slot,
|
| Result arguments = allocator()->Allocate();
|
| ASSERT(arguments.is_valid());
|
| __ movq(arguments.reg(),
|
| - ContextSlotOperandCheckExtensions(obj_proxy->var()->slot(),
|
| + ContextSlotOperandCheckExtensions(obj_proxy->var()->AsSlot(),
|
| arguments,
|
| slow));
|
| frame_->Push(&arguments);
|
| @@ -5018,7 +5018,7 @@ void CodeGenerator::EmitSlotAssignment(Assignment* node) {
|
| Comment cmnt(masm(), "[ Variable Assignment");
|
| Variable* var = node->target()->AsVariableProxy()->AsVariable();
|
| ASSERT(var != NULL);
|
| - Slot* slot = var->slot();
|
| + Slot* slot = var->AsSlot();
|
| ASSERT(slot != NULL);
|
|
|
| // Evaluate the right-hand side.
|
| @@ -5363,14 +5363,14 @@ void CodeGenerator::VisitCall(Call* node) {
|
| // in generated code. If we succeed, there is no need to perform a
|
| // context lookup in the runtime system.
|
| JumpTarget done;
|
| - if (var->slot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
|
| - ASSERT(var->slot()->type() == Slot::LOOKUP);
|
| + if (var->AsSlot() != NULL && var->mode() == Variable::DYNAMIC_GLOBAL) {
|
| + ASSERT(var->AsSlot()->type() == Slot::LOOKUP);
|
| JumpTarget slow;
|
| // Prepare the stack for the call to
|
| // ResolvePossiblyDirectEvalNoLookup by pushing the loaded
|
| // function, the first argument to the eval call and the
|
| // receiver.
|
| - Result fun = LoadFromGlobalSlotCheckExtensions(var->slot(),
|
| + Result fun = LoadFromGlobalSlotCheckExtensions(var->AsSlot(),
|
| NOT_INSIDE_TYPEOF,
|
| &slow);
|
| frame_->Push(&fun);
|
| @@ -5454,8 +5454,8 @@ void CodeGenerator::VisitCall(Call* node) {
|
| // Replace the function on the stack with the result.
|
| frame_->Push(&result);
|
|
|
| - } else if (var != NULL && var->slot() != NULL &&
|
| - var->slot()->type() == Slot::LOOKUP) {
|
| + } else if (var != NULL && var->AsSlot() != NULL &&
|
| + var->AsSlot()->type() == Slot::LOOKUP) {
|
| // ----------------------------------
|
| // JavaScript examples:
|
| //
|
| @@ -5474,7 +5474,7 @@ void CodeGenerator::VisitCall(Call* node) {
|
| // Generate fast case for loading functions from slots that
|
| // correspond to local/global variables or arguments unless they
|
| // are shadowed by eval-introduced bindings.
|
| - EmitDynamicLoadFromSlotFastCase(var->slot(),
|
| + EmitDynamicLoadFromSlotFastCase(var->AsSlot(),
|
| NOT_INSIDE_TYPEOF,
|
| &function,
|
| &slow,
|
| @@ -7337,7 +7337,7 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) {
|
|
|
| Variable* variable = node->expression()->AsVariableProxy()->AsVariable();
|
| if (variable != NULL) {
|
| - Slot* slot = variable->slot();
|
| + Slot* slot = variable->AsSlot();
|
| if (variable->is_global()) {
|
| LoadGlobal();
|
| frame_->Push(variable->name());
|
| @@ -8693,7 +8693,7 @@ void Reference::GetValue() {
|
| switch (type_) {
|
| case SLOT: {
|
| Comment cmnt(masm, "[ Load from Slot");
|
| - Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
|
| + Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
|
| ASSERT(slot != NULL);
|
| cgen_->LoadFromSlotCheckForArguments(slot, NOT_INSIDE_TYPEOF);
|
| break;
|
| @@ -8746,7 +8746,7 @@ void Reference::TakeValue() {
|
| return;
|
| }
|
|
|
| - Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
|
| + Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
|
| ASSERT(slot != NULL);
|
| if (slot->type() == Slot::LOOKUP ||
|
| slot->type() == Slot::CONTEXT ||
|
| @@ -8779,7 +8779,7 @@ void Reference::SetValue(InitState init_state) {
|
| switch (type_) {
|
| case SLOT: {
|
| Comment cmnt(masm, "[ Store to Slot");
|
| - Slot* slot = expression_->AsVariableProxy()->AsVariable()->slot();
|
| + Slot* slot = expression_->AsVariableProxy()->AsVariable()->AsSlot();
|
| ASSERT(slot != NULL);
|
| cgen_->StoreToSlot(slot, init_state);
|
| set_unloaded();
|
|
|