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

port 6df9a22c3f

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=verwaest@chromium.org, bmeurer@chromium.org, joransiu@ca.ibm.com, mbrandy@us.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:599073, v8:4413
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#35217}
This commit is contained in:
jyan 2016-04-01 12:31:11 -07:00 committed by Commit bot
parent 6ae6d3f8b7
commit 6c38fde94e

View File

@ -42,11 +42,11 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
receiver = scratch;
}
__ Push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
__ LoadAccessor(r3, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(r3, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ LoadImmP(r2, Operand(0));
__ 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.
@ -84,11 +84,11 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
receiver = scratch;
}
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
__ LoadAccessor(r3, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(r3, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ LoadImmP(r2, 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.