Skip to content

Commit 4e3d767

Browse files
ofrobotsrvagg
authored andcommitted
deps: upgrade V8 to 4.5.103.30
Pick up v8/v8@f9a0a16 Commit log at https://chromium.googlesource.com/v8/v8.git/+log/branch-heads/4.5 PR-URL: #2632 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: rvagg - Rod Vagg <rod@vagg.org>
1 parent 439c1dd commit 4e3d767

25 files changed

+210
-147
lines changed

deps/v8/BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,8 @@ source_set("v8_base") {
10771077
"src/splay-tree.h",
10781078
"src/splay-tree-inl.h",
10791079
"src/snapshot/snapshot.h",
1080+
"src/startup-data-util.h",
1081+
"src/startup-data-util.cc",
10801082
"src/string-builder.cc",
10811083
"src/string-builder.h",
10821084
"src/string-search.cc",
@@ -1678,8 +1680,6 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") ||
16781680
sources = [
16791681
"src/d8.cc",
16801682
"src/d8.h",
1681-
"src/startup-data-util.h",
1682-
"src/startup-data-util.cc",
16831683
]
16841684

16851685
configs -= [ "//build/config/compiler:chromium_code" ]

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 103
14-
#define V8_PATCH_LEVEL 24
14+
#define V8_PATCH_LEVEL 30
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/include/v8.h

+19
Original file line numberDiff line numberDiff line change
@@ -6247,6 +6247,25 @@ class V8_EXPORT V8 {
62476247
*/
62486248
static bool InitializeICU(const char* icu_data_file = NULL);
62496249

6250+
/**
6251+
* Initialize the external startup data. The embedder only needs to
6252+
* invoke this method when external startup data was enabled in a build.
6253+
*
6254+
* If V8 was compiled with the startup data in an external file, then
6255+
* V8 needs to be given those external files during startup. There are
6256+
* three ways to do this:
6257+
* - InitializeExternalStartupData(const char*)
6258+
* This will look in the given directory for files "natives_blob.bin"
6259+
* and "snapshot_blob.bin" - which is what the default build calls them.
6260+
* - InitializeExternalStartupData(const char*, const char*)
6261+
* As above, but will directly use the two given file names.
6262+
* - Call SetNativesDataBlob, SetNativesDataBlob.
6263+
* This will read the blobs from the given data structures and will
6264+
* not perform any file IO.
6265+
*/
6266+
static void InitializeExternalStartupData(const char* directory_path);
6267+
static void InitializeExternalStartupData(const char* natives_blob,
6268+
const char* snapshot_blob);
62506269
/**
62516270
* Sets the v8::Platform to use. This should be invoked before V8 is
62526271
* initialized.

deps/v8/samples/hello-world.cc

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
2525
int main(int argc, char* argv[]) {
2626
// Initialize V8.
2727
V8::InitializeICU();
28+
V8::InitializeExternalStartupData(argv[0]);
2829
Platform* platform = platform::CreateDefaultPlatform();
2930
V8::InitializePlatform(platform);
3031
V8::Initialize();

deps/v8/samples/process.cc

+1
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ void PrintMap(map<string, string>* m) {
686686

687687
int main(int argc, char* argv[]) {
688688
v8::V8::InitializeICU();
689+
v8::V8::InitializeExternalStartupData(argv[0]);
689690
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
690691
v8::V8::InitializePlatform(platform);
691692
v8::V8::Initialize();

deps/v8/samples/shell.cc

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
7575

7676
int main(int argc, char* argv[]) {
7777
v8::V8::InitializeICU();
78+
v8::V8::InitializeExternalStartupData(argv[0]);
7879
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
7980
v8::V8::InitializePlatform(platform);
8081
v8::V8::Initialize();

deps/v8/src/api.cc

+13
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "src/simulator.h"
5050
#include "src/snapshot/natives.h"
5151
#include "src/snapshot/snapshot.h"
52+
#include "src/startup-data-util.h"
5253
#include "src/unicode-inl.h"
5354
#include "src/v8threads.h"
5455
#include "src/version.h"
@@ -5398,11 +5399,23 @@ HeapObjectStatistics::HeapObjectStatistics()
53985399
object_count_(0),
53995400
object_size_(0) {}
54005401

5402+
54015403
bool v8::V8::InitializeICU(const char* icu_data_file) {
54025404
return i::InitializeICU(icu_data_file);
54035405
}
54045406

54055407

5408+
void v8::V8::InitializeExternalStartupData(const char* directory_path) {
5409+
i::InitializeExternalStartupData(directory_path);
5410+
}
5411+
5412+
5413+
void v8::V8::InitializeExternalStartupData(const char* natives_blob,
5414+
const char* snapshot_blob) {
5415+
i::InitializeExternalStartupData(natives_blob, snapshot_blob);
5416+
}
5417+
5418+
54065419
const char* v8::V8::GetVersion() {
54075420
return i::Version::GetVersion();
54085421
}

deps/v8/src/arm/assembler-arm.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
128128
if (FLAG_enable_32dregs && cpu.has_vfp3_d32()) supported_ |= 1u << VFP32DREGS;
129129

130130
if (cpu.implementer() == base::CPU::NVIDIA &&
131-
cpu.variant() == base::CPU::NVIDIA_DENVER) {
131+
cpu.variant() == base::CPU::NVIDIA_DENVER &&
132+
cpu.part() <= base::CPU::NVIDIA_DENVER_V10) {
132133
supported_ |= 1u << COHERENT_CACHE;
133134
}
134135
#endif

deps/v8/src/arm64/assembler-arm64.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
5353
// Probe for runtime features
5454
base::CPU cpu;
5555
if (cpu.implementer() == base::CPU::NVIDIA &&
56-
cpu.variant() == base::CPU::NVIDIA_DENVER) {
56+
cpu.variant() == base::CPU::NVIDIA_DENVER &&
57+
cpu.part() <= base::CPU::NVIDIA_DENVER_V10) {
5758
supported_ |= 1u << COHERENT_CACHE;
5859
}
5960
}

deps/v8/src/base/cpu.h

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class CPU final {
5959
static const int ARM_CORTEX_A12 = 0xc0c;
6060
static const int ARM_CORTEX_A15 = 0xc0f;
6161

62+
// Denver-specific part code
63+
static const int NVIDIA_DENVER_V10 = 0x002;
64+
6265
// PPC-specific part codes
6366
enum {
6467
PPC_POWER5,

deps/v8/src/d8.cc

+6-8
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
#include "src/v8.h"
5151
#endif // !V8_SHARED
5252

53-
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
54-
#include "src/startup-data-util.h"
55-
#endif // V8_USE_EXTERNAL_STARTUP_DATA
56-
5753
#if !defined(_WIN32) && !defined(_WIN64)
5854
#include <unistd.h> // NOLINT
5955
#else
@@ -2316,10 +2312,12 @@ int Shell::Main(int argc, char* argv[]) {
23162312
g_platform = v8::platform::CreateDefaultPlatform();
23172313
v8::V8::InitializePlatform(g_platform);
23182314
v8::V8::Initialize();
2319-
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
2320-
v8::StartupDataHandler startup_data(argv[0], options.natives_blob,
2321-
options.snapshot_blob);
2322-
#endif
2315+
if (options.natives_blob || options.snapshot_blob) {
2316+
v8::V8::InitializeExternalStartupData(options.natives_blob,
2317+
options.snapshot_blob);
2318+
} else {
2319+
v8::V8::InitializeExternalStartupData(argv[0]);
2320+
}
23232321
SetFlagsFromString("--trace-hydrogen-file=hydrogen.cfg");
23242322
SetFlagsFromString("--trace-turbo-cfg-file=turbo.cfg");
23252323
SetFlagsFromString("--redirect-code-traces-to=code.asm");

deps/v8/src/d8.gyp

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
'sources': [
5151
'd8.h',
5252
'd8.cc',
53-
'startup-data-util.h',
54-
'startup-data-util.cc'
5553
],
5654
'conditions': [
5755
[ 'want_separate_host_toolset==1', {

deps/v8/src/heap/heap.cc

-13
Original file line numberDiff line numberDiff line change
@@ -4867,19 +4867,6 @@ void Heap::ReduceNewSpaceSize() {
48674867
}
48684868

48694869

4870-
void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
4871-
if (FLAG_overapproximate_weak_closure &&
4872-
(incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
4873-
(!incremental_marking()->weak_closure_was_overapproximated() &&
4874-
mark_compact_collector_.marking_deque()->IsEmpty()))) {
4875-
OverApproximateWeakClosure(comment);
4876-
} else if (incremental_marking()->IsComplete() ||
4877-
(mark_compact_collector_.marking_deque()->IsEmpty())) {
4878-
CollectAllGarbage(kNoGCFlags, comment);
4879-
}
4880-
}
4881-
4882-
48834870
bool Heap::TryFinalizeIdleIncrementalMarking(
48844871
double idle_time_in_ms, size_t size_of_objects,
48854872
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {

deps/v8/src/heap/heap.h

-4
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,6 @@ class Heap {
852852
intptr_t step_size_in_bytes, double deadline_in_ms,
853853
IncrementalMarking::StepActions step_actions);
854854

855-
void FinalizeIncrementalMarkingIfComplete(const char* comment);
856-
857855
inline void increment_scan_on_scavenge_pages() {
858856
scan_on_scavenge_pages_++;
859857
if (FLAG_gc_verbose) {
@@ -1644,8 +1642,6 @@ class Heap {
16441642
bool HasHighFragmentation();
16451643
bool HasHighFragmentation(intptr_t used, intptr_t committed);
16461644

1647-
bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }
1648-
16491645
protected:
16501646
// Methods made available to tests.
16511647

deps/v8/src/heap/memory-reducer.cc

+1-24
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,12 @@ void MemoryReducer::NotifyTimer(const Event& event) {
4444
if (state_.action == kRun) {
4545
DCHECK(heap()->incremental_marking()->IsStopped());
4646
DCHECK(FLAG_incremental_marking);
47+
heap()->StartIdleIncrementalMarking();
4748
if (FLAG_trace_gc_verbose) {
4849
PrintIsolate(heap()->isolate(), "Memory reducer: started GC #%d\n",
4950
state_.started_gcs);
5051
}
51-
if (heap()->ShouldOptimizeForMemoryUsage()) {
52-
// Do full GC if memory usage has higher priority than latency. This is
53-
// important for background tabs that do not send idle notifications.
54-
heap()->CollectAllGarbage(Heap::kReduceMemoryFootprintMask,
55-
"memory reducer");
56-
} else {
57-
heap()->StartIdleIncrementalMarking();
58-
}
5952
} else if (state_.action == kWait) {
60-
if (!heap()->incremental_marking()->IsStopped() &&
61-
heap()->ShouldOptimizeForMemoryUsage()) {
62-
// Make progress with pending incremental marking if memory usage has
63-
// higher priority than latency. This is important for background tabs
64-
// that do not send idle notifications.
65-
const int kIncrementalMarkingDelayMs = 500;
66-
double deadline = heap()->MonotonicallyIncreasingTimeInMs() +
67-
kIncrementalMarkingDelayMs;
68-
heap()->AdvanceIncrementalMarking(
69-
0, deadline, i::IncrementalMarking::StepActions(
70-
i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
71-
i::IncrementalMarking::FORCE_MARKING,
72-
i::IncrementalMarking::FORCE_COMPLETION));
73-
heap()->FinalizeIncrementalMarkingIfComplete(
74-
"Memory reducer: finalize incremental marking");
75-
}
7653
// Re-schedule the timer.
7754
ScheduleTimer(state_.next_gc_start_ms - event.time_ms);
7855
if (FLAG_trace_gc_verbose) {

deps/v8/src/preparser.h

+14
Original file line numberDiff line numberDiff line change
@@ -2939,6 +2939,7 @@ ParserBase<Traits>::ParseConditionalExpression(bool accept_IN,
29392939
ExpressionT expression =
29402940
this->ParseBinaryExpression(4, accept_IN, classifier, CHECK_OK);
29412941
if (peek() != Token::CONDITIONAL) return expression;
2942+
ArrowFormalParametersUnexpectedToken(classifier);
29422943
BindingPatternUnexpectedToken(classifier);
29432944
Consume(Token::CONDITIONAL);
29442945
// In parsing the first assignment expression in conditional
@@ -2964,6 +2965,7 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN,
29642965
// prec1 >= 4
29652966
while (Precedence(peek(), accept_IN) == prec1) {
29662967
BindingPatternUnexpectedToken(classifier);
2968+
ArrowFormalParametersUnexpectedToken(classifier);
29672969
Token::Value op = Next();
29682970
Scanner::Location op_location = scanner()->location();
29692971
int pos = position();
@@ -3026,6 +3028,7 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier,
30263028
Token::Value op = peek();
30273029
if (Token::IsUnaryOp(op)) {
30283030
BindingPatternUnexpectedToken(classifier);
3031+
ArrowFormalParametersUnexpectedToken(classifier);
30293032

30303033
op = Next();
30313034
int pos = position();
@@ -3048,6 +3051,7 @@ ParserBase<Traits>::ParseUnaryExpression(ExpressionClassifier* classifier,
30483051
return this->BuildUnaryExpression(expression, op, pos, factory());
30493052
} else if (Token::IsCountOp(op)) {
30503053
BindingPatternUnexpectedToken(classifier);
3054+
ArrowFormalParametersUnexpectedToken(classifier);
30513055
op = Next();
30523056
Scanner::Location lhs_location = scanner()->peek_location();
30533057
ExpressionT expression = this->ParseUnaryExpression(classifier, CHECK_OK);
@@ -3080,6 +3084,7 @@ ParserBase<Traits>::ParsePostfixExpression(ExpressionClassifier* classifier,
30803084
if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
30813085
Token::IsCountOp(peek())) {
30823086
BindingPatternUnexpectedToken(classifier);
3087+
ArrowFormalParametersUnexpectedToken(classifier);
30833088

30843089
expression = this->CheckAndRewriteReferenceExpression(
30853090
expression, lhs_location, MessageTemplate::kInvalidLhsInPostfixOp,
@@ -3111,6 +3116,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
31113116
switch (peek()) {
31123117
case Token::LBRACK: {
31133118
BindingPatternUnexpectedToken(classifier);
3119+
ArrowFormalParametersUnexpectedToken(classifier);
31143120
Consume(Token::LBRACK);
31153121
int pos = position();
31163122
ExpressionT index = ParseExpression(true, classifier, CHECK_OK);
@@ -3121,6 +3127,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
31213127

31223128
case Token::LPAREN: {
31233129
BindingPatternUnexpectedToken(classifier);
3130+
ArrowFormalParametersUnexpectedToken(classifier);
31243131

31253132
if (is_strong(language_mode()) && this->IsIdentifier(result) &&
31263133
this->IsEval(this->AsIdentifier(result))) {
@@ -3172,6 +3179,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
31723179

31733180
case Token::PERIOD: {
31743181
BindingPatternUnexpectedToken(classifier);
3182+
ArrowFormalParametersUnexpectedToken(classifier);
31753183
Consume(Token::PERIOD);
31763184
int pos = position();
31773185
IdentifierT name = ParseIdentifierName(CHECK_OK);
@@ -3184,6 +3192,7 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
31843192
case Token::TEMPLATE_SPAN:
31853193
case Token::TEMPLATE_TAIL: {
31863194
BindingPatternUnexpectedToken(classifier);
3195+
ArrowFormalParametersUnexpectedToken(classifier);
31873196
result = ParseTemplateLiteral(result, position(), classifier, CHECK_OK);
31883197
break;
31893198
}
@@ -3221,6 +3230,7 @@ ParserBase<Traits>::ParseMemberWithNewPrefixesExpression(
32213230

32223231
if (peek() == Token::NEW) {
32233232
BindingPatternUnexpectedToken(classifier);
3233+
ArrowFormalParametersUnexpectedToken(classifier);
32243234
Consume(Token::NEW);
32253235
int new_pos = position();
32263236
ExpressionT result = this->EmptyExpression();
@@ -3274,6 +3284,7 @@ ParserBase<Traits>::ParseMemberExpression(ExpressionClassifier* classifier,
32743284
ExpressionT result = this->EmptyExpression();
32753285
if (peek() == Token::FUNCTION) {
32763286
BindingPatternUnexpectedToken(classifier);
3287+
ArrowFormalParametersUnexpectedToken(classifier);
32773288

32783289
Consume(Token::FUNCTION);
32793290
int function_token_position = position();
@@ -3523,6 +3534,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
35233534
switch (peek()) {
35243535
case Token::LBRACK: {
35253536
BindingPatternUnexpectedToken(classifier);
3537+
ArrowFormalParametersUnexpectedToken(classifier);
35263538

35273539
Consume(Token::LBRACK);
35283540
int pos = position();
@@ -3536,6 +3548,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
35363548
}
35373549
case Token::PERIOD: {
35383550
BindingPatternUnexpectedToken(classifier);
3551+
ArrowFormalParametersUnexpectedToken(classifier);
35393552

35403553
Consume(Token::PERIOD);
35413554
int pos = position();
@@ -3550,6 +3563,7 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(
35503563
case Token::TEMPLATE_SPAN:
35513564
case Token::TEMPLATE_TAIL: {
35523565
BindingPatternUnexpectedToken(classifier);
3566+
ArrowFormalParametersUnexpectedToken(classifier);
35533567
int pos;
35543568
if (scanner()->current_token() == Token::IDENTIFIER) {
35553569
pos = position();

0 commit comments

Comments
 (0)