Commit 57fc9a79 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: Make FastNewFunctionContextStub take slots parameter.

  port 5bc24397 (r38219)

  original commit message:
  This will enable the interpreter to add a bytecode and use the stub.

BUG=

Review-Url: https://codereview.chromium.org/2205813002
Cr-Commit-Position: refs/heads/master@{#38271}
parent d0148661
......@@ -148,14 +148,13 @@ 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(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
} else {
__ push(edi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
RecordSafepoint(deopt_mode);
......
......@@ -176,15 +176,12 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ push(edx); // 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(edi);
__ CallRuntime(Runtime::kNewFunctionContext);
}
FastNewFunctionContextStub stub(isolate());
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Immediate(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
if (info->scope()->new_target_var() != nullptr) {
__ pop(edx); // Restore new target.
}
......
......@@ -20,6 +20,11 @@ void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
default_stub_registers);
}
const Register FastNewFunctionContextDescriptor::FunctionRegister() {
return edi;
}
const Register FastNewFunctionContextDescriptor::SlotsRegister() { return eax; }
const Register LoadDescriptor::ReceiverRegister() { return edx; }
const Register LoadDescriptor::NameRegister() { return ecx; }
const Register LoadDescriptor::SlotRegister() { return eax; }
......@@ -76,12 +81,6 @@ void FastNewClosureDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
}
void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {edi};
data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
}
void FastNewObjectDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {edi, edx};
......
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