0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-27 22:16:50 +01:00

deps: make V8 10.2 ABI-compatible with 10.1

Create an unused deopt kind to replace `DeoptimizeKind::kSoft`, which
was removed. This ensures that the layout of IsolateData doesn't change.

Refs: 1ff685d8b1

PR-URL: https://github.com/nodejs/node/pull/42740
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
Michaël Zasso 2022-04-19 10:01:34 +02:00
parent 421fd079a2
commit 8d0bbf934f
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
15 changed files with 56 additions and 3 deletions

View File

@ -36,7 +36,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.7',
'v8_embedder_string': '-node.8',
##### V8 defaults for Node.js #####

View File

@ -365,8 +365,8 @@ class Internals {
static const uint32_t kNumIsolateDataSlots = 4;
static const int kStackGuardSize = 7 * kApiSystemPointerSize;
static const int kBuiltinTier0EntryTableSize = 9 * kApiSystemPointerSize;
static const int kBuiltinTier0TableSize = 9 * kApiSystemPointerSize;
static const int kBuiltinTier0EntryTableSize = 10 * kApiSystemPointerSize;
static const int kBuiltinTier0TableSize = 10 * kApiSystemPointerSize;
// IsolateData layout guarantees.
static const int kIsolateCageBaseOffset = 0;

View File

@ -3537,6 +3537,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -4056,6 +4056,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -46,6 +46,8 @@ namespace internal {
/* Deoptimization entries. */ \
ASM(DeoptimizationEntry_Eager, DeoptimizationEntry) \
ASM(DeoptimizationEntry_Lazy, DeoptimizationEntry) \
/* Replaces "Soft" for ABI compatibility. */ \
ASM(DeoptimizationEntry_Unused, DeoptimizationEntry) \
\
/* GC write barrier. */ \
TFC(RecordWriteEmitRememberedSetSaveFP, WriteBarrier) \

View File

@ -4153,6 +4153,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -3554,6 +3554,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -4002,6 +4002,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -3581,6 +3581,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -3839,6 +3839,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
void Builtins::Generate_BaselineOrInterpreterEnterAtBytecode(
MacroAssembler* masm) {
// Implement on this platform, https://crrev.com/c/2695591.

View File

@ -3668,6 +3668,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -3836,6 +3836,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
OnStackReplacement(masm, OsrSourceTier::kInterpreter);
}

View File

@ -5007,6 +5007,10 @@ void Builtins::Generate_DeoptimizationEntry_Lazy(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kLazy);
}
void Builtins::Generate_DeoptimizationEntry_Unused(MacroAssembler* masm) {
Generate_DeoptimizationEntry(masm, DeoptimizeKind::kUnused);
}
namespace {
// Restarts execution either at the current or next (in execution order)

View File

@ -522,11 +522,13 @@ constexpr int kNoDeoptimizationId = -1;
// Deoptimize bailout kind:
// - Eager: a check failed in the optimized code and deoptimization happens
// immediately.
// - Unused: replaces "Soft" for ABI compatibility.
// - Lazy: the code has been marked as dependent on some assumption which
// is checked elsewhere and can trigger deoptimization the next time the
// code is executed.
enum class DeoptimizeKind : uint8_t {
kEager,
kUnused,
kLazy,
};
constexpr DeoptimizeKind kFirstDeoptimizeKind = DeoptimizeKind::kEager;
@ -540,6 +542,8 @@ constexpr const char* ToString(DeoptimizeKind kind) {
switch (kind) {
case DeoptimizeKind::kEager:
return "Eager";
case DeoptimizeKind::kUnused:
return "Unused";
case DeoptimizeKind::kLazy:
return "Lazy";
}

View File

@ -460,6 +460,8 @@ const char* Deoptimizer::MessageFor(DeoptimizeKind kind) {
switch (kind) {
case DeoptimizeKind::kEager:
return "deopt-eager";
case DeoptimizeKind::kUnused:
return "deopt-unused";
case DeoptimizeKind::kLazy:
return "deopt-lazy";
}
@ -585,6 +587,8 @@ Builtin Deoptimizer::GetDeoptimizationEntry(DeoptimizeKind kind) {
switch (kind) {
case DeoptimizeKind::kEager:
return Builtin::kDeoptimizationEntry_Eager;
case DeoptimizeKind::kUnused:
return Builtin::kDeoptimizationEntry_Unused;
case DeoptimizeKind::kLazy:
return Builtin::kDeoptimizationEntry_Lazy;
}
@ -599,6 +603,9 @@ bool Deoptimizer::IsDeoptimizationEntry(Isolate* isolate, Address addr,
case Builtin::kDeoptimizationEntry_Eager:
*type_out = DeoptimizeKind::kEager;
return true;
case Builtin::kDeoptimizationEntry_Unused:
*type_out = DeoptimizeKind::kUnused;
return true;
case Builtin::kDeoptimizationEntry_Lazy:
*type_out = DeoptimizeKind::kLazy;
return true;