Revision: 5473
Author: [email protected]
Date: Thu Sep 16 03:36:32 2010
Log: Merge r5471 into 2.2 branch.
Fix a regression in character-at stub when doing a keyed load on a string.
Review URL: http://codereview.chromium.org/3441007
http://code.google.com/p/v8/source/detail?r=5473
Modified:
/branches/2.2/src/arm/ic-arm.cc
/branches/2.2/src/ia32/ic-ia32.cc
/branches/2.2/src/version.cc
/branches/2.2/src/x64/ic-x64.cc
/branches/2.2/test/mjsunit/regress/regress-900966.js
=======================================
--- /branches/2.2/src/arm/ic-arm.cc Mon Jul 5 04:01:40 2010
+++ /branches/2.2/src/arm/ic-arm.cc Thu Sep 16 03:36:32 2010
@@ -1226,7 +1226,6 @@
// -- r1 : receiver
// -----------------------------------
Label miss;
- Label index_out_of_range;
Register receiver = r1;
Register index = r0;
@@ -1241,7 +1240,7 @@
result,
&miss, // When not a string.
&miss, // When not a number.
- &index_out_of_range,
+ &miss, // When index out of
range.
STRING_INDEX_IS_ARRAY_INDEX);
char_at_generator.GenerateFast(masm);
__ Ret();
@@ -1249,10 +1248,6 @@
ICRuntimeCallHelper call_helper;
char_at_generator.GenerateSlow(masm, call_helper);
- __ bind(&index_out_of_range);
- __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
- __ Ret();
-
__ bind(&miss);
GenerateMiss(masm);
}
=======================================
--- /branches/2.2/src/ia32/ic-ia32.cc Mon Jul 5 04:01:40 2010
+++ /branches/2.2/src/ia32/ic-ia32.cc Thu Sep 16 03:36:32 2010
@@ -698,7 +698,6 @@
// -- esp[0] : return address
// -----------------------------------
Label miss;
- Label index_out_of_range;
Register receiver = edx;
Register index = eax;
@@ -713,7 +712,7 @@
result,
&miss, // When not a string.
&miss, // When not a number.
- &index_out_of_range,
+ &miss, // When index out of
range.
STRING_INDEX_IS_ARRAY_INDEX);
char_at_generator.GenerateFast(masm);
__ ret(0);
@@ -721,10 +720,6 @@
ICRuntimeCallHelper call_helper;
char_at_generator.GenerateSlow(masm, call_helper);
- __ bind(&index_out_of_range);
- __ Set(eax, Immediate(Factory::undefined_value()));
- __ ret(0);
-
__ bind(&miss);
GenerateMiss(masm);
}
=======================================
--- /branches/2.2/src/version.cc Wed Sep 1 06:28:50 2010
+++ /branches/2.2/src/version.cc Thu Sep 16 03:36:32 2010
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 2
#define MINOR_VERSION 2
#define BUILD_NUMBER 24
-#define PATCH_LEVEL 21
+#define PATCH_LEVEL 22
#define CANDIDATE_VERSION false
// Define SONAME to have the SCons build the put a specific SONAME into the
=======================================
--- /branches/2.2/src/x64/ic-x64.cc Mon Jul 5 04:01:40 2010
+++ /branches/2.2/src/x64/ic-x64.cc Thu Sep 16 03:36:32 2010
@@ -759,7 +759,6 @@
// -- rsp[0] : return address
// -----------------------------------
Label miss;
- Label index_out_of_range;
Register receiver = rdx;
Register index = rax;
@@ -774,7 +773,7 @@
result,
&miss, // When not a string.
&miss, // When not a number.
- &index_out_of_range,
+ &miss, // When index out of
range.
STRING_INDEX_IS_ARRAY_INDEX);
char_at_generator.GenerateFast(masm);
__ ret(0);
@@ -782,10 +781,6 @@
ICRuntimeCallHelper call_helper;
char_at_generator.GenerateSlow(masm, call_helper);
- __ bind(&index_out_of_range);
- __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
- __ ret(0);
-
__ bind(&miss);
GenerateMiss(masm);
}
=======================================
--- /branches/2.2/test/mjsunit/regress/regress-900966.js Thu Sep 11
02:11:10 2008
+++ /branches/2.2/test/mjsunit/regress/regress-900966.js Thu Sep 16
03:36:32 2010
@@ -29,6 +29,15 @@
String.prototype[10] = 'x';
assertEquals('abc'[10], 'x');
+// Test that the fast case character-at stub handles an out-of-bound
+// index correctly. We need to call the function twice to initialize
+// the character-at stub.
+function f() {
+ assertEquals('abc'[10], 'x');
+}
+f();
+f();
+
assertTrue(2[11] === undefined);
Number.prototype[11] = 'y';
assertEquals(2[11], 'y');
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev