diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/runtime/runtime-scopes.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/runtime/runtime-scopes.cc')
-rw-r--r-- | chromium/v8/src/runtime/runtime-scopes.cc | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/chromium/v8/src/runtime/runtime-scopes.cc b/chromium/v8/src/runtime/runtime-scopes.cc index 4b1f6f2231f..b78ca1d5340 100644 --- a/chromium/v8/src/runtime/runtime-scopes.cc +++ b/chromium/v8/src/runtime/runtime-scopes.cc @@ -18,6 +18,8 @@ #include "src/objects/module-inl.h" #include "src/objects/smi.h" #include "src/runtime/runtime-utils.h" +#include "torque-generated/exported-class-definitions-tq-inl.h" +#include "torque-generated/exported-class-definitions-tq.h" namespace v8 { namespace internal { @@ -408,20 +410,19 @@ Handle<JSObject> NewSloppyArguments(Isolate* isolate, Handle<JSFunction> callee, if (argument_count > 0) { if (parameter_count > 0) { int mapped_count = Min(argument_count, parameter_count); - Handle<FixedArray> parameter_map = isolate->factory()->NewFixedArray( - mapped_count + 2, AllocationType::kYoung); - parameter_map->set_map( - ReadOnlyRoots(isolate).sloppy_arguments_elements_map()); - result->set_map(isolate->native_context()->fast_aliased_arguments_map()); - result->set_elements(*parameter_map); // Store the context and the arguments array at the beginning of the // parameter map. Handle<Context> context(isolate->context(), isolate); Handle<FixedArray> arguments = isolate->factory()->NewFixedArray( argument_count, AllocationType::kYoung); - parameter_map->set(0, *context); - parameter_map->set(1, *arguments); + + Handle<SloppyArgumentsElements> parameter_map = + isolate->factory()->NewSloppyArgumentsElements( + mapped_count, context, arguments, AllocationType::kYoung); + + result->set_map(isolate->native_context()->fast_aliased_arguments_map()); + result->set_elements(*parameter_map); // Loop over the actual parameters backwards. int index = argument_count - 1; @@ -438,7 +439,8 @@ Handle<JSObject> NewSloppyArguments(Isolate* isolate, Handle<JSFunction> callee, // arguments object. for (int i = 0; i < mapped_count; i++) { arguments->set(i, parameters[i]); - parameter_map->set_the_hole(i + 2); + parameter_map->set_mapped_entries( + i, *isolate->factory()->the_hole_value()); } // Walk all context slots to find context allocated parameters. Mark each @@ -449,7 +451,7 @@ Handle<JSObject> NewSloppyArguments(Isolate* isolate, Handle<JSFunction> callee, if (parameter >= mapped_count) continue; arguments->set_the_hole(parameter); Smi slot = Smi::FromInt(scope_info->ContextHeaderLength() + i); - parameter_map->set(parameter + 2, slot); + parameter_map->set_mapped_entries(parameter, slot); } } else { // If there is no aliasing, the arguments object elements are not @@ -610,40 +612,35 @@ RUNTIME_FUNCTION(Runtime_NewFunctionContext) { return *isolate->factory()->NewFunctionContext(outer, scope_info); } +// TODO(jgruber): Rename these functions to 'New...Context'. RUNTIME_FUNCTION(Runtime_PushWithContext) { HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_ARG_HANDLE_CHECKED(JSReceiver, extension_object, 0); CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 1); Handle<Context> current(isolate->context(), isolate); - Handle<Context> context = - isolate->factory()->NewWithContext(current, scope_info, extension_object); - isolate->set_context(*context); - return *context; + return *isolate->factory()->NewWithContext(current, scope_info, + extension_object); } +// TODO(jgruber): Rename these functions to 'New...Context'. RUNTIME_FUNCTION(Runtime_PushCatchContext) { HandleScope scope(isolate); DCHECK_EQ(2, args.length()); CONVERT_ARG_HANDLE_CHECKED(Object, thrown_object, 0); CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 1); Handle<Context> current(isolate->context(), isolate); - Handle<Context> context = - isolate->factory()->NewCatchContext(current, scope_info, thrown_object); - isolate->set_context(*context); - return *context; + return *isolate->factory()->NewCatchContext(current, scope_info, + thrown_object); } - +// TODO(jgruber): Rename these functions to 'New...Context'. RUNTIME_FUNCTION(Runtime_PushBlockContext) { HandleScope scope(isolate); DCHECK_EQ(1, args.length()); CONVERT_ARG_HANDLE_CHECKED(ScopeInfo, scope_info, 0); Handle<Context> current(isolate->context(), isolate); - Handle<Context> context = - isolate->factory()->NewBlockContext(current, scope_info); - isolate->set_context(*context); - return *context; + return *isolate->factory()->NewBlockContext(current, scope_info); } |