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

Side by Side Diff: src/string.js

Issue 5977006: Introduce NUMBER_IS_FINITE macro to avoid ToNumber() conversion. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // ECMA-262 section 15.5.4.8 121 // ECMA-262 section 15.5.4.8
122 function StringLastIndexOf(pat /* position */) { // length == 1 122 function StringLastIndexOf(pat /* position */) { // length == 1
123 var sub = TO_STRING_INLINE(this); 123 var sub = TO_STRING_INLINE(this);
124 var subLength = sub.length; 124 var subLength = sub.length;
125 var pat = TO_STRING_INLINE(pat); 125 var pat = TO_STRING_INLINE(pat);
126 var patLength = pat.length; 126 var patLength = pat.length;
127 var index = subLength - patLength; 127 var index = subLength - patLength;
128 if (%_ArgumentsLength() > 1) { 128 if (%_ArgumentsLength() > 1) {
129 var position = ToNumber(%_Arguments(1)); 129 var position = ToNumber(%_Arguments(1));
130 if (!$isNaN(position)) { 130 if (!NUMBER_IS_NAN(position)) {
131 position = TO_INTEGER(position); 131 position = TO_INTEGER(position);
132 if (position < 0) { 132 if (position < 0) {
133 position = 0; 133 position = 0;
134 } 134 }
135 if (position + patLength < subLength) { 135 if (position + patLength < subLength) {
136 index = position 136 index = position
137 } 137 }
138 } 138 }
139 } 139 }
140 if (index < 0) { 140 if (index < 0) {
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 "italics", StringItalics, 911 "italics", StringItalics,
912 "small", StringSmall, 912 "small", StringSmall,
913 "strike", StringStrike, 913 "strike", StringStrike,
914 "sub", StringSub, 914 "sub", StringSub,
915 "sup", StringSup 915 "sup", StringSup
916 )); 916 ));
917 } 917 }
918 918
919 919
920 SetupString(); 920 SetupString();
OLDNEW
« no previous file with comments | « src/mirror-debugger.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698