Skip to content

Commit fe4434b

Browse files
committed
deps: upgrade v8 to 4.1.0.25
PR-URL: #1224 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 9705a34 commit fe4434b

10 files changed

+126
-66
lines changed

deps/v8/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Jan de Mooij <[email protected]>
4545
Jay Freeman <[email protected]>
4646
James Pike <[email protected]>
4747
Joel Stanley <[email protected]>
48+
Johan Bergström <[email protected]>
4849
John Jozwiak <[email protected]>
4950
Jonathan Liu <[email protected]>
5051
Kun Zhang <[email protected]>

deps/v8/PRESUBMIT.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def _CommonChecks(input_api, output_api):
198198

199199
def _SkipTreeCheck(input_api, output_api):
200200
"""Check the env var whether we want to skip tree check.
201-
Only skip if src/version.cc has been updated."""
202-
src_version = 'src/version.cc'
201+
Only skip if include/v8-version.h has been updated."""
202+
src_version = 'include/v8-version.h'
203203
FilterFile = lambda file: file.LocalPath() == src_version
204204
if not input_api.AffectedSourceFiles(
205205
lambda file: file.LocalPath() == src_version):

deps/v8/include/v8-version.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2015 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+
#ifndef V8_INCLUDE_VERSION_H_ // V8_VERSION_H_ conflicts with src/version.h
6+
#define V8_INCLUDE_VERSION_H_
7+
8+
// These macros define the version number for the current version.
9+
// NOTE these macros are used by some of the tool scripts and the build
10+
// system so their names cannot be changed without changing the scripts.
11+
#define V8_MAJOR_VERSION 4
12+
#define V8_MINOR_VERSION 1
13+
#define V8_BUILD_NUMBER 0
14+
#define V8_PATCH_LEVEL 25
15+
16+
// Use 1 for candidates and 0 otherwise.
17+
// (Boolean macro values are not supported by all preprocessors.)
18+
#define V8_IS_CANDIDATE_VERSION 0
19+
20+
#endif // V8_INCLUDE_VERSION_H_

deps/v8/include/v8.h

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdint.h>
2020
#include <stdio.h>
2121

22+
#include "v8-version.h"
2223
#include "v8config.h"
2324

2425
// We reserve the V8_* prefix for macros defined in V8 public API and

deps/v8/src/hydrogen-check-elimination.cc

+11-2
Original file line numberDiff line numberDiff line change
@@ -628,14 +628,23 @@ class HCheckTable : public ZoneObject {
628628
HValue* object = instr->object()->ActualValue();
629629
HCheckTableEntry* entry = Find(object);
630630
// Can only learn more about an object that already has a known set of maps.
631-
if (entry == NULL) return;
631+
if (entry == NULL) {
632+
Kill(object);
633+
return;
634+
}
632635
EnsureChecked(entry, object, instr);
633636
if (entry->maps_->Contains(instr->original_map())) {
634637
// If the object has the original map, it will be transitioned.
635638
UniqueSet<Map>* maps = entry->maps_->Copy(zone());
636639
maps->Remove(instr->original_map());
637640
maps->Add(instr->transitioned_map(), zone());
638-
entry->maps_ = maps;
641+
HCheckTableEntry::State state =
642+
(entry->state_ == HCheckTableEntry::CHECKED_STABLE &&
643+
instr->map_is_stable())
644+
? HCheckTableEntry::CHECKED_STABLE
645+
: HCheckTableEntry::CHECKED;
646+
Kill(object);
647+
Insert(object, NULL, maps, state);
639648
} else {
640649
// Object does not have the given map, thus the transition is redundant.
641650
instr->DeleteAndReplaceWith(object);

deps/v8/src/hydrogen-instructions.h

+18-9
Original file line numberDiff line numberDiff line change
@@ -7355,8 +7355,13 @@ class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
73557355
HValue* context() const { return OperandAt(1); }
73567356
Unique<Map> original_map() const { return original_map_; }
73577357
Unique<Map> transitioned_map() const { return transitioned_map_; }
7358-
ElementsKind from_kind() const { return from_kind_; }
7359-
ElementsKind to_kind() const { return to_kind_; }
7358+
ElementsKind from_kind() const {
7359+
return FromElementsKindField::decode(bit_field_);
7360+
}
7361+
ElementsKind to_kind() const {
7362+
return ToElementsKindField::decode(bit_field_);
7363+
}
7364+
bool map_is_stable() const { return MapIsStableField::decode(bit_field_); }
73607365

73617366
std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
73627367

@@ -7372,29 +7377,33 @@ class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
73727377
int RedefinedOperandIndex() OVERRIDE { return 0; }
73737378

73747379
private:
7375-
HTransitionElementsKind(HValue* context,
7376-
HValue* object,
7380+
HTransitionElementsKind(HValue* context, HValue* object,
73777381
Handle<Map> original_map,
73787382
Handle<Map> transitioned_map)
73797383
: original_map_(Unique<Map>(original_map)),
73807384
transitioned_map_(Unique<Map>(transitioned_map)),
7381-
from_kind_(original_map->elements_kind()),
7382-
to_kind_(transitioned_map->elements_kind()) {
7385+
bit_field_(
7386+
FromElementsKindField::encode(original_map->elements_kind()) |
7387+
ToElementsKindField::encode(transitioned_map->elements_kind()) |
7388+
MapIsStableField::encode(transitioned_map->is_stable())) {
73837389
SetOperandAt(0, object);
73847390
SetOperandAt(1, context);
73857391
SetFlag(kUseGVN);
73867392
SetChangesFlag(kElementsKind);
7387-
if (!IsSimpleMapChangeTransition(from_kind_, to_kind_)) {
7393+
if (!IsSimpleMapChangeTransition(from_kind(), to_kind())) {
73887394
SetChangesFlag(kElementsPointer);
73897395
SetChangesFlag(kNewSpacePromotion);
73907396
}
73917397
set_representation(Representation::Tagged());
73927398
}
73937399

7400+
class FromElementsKindField : public BitField<ElementsKind, 0, 5> {};
7401+
class ToElementsKindField : public BitField<ElementsKind, 5, 5> {};
7402+
class MapIsStableField : public BitField<bool, 10, 1> {};
7403+
73947404
Unique<Map> original_map_;
73957405
Unique<Map> transitioned_map_;
7396-
ElementsKind from_kind_;
7397-
ElementsKind to_kind_;
7406+
uint32_t bit_field_;
73987407
};
73997408

74007409

deps/v8/src/hydrogen.cc

-3
Original file line numberDiff line numberDiff line change
@@ -6954,9 +6954,6 @@ HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess(
69546954
PropertyAccessType access_type,
69556955
KeyedAccessStoreMode store_mode) {
69566956
HCheckMaps* checked_object = Add<HCheckMaps>(object, map, dependency);
6957-
if (dependency) {
6958-
checked_object->ClearDependsOnFlag(kElementsKind);
6959-
}
69606957

69616958
if (access_type == STORE && map->prototype()->IsJSObject()) {
69626959
// monomorphic stores need a prototype chain check because shape

deps/v8/src/version.cc

+16-50
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,17 @@
11
// Copyright 2012 the V8 project authors. All rights reserved.
2-
// Redistribution and use in source and binary forms, with or without
3-
// modification, are permitted provided that the following conditions are
4-
// met:
5-
//
6-
// * Redistributions of source code must retain the above copyright
7-
// notice, this list of conditions and the following disclaimer.
8-
// * Redistributions in binary form must reproduce the above
9-
// copyright notice, this list of conditions and the following
10-
// disclaimer in the documentation and/or other materials provided
11-
// with the distribution.
12-
// * Neither the name of Google Inc. nor the names of its
13-
// contributors may be used to endorse or promote products derived
14-
// from this software without specific prior written permission.
15-
//
16-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
274

5+
#include "include/v8-version.h"
286
#include "src/v8.h"
29-
307
#include "src/version.h"
318

32-
// These macros define the version number for the current version.
33-
// NOTE these macros are used by some of the tool scripts and the build
34-
// system so their names cannot be changed without changing the scripts.
35-
#define MAJOR_VERSION 4
36-
#define MINOR_VERSION 1
37-
#define BUILD_NUMBER 0
38-
#define PATCH_LEVEL 21
39-
// Use 1 for candidates and 0 otherwise.
40-
// (Boolean macro values are not supported by all preprocessors.)
41-
#define IS_CANDIDATE_VERSION 0
42-
439
// Define SONAME to have the build system put a specific SONAME into the
4410
// shared library instead the generic SONAME generated from the V8 version
4511
// number. This define is mainly used by the build system script.
4612
#define SONAME ""
4713

48-
#if IS_CANDIDATE_VERSION
14+
#if V8_IS_CANDIDATE_VERSION
4915
#define CANDIDATE_STRING " (candidate)"
5016
#else
5117
#define CANDIDATE_STRING ""
@@ -54,24 +20,24 @@
5420
#define SX(x) #x
5521
#define S(x) SX(x)
5622

57-
#if PATCH_LEVEL > 0
58-
#define VERSION_STRING \
59-
S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) "." \
60-
S(PATCH_LEVEL) CANDIDATE_STRING
23+
#if V8_PATCH_LEVEL > 0
24+
#define VERSION_STRING \
25+
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
26+
V8_PATCH_LEVEL) CANDIDATE_STRING
6127
#else
62-
#define VERSION_STRING \
63-
S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) \
64-
CANDIDATE_STRING
28+
#define VERSION_STRING \
29+
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
30+
CANDIDATE_STRING
6531
#endif
6632

6733
namespace v8 {
6834
namespace internal {
6935

70-
int Version::major_ = MAJOR_VERSION;
71-
int Version::minor_ = MINOR_VERSION;
72-
int Version::build_ = BUILD_NUMBER;
73-
int Version::patch_ = PATCH_LEVEL;
74-
bool Version::candidate_ = (IS_CANDIDATE_VERSION != 0);
36+
int Version::major_ = V8_MAJOR_VERSION;
37+
int Version::minor_ = V8_MINOR_VERSION;
38+
int Version::build_ = V8_BUILD_NUMBER;
39+
int Version::patch_ = V8_PATCH_LEVEL;
40+
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
7541
const char* Version::soname_ = SONAME;
7642
const char* Version::version_string_ = VERSION_STRING;
7743

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2015 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+
function boom(a1, a2) {
8+
// Do something with a2 that needs a map check (for DOUBLE_ELEMENTS).
9+
var s = a2[0];
10+
// Emit a load that transitions a1 to FAST_ELEMENTS.
11+
var t = a1[0];
12+
// Emit a store to a2 that assumes DOUBLE_ELEMENTS.
13+
// The map check is considered redundant and will be eliminated.
14+
a2[0] = 0.3;
15+
}
16+
17+
// Prepare type feedback for the "t = a1[0]" load: fast elements.
18+
var fast_elem = new Array(1);
19+
fast_elem[0] = "tagged";
20+
boom(fast_elem, [1]);
21+
22+
// Prepare type feedback for the "a2[0] = 0.3" store: double elements.
23+
var double_elem = new Array(1);
24+
double_elem[0] = 0.1;
25+
boom(double_elem, double_elem);
26+
27+
// Reset |double_elem| and go have a party.
28+
double_elem = new Array(10);
29+
double_elem[0] = 0.1;
30+
31+
%OptimizeFunctionOnNextCall(boom);
32+
boom(double_elem, double_elem);
33+
34+
assertEquals(0.3, double_elem[0]);
35+
assertEquals(undefined, double_elem[1]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2015 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+
function f(a1, a2) {
8+
var v7 = a2[0];
9+
var v8 = a1[0];
10+
a2[0] = 0.3;
11+
}
12+
v6 = new Array(1);
13+
v6[0] = "tagged";
14+
f(v6, [1]);
15+
v5 = new Array(1);
16+
v5[0] = 0.1;
17+
f(v5, v5);
18+
v5 = new Array(10);
19+
f(v5, v5);
20+
%OptimizeFunctionOnNextCall(f);
21+
f(v5, v5);
22+
v5[0];

0 commit comments

Comments
 (0)