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

[v14.x] deps: backport v8 367b0c1e #42637

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
deps: V8: cherry-pick 367b0c1e7a32
Original commit message:

    [runtime] Change default scope info for SyntheticFunctionContexts

    This changes the default scope info for SyntheticFunctionContexts
    to the EmptyScopeInfo which does not contain an extension slot.

    The bug happened because, previously, the native context scope info
    was used as dummy.

    Change-Id: I4d6bf6918c11c79201d16bde99ed76800ad6f6c5
    Bug: v8:10629
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2277806
    Commit-Queue: Victor Gomes <victorgomes@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Auto-Submit: Victor Gomes <victorgomes@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#68636}

Refs: v8/v8@367b0c1
  • Loading branch information
legendecas committed Apr 7, 2022
commit ec04c37edf658d74b7470c64854c6ea733a65858
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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.85',
'v8_embedder_string': '-node.86',

##### V8 defaults for Node.js #####

Expand Down
3 changes: 1 addition & 2 deletions deps/v8/src/codegen/code-stub-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13088,8 +13088,7 @@ void CodeStubAssembler::InitializeSyntheticFunctionContext(
SmiConstant(slots));

TNode<Context> context = CAST(context_heap_object);
const TNode<Object> empty_scope_info =
LoadContextElement(native_context, Context::SCOPE_INFO_INDEX);
const TNode<Object> empty_scope_info = LoadRoot(RootIndex::kEmptyScopeInfo);
StoreContextElementNoWriteBarrier(context, Context::SCOPE_INFO_INDEX,
empty_scope_info);
StoreContextElementNoWriteBarrier(context, Context::PREVIOUS_INDEX,
Expand Down
7 changes: 4 additions & 3 deletions deps/v8/test/cctest/test-code-stub-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,7 @@ TEST(CreatePromiseResolvingFunctionsContext) {
ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
CHECK(result->IsContext());
Handle<Context> context_js = Handle<Context>::cast(result);
CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info());
CHECK_EQ(isolate->root(RootIndex::kEmptyScopeInfo), context_js->scope_info());
CHECK_EQ(*isolate->native_context(), context_js->native_context());
CHECK(context_js->get(PromiseBuiltins::kPromiseSlot).IsJSPromise());
CHECK_EQ(ReadOnlyRoots(isolate).false_value(),
Expand Down Expand Up @@ -2724,7 +2724,7 @@ TEST(CreatePromiseGetCapabilitiesExecutorContext) {
CHECK(result_obj->IsContext());
Handle<Context> context_js = Handle<Context>::cast(result_obj);
CHECK_EQ(PromiseBuiltins::kCapabilitiesContextLength, context_js->length());
CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info());
CHECK_EQ(isolate->root(RootIndex::kEmptyScopeInfo), context_js->scope_info());
CHECK_EQ(*isolate->native_context(), context_js->native_context());
CHECK(
context_js->get(PromiseBuiltins::kCapabilitySlot).IsPromiseCapability());
Expand Down Expand Up @@ -2773,7 +2773,8 @@ TEST(NewPromiseCapability) {

for (auto&& callback : callbacks) {
Handle<Context> context(Context::cast(callback->context()), isolate);
CHECK_EQ(isolate->native_context()->scope_info(), context->scope_info());
CHECK_EQ(isolate->root(RootIndex::kEmptyScopeInfo),
context->scope_info());
CHECK_EQ(*isolate->native_context(), context->native_context());
CHECK_EQ(PromiseBuiltins::kPromiseContextLength, context->length());
CHECK_EQ(context->get(PromiseBuiltins::kPromiseSlot), result->promise());
Expand Down