From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/v8/src/wasm/wasm-objects.cc | 70 +++++++++++++++++------------------- 1 file changed, 33 insertions(+), 37 deletions(-) (limited to 'chromium/v8/src/wasm/wasm-objects.cc') diff --git a/chromium/v8/src/wasm/wasm-objects.cc b/chromium/v8/src/wasm/wasm-objects.cc index 28834678893..ae9d64b956d 100644 --- a/chromium/v8/src/wasm/wasm-objects.cc +++ b/chromium/v8/src/wasm/wasm-objects.cc @@ -283,7 +283,9 @@ Handle WasmTableObject::New(Isolate* isolate, table_obj->set_entries(*backing_store); table_obj->set_current_length(initial); table_obj->set_maximum_length(*max); - table_obj->set_raw_type(static_cast(type.kind())); + // TODO(7748): Make this work with other table types. + CHECK(type.is_nullable()); + table_obj->set_raw_type(static_cast(type.heap_type())); table_obj->set_dispatch_tables(ReadOnlyRoots(isolate).empty_fixed_array()); if (entries != nullptr) { @@ -384,14 +386,10 @@ bool WasmTableObject::IsValidElement(Isolate* isolate, Handle table, Handle entry) { // Anyref and exnref tables take everything. - if (table->type() == wasm::kWasmAnyRef || - table->type() == wasm::kWasmExnRef) { + if (table->type().heap_type() == wasm::kHeapExtern || + table->type().heap_type() == wasm::kHeapExn) { return true; } - // Nullref only takes {null}. - if (table->type() == wasm::kWasmNullRef) { - return entry->IsNull(isolate); - } // FuncRef tables can store {null}, {WasmExportedFunction}, {WasmJSFunction}, // or {WasmCapiFunction} objects. if (entry->IsNull(isolate)) return true; @@ -409,8 +407,8 @@ void WasmTableObject::Set(Isolate* isolate, Handle table, Handle entries(table->entries(), isolate); // The FixedArray is addressed with int's. int entry_index = static_cast(index); - if (table->type() == wasm::kWasmAnyRef || - table->type() == wasm::kWasmExnRef) { + if (table->type().heap_type() == wasm::kHeapExtern || + table->type().heap_type() == wasm::kHeapExn) { entries->set(entry_index, *entry); return; } @@ -454,9 +452,9 @@ Handle WasmTableObject::Get(Isolate* isolate, Handle entry(entries->get(entry_index), isolate); - // First we handle the easy anyref and exnref table case. - if (table->type() == wasm::kWasmAnyRef || - table->type() == wasm::kWasmExnRef) { + // First we handle the easy externref and exnref table case. + if (table->type().heap_type() == wasm::kHeapExtern || + table->type().heap_type() == wasm::kHeapExn) { return entry; } @@ -634,7 +632,7 @@ void WasmTableObject::GetFunctionTableEntry( Isolate* isolate, Handle table, int entry_index, bool* is_valid, bool* is_null, MaybeHandle* instance, int* function_index, MaybeHandle* maybe_js_function) { - DCHECK_EQ(table->type(), wasm::kWasmFuncRef); + DCHECK_EQ(table->type().heap_type(), wasm::kHeapFunc); DCHECK_LT(entry_index, table->current_length()); // We initialize {is_valid} with {true}. We may change it later. *is_valid = true; @@ -856,7 +854,7 @@ void WasmMemoryObject::update_instances(Isolate* isolate, int32_t WasmMemoryObject::Grow(Isolate* isolate, Handle memory_object, uint32_t pages) { - TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"), "GrowMemory"); + TRACE_EVENT0("v8.wasm", "wasm.GrowMemory"); Handle old_buffer(memory_object->array_buffer(), isolate); // Any buffer used as an asmjs memory cannot be detached, and // therefore this memory cannot be grown. @@ -951,13 +949,13 @@ MaybeHandle WasmGlobalObject::New( // Disallow GC until all fields have acceptable types. DisallowHeapAllocation no_gc; - global_obj->set_flags(0); + global_obj->set_raw_type(0); global_obj->set_type(type); global_obj->set_offset(offset); global_obj->set_is_mutable(is_mutable); } - if (type.IsReferenceType()) { + if (type.is_reference_type()) { DCHECK(maybe_untagged_buffer.is_null()); Handle tagged_buffer; if (!maybe_tagged_buffer.ToHandle(&tagged_buffer)) { @@ -1175,16 +1173,6 @@ const WasmModule* WasmInstanceObject::module() { return module_object().module(); } -Handle WasmInstanceObject::GetOrCreateDebugInfo( - Handle instance) { - if (instance->has_debug_info()) { - return handle(instance->debug_info(), instance->GetIsolate()); - } - Handle new_info = WasmDebugInfo::New(instance); - DCHECK(instance->has_debug_info()); - return new_info; -} - Handle WasmInstanceObject::New( Isolate* isolate, Handle module_object) { Handle instance_cons( @@ -1483,7 +1471,7 @@ void WasmInstanceObject::ImportWasmJSFunctionIntoTable( // static uint8_t* WasmInstanceObject::GetGlobalStorage( Handle instance, const wasm::WasmGlobal& global) { - DCHECK(!global.type.IsReferenceType()); + DCHECK(!global.type.is_reference_type()); if (global.mutability && global.imported) { return reinterpret_cast( instance->imported_mutable_globals()[global.index]); @@ -1496,7 +1484,7 @@ uint8_t* WasmInstanceObject::GetGlobalStorage( std::pair, uint32_t> WasmInstanceObject::GetGlobalBufferAndIndex(Handle instance, const wasm::WasmGlobal& global) { - DCHECK(global.type.IsReferenceType()); + DCHECK(global.type.is_reference_type()); Isolate* isolate = instance->GetIsolate(); if (global.mutability && global.imported) { Handle buffer( @@ -1522,10 +1510,19 @@ MaybeHandle WasmInstanceObject::GetGlobalNameOrNull( // static MaybeHandle WasmInstanceObject::GetMemoryNameOrNull( Isolate* isolate, Handle instance, - uint32_t global_index) { + uint32_t memory_index) { return WasmInstanceObject::GetNameFromImportsAndExportsOrNull( isolate, instance, wasm::ImportExportKindCode::kExternalMemory, - global_index); + memory_index); +} + +// static +MaybeHandle WasmInstanceObject::GetTableNameOrNull( + Isolate* isolate, Handle instance, + uint32_t table_index) { + return WasmInstanceObject::GetNameFromImportsAndExportsOrNull( + isolate, instance, wasm::ImportExportKindCode::kExternalTable, + table_index); } // static @@ -1533,7 +1530,8 @@ MaybeHandle WasmInstanceObject::GetNameFromImportsAndExportsOrNull( Isolate* isolate, Handle instance, wasm::ImportExportKindCode kind, uint32_t index) { DCHECK(kind == wasm::ImportExportKindCode::kExternalGlobal || - kind == wasm::ImportExportKindCode::kExternalMemory); + kind == wasm::ImportExportKindCode::kExternalMemory || + kind == wasm::ImportExportKindCode::kExternalTable); wasm::ModuleWireBytes wire_bytes( instance->module_object().native_module()->wire_bytes()); @@ -1562,7 +1560,7 @@ MaybeHandle WasmInstanceObject::GetNameFromImportsAndExportsOrNull( wasm::WasmValue WasmInstanceObject::GetGlobalValue( Handle instance, const wasm::WasmGlobal& global) { Isolate* isolate = instance->GetIsolate(); - if (global.type.IsReferenceType()) { + if (global.type.is_reference_type()) { Handle global_buffer; // The buffer of the global. uint32_t global_index = 0; // The index into the buffer. std::tie(global_buffer, global_index) = @@ -1727,17 +1725,15 @@ uint32_t WasmExceptionPackage::GetEncodedSize( DCHECK_EQ(8, ComputeEncodedElementSize(sig->GetParam(i))); encoded_size += 8; break; - case wasm::ValueType::kAnyRef: - case wasm::ValueType::kFuncRef: - case wasm::ValueType::kNullRef: - case wasm::ValueType::kExnRef: case wasm::ValueType::kRef: case wasm::ValueType::kOptRef: - case wasm::ValueType::kEqRef: encoded_size += 1; break; + case wasm::ValueType::kRtt: case wasm::ValueType::kStmt: case wasm::ValueType::kBottom: + case wasm::ValueType::kI8: + case wasm::ValueType::kI16: UNREACHABLE(); } } -- cgit v1.2.1