Commit 6038f637 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[GetIsolate] Remove 1-arg Handle constructor

Remove the one-argument Handle constructor and "handle" factory method,
replacing them with Isolates where available and GetIsolate() methods
otherwise.

TBR=verwaest@chromium.org

Bug: v8:7786
Change-Id: I8ee92ef727c05382c984a3e4c290198d0b312619
Reviewed-on: https://chromium-review.googlesource.com/1113542Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54025}
parent 722dfb70
......@@ -636,7 +636,7 @@ bool HandleScopeImplementer::LastEnteredContextWas(Handle<Context> context) {
Handle<Context> HandleScopeImplementer::LastEnteredContext() {
if (entered_contexts_.empty()) return Handle<Context>::null();
return Handle<Context>(entered_contexts_.back());
return Handle<Context>(entered_contexts_.back(), isolate_);
}
void HandleScopeImplementer::EnterMicrotaskContext(Handle<Context> context) {
......@@ -651,7 +651,7 @@ void HandleScopeImplementer::LeaveMicrotaskContext() {
}
Handle<Context> HandleScopeImplementer::MicrotaskContext() {
if (microtask_context_) return Handle<Context>(microtask_context_);
if (microtask_context_) return Handle<Context>(microtask_context_, isolate_);
return Handle<Context>::null();
}
......
......@@ -46,7 +46,8 @@ int CompileTimeValue::GetLiteralTypeFlags(Handle<FixedArray> value) {
}
Handle<HeapObject> CompileTimeValue::GetElements(Handle<FixedArray> value) {
return Handle<HeapObject>(HeapObject::cast(value->get(kElementsSlot)));
return Handle<HeapObject>(HeapObject::cast(value->get(kElementsSlot)),
value->GetIsolate());
}
} // namespace internal
......
......@@ -139,7 +139,7 @@ TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) {
shared_function_info);
StoreObjectFieldNoWriteBarrier(result, JSFunction::kContextOffset, context);
Handle<Code> lazy_builtin_handle(
isolate()->builtins()->builtin(Builtins::kCompileLazy));
isolate()->builtins()->builtin(Builtins::kCompileLazy), isolate());
Node* lazy_builtin = HeapConstant(lazy_builtin_handle);
StoreObjectFieldNoWriteBarrier(result, JSFunction::kCodeOffset, lazy_builtin);
Return(result);
......
......@@ -36,7 +36,8 @@ TNode<Map> TypedArrayBuiltinsAssembler::LoadMapForType(
DispatchTypedArrayByElementsKind(
elements_kind,
[&](ElementsKind kind, int size, int typed_array_fun_index) {
Handle<Map> map(isolate()->heap()->MapForFixedTypedArray(kind));
Handle<Map> map(isolate()->heap()->MapForFixedTypedArray(kind),
isolate());
var_typed_map = HeapConstant(map);
});
......
......@@ -115,8 +115,9 @@ bool CompilationCacheScript::HasOrigin(Handle<SharedFunctionInfo> function_info,
if (resource_options.Flags() != script->origin_options().Flags())
return false;
// Compare the two name strings for equality.
return String::Equals(isolate(), Handle<String>::cast(name),
Handle<String>(String::cast(script->name())));
return String::Equals(
isolate(), Handle<String>::cast(name),
Handle<String>(String::cast(script->name()), isolate()));
}
// TODO(245): Need to allow identical code from different contexts to
......
......@@ -203,7 +203,7 @@ void UnoptimizedCompileJob::PrepareOnMainThread(Isolate* isolate) {
parse_info_->maybe_outer_scope_info());
// Initailize the name after setting up the ast_value_factory.
Handle<String> name(shared_->Name());
Handle<String> name(shared_->Name(), isolate);
parse_info_->set_function_name(
parse_info_->ast_value_factory()->GetString(name));
......
......@@ -89,7 +89,7 @@ MaybeHandle<Map> GetStableMapFromObjectType(Type object_type) {
if (object_type.IsHeapConstant()) {
Handle<HeapObject> object =
Handle<HeapObject>::cast(object_type.AsHeapConstant()->Value());
Handle<Map> object_map(object->map());
Handle<Map> object_map(object->map(), object->GetIsolate());
if (object_map->is_stable()) return object_map;
}
return MaybeHandle<Map>();
......
......@@ -181,7 +181,7 @@ class JSArrayBasedStruct {
static S cast(Object* object) {
JSArray* array = JSArray::cast(object);
Handle<JSArray> array_handle(array);
Handle<JSArray> array_handle(array, array->GetIsolate());
return S(array_handle);
}
......
......@@ -2695,7 +2695,8 @@ int TranslatedFrame::GetValueCount() {
void TranslatedFrame::Handlify() {
if (raw_shared_info_ != nullptr) {
shared_info_ = Handle<SharedFunctionInfo>(raw_shared_info_);
shared_info_ = Handle<SharedFunctionInfo>(raw_shared_info_,
raw_shared_info_->GetIsolate());
raw_shared_info_ = nullptr;
}
for (auto& value : values_) {
......
......@@ -106,8 +106,9 @@ class ElementsAccessor {
inline MaybeHandle<FixedArray> PrependElementIndices(
Handle<JSObject> object, Handle<FixedArray> keys,
GetKeysConversion convert, PropertyFilter filter = ALL_PROPERTIES) {
return PrependElementIndices(object, handle(object->elements()), keys,
convert, filter);
return PrependElementIndices(
object, handle(object->elements(), object->GetIsolate()), keys, convert,
filter);
}
virtual void AddElementsToKeyAccumulator(Handle<JSObject> receiver,
......
......@@ -34,9 +34,6 @@ HandleScope::HandleScope(Isolate* isolate) {
data->level++;
}
template <typename T>
Handle<T>::Handle(T* object) : Handle(object, object->GetIsolate()) {}
template <typename T>
Handle<T>::Handle(T* object, Isolate* isolate) : HandleBase(object, isolate) {}
......
......@@ -97,10 +97,6 @@ class Handle final : public HandleBase {
"static type violation");
}
#ifdef DEPRECATE_GET_ISOLATE
[[deprecated("Use Handle(T* object, Isolate* isolate)")]]
#endif
V8_INLINE explicit Handle(T* object);
V8_INLINE Handle(T* object, Isolate* isolate);
// Allocate a new handle for the object, do not canonicalize.
......@@ -168,15 +164,6 @@ V8_INLINE Handle<T> handle(T* object, Isolate* isolate) {
return Handle<T>(object, isolate);
}
template <typename T>
#ifdef DEPRECATE_GET_ISOLATE
[[deprecated("Use handle(T* object, Isolate* isolate)")]]
#endif
V8_INLINE Handle<T>
handle(T* object) {
return Handle<T>(object);
}
// ----------------------------------------------------------------------------
// A Handle can be converted into a MaybeHandle. Converting a MaybeHandle
// into a Handle requires checking that it does not point to nullptr. This
......
......@@ -1129,7 +1129,8 @@ void ReportBootstrappingException(Handle<Object> exception,
// Since comments and empty lines have been stripped from the source of
// builtins, print the actual source here so that line numbers match.
if (location->script()->source()->IsString()) {
Handle<String> src(String::cast(location->script()->source()));
Handle<String> src(String::cast(location->script()->source()),
location->script()->GetIsolate());
PrintF("Failing script:");
int len = src->length();
if (len == 0) {
......
......@@ -673,7 +673,8 @@ void JitLogger::LogRecordedBuffer(AbstractCode* code,
event.code_len = code->InstructionSize();
Handle<SharedFunctionInfo> shared_function_handle;
if (shared && shared->script()->IsScript()) {
shared_function_handle = Handle<SharedFunctionInfo>(shared);
shared_function_handle =
Handle<SharedFunctionInfo>(shared, shared->GetIsolate());
}
event.script = ToApiHandle<v8::UnboundScript>(shared_function_handle);
event.name.str = name;
......@@ -1745,10 +1746,10 @@ static void AddFunctionAndCode(SharedFunctionInfo* sfi,
Handle<SharedFunctionInfo>* sfis,
Handle<AbstractCode>* code_objects, int offset) {
if (sfis != nullptr) {
sfis[offset] = Handle<SharedFunctionInfo>(sfi);
sfis[offset] = Handle<SharedFunctionInfo>(sfi, sfi->GetIsolate());
}
if (code_objects != nullptr) {
code_objects[offset] = Handle<AbstractCode>(code_object);
code_objects[offset] = Handle<AbstractCode>(code_object, sfi->GetIsolate());
}
}
......
......@@ -5313,9 +5313,10 @@ static int AppendUniqueCallbacks(Handle<TemplateList> callbacks,
// Fill in new callback descriptors. Process the callbacks from
// back to front so that the last callback with a given name takes
// precedence over previously added callbacks with that name.
Isolate* isolate = callbacks->GetIsolate();
for (int i = nof_callbacks - 1; i >= 0; i--) {
Handle<AccessorInfo> entry(AccessorInfo::cast(callbacks->get(i)));
Handle<Name> key(Name::cast(entry->name()));
Handle<AccessorInfo> entry(AccessorInfo::cast(callbacks->get(i)), isolate);
Handle<Name> key(Name::cast(entry->name()), isolate);
DCHECK(key->IsUniqueName());
// Check if a descriptor with this name already exists before writing.
if (!T::Contains(key, entry, valid_descriptors, array)) {
......@@ -10577,13 +10578,13 @@ Handle<AccessorPair> AccessorPair::Copy(Handle<AccessorPair> pair) {
Handle<Object> AccessorPair::GetComponent(Handle<AccessorPair> accessor_pair,
AccessorComponent component) {
Isolate* isolate = accessor_pair->GetIsolate();
Object* accessor = accessor_pair->get(component);
if (accessor->IsFunctionTemplateInfo()) {
return ApiNatives::InstantiateFunction(
handle(FunctionTemplateInfo::cast(accessor)))
handle(FunctionTemplateInfo::cast(accessor), isolate))
.ToHandleChecked();
}
Isolate* isolate = accessor_pair->GetIsolate();
if (accessor->IsNull(isolate)) {
return isolate->factory()->undefined_value();
}
......@@ -14169,9 +14170,12 @@ void SetStackFrameCacheCommon(Handle<Code> code,
void AbstractCode::SetStackFrameCache(Handle<AbstractCode> abstract_code,
Handle<SimpleNumberDictionary> cache) {
if (abstract_code->IsCode()) {
SetStackFrameCacheCommon(handle(abstract_code->GetCode()), cache);
SetStackFrameCacheCommon(
handle(abstract_code->GetCode(), abstract_code->GetIsolate()), cache);
} else {
SetStackFrameCacheCommon(handle(abstract_code->GetBytecodeArray()), cache);
SetStackFrameCacheCommon(
handle(abstract_code->GetBytecodeArray(), abstract_code->GetIsolate()),
cache);
}
}
......@@ -14326,7 +14330,9 @@ bool Code::IsIsolateIndependent(Isolate* isolate) {
Handle<WeakCell> Code::WeakCellFor(Handle<Code> code) {
DCHECK(code->kind() == OPTIMIZED_FUNCTION);
WeakCell* raw_cell = code->CachedWeakCell();
if (raw_cell != nullptr) return Handle<WeakCell>(raw_cell);
if (raw_cell != nullptr) {
return Handle<WeakCell>(raw_cell, code->GetIsolate());
}
Handle<WeakCell> cell = code->GetIsolate()->factory()->NewWeakCell(code);
DeoptimizationData::cast(code->deoptimization_data())
->SetWeakCellCache(*cell);
......@@ -14916,7 +14922,7 @@ Handle<DependentCode> DependentCode::Insert(Handle<DependentCode> entries,
}
if (entries->group() < group) {
// The group comes later in the list.
Handle<DependentCode> old_next(entries->next_link());
Handle<DependentCode> old_next(entries->next_link(), entries->GetIsolate());
Handle<DependentCode> new_next = Insert(old_next, group, object);
if (!old_next.is_identical_to(new_next)) {
entries->set_next_link(*new_next);
......@@ -18454,7 +18460,7 @@ Script* ScriptFromJSValue(Object* in) {
int JSMessageObject::GetLineNumber() const {
if (start_position() == -1) return Message::kNoLineNumberInfo;
Handle<Script> the_script = handle(ScriptFromJSValue(script()));
Handle<Script> the_script = handle(ScriptFromJSValue(script()), GetIsolate());
Script::PositionInfo info;
const Script::OffsetFlag offset_flag = Script::WITH_OFFSET;
......@@ -18469,7 +18475,7 @@ int JSMessageObject::GetLineNumber() const {
int JSMessageObject::GetColumnNumber() const {
if (start_position() == -1) return -1;
Handle<Script> the_script = handle(ScriptFromJSValue(script()));
Handle<Script> the_script = handle(ScriptFromJSValue(script()), GetIsolate());
Script::PositionInfo info;
const Script::OffsetFlag offset_flag = Script::WITH_OFFSET;
......@@ -18482,9 +18488,9 @@ int JSMessageObject::GetColumnNumber() const {
}
Handle<String> JSMessageObject::GetSourceLine() const {
Handle<Script> the_script = handle(ScriptFromJSValue(script()));
Isolate* isolate = GetIsolate();
Handle<Script> the_script = handle(ScriptFromJSValue(script()), isolate);
Isolate* isolate = the_script->GetIsolate();
if (the_script->type() == Script::TYPE_WASM) {
return isolate->factory()->empty_string();
}
......@@ -18668,10 +18674,11 @@ Handle<JSArrayBuffer> JSTypedArray::MaterializeArrayBuffer(
Handle<JSArrayBuffer> JSTypedArray::GetBuffer() {
if (!is_on_heap()) {
Handle<JSArrayBuffer> array_buffer(JSArrayBuffer::cast(buffer()));
Handle<JSArrayBuffer> array_buffer(JSArrayBuffer::cast(buffer()),
GetIsolate());
return array_buffer;
}
Handle<JSTypedArray> self(this);
Handle<JSTypedArray> self(this, GetIsolate());
return MaterializeArrayBuffer(self);
}
......
......@@ -302,13 +302,13 @@ Handle<String> String::Flatten(Isolate* isolate, Handle<String> string,
if (string->IsConsString()) {
Handle<ConsString> cons = Handle<ConsString>::cast(string);
if (cons->IsFlat()) {
string = handle(cons->first());
string = handle(cons->first(), isolate);
} else {
return SlowFlatten(isolate, cons, pretenure);
}
}
if (string->IsThinString()) {
string = handle(Handle<ThinString>::cast(string)->actual());
string = handle(Handle<ThinString>::cast(string)->actual(), isolate);
DCHECK(!string->IsConsString());
}
return string;
......
......@@ -529,7 +529,8 @@ ConsumedPreParsedScopeData::GetDataForSkippableFunction(
return nullptr;
}
Handle<PreParsedScopeData> child_data_handle(
PreParsedScopeData::cast(child_data));
PreParsedScopeData::cast(child_data),
PreParsedScopeData::cast(child_data)->GetIsolate());
return new (zone) ProducedPreParsedScopeData(child_data_handle, zone);
}
......
......@@ -332,7 +332,8 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
if (entry_count == 0) return;
// The WasmToJS wrapper stubs have source position entries.
if (!shared->HasSourceCode()) return;
Handle<Script> script(Script::cast(shared->script()));
Isolate* isolate = shared->GetIsolate();
Handle<Script> script(Script::cast(shared->script()), isolate);
PerfJitCodeDebugInfo debug_info;
......@@ -346,8 +347,8 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
size += entry_count * sizeof(PerfJitDebugEntry);
// Add the size of the name after each entry.
Handle<Code> code_handle(code);
Handle<SharedFunctionInfo> function_handle(shared);
Handle<Code> code_handle(code, isolate);
Handle<SharedFunctionInfo> function_handle(shared, isolate);
for (SourcePositionTableIterator iterator(code->SourcePositionTable());
!iterator.done(); iterator.Advance()) {
SourcePositionInfo info(GetSourcePositionInfo(code_handle, function_handle,
......
......@@ -56,20 +56,21 @@ std::vector<SourcePositionInfo> SourcePosition::InliningStack(
std::vector<SourcePositionInfo> SourcePosition::InliningStack(
Handle<Code> code) const {
Isolate* isolate = code->GetIsolate();
Handle<DeoptimizationData> deopt_data(
DeoptimizationData::cast(code->deoptimization_data()));
DeoptimizationData::cast(code->deoptimization_data()), isolate);
SourcePosition pos = *this;
std::vector<SourcePositionInfo> stack;
while (pos.isInlined()) {
InliningPosition inl =
deopt_data->InliningPositions()->get(pos.InliningId());
Handle<SharedFunctionInfo> function(
deopt_data->GetInlinedFunction(inl.inlined_function_id));
deopt_data->GetInlinedFunction(inl.inlined_function_id), isolate);
stack.push_back(SourcePositionInfo(pos, function));
pos = inl.position;
}
Handle<SharedFunctionInfo> function(
SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()));
SharedFunctionInfo::cast(deopt_data->SharedFunctionInfo()), isolate);
stack.push_back(SourcePositionInfo(pos, function));
return stack;
}
......@@ -125,7 +126,7 @@ SourcePositionInfo::SourcePositionInfo(SourcePosition pos,
: position(pos),
script(f.is_null() || !f->script()->IsScript()
? Handle<Script>::null()
: handle(Script::cast(f->script()))) {
: handle(Script::cast(f->script()), f->GetIsolate())) {
if (!script.is_null()) {
Script::PositionInfo info;
if (Script::GetPositionInfo(script, pos.ScriptOffset(), &info,
......
......@@ -1442,7 +1442,7 @@ Address WasmInstanceObject::GetCallTarget(uint32_t func_index) {
bool WasmExportedFunction::IsWasmExportedFunction(Object* object) {
if (!object->IsJSFunction()) return false;
Handle<JSFunction> js_function(JSFunction::cast(object));
JSFunction* js_function = JSFunction::cast(object);
if (Code::JS_TO_WASM_FUNCTION != js_function->code()->kind()) return false;
DCHECK(js_function->shared()->HasWasmExportedFunctionData());
return true;
......
......@@ -17,6 +17,7 @@ namespace heap {
Handle<FeedbackVector> CreateFeedbackVectorForTest(
v8::Isolate* isolate, Factory* factory,
PretenureFlag pretenure_flag = NOT_TENURED) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
v8::Local<v8::Script> script =
v8::Script::Compile(isolate->GetCurrentContext(),
v8::String::NewFromUtf8(isolate, "function foo() {}",
......@@ -25,7 +26,7 @@ Handle<FeedbackVector> CreateFeedbackVectorForTest(
.ToLocalChecked();
Handle<Object> obj = v8::Utils::OpenHandle(*script);
Handle<SharedFunctionInfo> shared_function =
Handle<SharedFunctionInfo>(JSFunction::cast(*obj)->shared());
Handle<SharedFunctionInfo>(JSFunction::cast(*obj)->shared(), i_isolate);
Handle<FeedbackVector> fv =
factory->NewFeedbackVector(shared_function, pretenure_flag);
return fv;
......
......@@ -25017,6 +25017,7 @@ TEST(ScriptNameAndLineNumber) {
TEST(ScriptPositionInfo) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
v8::HandleScope scope(isolate);
const char* url = "http://www.foo.com/foo.js";
v8::ScriptOrigin origin(v8_str(url), v8::Integer::New(isolate, 13));
......@@ -25031,7 +25032,7 @@ TEST(ScriptPositionInfo) {
v8::Utils::OpenHandle(*script->GetUnboundScript()));
CHECK(obj->script()->IsScript());
i::Handle<i::Script> script1(i::Script::cast(obj->script()));
i::Handle<i::Script> script1(i::Script::cast(obj->script()), i_isolate);
v8::internal::Script::PositionInfo info;
......
......@@ -3049,7 +3049,7 @@ TEST(DebugScriptLineEndsAreAscending) {
CHECK_GT(instances->length(), 0);
for (int i = 0; i < instances->length(); i++) {
Handle<v8::internal::Script> script = Handle<v8::internal::Script>(
v8::internal::Script::cast(instances->get(i)));
v8::internal::Script::cast(instances->get(i)), CcTest::i_isolate());
v8::internal::Script::InitLineEnds(script);
v8::internal::FixedArray* ends =
......@@ -4130,7 +4130,7 @@ TEST(DebugEvaluateNoSideEffect) {
while (i::HeapObject* obj = iterator.next()) {
if (!obj->IsJSFunction()) continue;
i::JSFunction* fun = i::JSFunction::cast(obj);
all_functions.emplace_back(fun);
all_functions.emplace_back(fun, isolate);
}
}
......
......@@ -2328,7 +2328,8 @@ TEST(ElementsKindTransitionFromMapOwningDescriptor) {
struct TestConfig {
Handle<Map> Transition(Handle<Map> map, Expectations& expectations) {
Handle<Symbol> frozen_symbol(map->GetHeap()->frozen_symbol());
Handle<Symbol> frozen_symbol(map->GetHeap()->frozen_symbol(),
CcTest::i_isolate());
expectations.SetElementsKind(DICTIONARY_ELEMENTS);
return Map::CopyForPreventExtensions(CcTest::i_isolate(), map, NONE,
frozen_symbol,
......
......@@ -202,14 +202,15 @@ void PatchFunctions(v8::Local<v8::Context> context, const char* source_a,
const char* source_b,
v8::debug::LiveEditResult* result = nullptr) {
v8::Isolate* isolate = context->GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
v8::HandleScope scope(isolate);
v8::Local<v8::Script> script_a =
v8::Script::Compile(context, v8_str(isolate, source_a)).ToLocalChecked();
script_a->Run(context).ToLocalChecked();
i::Handle<i::Script> i_script_a(
i::Script::cast(v8::Utils::OpenHandle(*script_a)->shared()->script()));
i::Script::cast(v8::Utils::OpenHandle(*script_a)->shared()->script()),
i_isolate);
i::Isolate* i_isolate = i_script_a->GetIsolate();
if (result) {
LiveEdit::PatchScript(
i_script_a, i_isolate->factory()->NewStringFromAsciiChecked(source_b),
......@@ -470,14 +471,15 @@ TEST(LiveEditFunctionExpression) {
v8::HandleScope scope(env->GetIsolate());
v8::Local<v8::Context> context = env.local();
v8::Isolate* isolate = context->GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
v8::Local<v8::Script> script =
v8::Script::Compile(context, v8_str(isolate, original_source))
.ToLocalChecked();
v8::Local<v8::Function> f =
script->Run(context).ToLocalChecked().As<v8::Function>();
i::Handle<i::Script> i_script(
i::Script::cast(v8::Utils::OpenHandle(*script)->shared()->script()));
i::Isolate* i_isolate = i_script->GetIsolate();
i::Script::cast(v8::Utils::OpenHandle(*script)->shared()->script()),
i_isolate);
debug::LiveEditResult result;
LiveEdit::PatchScript(
i_script, i_isolate->factory()->NewStringFromAsciiChecked(updated_source),
......
......@@ -529,7 +529,8 @@ TEST(Issue23768) {
CHECK(!evil_script.IsEmpty());
CHECK(!evil_script->Run(env).IsEmpty());
i::Handle<i::ExternalTwoByteString> i_source(
i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source)));
i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source)),
CcTest::i_isolate());
// This situation can happen if source was an external string disposed
// by its owner.
i_source->set_resource(nullptr);
......
......@@ -155,8 +155,9 @@ class WasmSerializationTest {
maybe_module_object.ToHandleChecked();
Handle<WasmCompiledModule> compiled_module(
module_object->compiled_module());
Handle<FixedArray> export_wrappers(module_object->export_wrappers());
module_object->compiled_module(), serialization_isolate);
Handle<FixedArray> export_wrappers(module_object->export_wrappers(),
serialization_isolate);
v8::Local<v8::Object> v8_module_obj =
v8::Utils::ToLocal(Handle<JSObject>::cast(module_object));
CHECK(v8_module_obj->IsWebAssemblyCompiledModule());
......
......@@ -144,7 +144,8 @@ class JSCallReducerTest : public TypedGraphTest {
};
TEST_F(JSCallReducerTest, PromiseConstructorNoArgs) {
Node* promise = HeapConstant(handle(native_context()->promise_function()));
Node* promise =
HeapConstant(handle(native_context()->promise_function(), isolate()));
Node* effect = graph()->start();
Node* control = graph()->start();
Node* context = UndefinedConstant();
......@@ -160,8 +161,10 @@ TEST_F(JSCallReducerTest, PromiseConstructorNoArgs) {
}
TEST_F(JSCallReducerTest, PromiseConstructorSubclass) {
Node* promise = HeapConstant(handle(native_context()->promise_function()));
Node* new_target = HeapConstant(handle(native_context()->array_function()));
Node* promise =
HeapConstant(handle(native_context()->promise_function(), isolate()));
Node* new_target =
HeapConstant(handle(native_context()->array_function(), isolate()));
Node* effect = graph()->start();
Node* control = graph()->start();
Node* context = UndefinedConstant();
......@@ -178,7 +181,8 @@ TEST_F(JSCallReducerTest, PromiseConstructorSubclass) {
}
TEST_F(JSCallReducerTest, PromiseConstructorBasic) {
Node* promise = HeapConstant(handle(native_context()->promise_function()));
Node* promise =
HeapConstant(handle(native_context()->promise_function(), isolate()));
Node* effect = graph()->start();
Node* control = graph()->start();
Node* context = UndefinedConstant();
......@@ -201,7 +205,8 @@ TEST_F(JSCallReducerTest, PromiseConstructorBasic) {
// Exactly the same as PromiseConstructorBasic which expects a reduction,
// except that we invalidate the protector cell.
TEST_F(JSCallReducerTest, PromiseConstructorWithHook) {
Node* promise = HeapConstant(handle(native_context()->promise_function()));
Node* promise =
HeapConstant(handle(native_context()->promise_function(), isolate()));
Node* effect = graph()->start();
Node* control = graph()->start();
Node* context = UndefinedConstant();
......
......@@ -94,7 +94,8 @@ TEST_F(JSCreateLoweringTest, JSCreateArgumentsInlinedMapped) {
Node* const closure = Parameter(Type::Any());
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared());
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared(),
isolate());
Node* const frame_state_outer = FrameState(shared, graph()->start());
Node* const frame_state_inner = FrameState(shared, frame_state_outer);
Reduction r = Reduce(graph()->NewNode(
......@@ -112,7 +113,8 @@ TEST_F(JSCreateLoweringTest, JSCreateArgumentsInlinedUnmapped) {
Node* const closure = Parameter(Type::Any());
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared());
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared(),
isolate());
Node* const frame_state_outer = FrameState(shared, graph()->start());
Node* const frame_state_inner = FrameState(shared, frame_state_outer);
Reduction r = Reduce(graph()->NewNode(
......@@ -130,7 +132,8 @@ TEST_F(JSCreateLoweringTest, JSCreateArgumentsInlinedRestArray) {
Node* const closure = Parameter(Type::Any());
Node* const context = UndefinedConstant();
Node* const effect = graph()->start();
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared());
Handle<SharedFunctionInfo> shared(isolate()->script_function()->shared(),
isolate());
Node* const frame_state_outer = FrameState(shared, graph()->start());
Node* const frame_state_inner = FrameState(shared, frame_state_outer);
Reduction r = Reduce(graph()->NewNode(
......@@ -150,8 +153,8 @@ TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) {
Node* const effect = graph()->start();
Node* const control = graph()->start();
Reduction const r = Reduce(graph()->NewNode(
javascript()->CreateFunctionContext(handle(ScopeInfo::Empty(isolate())),
8, FUNCTION_SCOPE),
javascript()->CreateFunctionContext(
handle(ScopeInfo::Empty(isolate()), isolate()), 8, FUNCTION_SCOPE),
context, effect, control));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(),
......
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