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

Unified Diff: src/x64/codegen-x64.cc

Issue 2223003: Fix: make string indexing work with Infinity. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/string-charat.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
index 1f3a5597ea82cde7a1f2c7353afb237e5353383d..d34543fcb362926aa4c1916fdae80080c8cfe255 100644
--- a/src/x64/codegen-x64.cc
+++ b/src/x64/codegen-x64.cc
@@ -10935,11 +10935,7 @@ void StringCharCodeAtGenerator::GenerateSlow(
__ push(result_);
__ push(index_); // Consumed by runtime conversion function.
if (index_flags_ == STRING_INDEX_IS_NUMBER) {
- // Strictly speaking, NumberToInteger should be called here, but
- // our string lengths don't exceed 32 bits and using ToUint32 maps
- // -0 to 0, which is what is required by the spec when accessing
- // strings.
- __ CallRuntime(Runtime::kNumberToJSUint32, 1);
+ __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1);
} else {
ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX);
// NumberToSmi discards numbers that are not exact integers.
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/string-charat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698