Commit bb2fd5d2 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: Make FastNewFunctionContextStub take slots parameter

Port 5bc24397

Original commit message:

    This will enable the interpreter to add a bytecode and use the stub.

R=klaasb@google.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=v8:4280
LOG=N

Review-Url: https://codereview.chromium.org/2200263003
Cr-Commit-Position: refs/heads/master@{#38264}
parent c0dfc8d8
......@@ -172,14 +172,12 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ Push(info()->scope()->GetScopeInfo(info()->isolate()));
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate(), slots);
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r4);
__ CallRuntime(Runtime::kNewFunctionContext);
}
RecordSafepoint(deopt_mode);
......@@ -5447,8 +5445,8 @@ void LCodeGen::DoTypeof(LTypeof* instr) {
__ mov(r3, Operand(isolate()->factory()->number_string()));
__ b(&end);
__ bind(&do_call);
Callable callable = CodeFactory::Typeof(isolate());
CallCode(callable.code(), RelocInfo::CODE_TARGET, instr);
TypeofStub stub(isolate());
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
__ bind(&end);
}
......
......@@ -162,14 +162,12 @@ void LCodeGen::DoPrologue(LPrologue* instr) {
__ Push(info()->scope()->GetScopeInfo(info()->isolate()));
__ CallRuntime(Runtime::kNewScriptContext);
deopt_mode = Safepoint::kLazyDeopt;
} else if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate(), slots);
} else {
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r3);
__ CallRuntime(Runtime::kNewFunctionContext);
}
RecordSafepoint(deopt_mode);
......@@ -5353,8 +5351,8 @@ void LCodeGen::DoTypeof(LTypeof* instr) {
__ mov(r2, Operand(isolate()->factory()->number_string()));
__ b(&end);
__ bind(&do_call);
Callable callable = CodeFactory::Typeof(isolate());
CallCode(callable.code(), RelocInfo::CODE_TARGET, instr);
TypeofStub stub(isolate());
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
__ bind(&end);
}
......
......@@ -190,15 +190,11 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(r6); // Preserve new target.
}
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r4);
__ CallRuntime(Runtime::kNewFunctionContext);
}
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (info->scope()->new_target_var() != nullptr) {
__ pop(r6); // Preserve new target.
}
......
......@@ -195,15 +195,11 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(r5); // Preserve new target.
}
if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
FastNewFunctionContextStub stub(isolate(), slots);
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(r3);
__ CallRuntime(Runtime::kNewFunctionContext);
}
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (info->scope()->new_target_var() != nullptr) {
__ pop(r5); // Preserve new target.
}
......
......@@ -20,6 +20,11 @@ void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
default_stub_registers);
}
const Register FastNewFunctionContextDescriptor::FunctionRegister() {
return r4;
}
const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r3; }
const Register LoadDescriptor::ReceiverRegister() { return r4; }
const Register LoadDescriptor::NameRegister() { return r5; }
const Register LoadDescriptor::SlotRegister() { return r3; }
......@@ -70,12 +75,6 @@ void FastNewClosureDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r4};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewObjectDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r4, r6};
......
......@@ -20,6 +20,11 @@ void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
default_stub_registers);
}
const Register FastNewFunctionContextDescriptor::FunctionRegister() {
return r3;
}
const Register FastNewFunctionContextDescriptor::SlotsRegister() { return r2; }
const Register LoadDescriptor::ReceiverRegister() { return r3; }
const Register LoadDescriptor::NameRegister() { return r4; }
const Register LoadDescriptor::SlotRegister() { return r2; }
......@@ -63,12 +68,6 @@ void FastNewClosureDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewObjectDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r3, r5};
......
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