Commit 6c1659be authored by ishell@chromium.org's avatar ishell@chromium.org

Fix for a smi stores optimization on x64 with a regression test.

BUG=345715
LOG=N
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/178833002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6eb2d358
......@@ -9924,9 +9924,11 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties(
Add<HStoreNamedField>(double_box, HObjectAccess::ForHeapNumberValue(),
Add<HConstant>(value));
value_instruction = double_box;
} else if (representation.IsSmi() && value->IsUninitialized()) {
value_instruction = graph()->GetConstant0();
// Ensure that Constant0 is stored as smi.
} else if (representation.IsSmi()) {
value_instruction = value->IsUninitialized()
? graph()->GetConstant0()
: Add<HConstant>(value);
// Ensure that value is stored as smi.
access = access.WithRepresentation(representation);
} else {
value_instruction = Add<HConstant>(value);
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
a = {y:1.5};
a.y = 0;
b = a.y;
c = {y:{}};
function f() {
return 1;
}
function g() {
var e = {y: b};
var d = {x:f()};
var d = {x:f()};
return [e, d];
}
g();
g();
%OptimizeFunctionOnNextCall(g);
assertEquals(1, g()[1].x);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment