Register context = cp;
Register result = r0;
Register slot = r2;
- Register name = r3;
- Label slow_case;
// Go up the context chain to the script context.
for (int i = 0; i < depth(); ++i) {
__ Ret(ne);
// Fallback to runtime.
- __ bind(&slow_case);
__ SmiTag(slot);
__ push(slot);
- __ push(name);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register value = r0;
Register slot = r2;
- Register name = r3;
Register cell = r1;
Register cell_details = r4;
if (FLAG_debug_code) {
__ CompareRoot(value, Heap::kTheHoleValueRootIndex);
__ Check(ne, kUnexpectedValue);
- __ AssertName(name);
}
// Go up the context chain to the script context.
// Fallback to runtime.
__ bind(&slow_case);
__ SmiTag(slot);
- __ push(slot);
- __ push(name);
- __ push(value);
+ __ Push(slot, value);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return r2; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return r3; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return r2; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return r3; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return r0; }
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(); }
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ mov(LoadGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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 depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ mov(StoreGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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);
}
}
Register context = cp;
Register result = x0;
Register slot = x2;
- Register name = x3;
Label slow_case;
// Go up the context chain to the script context.
// Fallback to runtime.
__ Bind(&slow_case);
__ SmiTag(slot);
- __ Push(slot, name);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ Push(slot);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
Register context = cp;
Register value = x0;
Register slot = x2;
- Register name = x3;
Register context_temp = x10;
Register cell = x10;
Register cell_details = x11;
if (FLAG_debug_code) {
__ CompareRoot(value, Heap::kTheHoleValueRootIndex);
__ Check(ne, kUnexpectedValue);
- __ AssertName(name);
}
// Go up the context chain to the script context.
// Fall back to the runtime.
__ Bind(&slow_case);
__ SmiTag(slot);
- __ Push(slot, name, value);
+ __ Push(slot, value);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return x2; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return x3; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return x2; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return x3; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return x0; }
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(); }
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ Mov(LoadGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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 depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ Mov(StoreGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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);
}
}
Callable callable = CodeFactory::LoadGlobalViaContext(isolate(), 0);
Node* script_context = node->InputAt(0);
node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index()));
- node->ReplaceInput(1, jsgraph()->HeapConstant(p.name()));
- node->ReplaceInput(2, script_context); // Set new context...
- node->RemoveInput(3); // ...instead of old one.
+ node->ReplaceInput(1, script_context); // Set new context...
+ node->RemoveInput(2);
+ node->RemoveInput(2); // ...instead of old one.
ReplaceWithStubCall(node, callable, flags);
} else {
Node* script_context = node->InputAt(0);
Node* value = node->InputAt(2);
node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index()));
- node->ReplaceInput(1, jsgraph()->HeapConstant(p.name()));
- node->ReplaceInput(2, value);
- node->ReplaceInput(3, script_context); // Set new context...
- node->RemoveInput(4); // ...instead of old one.
+ node->ReplaceInput(1, value);
+ node->ReplaceInput(2, script_context); // Set new context...
+ node->RemoveInput(3);
+ node->RemoveInput(3); // ...instead of old one.
ReplaceWithStubCall(node, callable, flags);
} else {
const int depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ mov(LoadGlobalViaContextDescriptor::NameRegister(),
- Operand(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 {
__ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
const int depth = scope()->ContextChainLength(var->scope());
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ mov(StoreGlobalViaContextDescriptor::NameRegister(),
- Operand(var->name()));
DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r0));
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ push(r0);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
// Non-initializing assignment to let variable needs a write barrier.
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), 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 {
__ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand());
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), slot);
- __ Mov(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(x0));
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ Push(x0);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
// Non-initializing assignment to let variable needs a write barrier.
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) {
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(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) {
__ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ Push(a0);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(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) {
__ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ Push(a0);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
if (var->IsGlobalSlot()) {
DCHECK(var->index() > 0);
DCHECK(var->IsStaticGlobalObjectProperty());
- // Each var occupies two slots in the context: for reads and writes.
int const slot = var->index();
int const depth = scope()->ContextChainLength(var->scope());
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ Set(LoadGlobalViaContextDescriptor::SlotRegister(), slot);
- __ Move(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) {
__ Set(StoreGlobalViaContextDescriptor::SlotRegister(), slot);
- __ Move(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(rax));
StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
__ CallStub(&stub);
} else {
__ Push(Smi::FromInt(slot));
- __ Push(var->name());
__ Push(rax);
__ CallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3);
+ 2);
}
} else if (var->mode() == LET && op != Token::INIT_LET) {
std::ostream& HStoreGlobalViaContext::PrintDataTo(
std::ostream& os) const { // NOLINT
- return os << name()->ToCString().get() << " = " << NameOf(value())
- << " depth:" << depth() << " slot:" << slot_index();
+ return os << " depth:" << depth() << " slot:" << slot_index() << " = "
+ << NameOf(value());
}
std::ostream& HLoadGlobalViaContext::PrintDataTo(
std::ostream& os) const { // NOLINT
- return os << name()->ToCString().get() << " "
- << "depth:" << depth() << " slot:" << slot_index();
+ return os << "depth:" << depth() << " slot:" << slot_index();
}
class HLoadGlobalViaContext final : public HTemplateInstruction<1> {
public:
- DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalViaContext,
- Handle<String>, int, int);
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadGlobalViaContext, int, int);
HValue* context() { return OperandAt(0); }
- Handle<String> name() const { return name_; }
int depth() const { return depth_; }
int slot_index() const { return slot_index_; }
DECLARE_CONCRETE_INSTRUCTION(LoadGlobalViaContext)
private:
- HLoadGlobalViaContext(HValue* context, Handle<String> name, int depth,
- int slot_index)
- : name_(name), depth_(depth), slot_index_(slot_index) {
+ HLoadGlobalViaContext(HValue* context, int depth, int slot_index)
+ : depth_(depth), slot_index_(slot_index) {
SetOperandAt(0, context);
set_representation(Representation::Tagged());
SetAllSideEffects();
}
- Handle<String> name_;
- int depth_;
- int slot_index_;
+ int const depth_;
+ int const slot_index_;
};
class HStoreGlobalViaContext final : public HTemplateInstruction<2> {
public:
- DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreGlobalViaContext,
- Handle<String>, HValue*, int, int,
- LanguageMode);
+ DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreGlobalViaContext, HValue*,
+ int, int, LanguageMode);
HValue* context() const { return OperandAt(0); }
HValue* value() const { return OperandAt(1); }
- Handle<String> name() const { return name_; }
int depth() const { return depth_; }
int slot_index() const { return slot_index_; }
LanguageMode language_mode() const { return language_mode_; }
DECLARE_CONCRETE_INSTRUCTION(StoreGlobalViaContext)
private:
- HStoreGlobalViaContext(HValue* context, Handle<String> name, HValue* value,
- int depth, int slot_index, LanguageMode language_mode)
- : name_(name),
- depth_(depth),
- slot_index_(slot_index),
- language_mode_(language_mode) {
+ HStoreGlobalViaContext(HValue* context, HValue* value, int depth,
+ int slot_index, LanguageMode language_mode)
+ : depth_(depth), slot_index_(slot_index), language_mode_(language_mode) {
SetOperandAt(0, context);
SetOperandAt(1, value);
SetAllSideEffects();
}
- Handle<String> name_;
- int depth_;
- int slot_index_;
- LanguageMode language_mode_;
+ int const depth_;
+ int const slot_index_;
+ LanguageMode const language_mode_;
};
int depth = scope()->ContextChainLength(variable->scope());
HLoadGlobalViaContext* instr =
- New<HLoadGlobalViaContext>(variable->name(), depth, slot_index);
+ New<HLoadGlobalViaContext>(depth, slot_index);
return ast_context()->ReturnInstruction(instr, expr->id());
} else {
int depth = scope()->ContextChainLength(var->scope());
HStoreGlobalViaContext* instr = Add<HStoreGlobalViaContext>(
- var->name(), value, depth, slot_index, function_language_mode());
+ value, depth, slot_index, function_language_mode());
USE(instr);
DCHECK(instr->HasObservableSideEffects());
Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
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(); }
LoadGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
- AnyTagged(), Type::Undefined(), 2, isolate->interface_descriptor_zone());
+ AnyTagged(), Type::Undefined(), 1, isolate->interface_descriptor_zone());
function->InitParameter(0, UntaggedSigned32());
- function->InitParameter(1, AnyTagged());
return function;
}
void LoadGlobalViaContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
- Register registers[] = {SlotRegister(), NameRegister()};
+ Register registers[] = {SlotRegister()};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType(
Isolate* isolate, int paramater_count) {
Type::FunctionType* function = Type::FunctionType::New(
- AnyTagged(), Type::Undefined(), 3, isolate->interface_descriptor_zone());
+ AnyTagged(), Type::Undefined(), 2, isolate->interface_descriptor_zone());
function->InitParameter(0, UntaggedSigned32());
function->InitParameter(1, AnyTagged());
- function->InitParameter(2, AnyTagged());
return function;
}
void StoreGlobalViaContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
- Register registers[] = {SlotRegister(), NameRegister(), ValueRegister()};
+ Register registers[] = {SlotRegister(), ValueRegister()};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
CallInterfaceDescriptor)
static const Register SlotRegister();
- static const Register NameRegister();
};
CallInterfaceDescriptor)
static const Register SlotRegister();
- static const Register NameRegister();
static const Register ValueRegister();
};
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
- Register name_reg = a3;
Register result_reg = v0;
Label slow_case;
// Load the PropertyCell value at the specified slot.
__ sll(at, slot_reg, kPointerSizeLog2);
__ Addu(at, at, Operand(context_reg));
- __ Addu(at, at, Context::SlotOffset(0));
- __ lw(result_reg, MemOperand(at));
+ __ lw(result_reg, ContextOperand(at, 0));
__ lw(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset));
// Check that value is not the_hole.
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg, name_reg);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ Push(slot_reg);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
- Register name_reg = a3;
Register value_reg = a0;
Register cell_reg = t0;
Register cell_value_reg = t1;
if (FLAG_debug_code) {
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Check(ne, kUnexpectedValue, value_reg, Operand(at));
- __ AssertName(name_reg);
}
// Go up context chain to the script context.
// Load the PropertyCell at the specified slot.
__ sll(at, slot_reg, kPointerSizeLog2);
__ Addu(at, at, Operand(context_reg));
- __ Addu(at, at, Context::SlotOffset(0));
- __ lw(cell_reg, MemOperand(at));
+ __ lw(cell_reg, ContextOperand(at, 0));
// Load PropertyDetails for the cell (actually only the cell_type and kind).
__ lw(cell_details_reg,
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg, name_reg, value_reg);
+ __ Push(slot_reg, value_reg);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return a2; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return a3; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return a2; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return a3; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return a0; }
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(LoadGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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 depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(StoreGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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(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(); }
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
- Register name_reg = a3;
Register result_reg = v0;
Label slow_case;
// Load the PropertyCell value at the specified slot.
__ dsll(at, slot_reg, kPointerSizeLog2);
__ Daddu(at, at, Operand(context_reg));
- __ Daddu(at, at, Context::SlotOffset(0));
- __ ld(result_reg, MemOperand(at));
+ __ ld(result_reg, ContextOperand(at, 0));
__ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset));
// Check that value is not the_hole.
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg, name_reg);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ Push(slot_reg);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = cp;
Register slot_reg = a2;
- Register name_reg = a3;
Register value_reg = a0;
Register cell_reg = a4;
Register cell_value_reg = a5;
if (FLAG_debug_code) {
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
__ Check(ne, kUnexpectedValue, value_reg, Operand(at));
- __ AssertName(name_reg);
}
// Go up context chain to the script context.
// Load the PropertyCell at the specified slot.
__ dsll(at, slot_reg, kPointerSizeLog2);
__ Daddu(at, at, Operand(context_reg));
- __ Daddu(at, at, Context::SlotOffset(0));
- __ ld(cell_reg, MemOperand(at));
+ __ ld(cell_reg, ContextOperand(at, 0));
// Load PropertyDetails for the cell (actually only the cell_type and kind).
__ ld(cell_details_reg,
// Fallback to the runtime.
__ bind(&slow_case);
__ SmiTag(slot_reg);
- __ Push(slot_reg, name_reg, value_reg);
+ __ Push(slot_reg, value_reg);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return a2; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return a3; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return a2; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return a3; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return a0; }
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(LoadGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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 depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
- __ li(StoreGlobalViaContextDescriptor::NameRegister(),
- Operand(instr->name()));
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(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(); }
InitializationFlag* init_flag,
MaybeAssignedFlag* maybe_assigned_flag);
+ // Lookup the name of a certain context slot by its index.
+ String* ContextSlotName(int slot_index);
+
// Lookup support for serialized scope info. Returns the
// parameter index for a given parameter name if the parameter is present;
// otherwise returns a value < 0. The name must be an internalized string.
RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
HandleScope scope(isolate);
- DCHECK_EQ(2, args.length());
+ DCHECK_EQ(1, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
// Go up context chain to the script context.
Handle<Context> script_context(isolate->context()->script_context(), isolate);
DCHECK(script_context->get(slot)->IsPropertyCell());
// Lookup the named property on the global object.
+ Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()),
+ isolate);
+ Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
Handle<GlobalObject> global_object(script_context->global_object(), isolate);
LookupIterator it(global_object, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
// a hidden prototype.
- if (it.state() == LookupIterator::DATA &&
+ if (LookupIterator::DATA == it.state() &&
it.GetHolder<Object>()->IsJSGlobalObject()) {
// Now update the cell in the script context.
Handle<PropertyCell> cell = it.GetPropertyCell();
namespace {
-Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Name> name,
- Handle<Object> value,
+Object* StoreGlobalViaContext(Isolate* isolate, int slot, Handle<Object> value,
LanguageMode language_mode) {
// Go up context chain to the script context.
Handle<Context> script_context(isolate->context()->script_context(), isolate);
DCHECK(script_context->get(slot)->IsPropertyCell());
// Lookup the named property on the global object.
+ Handle<ScopeInfo> scope_info(ScopeInfo::cast(script_context->extension()),
+ isolate);
+ Handle<Name> name(scope_info->ContextSlotName(slot), isolate);
Handle<GlobalObject> global_object(script_context->global_object(), isolate);
LookupIterator it(global_object, name, LookupIterator::HIDDEN);
// Switch to fast mode only if there is a data property and it's not on
RUNTIME_FUNCTION(Runtime_StoreGlobalViaContext_Sloppy) {
HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
+ DCHECK_EQ(2, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- return StoreGlobalViaContext(isolate, slot, name, value, SLOPPY);
+ return StoreGlobalViaContext(isolate, slot, value, SLOPPY);
}
RUNTIME_FUNCTION(Runtime_StoreGlobalViaContext_Strict) {
HandleScope scope(isolate);
- DCHECK_EQ(3, args.length());
+ DCHECK_EQ(2, args.length());
CONVERT_SMI_ARG_CHECKED(slot, 0);
- CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
- return StoreGlobalViaContext(isolate, slot, name, value, STRICT);
+ return StoreGlobalViaContext(isolate, slot, value, STRICT);
}
F(GetPropertyStrong, 2, 1) \
F(KeyedGetProperty, 2, 1) \
F(KeyedGetPropertyStrong, 2, 1) \
- F(LoadGlobalViaContext, 2, 1) \
- F(StoreGlobalViaContext_Sloppy, 3, 1) \
- F(StoreGlobalViaContext_Strict, 3, 1) \
+ F(LoadGlobalViaContext, 1, 1) \
+ F(StoreGlobalViaContext_Sloppy, 2, 1) \
+ F(StoreGlobalViaContext_Strict, 2, 1) \
F(AddNamedProperty, 4, 1) \
F(SetProperty, 4, 1) \
F(AddElement, 3, 1) \
}
+String* ScopeInfo::ContextSlotName(int slot_index) {
+ // TODO(bmeurer): Simplify this once we have only a single slot for both reads
+ // and writes to context globals; currently we have 2 slots per context
+ // global, and these are located after the common context slots (of which we
+ // always have Context::MIN_CONTEXT_SLOTS) and the context locals.
+ int const var =
+ slot_index - (Context::MIN_CONTEXT_SLOTS + ContextLocalCount());
+ DCHECK_LE(0, var);
+ DCHECK_LT(var, 2 * ContextGlobalCount());
+ return ContextLocalName(ContextLocalCount() + var / 2);
+}
+
+
int ScopeInfo::ParameterIndex(String* name) {
DCHECK(name->IsInternalizedString());
if (length() > 0) {
void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = rsi;
Register slot_reg = rbx;
- Register name_reg = rcx;
Register result_reg = rax;
Label slow_case;
__ Integer32ToSmi(slot_reg, slot_reg);
__ PopReturnAddressTo(kScratchRegister);
__ Push(slot_reg);
- __ Push(name_reg);
__ Push(kScratchRegister);
- __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1);
+ __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 1, 1);
}
void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
Register context_reg = rsi;
Register slot_reg = rbx;
- Register name_reg = rcx;
Register value_reg = rax;
Register cell_reg = r8;
Register cell_details_reg = rdx;
if (FLAG_debug_code) {
__ CompareRoot(value_reg, Heap::kTheHoleValueRootIndex);
__ Check(not_equal, kUnexpectedValue);
- __ AssertName(name_reg);
}
// Go up context chain to the script context.
__ Integer32ToSmi(slot_reg, slot_reg);
__ PopReturnAddressTo(kScratchRegister);
__ Push(slot_reg);
- __ Push(name_reg);
__ Push(value_reg);
__ Push(kScratchRegister);
__ TailCallRuntime(is_strict(language_mode())
? Runtime::kStoreGlobalViaContext_Strict
: Runtime::kStoreGlobalViaContext_Sloppy,
- 3, 1);
+ 2, 1);
}
const Register LoadGlobalViaContextDescriptor::SlotRegister() { return rbx; }
-const Register LoadGlobalViaContextDescriptor::NameRegister() { return rcx; }
const Register StoreGlobalViaContextDescriptor::SlotRegister() { return rbx; }
-const Register StoreGlobalViaContextDescriptor::NameRegister() { return rcx; }
const Register StoreGlobalViaContextDescriptor::ValueRegister() { return rax; }
int const depth = instr->depth();
if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
__ Set(LoadGlobalViaContextDescriptor::SlotRegister(), slot);
- __ Move(LoadGlobalViaContextDescriptor::NameRegister(), instr->name());
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 depth = instr->depth();
if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
__ Set(StoreGlobalViaContextDescriptor::SlotRegister(), slot);
- __ Move(StoreGlobalViaContextDescriptor::NameRegister(), instr->name());
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(); }