Commit 2799cd15 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [ic] Use the CallFunction builtin to invoke accessors.

Port 6df9a22c

Original commit message:
    The HandlerCompiler did not properly handle the weird edge case when a
    sloppy mode function was installed as an accessor on one of the value
    wrapper prototypes and then accessed via a load from a primitive value.
    In this case we just passed the primitive value untouched instead of
    properly wrapping it first. The CallFunction builtin properly deals with
    all the funny edge cases, so we use it instead of duplicating almost all
    of the logic here (the performance difference is neglible).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:599073, v8:4413
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35214}
parent 3831d41e
......@@ -43,11 +43,11 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
receiver = scratch;
}
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
__ LoadAccessor(r4, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(r4, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ li(r3, Operand::Zero());
__ Call(masm->isolate()->builtins()->CallFunction(
ConvertReceiverMode::kNotNullOrUndefined),
RelocInfo::CODE_TARGET);
} else {
// If we generate a global code snippet for deoptimization only, remember
// the place to continue after deoptimization.
......@@ -86,11 +86,11 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
receiver = scratch;
}
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
__ LoadAccessor(r4, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(r4, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ li(r3, Operand(1));
__ Call(masm->isolate()->builtins()->CallFunction(
ConvertReceiverMode::kNotNullOrUndefined),
RelocInfo::CODE_TARGET);
} else {
// If we generate a global code snippet for deoptimization only, remember
// the place to continue after deoptimization.
......
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