Commit ec5aaba2 authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[maglev] Support Create[Block/Catch/With]Context

Bug: v8:7700
Change-Id: I51f3da86cb71ec5980c799a77ce280d83ca42cd7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3793387
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82062}
parent 2e4c9526
......@@ -1794,8 +1794,29 @@ void MaglevGraphBuilder::VisitCreateClosure() {
}
}
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateBlockContext)
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateCatchContext)
void MaglevGraphBuilder::VisitCreateBlockContext() {
// TODO(v8:7700): Inline allocation when context is small.
// CreateBlockContext <scope_info_idx>
ValueNode* scope_info = GetConstant(GetRefOperand<ScopeInfo>(0));
CallRuntime* call_runtime =
CreateNewNode<CallRuntime>(1 + CallRuntime::kFixedInputCount,
Runtime::kPushBlockContext, GetContext());
call_runtime->set_arg(0, scope_info);
SetAccumulator(AddNode(call_runtime));
}
void MaglevGraphBuilder::VisitCreateCatchContext() {
// TODO(v8:7700): Inline allocation when context is small.
// CreateCatchContext <exception> <scope_info_idx>
ValueNode* exception = LoadRegisterTagged(0);
ValueNode* scope_info = GetConstant(GetRefOperand<ScopeInfo>(1));
CallRuntime* call_runtime =
CreateNewNode<CallRuntime>(2 + CallRuntime::kFixedInputCount,
Runtime::kPushCatchContext, GetContext());
call_runtime->set_arg(0, exception);
call_runtime->set_arg(1, scope_info);
SetAccumulator(AddNode(call_runtime));
}
void MaglevGraphBuilder::VisitCreateFunctionContext() {
compiler::ScopeInfoRef info = GetRefOperand<ScopeInfo>(0);
......@@ -1805,7 +1826,20 @@ void MaglevGraphBuilder::VisitCreateFunctionContext() {
}
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateEvalContext)
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateWithContext)
void MaglevGraphBuilder::VisitCreateWithContext() {
// TODO(v8:7700): Inline allocation when context is small.
// CreateWithContext <register> <scope_info_idx>
ValueNode* object = LoadRegisterTagged(0);
ValueNode* scope_info = GetConstant(GetRefOperand<ScopeInfo>(1));
CallRuntime* call_runtime =
CreateNewNode<CallRuntime>(2 + CallRuntime::kFixedInputCount,
Runtime::kPushWithContext, GetContext());
call_runtime->set_arg(0, object);
call_runtime->set_arg(1, scope_info);
SetAccumulator(AddNode(call_runtime));
}
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateMappedArguments)
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateUnmappedArguments)
MAGLEV_UNIMPLEMENTED_BYTECODE(CreateRestParameter)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment