Skip to content

Commit bef4b3b

Browse files
targosjasnell
authored andcommitted
deps: update V8 to 5.4.500.31
PR-URL: #8852 Reviewed-By: Franziska Hinkelmann <franzih@chromium.org> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 943ff11 commit bef4b3b

19 files changed

+84
-79
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 500
14-
#define V8_PATCH_LEVEL 27
14+
#define V8_PATCH_LEVEL 31
1515

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

deps/v8/src/api.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ class HandleScopeImplementer {
389389
call_depth_(0),
390390
microtasks_depth_(0),
391391
microtasks_suppressions_(0),
392+
entered_context_count_during_microtasks_(0),
392393
#ifdef DEBUG
393394
debug_microtasks_depth_(0),
394395
#endif
@@ -454,6 +455,11 @@ class HandleScopeImplementer {
454455
inline void EnterMicrotaskContext(Handle<Context> context);
455456
inline void LeaveMicrotaskContext();
456457
inline Handle<Context> MicrotaskContext();
458+
inline bool MicrotaskContextIsLastEnteredContext() const {
459+
return microtask_context_ &&
460+
entered_context_count_during_microtasks_ ==
461+
entered_contexts_.length();
462+
}
457463

458464
inline void SaveContext(Context* context);
459465
inline Context* RestoreContext();
@@ -474,6 +480,7 @@ class HandleScopeImplementer {
474480
entered_contexts_.Initialize(0);
475481
saved_contexts_.Initialize(0);
476482
microtask_context_ = nullptr;
483+
entered_context_count_during_microtasks_ = 0;
477484
spare_ = NULL;
478485
last_handle_before_deferred_block_ = NULL;
479486
call_depth_ = 0;
@@ -508,6 +515,7 @@ class HandleScopeImplementer {
508515
int call_depth_;
509516
int microtasks_depth_;
510517
int microtasks_suppressions_;
518+
int entered_context_count_during_microtasks_;
511519
#ifdef DEBUG
512520
int debug_microtasks_depth_;
513521
#endif
@@ -579,11 +587,13 @@ Handle<Context> HandleScopeImplementer::LastEnteredContext() {
579587
void HandleScopeImplementer::EnterMicrotaskContext(Handle<Context> context) {
580588
DCHECK(!microtask_context_);
581589
microtask_context_ = *context;
590+
entered_context_count_during_microtasks_ = entered_contexts_.length();
582591
}
583592

584593
void HandleScopeImplementer::LeaveMicrotaskContext() {
585594
DCHECK(microtask_context_);
586595
microtask_context_ = nullptr;
596+
entered_context_count_during_microtasks_ = 0;
587597
}
588598

589599
Handle<Context> HandleScopeImplementer::MicrotaskContext() {

deps/v8/src/builtins/builtins.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,12 @@ bool Builtins::AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target,
280280
Handle<JSObject> target_global_proxy) {
281281
if (FLAG_allow_unsafe_function_constructor) return true;
282282
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
283-
Handle<Context> responsible_context = impl->LastEnteredContext();
283+
Handle<Context> responsible_context =
284+
impl->MicrotaskContextIsLastEnteredContext() ? impl->MicrotaskContext()
285+
: impl->LastEnteredContext();
286+
// TODO(jochen): Remove this.
284287
if (responsible_context.is_null()) {
285-
responsible_context = impl->MicrotaskContext();
286-
// TODO(jochen): Remove this.
287-
if (responsible_context.is_null()) {
288-
return true;
289-
}
288+
return true;
290289
}
291290
if (*responsible_context == target->context()) return true;
292291
return isolate->MayAccess(responsible_context, target_global_proxy);

deps/v8/src/compiler/access-info.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ bool AccessInfoFactory::ComputePropertyAccessInfo(
312312
isolate());
313313
dependencies()->AssumeFieldType(field_owner_map);
314314
}
315-
DCHECK(field_type->Is(Type::TaggedPointer()));
315+
if (access_mode == AccessMode::kLoad) {
316+
field_type = Type::Any();
317+
}
316318
}
317319
*access_info = PropertyAccessInfo::DataField(
318320
MapList{receiver_map}, field_index, field_type, holder);

deps/v8/src/compiler/arm/code-generator-arm.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,10 +1878,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
18781878
case Constant::kHeapObject: {
18791879
Handle<HeapObject> src_object = src.ToHeapObject();
18801880
Heap::RootListIndex index;
1881-
int slot;
1882-
if (IsMaterializableFromFrame(src_object, &slot)) {
1883-
__ ldr(dst, g.SlotToMemOperand(slot));
1884-
} else if (IsMaterializableFromRoot(src_object, &index)) {
1881+
if (IsMaterializableFromRoot(src_object, &index)) {
18851882
__ LoadRoot(dst, index);
18861883
} else {
18871884
__ Move(dst, src_object);

deps/v8/src/compiler/arm64/code-generator-arm64.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,10 +1939,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
19391939
if (src.type() == Constant::kHeapObject) {
19401940
Handle<HeapObject> src_object = src.ToHeapObject();
19411941
Heap::RootListIndex index;
1942-
int slot;
1943-
if (IsMaterializableFromFrame(src_object, &slot)) {
1944-
__ Ldr(dst, g.SlotToMemOperand(slot, masm()));
1945-
} else if (IsMaterializableFromRoot(src_object, &index)) {
1942+
if (IsMaterializableFromRoot(src_object, &index)) {
19461943
__ LoadRoot(dst, index);
19471944
} else {
19481945
__ LoadObject(dst, src_object);

deps/v8/src/compiler/ast-loop-assignment-analyzer.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,12 @@ void ALAA::VisitForStatement(ForStatement* loop) {
252252

253253

254254
void ALAA::VisitForInStatement(ForInStatement* loop) {
255+
Expression* l = loop->each();
255256
Enter(loop);
256-
Visit(loop->each());
257+
Visit(l);
257258
Visit(loop->subject());
258259
Visit(loop->body());
260+
if (l->IsVariableProxy()) AnalyzeAssignment(l->AsVariableProxy()->var());
259261
Exit(loop);
260262
}
261263

deps/v8/src/compiler/code-generator.cc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,6 @@ void CodeGenerator::RecordSafepoint(ReferenceMap* references,
278278
}
279279
}
280280

281-
bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
282-
int* slot_return) {
283-
if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
284-
if (object.is_identical_to(info()->context()) && !info()->is_osr()) {
285-
*slot_return = Frame::kContextSlot;
286-
return true;
287-
} else if (object.is_identical_to(info()->closure())) {
288-
*slot_return = Frame::kJSFunctionSlot;
289-
return true;
290-
}
291-
}
292-
return false;
293-
}
294-
295-
296281
bool CodeGenerator::IsMaterializableFromRoot(
297282
Handle<HeapObject> object, Heap::RootListIndex* index_return) {
298283
const CallDescriptor* incoming_descriptor =

deps/v8/src/compiler/code-generator.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ class CodeGenerator final : public GapResolver::Assembler {
8484
void RecordSafepoint(ReferenceMap* references, Safepoint::Kind kind,
8585
int arguments, Safepoint::DeoptMode deopt_mode);
8686

87-
// Check if a heap object can be materialized by loading from the frame, which
88-
// is usually way cheaper than materializing the actual heap object constant.
89-
bool IsMaterializableFromFrame(Handle<HeapObject> object, int* slot_return);
9087
// Check if a heap object can be materialized by loading from a heap root,
9188
// which is cheaper on some platforms than materializing the actual heap
9289
// object constant.

deps/v8/src/compiler/ia32/code-generator-ia32.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,18 +2040,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
20402040
Constant src_constant = g.ToConstant(source);
20412041
if (src_constant.type() == Constant::kHeapObject) {
20422042
Handle<HeapObject> src = src_constant.ToHeapObject();
2043-
int slot;
2044-
if (IsMaterializableFromFrame(src, &slot)) {
2045-
if (destination->IsRegister()) {
2046-
Register dst = g.ToRegister(destination);
2047-
__ mov(dst, g.SlotToOperand(slot));
2048-
} else {
2049-
DCHECK(destination->IsStackSlot());
2050-
Operand dst = g.ToOperand(destination);
2051-
__ push(g.SlotToOperand(slot));
2052-
__ pop(dst);
2053-
}
2054-
} else if (destination->IsRegister()) {
2043+
if (destination->IsRegister()) {
20552044
Register dst = g.ToRegister(destination);
20562045
__ LoadHeapObject(dst, src);
20572046
} else {

0 commit comments

Comments
 (0)