Do not use ranges after range analysis.
Due to the SSA vs. SSI difference, we are only allowed to use the flags computed during range analysis, not the ranges themselves. For the case at hand, there is no such flag, so the condition is simply remvoed. BUG=361608 LOG=y R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/232553004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
32735ae3a9
commit
5bddec047d
@ -179,12 +179,9 @@ template<int R>
|
||||
bool LTemplateResultInstruction<R>::MustSignExtendResult(
|
||||
LPlatformChunk* chunk) const {
|
||||
HValue* hvalue = this->hydrogen_value();
|
||||
|
||||
if (hvalue == NULL) return false;
|
||||
if (!hvalue->representation().IsInteger32()) return false;
|
||||
if (hvalue->HasRange() && !hvalue->range()->CanBeNegative()) return false;
|
||||
|
||||
return chunk->GetDehoistedKeyIds()->Contains(hvalue->id());
|
||||
return hvalue != NULL &&
|
||||
hvalue->representation().IsInteger32() &&
|
||||
chunk->GetDehoistedKeyIds()->Contains(hvalue->id());
|
||||
}
|
||||
|
||||
|
||||
|
20
test/mjsunit/regress/regress-361608.js
Normal file
20
test/mjsunit/regress/regress-361608.js
Normal file
@ -0,0 +1,20 @@
|
||||
// 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
|
||||
|
||||
function f() {};
|
||||
int_array = [1];
|
||||
|
||||
function foo() {
|
||||
var x;
|
||||
for (var i = -1; i < 0; i++) {
|
||||
x = int_array[i + 1];
|
||||
f(function() { x = i; });
|
||||
}
|
||||
}
|
||||
|
||||
foo();
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
foo();
|
Loading…
Reference in New Issue
Block a user