Skip to content

Commit 01652c7

Browse files
deps: upgrade v8 to 4.2.77.18
This commit applies a secondary change in order to make `make test` pass cleanly, specifically re-disabling post-mortem debugging in common.gypi. PR-URL: #1506 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 01e6632 commit 01652c7

14 files changed

+185
-146
lines changed

common.gypi

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
# Enable disassembler for `--print-code` v8 options
2121
'v8_enable_disassembler': 1,
2222

23+
# Disable support for postmortem debugging, continuously broken.
24+
'v8_postmortem_support%': 'false',
25+
2326
# Don't bake anything extra into the snapshot.
2427
'v8_use_external_startup_data%': 0,
2528

2629
'conditions': [
2730
['OS == "win"', {
2831
'os_posix': 0,
29-
'v8_postmortem_support%': 'false',
3032
}, {
3133
'os_posix': 1,
32-
'v8_postmortem_support%': 'true',
3334
}],
3435
['GENERATOR == "ninja" or OS== "mac"', {
3536
'OBJ_DIR': '<(PRODUCT_DIR)/obj',

deps/v8/AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Jan de Mooij <[email protected]>
6161
Jay Freeman <[email protected]>
6262
James Pike <[email protected]>
6363
Jianghua Yang <[email protected]>
64-
Joel Stanley <joel[email protected]>
64+
Joel Stanley <joel@jms.id.au>
6565
Johan Bergström <[email protected]>
6666
Jonathan Liu <[email protected]>
6767
Kang-Hao (Kenny) Lu <[email protected]>

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 2
1313
#define V8_BUILD_NUMBER 77
14-
#define V8_PATCH_LEVEL 15
14+
#define V8_PATCH_LEVEL 18
1515

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

deps/v8/include/v8.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,24 @@ class V8_EXPORT EscapableHandleScope : public HandleScope {
932932
internal::Object** escape_slot_;
933933
};
934934

935+
class V8_EXPORT SealHandleScope {
936+
public:
937+
SealHandleScope(Isolate* isolate);
938+
~SealHandleScope();
939+
940+
private:
941+
// Make it hard to create heap-allocated or illegal handle scopes by
942+
// disallowing certain operations.
943+
SealHandleScope(const SealHandleScope&);
944+
void operator=(const SealHandleScope&);
945+
void* operator new(size_t size);
946+
void operator delete(void*, size_t);
947+
948+
internal::Isolate* isolate_;
949+
int prev_level_;
950+
internal::Object** prev_limit_;
951+
};
952+
935953

936954
/**
937955
* A simple Maybe type, representing an object which may or may not have a
@@ -1004,24 +1022,6 @@ class ScriptOrigin {
10041022
Handle<Integer> script_id_;
10051023
};
10061024

1007-
class V8_EXPORT SealHandleScope {
1008-
public:
1009-
SealHandleScope(Isolate* isolate);
1010-
~SealHandleScope();
1011-
1012-
private:
1013-
// Make it hard to create heap-allocated or illegal handle scopes by
1014-
// disallowing certain operations.
1015-
SealHandleScope(const SealHandleScope&);
1016-
void operator=(const SealHandleScope&);
1017-
void* operator new(size_t size);
1018-
void operator delete(void*, size_t);
1019-
1020-
internal::Isolate* isolate_;
1021-
int prev_level_;
1022-
internal::Object** prev_limit_;
1023-
};
1024-
10251025

10261026
/**
10271027
* A compiled JavaScript script, not yet tied to a Context.

deps/v8/src/compiler/x64/instruction-selector-x64.cc

+5-17
Original file line numberDiff line numberDiff line change
@@ -812,22 +812,12 @@ void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
812812
Node* value = node->InputAt(0);
813813
if (CanCover(node, value)) {
814814
switch (value->opcode()) {
815-
case IrOpcode::kWord64Sar: {
815+
case IrOpcode::kWord64Sar:
816+
case IrOpcode::kWord64Shr: {
816817
Int64BinopMatcher m(value);
817-
if (m.right().IsInRange(1, 32)) {
818+
if (m.right().Is(32)) {
818819
Emit(kX64Shr, g.DefineSameAsFirst(node),
819-
g.UseRegister(m.left().node()),
820-
g.UseImmediate(m.right().node()));
821-
return;
822-
}
823-
break;
824-
}
825-
case IrOpcode::kWord64Shl: {
826-
Int64BinopMatcher m(value);
827-
if (m.right().IsInRange(1, 31)) {
828-
Emit(kX64Shl32, g.DefineSameAsFirst(node),
829-
g.UseRegister(m.left().node()),
830-
g.UseImmediate(m.right().node()));
820+
g.UseRegister(m.left().node()), g.TempImmediate(32));
831821
return;
832822
}
833823
break;
@@ -836,9 +826,7 @@ void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
836826
break;
837827
}
838828
}
839-
// Otherwise truncation from 64-bit to 32-bit is a no-nop, as 32-bit
840-
// operations just ignore the upper 64-bit.
841-
Emit(kArchNop, g.DefineAsRegister(node), g.Use(value));
829+
Emit(kX64Movl, g.DefineAsRegister(node), g.Use(value));
842830
}
843831

844832

deps/v8/src/heap/gc-idle-time-handler.h

+3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ class GCIdleTimeHandler {
125125
// That is the maximum idle time we will have during frame rendering.
126126
static const size_t kMaxFrameRenderingIdleTime = 16;
127127

128+
// Minimum idle time to start incremental marking.
129+
static const size_t kMinIdleTimeToStartIncrementalMarking = 10;
130+
128131
// If we haven't recorded any scavenger events yet, we use a conservative
129132
// lower bound for the scavenger speed.
130133
static const size_t kInitialConservativeScavengeSpeed = 100 * KB;

deps/v8/src/heap/heap.cc

+38-15
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ Heap::Heap()
104104
allocation_timeout_(0),
105105
#endif // DEBUG
106106
old_generation_allocation_limit_(initial_old_generation_size_),
107+
idle_old_generation_allocation_limit_(
108+
kMinimumOldGenerationAllocationLimit),
107109
old_gen_exhausted_(false),
108110
inline_allocation_disabled_(false),
109111
store_buffer_rebuilder_(store_buffer()),
@@ -1159,8 +1161,7 @@ bool Heap::PerformGarbageCollection(
11591161
// Temporarily set the limit for case when PostGarbageCollectionProcessing
11601162
// allocates and triggers GC. The real limit is set at after
11611163
// PostGarbageCollectionProcessing.
1162-
old_generation_allocation_limit_ =
1163-
OldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), 0);
1164+
SetOldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(), 0);
11641165
old_gen_exhausted_ = false;
11651166
old_generation_size_configured_ = true;
11661167
} else {
@@ -1194,8 +1195,8 @@ bool Heap::PerformGarbageCollection(
11941195
// Register the amount of external allocated memory.
11951196
amount_of_external_allocated_memory_at_last_global_gc_ =
11961197
amount_of_external_allocated_memory_;
1197-
old_generation_allocation_limit_ = OldGenerationAllocationLimit(
1198-
PromotedSpaceSizeOfObjects(), freed_global_handles);
1198+
SetOldGenerationAllocationLimit(PromotedSpaceSizeOfObjects(),
1199+
freed_global_handles);
11991200
// We finished a marking cycle. We can uncommit the marking deque until
12001201
// we start marking again.
12011202
mark_compact_collector_.UncommitMarkingDeque();
@@ -4558,7 +4559,7 @@ bool Heap::TryFinalizeIdleIncrementalMarking(
45584559

45594560
bool Heap::WorthActivatingIncrementalMarking() {
45604561
return incremental_marking()->IsStopped() &&
4561-
incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull();
4562+
incremental_marking()->ShouldActivate();
45624563
}
45634564

45644565

@@ -4583,6 +4584,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
45834584
static_cast<double>(base::Time::kMillisecondsPerSecond);
45844585
HistogramTimerScope idle_notification_scope(
45854586
isolate_->counters()->gc_idle_notification());
4587+
double idle_time_in_ms = deadline_in_ms - MonotonicallyIncreasingTimeInMs();
45864588

45874589
GCIdleTimeHandler::HeapState heap_state;
45884590
heap_state.contexts_disposed = contexts_disposed_;
@@ -4591,8 +4593,15 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
45914593
heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects());
45924594
heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
45934595
// TODO(ulan): Start incremental marking only for large heaps.
4596+
intptr_t limit = old_generation_allocation_limit_;
4597+
if (static_cast<size_t>(idle_time_in_ms) >
4598+
GCIdleTimeHandler::kMinIdleTimeToStartIncrementalMarking) {
4599+
limit = idle_old_generation_allocation_limit_;
4600+
}
4601+
45944602
heap_state.can_start_incremental_marking =
4595-
incremental_marking()->ShouldActivate() && FLAG_incremental_marking;
4603+
incremental_marking()->WorthActivating() &&
4604+
NextGCIsLikelyToBeFull(limit) && FLAG_incremental_marking;
45964605
heap_state.sweeping_in_progress =
45974606
mark_compact_collector()->sweeping_in_progress();
45984607
heap_state.mark_compact_speed_in_bytes_per_ms =
@@ -4610,7 +4619,6 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
46104619
static_cast<size_t>(
46114620
tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond());
46124621

4613-
double idle_time_in_ms = deadline_in_ms - MonotonicallyIncreasingTimeInMs();
46144622
GCIdleTimeAction action =
46154623
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
46164624
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
@@ -5358,21 +5366,37 @@ int64_t Heap::PromotedExternalMemorySize() {
53585366
}
53595367

53605368

5361-
intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size,
5362-
int freed_global_handles) {
5369+
intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor,
5370+
intptr_t old_gen_size) {
5371+
CHECK(factor > 1.0);
5372+
CHECK(old_gen_size > 0);
5373+
intptr_t limit = static_cast<intptr_t>(old_gen_size * factor);
5374+
limit = Max(limit, kMinimumOldGenerationAllocationLimit);
5375+
limit += new_space_.Capacity();
5376+
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
5377+
return Min(limit, halfway_to_the_max);
5378+
}
5379+
5380+
5381+
void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
5382+
int freed_global_handles) {
53635383
const int kMaxHandles = 1000;
53645384
const int kMinHandles = 100;
5365-
double min_factor = 1.1;
5385+
const double min_factor = 1.1;
53665386
double max_factor = 4;
5387+
const double idle_max_factor = 1.5;
53675388
// We set the old generation growing factor to 2 to grow the heap slower on
53685389
// memory-constrained devices.
53695390
if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) {
53705391
max_factor = 2;
53715392
}
5393+
53725394
// If there are many freed global handles, then the next full GC will
53735395
// likely collect a lot of garbage. Choose the heap growing factor
53745396
// depending on freed global handles.
53755397
// TODO(ulan, hpayer): Take into account mutator utilization.
5398+
// TODO(hpayer): The idle factor could make the handles heuristic obsolete.
5399+
// Look into that.
53765400
double factor;
53775401
if (freed_global_handles <= kMinHandles) {
53785402
factor = max_factor;
@@ -5391,11 +5415,10 @@ intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size,
53915415
factor = min_factor;
53925416
}
53935417

5394-
intptr_t limit = static_cast<intptr_t>(old_gen_size * factor);
5395-
limit = Max(limit, kMinimumOldGenerationAllocationLimit);
5396-
limit += new_space_.Capacity();
5397-
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
5398-
return Min(limit, halfway_to_the_max);
5418+
old_generation_allocation_limit_ =
5419+
CalculateOldGenerationAllocationLimit(factor, old_gen_size);
5420+
idle_old_generation_allocation_limit_ = CalculateOldGenerationAllocationLimit(
5421+
Min(factor, idle_max_factor), old_gen_size);
53995422
}
54005423

54015424

deps/v8/src/heap/heap.h

+18-5
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,10 @@ class Heap {
628628
// Returns of size of all objects residing in the heap.
629629
intptr_t SizeOfObjects();
630630

631+
intptr_t old_generation_allocation_limit() const {
632+
return old_generation_allocation_limit_;
633+
}
634+
631635
// Return the starting address and a mask for the new space. And-masking an
632636
// address with the mask will result in the start address of the new space
633637
// for all addresses in either semispace.
@@ -1112,8 +1116,14 @@ class Heap {
11121116
static const int kMaxExecutableSizeHugeMemoryDevice =
11131117
256 * kPointerMultiplier;
11141118

1115-
intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size,
1116-
int freed_global_handles);
1119+
// Calculates the allocation limit based on a given growing factor and a
1120+
// given old generation size.
1121+
intptr_t CalculateOldGenerationAllocationLimit(double factor,
1122+
intptr_t old_gen_size);
1123+
1124+
// Sets the allocation limit to trigger the next full garbage collection.
1125+
void SetOldGenerationAllocationLimit(intptr_t old_gen_size,
1126+
int freed_global_handles);
11171127

11181128
// Indicates whether inline bump-pointer allocation has been disabled.
11191129
bool inline_allocation_disabled() { return inline_allocation_disabled_; }
@@ -1219,13 +1229,12 @@ class Heap {
12191229
survived_since_last_expansion_ += survived;
12201230
}
12211231

1222-
inline bool NextGCIsLikelyToBeFull() {
1232+
inline bool NextGCIsLikelyToBeFull(intptr_t limit) {
12231233
if (FLAG_gc_global) return true;
12241234

12251235
if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true;
12261236

1227-
intptr_t adjusted_allocation_limit =
1228-
old_generation_allocation_limit_ - new_space_.Capacity();
1237+
intptr_t adjusted_allocation_limit = limit - new_space_.Capacity();
12291238

12301239
if (PromotedTotalSize() >= adjusted_allocation_limit) return true;
12311240

@@ -1604,6 +1613,10 @@ class Heap {
16041613
// generation and on every allocation in large object space.
16051614
intptr_t old_generation_allocation_limit_;
16061615

1616+
// The allocation limit when there is > kMinIdleTimeToStartIncrementalMarking
1617+
// idle time in the idle time handler.
1618+
intptr_t idle_old_generation_allocation_limit_;
1619+
16071620
// Indicates that an allocation has failed in the old generation since the
16081621
// last GC.
16091622
bool old_gen_exhausted_;

deps/v8/src/heap/incremental-marking.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,9 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier() {
422422

423423

424424
bool IncrementalMarking::ShouldActivate() {
425-
return WorthActivating() && heap_->NextGCIsLikelyToBeFull();
425+
return WorthActivating() &&
426+
heap_->NextGCIsLikelyToBeFull(
427+
heap_->old_generation_allocation_limit());
426428
}
427429

428430

deps/v8/src/hydrogen.cc

+7-15
Original file line numberDiff line numberDiff line change
@@ -2391,6 +2391,8 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
23912391
PropertyAccessType access_type,
23922392
LoadKeyedHoleMode load_mode,
23932393
KeyedAccessStoreMode store_mode) {
2394+
DCHECK(top_info()->IsStub() || checked_object->IsCompareMap() ||
2395+
checked_object->IsCheckMaps());
23942396
DCHECK((!IsExternalArrayElementsKind(elements_kind) &&
23952397
!IsFixedTypedArrayElementsKind(elements_kind)) ||
23962398
!is_js_array);
@@ -8401,11 +8403,10 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
84018403
new_size = AddUncasted<HAdd>(length, graph()->GetConstant1());
84028404

84038405
bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
8404-
BuildUncheckedMonomorphicElementAccess(array, length,
8405-
value_to_push, is_array,
8406-
elements_kind, STORE,
8407-
NEVER_RETURN_HOLE,
8408-
STORE_AND_GROW_NO_TRANSITION);
8406+
HValue* checked_array = Add<HCheckMaps>(array, receiver_map);
8407+
BuildUncheckedMonomorphicElementAccess(
8408+
checked_array, length, value_to_push, is_array, elements_kind,
8409+
STORE, NEVER_RETURN_HOLE, STORE_AND_GROW_NO_TRANSITION);
84098410

84108411
if (!ast_context()->IsEffect()) Push(new_size);
84118412
Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE);
@@ -8763,18 +8764,9 @@ void HOptimizedGraphBuilder::HandleIndirectCall(Call* expr, HValue* function,
87638764
int args_count_no_receiver = arguments_count - 1;
87648765
if (function->IsConstant() &&
87658766
HConstant::cast(function)->handle(isolate())->IsJSFunction()) {
8766-
HValue* receiver = environment()->ExpressionStackAt(args_count_no_receiver);
8767-
Handle<Map> receiver_map;
8768-
if (receiver->IsConstant() &&
8769-
HConstant::cast(receiver)->handle(isolate())->IsHeapObject()) {
8770-
receiver_map =
8771-
handle(Handle<HeapObject>::cast(
8772-
HConstant::cast(receiver)->handle(isolate()))->map());
8773-
}
8774-
87758767
known_function =
87768768
Handle<JSFunction>::cast(HConstant::cast(function)->handle(isolate()));
8777-
if (TryInlineBuiltinMethodCall(expr, known_function, receiver_map,
8769+
if (TryInlineBuiltinMethodCall(expr, known_function, Handle<Map>(),
87788770
args_count_no_receiver)) {
87798771
if (FLAG_trace_inlining) {
87808772
PrintF("Inlining builtin ");

0 commit comments

Comments
 (0)