Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: patch V8 to 6.6.346.31 #20603

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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.6',
'v8_embedder_string': '-node.5',

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 6
#define V8_BUILD_NUMBER 346
#define V8_PATCH_LEVEL 27
#define V8_PATCH_LEVEL 31

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/arm/builtins-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ cmp(bytecode, Operand(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ cmp(bytecode, Operand(0x3));
__ b(hi, &process_bytecode);
__ b(eq, &extra_wide);
__ tst(bytecode, Operand(0x1));
__ b(ne, &extra_wide);

// Load the next bytecode and update table to the wide scaled table.
__ add(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/arm64/builtins-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ Cmp(bytecode, Operand(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ Cmp(bytecode, Operand(0x3));
__ B(hi, &process_bytecode);
__ B(eq, &extra_wide);
__ Tst(bytecode, Operand(0x1));
__ B(ne, &extra_wide);

// Load the next bytecode and update table to the wide scaled table.
__ Add(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/builtins/builtins-promise-gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ TF_BUILTIN(PromiseResolveThenableJob, PromiseBuiltinsAssembler) {
// We need to reject the {thenable}.
Node* const result = CallJS(
CodeFactory::Call(isolate(), ConvertReceiverMode::kNullOrUndefined),
native_context, UndefinedConstant(), var_exception.value());
native_context, reject, UndefinedConstant(), var_exception.value());
Return(result);
}
}
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/ia32/builtins-ia32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ cmpb(bytecode, Immediate(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ cmpb(bytecode, Immediate(0x3));
__ j(above, &process_bytecode, Label::kNear);
__ j(equal, &extra_wide, Label::kNear);
__ test(bytecode, Immediate(0x1));
__ j(not_equal, &extra_wide, Label::kNear);

// Load the next bytecode and update table to the wide scaled table.
__ inc(bytecode_offset);
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/mips/builtins-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,12 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ Branch(&process_bytecode, hi, bytecode, Operand(1));
__ Branch(&extra_wide, eq, bytecode, Operand(1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ Branch(&process_bytecode, hi, bytecode, Operand(3));
__ And(scratch2, bytecode, Operand(1));
__ Branch(&extra_wide, ne, scratch2, Operand(zero_reg));

// Load the next bytecode and update table to the wide scaled table.
__ Addu(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/mips64/builtins-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,12 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ Branch(&process_bytecode, hi, bytecode, Operand(1));
__ Branch(&extra_wide, eq, bytecode, Operand(1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ Branch(&process_bytecode, hi, bytecode, Operand(3));
__ And(scratch2, bytecode, Operand(1));
__ Branch(&extra_wide, ne, scratch2, Operand(zero_reg));

// Load the next bytecode and update table to the wide scaled table.
__ Daddu(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/ppc/builtins-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ cmpi(bytecode, Operand(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ cmpi(bytecode, Operand(0x3));
__ bgt(&process_bytecode);
__ beq(&extra_wide);
__ andi(r0, bytecode, Operand(0x1));
__ bne(&extra_wide, cr0);

// Load the next bytecode and update table to the wide scaled table.
__ addi(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/s390/builtins-s390.cc
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ CmpP(bytecode, Operand(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ CmpP(bytecode, Operand(0x3));
__ bgt(&process_bytecode);
__ beq(&extra_wide);
__ tmll(bytecode, Operand(0x1));
__ bne(&extra_wide);

// Load the next bytecode and update table to the wide scaled table.
__ AddP(bytecode_offset, bytecode_offset, Operand(1));
Expand Down
8 changes: 6 additions & 2 deletions deps/v8/src/builtins/x64/builtins-x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,13 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
Label process_bytecode, extra_wide;
STATIC_ASSERT(0 == static_cast<int>(interpreter::Bytecode::kWide));
STATIC_ASSERT(1 == static_cast<int>(interpreter::Bytecode::kExtraWide));
__ cmpb(bytecode, Immediate(0x1));
STATIC_ASSERT(2 == static_cast<int>(interpreter::Bytecode::kDebugBreakWide));
STATIC_ASSERT(3 ==
static_cast<int>(interpreter::Bytecode::kDebugBreakExtraWide));
__ cmpb(bytecode, Immediate(0x3));
__ j(above, &process_bytecode, Label::kNear);
__ j(equal, &extra_wide, Label::kNear);
__ testb(bytecode, Immediate(0x1));
__ j(not_equal, &extra_wide, Label::kNear);

// Load the next bytecode and update table to the wide scaled table.
__ incl(bytecode_offset);
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/compiler/js-call-reducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5135,6 +5135,7 @@ Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
Node* context = NodeProperties::GetContextInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* frame_state = NodeProperties::GetFrameStateInput(node);

// Check that promises aren't being observed through (debug) hooks.
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
Expand Down Expand Up @@ -5193,9 +5194,9 @@ Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
graph()->NewNode(javascript()->CreatePromise(), context, effect);

// Chain {result} onto {receiver}.
result = effect = graph()->NewNode(javascript()->PerformPromiseThen(),
receiver, on_fulfilled, on_rejected,
result, context, effect, control);
result = effect = graph()->NewNode(
javascript()->PerformPromiseThen(), receiver, on_fulfilled, on_rejected,
result, context, frame_state, effect, control);
ReplaceWithValue(node, result, effect, control);
return Replace(result);
}
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/compiler/operator-properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
case IrOpcode::kJSPromiseResolve:
case IrOpcode::kJSRejectPromise:
case IrOpcode::kJSResolvePromise:
case IrOpcode::kJSPerformPromiseThen:
return true;

default:
Expand Down
34 changes: 17 additions & 17 deletions deps/v8/src/interpreter/bytecodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ namespace interpreter {
V(Wide, AccumulatorUse::kNone) \
V(ExtraWide, AccumulatorUse::kNone) \
\
/* Debug Breakpoints - one for each possible size of unscaled bytecodes */ \
/* and one for each operand widening prefix bytecode */ \
V(DebugBreakWide, AccumulatorUse::kReadWrite) \
V(DebugBreakExtraWide, AccumulatorUse::kReadWrite) \
V(DebugBreak0, AccumulatorUse::kReadWrite) \
V(DebugBreak1, AccumulatorUse::kReadWrite, OperandType::kReg) \
V(DebugBreak2, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg) \
V(DebugBreak3, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg, OperandType::kReg) \
V(DebugBreak4, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg, OperandType::kReg, OperandType::kReg) \
V(DebugBreak5, AccumulatorUse::kReadWrite, OperandType::kRuntimeId, \
OperandType::kReg, OperandType::kReg) \
V(DebugBreak6, AccumulatorUse::kReadWrite, OperandType::kRuntimeId, \
OperandType::kReg, OperandType::kReg, OperandType::kReg) \
\
/* Loading the accumulator */ \
V(LdaZero, AccumulatorUse::kWrite) \
V(LdaSmi, AccumulatorUse::kWrite, OperandType::kImm) \
Expand Down Expand Up @@ -325,23 +342,6 @@ namespace interpreter {
/* Debugger */ \
V(Debugger, AccumulatorUse::kNone) \
\
/* Debug Breakpoints - one for each possible size of unscaled bytecodes */ \
/* and one for each operand widening prefix bytecode */ \
V(DebugBreak0, AccumulatorUse::kReadWrite) \
V(DebugBreak1, AccumulatorUse::kReadWrite, OperandType::kReg) \
V(DebugBreak2, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg) \
V(DebugBreak3, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg, OperandType::kReg) \
V(DebugBreak4, AccumulatorUse::kReadWrite, OperandType::kReg, \
OperandType::kReg, OperandType::kReg, OperandType::kReg) \
V(DebugBreak5, AccumulatorUse::kReadWrite, OperandType::kRuntimeId, \
OperandType::kReg, OperandType::kReg) \
V(DebugBreak6, AccumulatorUse::kReadWrite, OperandType::kRuntimeId, \
OperandType::kReg, OperandType::kReg, OperandType::kReg) \
V(DebugBreakWide, AccumulatorUse::kReadWrite) \
V(DebugBreakExtraWide, AccumulatorUse::kReadWrite) \
\
/* Block Coverage */ \
V(IncBlockCounter, AccumulatorUse::kNone, OperandType::kIdx) \
\
Expand Down
29 changes: 29 additions & 0 deletions deps/v8/test/cctest/test-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17613,6 +17613,35 @@ TEST(PromiseRejectCallback) {
CHECK_EQ(7, promise_reject_msg_column_number);
}

void PromiseRejectCallbackConstructError(
v8::PromiseRejectMessage reject_message) {
v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
CHECK_EQ(v8::Promise::PromiseState::kRejected,
reject_message.GetPromise()->State());
USE(v8::Script::Compile(context, v8_str("new Error('test')"))
.ToLocalChecked()
->Run(context));
}

TEST(PromiseRejectCallbackConstructError) {
i::FLAG_allow_natives_syntax = true;
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope scope(isolate);

isolate->SetPromiseRejectCallback(PromiseRejectCallbackConstructError);

ResetPromiseStates();
CompileRun(
"function f(p) {"
" p.catch(() => {});"
"}"
"f(Promise.reject());"
"f(Promise.reject());"
"%OptimizeFunctionOnNextCall(f);"
"let p = Promise.reject();"
"f(p);");
}

void AnalyzeStackOfEvalWithSourceURL(
const v8::FunctionCallbackInfo<v8::Value>& args) {
Expand Down
Loading