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

Unified Diff: src/js/string.js

Issue 1427743008: Do not switch to two-byte string in String.fromCharCode if avoidable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index 5725b3758a4d3b862446d4499a2781e9c2d0f933..41b16cc37b37482130c4dccd65a4a292407093d5 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -782,8 +782,8 @@ function StringFromCharCode(code) {
var i;
for (i = 0; i < n; i++) {
var code = %_Arguments(i);
- if (!%_IsSmi(code)) code = TO_NUMBER(code) & 0xffff;
- if (code < 0) code = code & 0xffff;
+ if (!%_IsSmi(code)) code = TO_NUMBER(code);
Benedikt Meurer 2015/11/09 07:50:12 As discussed offline: Please do not do this %_IsSm
+ code = code & 0xffff;
if (code > 0xff) break;
%_OneByteSeqStringSetChar(i, code, one_byte);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698