Commit 9bc155b9 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber.

  port df981a9f (r40577)

  original commit message:
  The meaning of the HValue::kAllowUndefinedAsNaN is actually ToNumber
  conversion (except for the uses in HBranch and HCompareHoleAndBranch,
  which were confusing and useless anyways), so fix the naming to match
  that.

  Also properly integrate the handling of this flag with the existing
  truncation analysis that is run as part of the representation changes
  phase (i.e. where we already deal with truncating to int32 and smi).

  This is done in preparation of allowing Crankshaft to handle any kind
  of Oddball in the ToNumber truncation, instead of just undefined for
  truncation ToNumber and undefined or boolean for ToInt32. It also helps
  to make Crankshaft somewhat more compatible with the (saner)
  implementation in TurboFan.

BUG=

Review-Url: https://codereview.chromium.org/2456503003
Cr-Commit-Position: refs/heads/master@{#40607}
parent 4156d940
......@@ -4596,8 +4596,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
void LCodeGen::EmitNumberUntagDNoSSE2(LNumberUntagD* instr, Register input_reg,
Register temp_reg, X87Register res_reg,
NumberUntagDMode mode) {
bool can_convert_undefined_to_nan =
instr->hydrogen()->can_convert_undefined_to_nan();
bool can_convert_undefined_to_nan = instr->truncating();
bool deoptimize_on_minus_zero = instr->hydrogen()->deoptimize_on_minus_zero();
Label load_smi, done;
......
......@@ -1871,6 +1871,8 @@ class LNumberUntagD final : public LTemplateInstruction<1, 1, 1> {
DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change);
bool truncating() { return hydrogen()->CanTruncateToNumber(); }
};
......
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