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

Unified Diff: src/math.js

Issue 14471041: Implement support for Math.imul in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/math.js
diff --git a/src/math.js b/src/math.js
index e5ab70cc1eb6ee236c79e21db7d73d633533a6b0..9ba1934b851a7224c1ea310fd03597e5ec185707 100644
--- a/src/math.js
+++ b/src/math.js
@@ -213,6 +213,13 @@ function MathTan(x) {
return %_MathTan(x);
}
+// Non-standard extension.
+function MathImul(x, y) {
+ if (!IS_NUMBER(x)) x = NonNumberToNumber(x);
+ if (!IS_NUMBER(y)) y = NonNumberToNumber(y);
+ return %NumberImul(x, y);
Sven Panne 2013/04/29 06:36:00 I think the right way to implement this would be r
+}
+
// -------------------------------------------------------------------
@@ -283,7 +290,8 @@ function SetUpMath() {
"atan2", MathAtan2,
"pow", MathPow,
"max", MathMax,
- "min", MathMin
+ "min", MathMin,
+ "imul", MathImul
));
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698