[Interpreter] Add SetPendingMessage bytecode.
Adds a bytecode to set and retrieve the pending message. This avoids a runtime call in finally blocks, and also ensures that TurboFan builds a graph using the SetMessage / LoadMessage nodes instead of inserting a runtime call. BUG=chromium:662334 Review-Url: https://codereview.chromium.org/2501503005 Cr-Commit-Position: refs/heads/master@{#41023}
This commit is contained in:
parent
c2db3b3898
commit
fe9ac966cc
@ -1729,6 +1729,12 @@ void BytecodeGraphBuilder::VisitStackCheck() {
|
||||
environment()->RecordAfterState(node, Environment::kAttachFrameState);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitSetPendingMessage() {
|
||||
Node* previous_message = NewNode(javascript()->LoadMessage());
|
||||
NewNode(javascript()->StoreMessage(), environment()->LookupAccumulator());
|
||||
environment()->BindAccumulator(previous_message);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitReturn() {
|
||||
BuildLoopExitsForFunctionExit();
|
||||
Node* pop_node = jsgraph()->ZeroConstant();
|
||||
|
@ -742,6 +742,11 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck(int position) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
BytecodeArrayBuilder& BytecodeArrayBuilder::SetPendingMessage() {
|
||||
OutputSetPendingMessage();
|
||||
return *this;
|
||||
}
|
||||
|
||||
BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() {
|
||||
OutputThrow();
|
||||
return *this;
|
||||
|
@ -272,6 +272,10 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final
|
||||
|
||||
BytecodeArrayBuilder& StackCheck(int position);
|
||||
|
||||
// Sets the pending message to the value in the accumulator, and returns the
|
||||
// previous pending message in the accumulator.
|
||||
BytecodeArrayBuilder& SetPendingMessage();
|
||||
|
||||
BytecodeArrayBuilder& Throw();
|
||||
BytecodeArrayBuilder& ReThrow();
|
||||
BytecodeArrayBuilder& Return();
|
||||
|
@ -1300,7 +1300,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
|
||||
|
||||
// If requested, clear message object as we enter the catch block.
|
||||
if (stmt->clear_pending_message()) {
|
||||
builder()->CallRuntime(Runtime::kInterpreterClearPendingMessage);
|
||||
builder()->LoadTheHole().SetPendingMessage();
|
||||
}
|
||||
|
||||
// Load the catch context into the accumulator.
|
||||
@ -1359,16 +1359,15 @@ void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
|
||||
Register message = context; // Reuse register.
|
||||
|
||||
// Clear message object as we enter the finally block.
|
||||
builder()
|
||||
->CallRuntime(Runtime::kInterpreterClearPendingMessage)
|
||||
.StoreAccumulatorInRegister(message);
|
||||
builder()->LoadTheHole().SetPendingMessage().StoreAccumulatorInRegister(
|
||||
message);
|
||||
|
||||
// Evaluate the finally-block.
|
||||
Visit(stmt->finally_block());
|
||||
try_control_builder.EndFinally();
|
||||
|
||||
// Pending message object is restored on exit.
|
||||
builder()->CallRuntime(Runtime::kInterpreterSetPendingMessage, message);
|
||||
builder()->LoadAccumulatorWithRegister(message).SetPendingMessage();
|
||||
|
||||
// Dynamic dispatch after the finally-block.
|
||||
commands.ApplyDeferredCommands();
|
||||
|
@ -241,6 +241,9 @@ namespace interpreter {
|
||||
/* Perform a stack guard check */ \
|
||||
V(StackCheck, AccumulatorUse::kNone) \
|
||||
\
|
||||
/* Update the pending message */ \
|
||||
V(SetPendingMessage, AccumulatorUse::kReadWrite) \
|
||||
\
|
||||
/* Non-local flow control */ \
|
||||
V(Throw, AccumulatorUse::kRead) \
|
||||
V(ReThrow, AccumulatorUse::kRead) \
|
||||
|
@ -2371,6 +2371,22 @@ void Interpreter::DoStackCheck(InterpreterAssembler* assembler) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetPendingMessage
|
||||
//
|
||||
// Sets the pending message to the value in the accumulator, and returns the
|
||||
// previous pending message in the accumulator.
|
||||
void Interpreter::DoSetPendingMessage(InterpreterAssembler* assembler) {
|
||||
Node* pending_message = __ ExternalConstant(
|
||||
ExternalReference::address_of_pending_message_obj(isolate_));
|
||||
Node* previous_message =
|
||||
__ Load(MachineType::TaggedPointer(), pending_message);
|
||||
Node* new_message = __ GetAccumulator();
|
||||
__ StoreNoWriteBarrier(MachineRepresentation::kTaggedPointer, pending_message,
|
||||
new_message);
|
||||
__ SetAccumulator(previous_message);
|
||||
__ Dispatch();
|
||||
}
|
||||
|
||||
// Throw
|
||||
//
|
||||
// Throws the exception in the accumulator.
|
||||
|
@ -155,22 +155,6 @@ RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) {
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_InterpreterClearPendingMessage) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(0, args.length());
|
||||
Object* message = isolate->thread_local_top()->pending_message_obj_;
|
||||
isolate->clear_pending_message();
|
||||
return message;
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, message, 0);
|
||||
isolate->thread_local_top()->pending_message_obj_ = *message;
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
|
@ -213,8 +213,6 @@ namespace internal {
|
||||
F(InterpreterNewClosure, 2, 1) \
|
||||
F(InterpreterTraceBytecodeEntry, 3, 1) \
|
||||
F(InterpreterTraceBytecodeExit, 3, 1) \
|
||||
F(InterpreterClearPendingMessage, 0, 1) \
|
||||
F(InterpreterSetPendingMessage, 1, 1) \
|
||||
F(InterpreterAdvanceBytecodeOffset, 2, 1)
|
||||
|
||||
#define FOR_EACH_INTRINSIC_FUNCTION(F) \
|
||||
|
@ -11,7 +11,7 @@ snippet: "
|
||||
"
|
||||
frame size: 15
|
||||
parameter count: 1
|
||||
bytecode array length: 282
|
||||
bytecode array length: 274
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
B(LdaZero),
|
||||
@ -66,23 +66,24 @@ bytecodes: [
|
||||
B(Star), R(10),
|
||||
B(LdaZero),
|
||||
B(Star), R(9),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(11),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(4), U8(15),
|
||||
B(JumpIfTrue), U8(122),
|
||||
B(JumpIfTrue), U8(119),
|
||||
B(LdaUndefined),
|
||||
B(TestEqualStrict), R(2), U8(16),
|
||||
B(JumpIfTrue), U8(116),
|
||||
B(JumpIfTrue), U8(113),
|
||||
B(LdaNamedProperty), R(2), U8(7), U8(17),
|
||||
B(Star), R(6),
|
||||
B(LdaNull),
|
||||
B(TestEqual), R(6), U8(19),
|
||||
B(JumpIfFalse), U8(4),
|
||||
B(Jump), U8(102),
|
||||
B(Jump), U8(99),
|
||||
B(LdaSmi), U8(1),
|
||||
B(TestEqualStrict), R(4), U8(20),
|
||||
B(JumpIfFalse), U8(70),
|
||||
B(JumpIfFalse), U8(67),
|
||||
B(Ldar), R(6),
|
||||
B(TypeOf),
|
||||
B(Star), R(12),
|
||||
@ -100,12 +101,13 @@ bytecodes: [
|
||||
B(Mov), R(6), R(13),
|
||||
B(Mov), R(2), R(14),
|
||||
B(InvokeIntrinsic), U8(Runtime::k_Call), R(13), U8(2),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(13),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(13), U8(5), U8(10),
|
||||
B(Star), R(12),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(12),
|
||||
B(PushContext), R(8),
|
||||
B(PopContext), R(8),
|
||||
@ -118,7 +120,8 @@ bytecodes: [
|
||||
B(JumpIfToBooleanFalse), U8(4),
|
||||
B(Jump), U8(7),
|
||||
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(11), U8(1),
|
||||
B(Ldar), R(11),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(9), U8(0),
|
||||
B(JumpIfTrue), U8(4),
|
||||
@ -144,7 +147,7 @@ constant pool: [
|
||||
handlers: [
|
||||
[7, 120, 126],
|
||||
[10, 84, 86],
|
||||
[204, 214, 216],
|
||||
[201, 211, 213],
|
||||
]
|
||||
|
||||
---
|
||||
@ -154,7 +157,7 @@ snippet: "
|
||||
"
|
||||
frame size: 16
|
||||
parameter count: 1
|
||||
bytecode array length: 293
|
||||
bytecode array length: 285
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
/* 42 S> */ B(LdaConstant), U8(0),
|
||||
@ -210,23 +213,24 @@ bytecodes: [
|
||||
B(Star), R(11),
|
||||
B(LdaSmi), U8(1),
|
||||
B(Star), R(10),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(12),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(5), U8(15),
|
||||
B(JumpIfTrue), U8(122),
|
||||
B(JumpIfTrue), U8(119),
|
||||
B(LdaUndefined),
|
||||
B(TestEqualStrict), R(3), U8(16),
|
||||
B(JumpIfTrue), U8(116),
|
||||
B(JumpIfTrue), U8(113),
|
||||
B(LdaNamedProperty), R(3), U8(7), U8(17),
|
||||
B(Star), R(7),
|
||||
B(LdaNull),
|
||||
B(TestEqual), R(7), U8(19),
|
||||
B(JumpIfFalse), U8(4),
|
||||
B(Jump), U8(102),
|
||||
B(Jump), U8(99),
|
||||
B(LdaSmi), U8(1),
|
||||
B(TestEqualStrict), R(5), U8(20),
|
||||
B(JumpIfFalse), U8(70),
|
||||
B(JumpIfFalse), U8(67),
|
||||
B(Ldar), R(7),
|
||||
B(TypeOf),
|
||||
B(Star), R(13),
|
||||
@ -244,12 +248,13 @@ bytecodes: [
|
||||
B(Mov), R(7), R(14),
|
||||
B(Mov), R(3), R(15),
|
||||
B(InvokeIntrinsic), U8(Runtime::k_Call), R(14), U8(2),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(14),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(14), U8(5), U8(10),
|
||||
B(Star), R(13),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(13),
|
||||
B(PushContext), R(9),
|
||||
B(PopContext), R(9),
|
||||
@ -262,7 +267,8 @@ bytecodes: [
|
||||
B(JumpIfToBooleanFalse), U8(4),
|
||||
B(Jump), U8(7),
|
||||
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(12), U8(1),
|
||||
B(Ldar), R(12),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(10), U8(0),
|
||||
B(JumpIfTrue), U8(11),
|
||||
@ -293,7 +299,7 @@ constant pool: [
|
||||
handlers: [
|
||||
[11, 120, 126],
|
||||
[14, 84, 86],
|
||||
[205, 215, 217],
|
||||
[202, 212, 214],
|
||||
]
|
||||
|
||||
---
|
||||
@ -305,7 +311,7 @@ snippet: "
|
||||
"
|
||||
frame size: 15
|
||||
parameter count: 1
|
||||
bytecode array length: 300
|
||||
bytecode array length: 292
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
B(LdaZero),
|
||||
@ -368,23 +374,24 @@ bytecodes: [
|
||||
B(Star), R(10),
|
||||
B(LdaZero),
|
||||
B(Star), R(9),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(11),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(4), U8(17),
|
||||
B(JumpIfTrue), U8(122),
|
||||
B(JumpIfTrue), U8(119),
|
||||
B(LdaUndefined),
|
||||
B(TestEqualStrict), R(2), U8(18),
|
||||
B(JumpIfTrue), U8(116),
|
||||
B(JumpIfTrue), U8(113),
|
||||
B(LdaNamedProperty), R(2), U8(7), U8(19),
|
||||
B(Star), R(6),
|
||||
B(LdaNull),
|
||||
B(TestEqual), R(6), U8(21),
|
||||
B(JumpIfFalse), U8(4),
|
||||
B(Jump), U8(102),
|
||||
B(Jump), U8(99),
|
||||
B(LdaSmi), U8(1),
|
||||
B(TestEqualStrict), R(4), U8(22),
|
||||
B(JumpIfFalse), U8(70),
|
||||
B(JumpIfFalse), U8(67),
|
||||
B(Ldar), R(6),
|
||||
B(TypeOf),
|
||||
B(Star), R(12),
|
||||
@ -402,12 +409,13 @@ bytecodes: [
|
||||
B(Mov), R(6), R(13),
|
||||
B(Mov), R(2), R(14),
|
||||
B(InvokeIntrinsic), U8(Runtime::k_Call), R(13), U8(2),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(13),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(13), U8(5), U8(10),
|
||||
B(Star), R(12),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(12),
|
||||
B(PushContext), R(8),
|
||||
B(PopContext), R(8),
|
||||
@ -420,7 +428,8 @@ bytecodes: [
|
||||
B(JumpIfToBooleanFalse), U8(4),
|
||||
B(Jump), U8(7),
|
||||
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(7), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(11), U8(1),
|
||||
B(Ldar), R(11),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(9), U8(0),
|
||||
B(JumpIfTrue), U8(4),
|
||||
@ -446,7 +455,7 @@ constant pool: [
|
||||
handlers: [
|
||||
[7, 138, 144],
|
||||
[10, 102, 104],
|
||||
[222, 232, 234],
|
||||
[219, 229, 231],
|
||||
]
|
||||
|
||||
---
|
||||
@ -456,7 +465,7 @@ snippet: "
|
||||
"
|
||||
frame size: 14
|
||||
parameter count: 1
|
||||
bytecode array length: 307
|
||||
bytecode array length: 299
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(8),
|
||||
@ -516,23 +525,24 @@ bytecodes: [
|
||||
B(Star), R(9),
|
||||
B(LdaSmi), U8(1),
|
||||
B(Star), R(8),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(10),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(3), U8(19),
|
||||
B(JumpIfTrue), U8(122),
|
||||
B(JumpIfTrue), U8(119),
|
||||
B(LdaUndefined),
|
||||
B(TestEqualStrict), R(1), U8(20),
|
||||
B(JumpIfTrue), U8(116),
|
||||
B(JumpIfTrue), U8(113),
|
||||
B(LdaNamedProperty), R(1), U8(9), U8(21),
|
||||
B(Star), R(5),
|
||||
B(LdaNull),
|
||||
B(TestEqual), R(5), U8(23),
|
||||
B(JumpIfFalse), U8(4),
|
||||
B(Jump), U8(102),
|
||||
B(Jump), U8(99),
|
||||
B(LdaSmi), U8(1),
|
||||
B(TestEqualStrict), R(3), U8(24),
|
||||
B(JumpIfFalse), U8(70),
|
||||
B(JumpIfFalse), U8(67),
|
||||
B(Ldar), R(5),
|
||||
B(TypeOf),
|
||||
B(Star), R(11),
|
||||
@ -550,12 +560,13 @@ bytecodes: [
|
||||
B(Mov), R(5), R(12),
|
||||
B(Mov), R(1), R(13),
|
||||
B(InvokeIntrinsic), U8(Runtime::k_Call), R(12), U8(2),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(12),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(12), U8(7), U8(12),
|
||||
B(Star), R(11),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(11),
|
||||
B(PushContext), R(7),
|
||||
B(PopContext), R(7),
|
||||
@ -568,7 +579,8 @@ bytecodes: [
|
||||
B(JumpIfToBooleanFalse), U8(4),
|
||||
B(Jump), U8(7),
|
||||
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(6), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(10), U8(1),
|
||||
B(Ldar), R(10),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(8), U8(0),
|
||||
B(JumpIfTrue), U8(11),
|
||||
@ -601,6 +613,6 @@ constant pool: [
|
||||
handlers: [
|
||||
[15, 134, 140],
|
||||
[18, 98, 100],
|
||||
[219, 229, 231],
|
||||
[216, 226, 228],
|
||||
]
|
||||
|
||||
|
@ -13,7 +13,7 @@ snippet: "
|
||||
"
|
||||
frame size: 11
|
||||
parameter count: 1
|
||||
bytecode array length: 204
|
||||
bytecode array length: 199
|
||||
bytecodes: [
|
||||
B(Ldar), R(new_target),
|
||||
B(JumpIfUndefined), U8(21),
|
||||
@ -83,12 +83,14 @@ bytecodes: [
|
||||
B(Star), R(3),
|
||||
B(LdaSmi), U8(2),
|
||||
B(Star), R(2),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(4),
|
||||
B(LdaCurrentContextSlot), U8(5),
|
||||
B(Star), R(5),
|
||||
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(5), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(4), U8(1),
|
||||
B(Ldar), R(4),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(2), U8(0),
|
||||
B(JumpIfTrue), U8(18),
|
||||
@ -121,7 +123,7 @@ snippet: "
|
||||
"
|
||||
frame size: 11
|
||||
parameter count: 1
|
||||
bytecode array length: 301
|
||||
bytecode array length: 296
|
||||
bytecodes: [
|
||||
B(Ldar), R(new_target),
|
||||
B(JumpIfUndefined), U8(28),
|
||||
@ -229,12 +231,14 @@ bytecodes: [
|
||||
B(Star), R(3),
|
||||
B(LdaSmi), U8(3),
|
||||
B(Star), R(2),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(4),
|
||||
B(LdaCurrentContextSlot), U8(5),
|
||||
B(Star), R(5),
|
||||
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(5), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(4), U8(1),
|
||||
B(Ldar), R(4),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(2), U8(0),
|
||||
B(JumpIfTrue), U8(25),
|
||||
@ -273,7 +277,7 @@ snippet: "
|
||||
"
|
||||
frame size: 18
|
||||
parameter count: 1
|
||||
bytecode array length: 796
|
||||
bytecode array length: 783
|
||||
bytecodes: [
|
||||
B(Ldar), R(new_target),
|
||||
B(JumpIfUndefined), U8(28),
|
||||
@ -457,7 +461,8 @@ bytecodes: [
|
||||
B(Star), R(9),
|
||||
B(LdaSmi), U8(1),
|
||||
B(Star), R(8),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(10),
|
||||
B(LdaContextSlot), R(1), U8(9), U8(0),
|
||||
B(Star), R(11),
|
||||
@ -483,7 +488,7 @@ bytecodes: [
|
||||
B(Star), R(11),
|
||||
B(LdaSmi), U8(1),
|
||||
B(TestEqualStrict), R(11), U8(20),
|
||||
B(JumpIfFalse), U8(78),
|
||||
B(JumpIfFalse), U8(75),
|
||||
B(LdaContextSlot), R(1), U8(11), U8(0),
|
||||
B(TypeOf),
|
||||
B(Star), R(11),
|
||||
@ -503,12 +508,13 @@ bytecodes: [
|
||||
B(LdaContextSlot), R(1), U8(7), U8(0),
|
||||
B(Star), R(13),
|
||||
B(InvokeIntrinsic), U8(Runtime::k_Call), R(12), U8(2),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(12),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(12), U8(10), U8(15),
|
||||
B(Star), R(11),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(11),
|
||||
B(PushContext), R(2),
|
||||
B(PopContext), R(2),
|
||||
@ -527,7 +533,8 @@ bytecodes: [
|
||||
B(LdaContextSlot), R(1), U8(12), U8(0),
|
||||
B(Star), R(11),
|
||||
B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(10), U8(1),
|
||||
B(Ldar), R(10),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(8), U8(0),
|
||||
B(JumpIfTrue), U8(11),
|
||||
@ -563,12 +570,14 @@ bytecodes: [
|
||||
B(Star), R(6),
|
||||
B(LdaSmi), U8(4),
|
||||
B(Star), R(5),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Star), R(7),
|
||||
B(LdaCurrentContextSlot), U8(5),
|
||||
B(Star), R(8),
|
||||
B(CallRuntime), U16(Runtime::k_GeneratorClose), R(8), U8(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(7), U8(1),
|
||||
B(Ldar), R(7),
|
||||
B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(5), U8(0),
|
||||
B(JumpIfTrue), U8(32),
|
||||
@ -615,15 +624,15 @@ constant pool: [
|
||||
ONE_BYTE_INTERNALIZED_STRING_TYPE ["function"],
|
||||
ONE_BYTE_INTERNALIZED_STRING_TYPE [""],
|
||||
FIXED_ARRAY_TYPE,
|
||||
Smi [136],
|
||||
Smi [176],
|
||||
Smi [164],
|
||||
Smi [601],
|
||||
Smi [133],
|
||||
Smi [173],
|
||||
Smi [161],
|
||||
Smi [593],
|
||||
]
|
||||
handlers: [
|
||||
[46, 710, 716],
|
||||
[46, 702, 708],
|
||||
[143, 438, 444],
|
||||
[146, 394, 396],
|
||||
[557, 573, 575],
|
||||
[554, 570, 572],
|
||||
]
|
||||
|
||||
|
@ -11,18 +11,19 @@ snippet: "
|
||||
"
|
||||
frame size: 3
|
||||
parameter count: 1
|
||||
bytecode array length: 35
|
||||
bytecode array length: 32
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
B(Mov), R(context), R(1),
|
||||
/* 40 S> */ B(LdaSmi), U8(1),
|
||||
/* 75 S> */ B(Return),
|
||||
B(Jump), U8(26),
|
||||
B(Jump), U8(23),
|
||||
B(Star), R(2),
|
||||
B(Ldar), R(closure),
|
||||
B(CreateCatchContext), R(2), U8(0), U8(1),
|
||||
B(Star), R(1),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(1),
|
||||
B(PushContext), R(0),
|
||||
/* 63 S> */ B(LdaSmi), U8(2),
|
||||
@ -47,30 +48,32 @@ snippet: "
|
||||
"
|
||||
frame size: 4
|
||||
parameter count: 1
|
||||
bytecode array length: 67
|
||||
bytecode array length: 61
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
B(Mov), R(context), R(2),
|
||||
/* 47 S> */ B(LdaSmi), U8(1),
|
||||
B(Star), R(0),
|
||||
B(Jump), U8(23),
|
||||
B(Jump), U8(20),
|
||||
B(Star), R(3),
|
||||
B(Ldar), R(closure),
|
||||
/* 49 E> */ B(CreateCatchContext), R(3), U8(0), U8(1),
|
||||
B(Star), R(2),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(2),
|
||||
B(PushContext), R(1),
|
||||
B(PopContext), R(1),
|
||||
B(Mov), R(context), R(2),
|
||||
/* 75 S> */ B(LdaSmi), U8(2),
|
||||
B(Star), R(0),
|
||||
B(Jump), U8(27),
|
||||
B(Jump), U8(24),
|
||||
B(Star), R(3),
|
||||
B(Ldar), R(closure),
|
||||
/* 77 E> */ B(CreateCatchContext), R(3), U8(2), U8(3),
|
||||
B(Star), R(2),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(2),
|
||||
B(PushContext), R(1),
|
||||
/* 95 S> */ B(LdaSmi), U8(3),
|
||||
@ -87,6 +90,6 @@ constant pool: [
|
||||
]
|
||||
handlers: [
|
||||
[4, 8, 10],
|
||||
[34, 38, 40],
|
||||
[31, 35, 37],
|
||||
]
|
||||
|
||||
|
@ -12,7 +12,7 @@ snippet: "
|
||||
"
|
||||
frame size: 4
|
||||
parameter count: 1
|
||||
bytecode array length: 52
|
||||
bytecode array length: 47
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
/* 42 S> */ B(LdaSmi), U8(1),
|
||||
@ -26,11 +26,13 @@ bytecodes: [
|
||||
B(Star), R(2),
|
||||
B(LdaZero),
|
||||
B(Star), R(1),
|
||||
/* 53 E> */ B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
/* 53 E> */ B(SetPendingMessage),
|
||||
B(Star), R(3),
|
||||
/* 70 S> */ B(LdaSmi), U8(3),
|
||||
B(Star), R(0),
|
||||
/* 72 E> */ B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(3), U8(1),
|
||||
B(Ldar), R(3),
|
||||
/* 72 E> */ B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(1), U8(0),
|
||||
B(JumpIfTrue), U8(4),
|
||||
@ -53,7 +55,7 @@ snippet: "
|
||||
"
|
||||
frame size: 7
|
||||
parameter count: 1
|
||||
bytecode array length: 82
|
||||
bytecode array length: 74
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
/* 42 S> */ B(LdaSmi), U8(1),
|
||||
@ -62,12 +64,13 @@ bytecodes: [
|
||||
B(Mov), R(context), R(5),
|
||||
/* 51 S> */ B(LdaSmi), U8(2),
|
||||
B(Star), R(0),
|
||||
B(Jump), U8(27),
|
||||
B(Jump), U8(24),
|
||||
B(Star), R(6),
|
||||
B(Ldar), R(closure),
|
||||
/* 53 E> */ B(CreateCatchContext), R(6), U8(0), U8(1),
|
||||
B(Star), R(5),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(5),
|
||||
B(PushContext), R(1),
|
||||
/* 71 S> */ B(LdaSmi), U8(20),
|
||||
@ -79,11 +82,13 @@ bytecodes: [
|
||||
B(Star), R(3),
|
||||
B(LdaZero),
|
||||
B(Star), R(2),
|
||||
/* 73 E> */ B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
/* 73 E> */ B(SetPendingMessage),
|
||||
B(Star), R(4),
|
||||
/* 90 S> */ B(LdaSmi), U8(3),
|
||||
B(Star), R(0),
|
||||
/* 92 E> */ B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(4), U8(1),
|
||||
B(Ldar), R(4),
|
||||
/* 92 E> */ B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(2), U8(0),
|
||||
B(JumpIfTrue), U8(4),
|
||||
@ -98,7 +103,7 @@ constant pool: [
|
||||
FIXED_ARRAY_TYPE,
|
||||
]
|
||||
handlers: [
|
||||
[8, 42, 48],
|
||||
[8, 39, 45],
|
||||
[11, 15, 17],
|
||||
]
|
||||
|
||||
@ -110,7 +115,7 @@ snippet: "
|
||||
"
|
||||
frame size: 8
|
||||
parameter count: 1
|
||||
bytecode array length: 108
|
||||
bytecode array length: 97
|
||||
bytecodes: [
|
||||
/* 30 E> */ B(StackCheck),
|
||||
B(Mov), R(context), R(4),
|
||||
@ -118,23 +123,25 @@ bytecodes: [
|
||||
B(Mov), R(context), R(6),
|
||||
/* 55 S> */ B(LdaSmi), U8(1),
|
||||
B(Star), R(0),
|
||||
B(Jump), U8(27),
|
||||
B(Jump), U8(24),
|
||||
B(Star), R(7),
|
||||
B(Ldar), R(closure),
|
||||
/* 57 E> */ B(CreateCatchContext), R(7), U8(0), U8(1),
|
||||
B(Star), R(6),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(6),
|
||||
B(PushContext), R(1),
|
||||
/* 74 S> */ B(LdaSmi), U8(2),
|
||||
B(Star), R(0),
|
||||
B(PopContext), R(1),
|
||||
B(Jump), U8(27),
|
||||
B(Jump), U8(24),
|
||||
B(Star), R(6),
|
||||
B(Ldar), R(closure),
|
||||
/* 76 E> */ B(CreateCatchContext), R(6), U8(0), U8(2),
|
||||
B(Star), R(5),
|
||||
B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
B(SetPendingMessage),
|
||||
B(Ldar), R(5),
|
||||
B(PushContext), R(1),
|
||||
/* 95 S> */ B(LdaSmi), U8(20),
|
||||
@ -146,11 +153,13 @@ bytecodes: [
|
||||
B(Star), R(3),
|
||||
B(LdaZero),
|
||||
B(Star), R(2),
|
||||
/* 97 E> */ B(CallRuntime), U16(Runtime::kInterpreterClearPendingMessage), R(0), U8(0),
|
||||
B(LdaTheHole),
|
||||
/* 97 E> */ B(SetPendingMessage),
|
||||
B(Star), R(4),
|
||||
/* 114 S> */ B(LdaSmi), U8(3),
|
||||
B(Star), R(0),
|
||||
/* 116 E> */ B(CallRuntime), U16(Runtime::kInterpreterSetPendingMessage), R(4), U8(1),
|
||||
B(Ldar), R(4),
|
||||
/* 116 E> */ B(SetPendingMessage),
|
||||
B(LdaZero),
|
||||
B(TestEqualStrict), R(2), U8(0),
|
||||
B(JumpIfTrue), U8(4),
|
||||
@ -166,8 +175,8 @@ constant pool: [
|
||||
FIXED_ARRAY_TYPE,
|
||||
]
|
||||
handlers: [
|
||||
[4, 68, 74],
|
||||
[7, 41, 43],
|
||||
[4, 62, 68],
|
||||
[7, 38, 40],
|
||||
[10, 14, 16],
|
||||
]
|
||||
|
||||
|
@ -258,6 +258,9 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
.Bind(&after_jump2);
|
||||
}
|
||||
|
||||
// Emit set pending message bytecode.
|
||||
builder.SetPendingMessage();
|
||||
|
||||
// Emit stack check bytecode.
|
||||
builder.StackCheck(0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user