Commit 35b3e013 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [crankshaft] Refactor kAllowUndefinedAsNaN to kTruncatingToNumber.

Port df981a9f

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.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2449373002
Cr-Commit-Position: refs/heads/master@{#40593}
parent 2bd7464e
......@@ -4725,8 +4725,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg,
DoubleRegister result_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();
Register scratch = scratch0();
......
......@@ -1821,6 +1821,8 @@ class LNumberUntagD final : public LTemplateInstruction<1, 1, 0> {
DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change)
bool truncating() { return hydrogen()->CanTruncateToNumber(); }
};
......
......@@ -4655,8 +4655,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
void LCodeGen::EmitNumberUntagD(LNumberUntagD* instr, Register input_reg,
DoubleRegister result_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();
Register scratch = scratch0();
......
......@@ -1697,6 +1697,8 @@ class LNumberUntagD final : public LTemplateInstruction<1, 1, 0> {
DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
DECLARE_HYDROGEN_ACCESSOR(Change)
bool truncating() { return hydrogen()->CanTruncateToNumber(); }
};
class LSmiUntag final : public LTemplateInstruction<1, 1, 0> {
......
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