Revision: 8394
Author: [email protected]
Date: Thu Jun 23 03:27:56 2011
Log: Merge r8390 from bleeding edge (fix missing write barrier in
arguments IC).
Review URL: http://codereview.chromium.org/7247001
http://code.google.com/p/v8/source/detail?r=8394
Added:
/trunk/test/mjsunit/regress/regress-arguments-gc.js
Modified:
/trunk/src/arm/ic-arm.cc
/trunk/src/ia32/ic-ia32.cc
/trunk/src/version.cc
/trunk/src/x64/ic-x64.cc
/trunk/test/mjsunit/arguments-escape.js
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-arguments-gc.js Thu Jun 23 03:27:56
2011
@@ -0,0 +1,37 @@
+// Copyright 2011 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-gc --nocleanup_code_caches_at_gc
+
+function f(x) {
+ gc();
+ arguments[0] = {};
+}
+
+f(1);
+f(1);
+f(1);
=======================================
--- /trunk/src/arm/ic-arm.cc Mon Jun 20 08:33:18 2011
+++ /trunk/src/arm/ic-arm.cc Thu Jun 23 03:27:56 2011
@@ -996,12 +996,16 @@
MemOperand mapped_location =
GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, ¬in,
&slow);
__ str(r0, mapped_location);
+ __ add(r6, r3, r5);
+ __ RecordWrite(r3, r6, r9);
__ Ret();
__ bind(¬in);
// The unmapped lookup expects that the parameter map is in r3.
MemOperand unmapped_location =
GenerateUnmappedArgumentsLookup(masm, r1, r3, r4, &slow);
__ str(r0, unmapped_location);
+ __ add(r6, r3, r4);
+ __ RecordWrite(r3, r6, r9);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, false);
=======================================
--- /trunk/src/ia32/ic-ia32.cc Mon Jun 20 08:33:18 2011
+++ /trunk/src/ia32/ic-ia32.cc Thu Jun 23 03:27:56 2011
@@ -801,12 +801,18 @@
Operand mapped_location =
GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, edi, ¬in,
&slow);
__ mov(mapped_location, eax);
+ __ lea(ecx, mapped_location);
+ __ mov(edx, eax);
+ __ RecordWrite(ebx, ecx, edx);
__ Ret();
__ bind(¬in);
// The unmapped lookup expects that the parameter map is in ebx.
Operand unmapped_location =
GenerateUnmappedArgumentsLookup(masm, ecx, ebx, edi, &slow);
__ mov(unmapped_location, eax);
+ __ lea(edi, unmapped_location);
+ __ mov(edx, eax);
+ __ RecordWrite(ebx, edi, edx);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, false);
=======================================
--- /trunk/src/version.cc Thu Jun 23 03:18:16 2011
+++ /trunk/src/version.cc Thu Jun 23 03:27:56 2011
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 4
#define BUILD_NUMBER 6
-#define PATCH_LEVEL 1
+#define PATCH_LEVEL 2
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
=======================================
--- /trunk/src/x64/ic-x64.cc Mon Jun 20 08:33:18 2011
+++ /trunk/src/x64/ic-x64.cc Thu Jun 23 03:27:56 2011
@@ -1308,12 +1308,18 @@
Operand mapped_location = GenerateMappedArgumentsLookup(
masm, rdx, rcx, rbx, rdi, r8, ¬in, &slow);
__ movq(mapped_location, rax);
+ __ lea(r9, mapped_location);
+ __ movq(r8, rax);
+ __ RecordWrite(rbx, r9, r8);
__ Ret();
__ bind(¬in);
// The unmapped lookup expects that the parameter map is in rbx.
Operand unmapped_location =
GenerateUnmappedArgumentsLookup(masm, rcx, rbx, rdi, &slow);
__ movq(unmapped_location, rax);
+ __ lea(r9, unmapped_location);
+ __ movq(r8, rax);
+ __ RecordWrite(rbx, r9, r8);
__ Ret();
__ bind(&slow);
GenerateMiss(masm, false);
=======================================
--- /trunk/test/mjsunit/arguments-escape.js Mon Jun 20 08:33:18 2011
+++ /trunk/test/mjsunit/arguments-escape.js Thu Jun 23 03:27:56 2011
@@ -40,3 +40,20 @@
baz(4);
baz(5);
baz(6);
+
+// Test writing a non-smi.
+function foo2(x) {
+ var a = arguments;
+ function bar2(i) {
+ assertEquals(i, ++a[0]);
+ assertEquals(i, x);
+ };
+ bar2(1.5);
+ bar2(2.5);
+ bar2(3.5);
+ return bar2;
+}
+var baz2 = foo2(0.5);
+baz2(4.5);
+baz2(5.5);
+baz2(6.5);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev