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

Unified Diff: src/runtime.js

Issue 1137703002: Add a MathFloor stub generated with TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Latest Created 5 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
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 9d9fe273359e347dd7edc561a87d253b53d69876..247b71ae2744da85f4f37cb4c58231225d1100e1 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -896,7 +896,20 @@ function ToPositiveInteger(x, rangeErrorName) {
-----------------------------------------------
*/
-function STRING_LENGTH_STUB(name) {
- var receiver = this; // implicit first parameter
+function StringLengthTF_STUB(receiver, name) {
return %_StringGetLength(%_JSValueGetValue(receiver));
}
+
+function MathFloor_STUB(f, i, v) {
+ var r = %_MathFloor(+v);
+ if (%_IsMinusZero(r)) {
+ %_FixedArraySet(%_GetTypeFeedbackVector(f), ((i|0)+1)|0, 1);
Benedikt Meurer 2015/05/11 04:40:12 Please add a comment explaining what this line doe
danno 2015/05/11 06:14:19 Done.
+ return -0;
+ }
+ // Return integers in smi range as smis.
+ var trunc = r|0;
+ if (trunc === r) {
+ return trunc;
+ }
+ return r;
+}

Powered by Google App Engine
This is Rietveld 408576698