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

PPC/s390: [stubs] Drop CallApiCallbackStub::call_data_undefined optimization.

Port 46d0e481

Original Commit Message:

    The CallApiCallbackStub can avoid loading undefined in case the
    call_data is already undefined, which doubles the number of versions of
    the stub and adds unnecessary complexity (at the benefit of saving one
    stupid load). The idea is to turn the CallApiCallbackStub into a single
    builtin instead, which does the right thing, so this is the first step
    towards that goal.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:6304
LOG=N

Review-Url: https://codereview.chromium.org/2837283004
Cr-Commit-Position: refs/heads/master@{#44872}
parent f661fe84
......@@ -216,10 +216,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
......@@ -244,8 +242,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Operand(ref));
// Jump to stub.
CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
!optimization.is_constant_call());
CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
......
......@@ -208,10 +208,8 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Isolate* isolate = masm->isolate();
Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
bool call_data_undefined = false;
// Put call data in place.
if (api_call_info->data()->IsUndefined(isolate)) {
call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
if (optimization.is_constant_call()) {
......@@ -236,8 +234,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ mov(api_function_address, Operand(ref));
// Jump to stub.
CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
!optimization.is_constant_call());
CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
__ TailCallStub(&stub);
}
......
......@@ -2946,9 +2946,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
__ push(call_data);
Register scratch = call_data;
if (!call_data_undefined()) {
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
}
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
// return value
__ push(scratch);
// return value default
......
......@@ -2875,9 +2875,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
__ push(call_data);
Register scratch = call_data;
if (!call_data_undefined()) {
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
}
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
// return value
__ push(scratch);
// return value default
......
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