Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: src/compiler/js-builtin-reducer.cc

Issue 1982223002: Version 5.1.281.38 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-version.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index b5caf9f1fe6ecc3824a487de3359f76bc038d6a4..41f9c30707b2c3d1de29420b57f25053a1127809 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/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();
« no previous file with comments | « include/v8-version.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698