Ignore:
Timestamp:
Oct 20, 2017, 12:35:16 AM (8 years ago)
Author:
Yusuke Suzuki
Message:

[ARM64] static_cast<int32_t>() in BinaryOpNode::emitBytecode() prevents op_unsigned emission
https://bugs.webkit.org/show_bug.cgi?id=178379

Reviewed by Saam Barati.

We reuse jsNumber's checking mechanism here to precisely check the generated number is within uint32_t
in bytecode compiler. This is reasonable since the NumberNode will generate the exact this JSValue.

  • bytecompiler/NodesCodegen.cpp:

(JSC::BinaryOpNode::emitBytecode):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r223318 r223745  
    19941994                return UInt32Result::UInt32;
    19951995            if (node->isNumber() && static_cast<NumberNode*>(node)->isIntegerNode()) {
    1996                 int32_t value = static_cast<int32_t>(static_cast<IntegerNode*>(node)->value());
    1997                 if (value >= 0)
     1996                auto value = jsNumber(static_cast<NumberNode*>(node)->value());
     1997                if (value.isInt32() && value.asInt32() >= 0)
    19981998                    return UInt32Result::Constant;
    19991999            }
Note: See TracChangeset for help on using the changeset viewer.