File tree 3 files changed +17
-5
lines changed
3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 11
11
#define V8_MAJOR_VERSION 6
12
12
#define V8_MINOR_VERSION 2
13
13
#define V8_BUILD_NUMBER 414
14
- #define V8_PATCH_LEVEL 77
14
+ #define V8_PATCH_LEVEL 78
15
15
16
16
// Use 1 for candidates and 0 otherwise.
17
17
// (Boolean macro values are not supported by all preprocessors.)
Original file line number Diff line number Diff line change @@ -244,12 +244,13 @@ Reduction TypedOptimization::ReduceNumberFloor(Node* node) {
244
244
//
245
245
// NumberToUint32(NumberDivide(lhs, rhs))
246
246
//
247
- // and just smash the type of the { lhs} on the {node},
248
- // as the truncated result must be in the same range as
249
- // {lhs} since {rhs} cannot be less than 1 ( due to the
247
+ // and just smash the type [0... lhs.Max] on the {node},
248
+ // as the truncated result must be loewr than {lhs}'s maximum
249
+ // value (note that {rhs} cannot be less than 1 due to the
250
250
// plain-number type constraint on the {node}).
251
251
NodeProperties::ChangeOp (node, simplified ()->NumberToUint32 ());
252
- NodeProperties::SetType (node, lhs_type);
252
+ NodeProperties::SetType (node,
253
+ Type::Range (0 , lhs_type->Max (), graph ()->zone ()));
253
254
return Changed (node);
254
255
}
255
256
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2018 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ // Flags: --allow-natives-syntax
6
+
7
+ var v = 1e9 ;
8
+ function f ( ) { return Math . floor ( v / 10 ) ; }
9
+ assertEquals ( 1e8 , f ( ) ) ;
10
+ % OptimizeFunctionOnNextCall ( f ) ;
11
+ assertEquals ( 1e8 , f ( ) ) ;
You can’t perform that action at this time.
0 commit comments