int const depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ Move(LoadGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
- __ mov(LoadGlobalViaContextDescriptor::NameRegister(), var->name());
LoadGlobalViaContextStub stub(isolate(), depth);
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
- __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
+ __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
}
} else {
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ Move(StoreGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
- __ mov(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(eax));
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ Push(eax);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = esi;
Register slot_reg = ebx;
- Register name_reg = ecx;
Register result_reg = eax;
Label slow_case;
__ SmiTag(slot_reg);
__ Pop(result_reg); // Pop return address.
__ Push(slot_reg);
- __ Push(name_reg);
__ Push(result_reg); // Push return address.
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = esi;
Register slot_reg = ebx;
- Register name_reg = ecx;
Register value_reg = eax;
Register cell_reg = edi;
Register cell_details_reg = edx;
+ Register cell_value_reg = ecx;
Label fast_heapobject_case, fast_smi_case, slow_case;
if (FLAG_debug_code) {
__ CompareRoot(value_reg, Heap::kTheHoleValueRootIndex);
__ Check(not_equal, kUnexpectedValue);
- __ AssertName(name_reg);
}
// Go up context chain to the script context.
// Check if PropertyCell value matches the new value (relevant for Constant,
// ConstantType and Undefined cells).
Label not_same_value;
- __ cmp(value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset));
+ __ mov(cell_value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset));
+ __ cmp(cell_value_reg, value_reg);
__ j(not_equal, ¬_same_value,
FLAG_debug_code ? Label::kFar : Label::kNear);
// Make sure the PropertyCell is not marked READ_ONLY.
// Now either both old and new values must be SMIs or both must be heap
// objects with same map.
Label value_is_heap_object;
- // TODO(bmeurer): use ecx (name_reg) when name parameter is removed.
- Register cell_value_reg = cell_details_reg;
- __ mov(cell_value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset));
__ JumpIfNotSmi(value_reg, &value_is_heap_object, Label::kNear);
__ JumpIfNotSmi(cell_value_reg, &slow_case, Label::kNear);
// Old and new values are SMIs, no need for a write barrier here.
__ SmiTag(slot_reg);
__ Pop(cell_reg); // Pop return address.
__ Push(slot_reg);
- __ Push(name_reg);
__ Push(value_reg);
__ Push(cell_reg); // Push return address.
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return ebx; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return ecx; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return ebx; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return ecx; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return eax; }
int const slot = instr->slot_index();
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
- __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), slot);
- __ mov(LoadGlobalViaContextDescriptor::NameRegister(), instr->name());
+ __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
Handle<Code> stub =
CodeFactory::LoadGlobalViaContext(isolate(), depth).code();
CallCode(stub, RelocInfo::CODE_TARGET, instr);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(instr->name());
- __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
+ __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
}
}
int const slot = instr->slot_index();
int const depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
- __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), slot);
- __ mov(StoreGlobalViaContextDescriptor::NameRegister(), instr->name());
+ __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
Handle<Code> stub = CodeFactory::StoreGlobalViaContext(
isolate(), depth, instr->language_mode())
.code();
CallCode(stub, RelocInfo::CODE_TARGET, instr);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(instr->name());
__ Push(StoreGlobalViaContextDescriptor::ValueRegister());
__ CallRuntime(is_strict(instr->language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
}
void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) {
- stream->Add(String::cast(*name())->ToCString().get());
- stream->Add(" depth:%d slot:%d", depth(), slot_index());
+ stream->Add("depth:%d slot:%d", depth(), slot_index());
}
void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) {
- stream->Add(String::cast(*name())->ToCString().get());
- stream->Add(" <- ");
+ stream->Add("depth:%d slot:%d <- ", depth(), slot_index());
value()->PrintTo(stream);
- stream->Add(" depth:%d slot:%d", depth(), slot_index());
}
LOperand* context() { return inputs_[0]; }
- Handle<Object> name() const { return hydrogen()->name(); }
int depth() const { return hydrogen()->depth(); }
int slot_index() const { return hydrogen()->slot_index(); }
};
void PrintDataTo(StringStream* stream) override;
- Handle<Object> name() const { return hydrogen()->name(); }
int depth() { return hydrogen()->depth(); }
int slot_index() { return hydrogen()->slot_index(); }
LanguageMode language_mode() { return hydrogen()->language_mode(); }