Commit 96ddf420 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

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

  port 6df9a22c (r35187)

  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).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#35522}
parent 58820332
......@@ -38,11 +38,11 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
receiver = scratch;
}
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
__ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ Set(eax, 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.
......@@ -273,11 +273,11 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
}
__ push(receiver);
__ push(value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
__ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
CheckDebugStepCallWrapper());
__ Set(eax, 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