Changeset 223745 in webkit


Ignore:
Timestamp:
Oct 20, 2017 12:35:16 AM (7 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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r223744 r223745  
     12017-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [ARM64] static_cast<int32_t>() in BinaryOpNode::emitBytecode() prevents op_unsigned emission
     4        https://bugs.webkit.org/show_bug.cgi?id=178379
     5
     6        Reviewed by Saam Barati.
     7
     8        We reuse jsNumber's checking mechanism here to precisely check the generated number is within uint32_t
     9        in bytecode compiler. This is reasonable since the NumberNode will generate the exact this JSValue.
     10
     11        * bytecompiler/NodesCodegen.cpp:
     12        (JSC::BinaryOpNode::emitBytecode):
     13
    1142017-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
    215
  • 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.