Revision: 15215
Author: [email protected]
Date: Wed Jun 19 11:17:45 2013
Log: Merged r15196, r15203, r15204, r15207, r15214 into trunk branch.
Tweak type info threshold.
x64: LAddI must use LEAL, not LEAQ
Always reset allowed OSR nesting level when reverting interrupt code
patches.
Bugfix in hydrogen array literal code generation.
Fix using monomorphic store instruction for polymorphic stores.
[email protected]
BUG=
Review URL: https://codereview.chromium.org/17463005
http://code.google.com/p/v8/source/detail?r=15215
Added:
/trunk/test/mjsunit/array-literal-feedback.js
/trunk/test/mjsunit/regress/regress-polymorphic-store.js
Modified:
/trunk/src/arm/lithium-codegen-arm.cc
/trunk/src/deoptimizer.cc
/trunk/src/flag-definitions.h
/trunk/src/hydrogen.cc
/trunk/src/ia32/lithium-codegen-ia32.cc
/trunk/src/mips/lithium-codegen-mips.cc
/trunk/src/runtime.cc
/trunk/src/version.cc
/trunk/src/x64/lithium-codegen-x64.cc
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/array-literal-feedback.js Wed Jun 19 11:17:45 2013
@@ -0,0 +1,75 @@
+// Copyright 2013 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: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --track-allocation-sites --noalways-opt
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays
enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only
arrays.
+
+// support_smi_only_arrays = %HasFastSmiElements(new
Array(1,2,3,4,5,6,7,8));
+support_smi_only_arrays = true;
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+if (support_smi_only_arrays) {
+
+ function get_literal(x) {
+ var literal = [1, 2, x];
+ return literal;
+ }
+
+ get_literal(3);
+ get_literal(3);
+ %OptimizeFunctionOnNextCall(get_literal);
+ a = get_literal(3);
+ assertTrue(2 != %GetOptimizationStatus(get_literal));
+ assertTrue(%HasFastSmiElements(a));
+ a[0] = 3.5;
+
+ // We should have transitioned the boilerplate array to double, and
+ // crankshafted code should de-opt on the unexpected elements kind
+ b = get_literal(3);
+ assertTrue(%HasFastDoubleElements(b));
+ assertEquals([1, 2, 3], b);
+ assertTrue(1 != %GetOptimizationStatus(get_literal));
+
+ // Optimize again
+ get_literal(3);
+ %OptimizeFunctionOnNextCall(get_literal);
+ b = get_literal(3);
+ assertTrue(%HasFastDoubleElements(b));
+ assertTrue(2 != %GetOptimizationStatus(get_literal));
+}
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-polymorphic-store.js Wed Jun 19
11:17:45 2013
@@ -0,0 +1,48 @@
+// Copyright 2013 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: --allow-natives-syntax
+
+var o1 = {};
+o1.f1 = function() { return 10; };
+o1.x = 5;
+o1.y = 2;
+var o2 = {};
+o2.x = 5;
+o2.y = 5;
+
+function store(o, v) {
+ o.y = v;
+}
+
+store(o2, 0);
+store(o1, 0);
+store(o2, 0);
+%OptimizeFunctionOnNextCall(store);
+store(o1, 10);
+assertEquals(5, o1.x);
+assertEquals(10, o1.y);
=======================================
--- /trunk/src/arm/lithium-codegen-arm.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/arm/lithium-codegen-arm.cc Wed Jun 19 11:17:45 2013
@@ -825,7 +825,7 @@
return;
}
- if (FLAG_trap_on_deopt) {
+ if (FLAG_trap_on_deopt && info()->IsOptimizing()) {
__ stop("trap_on_deopt", cc);
}
=======================================
--- /trunk/src/deoptimizer.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/deoptimizer.cc Wed Jun 19 11:17:45 2013
@@ -2429,6 +2429,7 @@
back_edge_cursor += FullCodeGenerator::kBackEdgeEntrySize;
}
unoptimized_code->set_back_edges_patched_for_osr(false);
+ unoptimized_code->set_allow_osr_at_loop_nesting_level(0);
#ifdef DEBUG
// Assert that none of the back edges are patched anymore.
Deoptimizer::VerifyInterruptCode(
=======================================
--- /trunk/src/flag-definitions.h Tue Jun 18 04:54:54 2013
+++ /trunk/src/flag-definitions.h Wed Jun 19 11:17:45 2013
@@ -317,7 +317,7 @@
// 0x1700 fits in the immediate field of an ARM instruction.
DEFINE_int(interrupt_budget, 0x1700,
"execution budget before interrupt is triggered")
-DEFINE_int(type_info_threshold, 30,
+DEFINE_int(type_info_threshold, 25,
"percentage of ICs that must have type info to allow
optimization")
DEFINE_int(self_opt_count, 130, "call count before self-optimization")
=======================================
--- /trunk/src/hydrogen.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/hydrogen.cc Wed Jun 19 11:17:45 2013
@@ -6084,6 +6084,11 @@
isolate()->factory()->empty_string(),
Runtime::FunctionForId(function_id),
3));
+
+ // De-opt if elements kind changed from boilerplate_elements_kind.
+ Handle<Map> map = Handle<Map>(original_boilerplate_object->map(),
+ isolate());
+ AddInstruction(HCheckMaps::New(literal, map, zone()));
}
// The array is expected in the bailout environment during computation
@@ -6423,7 +6428,8 @@
AddInstruction(HCheckMaps::New(object, types, zone()));
HInstruction* store;
CHECK_ALIVE_OR_RETURN(
- store = BuildStoreNamedField(object, name, value, types->at(0),
&lookup),
+ store = BuildStoreNamedField(
+ object, name, value, types->at(count - 1), &lookup),
true);
Push(value);
store->set_position(expr->position());
=======================================
--- /trunk/src/ia32/lithium-codegen-ia32.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/ia32/lithium-codegen-ia32.cc Wed Jun 19 11:17:45 2013
@@ -901,7 +901,7 @@
__ popfd();
}
- if (FLAG_trap_on_deopt) {
+ if (FLAG_trap_on_deopt && info()->IsOptimizing()) {
Label done;
if (cc != no_condition) {
__ j(NegateCondition(cc), &done, Label::kNear);
=======================================
--- /trunk/src/mips/lithium-codegen-mips.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/mips/lithium-codegen-mips.cc Wed Jun 19 11:17:45 2013
@@ -796,7 +796,7 @@
return;
}
- if (FLAG_trap_on_deopt) {
+ if (FLAG_trap_on_deopt && info()->IsOptimizing()) {
Label skip;
if (cc != al) {
__ Branch(&skip, NegateCondition(cc), src1, src2);
=======================================
--- /trunk/src/runtime.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/runtime.cc Wed Jun 19 11:17:45 2013
@@ -8265,9 +8265,6 @@
*interrupt_code,
*replacement_code);
- // Allow OSR only at nesting level zero again.
- unoptimized->set_allow_osr_at_loop_nesting_level(0);
-
// If the optimization attempt succeeded, return the AST id tagged as a
// smi. This tells the builtin that we need to translate the unoptimized
// frame to an optimized one.
=======================================
--- /trunk/src/version.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/version.cc Wed Jun 19 11:17:45 2013
@@ -35,10 +35,10 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 19
#define BUILD_NUMBER 18
-#define PATCH_LEVEL 0
+#define PATCH_LEVEL 1
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
-#define IS_CANDIDATE_VERSION 1
+#define IS_CANDIDATE_VERSION 0
// Define SONAME to have the build system put a specific SONAME into the
// shared library instead the generic SONAME generated from the V8 version
=======================================
--- /trunk/src/x64/lithium-codegen-x64.cc Tue Jun 18 04:54:54 2013
+++ /trunk/src/x64/lithium-codegen-x64.cc Wed Jun 19 11:17:45 2013
@@ -706,7 +706,7 @@
ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64.
- if (FLAG_trap_on_deopt) {
+ if (FLAG_trap_on_deopt && info()->IsOptimizing()) {
Label done;
if (cc != no_condition) {
__ j(NegateCondition(cc), &done, Label::kNear);
@@ -1717,10 +1717,11 @@
if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) {
if (right->IsConstantOperand()) {
int32_t offset = ToInteger32(LConstantOperand::cast(right));
- __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left),
offset));
+ __ leal(ToRegister(instr->result()),
+ MemOperand(ToRegister(left), offset));
} else {
Operand address(ToRegister(left), ToRegister(right), times_1, 0);
- __ lea(ToRegister(instr->result()), address);
+ __ leal(ToRegister(instr->result()), address);
}
} else {
if (right->IsConstantOperand()) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.