Commit 50f28700 authored by paul.lind@imgtec.com's avatar paul.lind@imgtec.com

MIPS: Do not cache CodeStubInterfaceDescriptor on the isolate.

Port r23744 (998c3e4)

BUG=
R=paul.lind@imgtec.com

Review URL: https://codereview.chromium.org/540403002

Patch from Balazs Kilvady <balazs.kilvady@imgtec.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent fc90c556
...@@ -122,22 +122,22 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { ...@@ -122,22 +122,22 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated. // Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment(); isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor descriptor = GetInterfaceDescriptor(); CodeStubInterfaceDescriptor descriptor;
int param_count = descriptor->GetEnvironmentParameterCount(); InitializeInterfaceDescriptor(&descriptor);
int param_count = descriptor.GetEnvironmentParameterCount();
{ {
// Call the runtime system in a fresh internal frame. // Call the runtime system in a fresh internal frame.
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
DCHECK(param_count == 0 || DCHECK(param_count == 0 ||
a0.is(descriptor->GetEnvironmentParameterRegister( a0.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
param_count - 1)));
// Push arguments, adjust sp. // Push arguments, adjust sp.
__ Subu(sp, sp, Operand(param_count * kPointerSize)); __ Subu(sp, sp, Operand(param_count * kPointerSize));
for (int i = 0; i < param_count; ++i) { for (int i = 0; i < param_count; ++i) {
// Store argument to stack. // Store argument to stack.
__ sw(descriptor->GetEnvironmentParameterRegister(i), __ sw(descriptor.GetEnvironmentParameterRegister(i),
MemOperand(sp, (param_count-1-i) * kPointerSize)); MemOperand(sp, (param_count - 1 - i) * kPointerSize));
} }
ExternalReference miss = descriptor->miss_handler(); ExternalReference miss = descriptor.miss_handler();
__ CallExternalReference(miss, param_count); __ CallExternalReference(miss, param_count);
} }
......
...@@ -2392,10 +2392,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { ...@@ -2392,10 +2392,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
return DefineAsSpilled(result, spill_index); return DefineAsSpilled(result, spill_index);
} else { } else {
DCHECK(info()->IsStub()); DCHECK(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor = CodeStubInterfaceDescriptor descriptor;
info()->code_stub()->GetInterfaceDescriptor(); info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
int index = static_cast<int>(instr->index()); int index = static_cast<int>(instr->index());
Register reg = descriptor->GetEnvironmentParameterRegister(index); Register reg = descriptor.GetEnvironmentParameterRegister(index);
return DefineFixed(result, reg); return DefineFixed(result, reg);
} }
} }
......
...@@ -121,21 +121,22 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { ...@@ -121,21 +121,22 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated. // Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment(); isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); CodeStubInterfaceDescriptor descriptor;
int param_count = descriptor->GetEnvironmentParameterCount(); InitializeInterfaceDescriptor(&descriptor);
int param_count = descriptor.GetEnvironmentParameterCount();
{ {
// Call the runtime system in a fresh internal frame. // Call the runtime system in a fresh internal frame.
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
DCHECK((param_count == 0) || DCHECK((param_count == 0) ||
a0.is(descriptor->GetEnvironmentParameterRegister(param_count - 1))); a0.is(descriptor.GetEnvironmentParameterRegister(param_count - 1)));
// Push arguments, adjust sp. // Push arguments, adjust sp.
__ Dsubu(sp, sp, Operand(param_count * kPointerSize)); __ Dsubu(sp, sp, Operand(param_count * kPointerSize));
for (int i = 0; i < param_count; ++i) { for (int i = 0; i < param_count; ++i) {
// Store argument to stack. // Store argument to stack.
__ sd(descriptor->GetEnvironmentParameterRegister(i), __ sd(descriptor.GetEnvironmentParameterRegister(i),
MemOperand(sp, (param_count-1-i) * kPointerSize)); MemOperand(sp, (param_count - 1 - i) * kPointerSize));
} }
ExternalReference miss = descriptor->miss_handler(); ExternalReference miss = descriptor.miss_handler();
__ CallExternalReference(miss, param_count); __ CallExternalReference(miss, param_count);
} }
......
...@@ -2392,10 +2392,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { ...@@ -2392,10 +2392,10 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
return DefineAsSpilled(result, spill_index); return DefineAsSpilled(result, spill_index);
} else { } else {
DCHECK(info()->IsStub()); DCHECK(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor = CodeStubInterfaceDescriptor descriptor;
info()->code_stub()->GetInterfaceDescriptor(); info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
int index = static_cast<int>(instr->index()); int index = static_cast<int>(instr->index());
Register reg = descriptor->GetEnvironmentParameterRegister(index); Register reg = descriptor.GetEnvironmentParameterRegister(index);
return DefineFixed(result, reg); return DefineFixed(result, reg);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment