aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-15 11:26:49 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 11:26:49 -0700
commit8c5d311915d8da91151fda74b06a40fabafdf37a (patch)
tree7152aa3da99ac2226cdd896f9327c052cfa5afad /src
parentb20529efadbb7357c8e69de12d41bc118d772690 (diff)
asmify strcasecmp
Diffstat (limited to 'src')
-rw-r--r--src/library.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index c8e264ca..ab5efaff 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4423,9 +4423,12 @@ LibraryManager.library = {
// We always assume ASCII locale.
strcoll: 'strcmp',
+ strcasecmp__asm: true,
+ strcasecmp__sig: 'iii',
strcasecmp__deps: ['strncasecmp'],
strcasecmp: function(px, py) {
- return _strncasecmp(px, py, TOTAL_MEMORY);
+ px = px|0; py = py|0;
+ return _strncasecmp(px, py, -1)|0;
},
strncmp: function(px, py, n) {
@@ -4452,7 +4455,7 @@ LibraryManager.library = {
strncasecmp: function(px, py, n) {
px = px|0; py = py|0; n = n|0;
var i = 0, x = 0, y = 0;
- while ((i|0) < (n|0)) {
+ while ((i>>>0) < (n>>>0)) {
x = _tolower({{{ makeGetValueAsm('px', 'i', 'i8', 0, 1) }}});
y = _tolower({{{ makeGetValueAsm('py', 'i', 'i8', 0, 1) }}});
if (((x|0) == (y|0)) & ((x|0) == 0)) return 0;