diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-02 10:43:26 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-02 10:44:03 +0200 |
commit | bb91a70e24ac49fd21c1d7c8c91a216961da1e2d (patch) | |
tree | 4c2497e0b093c7b0a25d48e72659dca21a50569a /chromium/v8/src/compiler/js-builtin-reducer.cc | |
parent | 1ec92e71bb67445775ce64cb081ed25c3d7481f1 (diff) | |
parent | b92421879c003a0857b2074f7e05b3bbbb326569 (diff) | |
download | qtwebengine-chromium-bb91a70e24ac49fd21c1d7c8c91a216961da1e2d.tar.gz |
Merge branch 'upstream-master' into 51-based
Change-Id: I08d36e04494c3bb0c04641ad7c8e53bf418975db
Diffstat (limited to 'chromium/v8/src/compiler/js-builtin-reducer.cc')
-rw-r--r-- | chromium/v8/src/compiler/js-builtin-reducer.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chromium/v8/src/compiler/js-builtin-reducer.cc b/chromium/v8/src/compiler/js-builtin-reducer.cc index b5caf9f1fe6..41f9c30707b 100644 --- a/chromium/v8/src/compiler/js-builtin-reducer.cc +++ b/chromium/v8/src/compiler/js-builtin-reducer.cc @@ -117,13 +117,15 @@ Reduction JSBuiltinReducer::ReduceMathMax(Node* node) { return NoChange(); } - -// ES6 draft 08-24-14, section 20.2.2.19. +// ES6 section 20.2.2.19 Math.imul ( x, y ) Reduction JSBuiltinReducer::ReduceMathImul(Node* node) { JSCallReduction r(node); - if (r.InputsMatchTwo(Type::Integral32(), Type::Integral32())) { - // Math.imul(a:int32, b:int32) -> Int32Mul(a, b) - Node* value = graph()->NewNode(machine()->Int32Mul(), r.left(), r.right()); + if (r.InputsMatchTwo(Type::Number(), Type::Number())) { + // Math.imul(a:number, b:number) -> NumberImul(NumberToUint32(a), + // NumberToUint32(b)) + Node* a = graph()->NewNode(simplified()->NumberToUint32(), r.left()); + Node* b = graph()->NewNode(simplified()->NumberToUint32(), r.right()); + Node* value = graph()->NewNode(simplified()->NumberImul(), a, b); return Replace(value); } return NoChange(); |