Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8.x] deps: V8: backport d520ebb #27358

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 77
#define V8_PATCH_LEVEL 78

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
9 changes: 5 additions & 4 deletions deps/v8/src/compiler/typed-optimization.cc
Expand Up @@ -244,12 +244,13 @@ Reduction TypedOptimization::ReduceNumberFloor(Node* node) {
//
// NumberToUint32(NumberDivide(lhs, rhs))
//
// and just smash the type of the {lhs} on the {node},
// as the truncated result must be in the same range as
// {lhs} since {rhs} cannot be less than 1 (due to the
// and just smash the type [0...lhs.Max] on the {node},
// as the truncated result must be loewr than {lhs}'s maximum
// value (note that {rhs} cannot be less than 1 due to the
// plain-number type constraint on the {node}).
NodeProperties::ChangeOp(node, simplified()->NumberToUint32());
NodeProperties::SetType(node, lhs_type);
NodeProperties::SetType(node,
Type::Range(0, lhs_type->Max(), graph()->zone()));
return Changed(node);
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/v8/test/mjsunit/compiler/regress-841117.js
@@ -0,0 +1,11 @@
// Copyright 2018 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

var v = 1e9;
function f() { return Math.floor(v / 10); }
assertEquals(1e8, f());
%OptimizeFunctionOnNextCall(f);
assertEquals(1e8, f());