| Index: src/ppc/lithium-codegen-ppc.cc
|
| diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc
|
| index 8968f2fc09de4adfd3ab3363e5db9c18295844d7..bb7287c625850894e4e044368603076b1d538bc8 100644
|
| --- a/src/ppc/lithium-codegen-ppc.cc
|
| +++ b/src/ppc/lithium-codegen-ppc.cc
|
| @@ -3064,16 +3064,20 @@ void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
|
| DCHECK(ToRegister(instr->context()).is(cp));
|
| DCHECK(ToRegister(instr->result()).is(r3));
|
|
|
| - __ mov(LoadGlobalViaContextDescriptor::DepthRegister(),
|
| - Operand(Smi::FromInt(instr->depth())));
|
| - __ mov(LoadGlobalViaContextDescriptor::SlotRegister(),
|
| - Operand(Smi::FromInt(instr->slot_index())));
|
| - __ mov(LoadGlobalViaContextDescriptor::NameRegister(),
|
| - Operand(instr->name()));
|
| -
|
| - Handle<Code> stub =
|
| - CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code();
|
| - CallCode(stub, RelocInfo::CODE_TARGET, instr);
|
| + int const slot = instr->slot_index();
|
| + 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);
|
| + }
|
| }
|
|
|
|
|
| @@ -4485,17 +4489,24 @@ void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
|
| DCHECK(ToRegister(instr->value())
|
| .is(StoreGlobalViaContextDescriptor::ValueRegister()));
|
|
|
| - __ mov(StoreGlobalViaContextDescriptor::DepthRegister(),
|
| - Operand(Smi::FromInt(instr->depth())));
|
| - __ mov(StoreGlobalViaContextDescriptor::SlotRegister(),
|
| - Operand(Smi::FromInt(instr->slot_index())));
|
| - __ mov(StoreGlobalViaContextDescriptor::NameRegister(),
|
| - Operand(instr->name()));
|
| -
|
| - Handle<Code> stub =
|
| - CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(),
|
| - instr->language_mode()).code();
|
| - CallCode(stub, RelocInfo::CODE_TARGET, instr);
|
| + int const slot = instr->slot_index();
|
| + 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);
|
| + }
|
| }
|
|
|
|
|
|
|