Commit f6d988f9 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[offthread] Clean-up HandleOrOffThreadHandle uses

Take advantage of the HandleOrOffThreadHandle implicit conversions where
applicable.

Bug: chromium:1011762
Change-Id: Iaf49d9098368b402e1cd3d991629d3f5e718f28e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2046885
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66199}
parent 86d4b9f6
......@@ -169,11 +169,11 @@ HandleFor<Isolate, String> AstConsString::Allocate(Isolate* isolate) const {
}
// AstRawStrings are internalized before AstConsStrings are allocated, so
// AstRawString::string() will just work.
HandleFor<Isolate, String> tmp(segment_.string->string().get<Isolate>());
HandleFor<Isolate, String> tmp = segment_.string->string();
for (AstConsString::Segment* current = segment_.next; current != nullptr;
current = current->next) {
tmp = isolate->factory()
->NewConsString(current->string->string().get<Isolate>(), tmp,
->NewConsString(current->string->string(), tmp,
AllocationType::kOld)
.ToHandleChecked();
}
......@@ -191,7 +191,7 @@ HandleFor<Isolate, String> AstConsString::AllocateFlat(Isolate* isolate) const {
return isolate->factory()->empty_string();
}
if (!segment_.next) {
return segment_.string->string().get<Isolate>();
return segment_.string->string();
}
int result_length = 0;
......
......@@ -741,12 +741,12 @@ HandleFor<Isolate, Object> MaterializedLiteral::GetBoilerplateValue(
if (expression->IsObjectLiteral()) {
ObjectLiteral* object_literal = expression->AsObjectLiteral();
DCHECK(object_literal->is_simple());
return object_literal->boilerplate_description().get<Isolate>();
return object_literal->boilerplate_description();
} else {
DCHECK(expression->IsArrayLiteral());
ArrayLiteral* array_literal = expression->AsArrayLiteral();
DCHECK(array_literal->is_simple());
return array_literal->boilerplate_description().get<Isolate>();
return array_literal->boilerplate_description();
}
}
return isolate->factory()->uninitialized_value();
......@@ -1014,7 +1014,7 @@ HandleFor<Isolate, Object> Literal::BuildValue(Isolate* isolate) const {
return isolate->factory()->template NewNumber<AllocationType::kOld>(
number_);
case kString:
return string_->string().get<Isolate>();
return string_->string();
case kSymbol:
return isolate->factory()->home_object_symbol();
case kBoolean:
......
......@@ -1181,7 +1181,7 @@ class MaterializedLiteral : public Expression {
// Node for capturing a regexp literal.
class RegExpLiteral final : public MaterializedLiteral {
public:
Handle<String> pattern() const { return pattern_->string(); }
HandleOrOffThreadHandle<String> pattern() const { return pattern_->string(); }
const AstRawString* raw_pattern() const { return pattern_; }
int flags() const { return flags_; }
......
......@@ -5352,7 +5352,7 @@ void SharedFunctionInfo::InitFromFunctionLiteral(
Scope* outer_scope = lit->scope()->GetOuterScopeWithContext();
if (outer_scope) {
shared_info->set_outer_scope_info(
*outer_scope->scope_info().get_handle());
*outer_scope->scope_info().get<Isolate>());
shared_info->set_private_name_lookup_skips_outer_class(
lit->scope()->private_name_lookup_skips_outer_class());
}
......
......@@ -10,7 +10,6 @@
#include "src/execution/isolate.h"
#include "src/execution/off-thread-isolate.h"
#include "src/handles/handles.h"
#include "src/heap/off-thread-factory.h"
#include "src/heap/read-only-heap.h"
#include "src/objects/api-callbacks.h"
#include "src/objects/descriptor-array.h"
......
......@@ -18,7 +18,7 @@ namespace internal {
// Forward declarations.
enum ElementsKind : uint8_t;
class OffThreadFactory;
class OffThreadIsolate;
template <typename T>
class Handle;
class Heap;
......
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