[AsmJs] Avoid allocation of WasmModuleObject until instantiation.
Moves allocation of the WasmModuleObject for asm.js code out of SyncCompileTranslatedAsmJS since that is called when we are compiling the native context independent SharedFunctionInfo and the WasmModuleObject requires a native context. Instead save the members required to create the object in the AsmWasmData and create it during module instantiation. Note: since the Wasm module is an implementation detail for asm_wasm code and isn't exposed, this doeesn't have semantic change for asm.js code. As part of this change, the AsmWasmData is changed from a FixedArray to a dedicated struct. Some logic is also moved from module-compiler to wasm-engine to make the seperation between Wasm SyncCompile and AsmJS SyncCompile more clear. BUG=chromium:900535,v8:8395 Change-Id: Ia48469c095b0688f210aa86e7430c9ab4ea4b26b Reviewed-on: https://chromium-review.googlesource.com/c/1345509 Commit-Queue: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#57704}
This commit is contained in:
parent
54f92d52c6
commit
ccd8073c7b
@ -36,11 +36,6 @@ namespace internal {
|
|||||||
const char* const AsmJs::kSingleFunctionName = "__single_function__";
|
const char* const AsmJs::kSingleFunctionName = "__single_function__";
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
enum WasmDataEntries {
|
|
||||||
kWasmDataCompiledModule,
|
|
||||||
kWasmDataUsesBitSet,
|
|
||||||
kWasmDataEntryCount,
|
|
||||||
};
|
|
||||||
|
|
||||||
Handle<Object> StdlibMathMember(Isolate* isolate, Handle<JSReceiver> stdlib,
|
Handle<Object> StdlibMathMember(Isolate* isolate, Handle<JSReceiver> stdlib,
|
||||||
Handle<Name> name) {
|
Handle<Name> name) {
|
||||||
@ -282,23 +277,19 @@ UnoptimizedCompilationJob::Status AsmJsCompilationJob::FinalizeJobImpl(
|
|||||||
Handle<HeapNumber> uses_bitset =
|
Handle<HeapNumber> uses_bitset =
|
||||||
isolate->factory()->NewHeapNumberFromBits(stdlib_uses_.ToIntegral());
|
isolate->factory()->NewHeapNumberFromBits(stdlib_uses_.ToIntegral());
|
||||||
|
|
||||||
|
// The result is a compiled module and serialized standard library uses.
|
||||||
wasm::ErrorThrower thrower(isolate, "AsmJs::Compile");
|
wasm::ErrorThrower thrower(isolate, "AsmJs::Compile");
|
||||||
Handle<WasmModuleObject> compiled =
|
Handle<AsmWasmData> result =
|
||||||
isolate->wasm_engine()
|
isolate->wasm_engine()
|
||||||
->SyncCompileTranslatedAsmJs(
|
->SyncCompileTranslatedAsmJs(
|
||||||
isolate, &thrower,
|
isolate, &thrower,
|
||||||
wasm::ModuleWireBytes(module_->begin(), module_->end()),
|
wasm::ModuleWireBytes(module_->begin(), module_->end()),
|
||||||
parse_info()->script(),
|
Vector<const byte>(asm_offsets_->begin(), asm_offsets_->size()),
|
||||||
Vector<const byte>(asm_offsets_->begin(), asm_offsets_->size()))
|
uses_bitset)
|
||||||
.ToHandleChecked();
|
.ToHandleChecked();
|
||||||
DCHECK(!thrower.error());
|
DCHECK(!thrower.error());
|
||||||
compile_time_ = compile_timer.Elapsed().InMillisecondsF();
|
compile_time_ = compile_timer.Elapsed().InMillisecondsF();
|
||||||
|
|
||||||
// The result is a compiled module and serialized standard library uses.
|
|
||||||
Handle<FixedArray> result =
|
|
||||||
isolate->factory()->NewFixedArray(kWasmDataEntryCount);
|
|
||||||
result->set(kWasmDataCompiledModule, *compiled);
|
|
||||||
result->set(kWasmDataUsesBitSet, *uses_bitset);
|
|
||||||
compilation_info()->SetAsmWasmData(result);
|
compilation_info()->SetAsmWasmData(result);
|
||||||
|
|
||||||
RecordHistograms(isolate);
|
RecordHistograms(isolate);
|
||||||
@ -354,17 +345,20 @@ inline bool IsValidAsmjsMemorySize(size_t size) {
|
|||||||
|
|
||||||
MaybeHandle<Object> AsmJs::InstantiateAsmWasm(Isolate* isolate,
|
MaybeHandle<Object> AsmJs::InstantiateAsmWasm(Isolate* isolate,
|
||||||
Handle<SharedFunctionInfo> shared,
|
Handle<SharedFunctionInfo> shared,
|
||||||
Handle<FixedArray> wasm_data,
|
Handle<AsmWasmData> wasm_data,
|
||||||
Handle<JSReceiver> stdlib,
|
Handle<JSReceiver> stdlib,
|
||||||
Handle<JSReceiver> foreign,
|
Handle<JSReceiver> foreign,
|
||||||
Handle<JSArrayBuffer> memory) {
|
Handle<JSArrayBuffer> memory) {
|
||||||
base::ElapsedTimer instantiate_timer;
|
base::ElapsedTimer instantiate_timer;
|
||||||
instantiate_timer.Start();
|
instantiate_timer.Start();
|
||||||
Handle<HeapNumber> uses_bitset(
|
Handle<HeapNumber> uses_bitset(wasm_data->uses_bitset(), isolate);
|
||||||
HeapNumber::cast(wasm_data->get(kWasmDataUsesBitSet)), isolate);
|
|
||||||
Handle<WasmModuleObject> module(
|
|
||||||
WasmModuleObject::cast(wasm_data->get(kWasmDataCompiledModule)), isolate);
|
|
||||||
Handle<Script> script(Script::cast(shared->script()), isolate);
|
Handle<Script> script(Script::cast(shared->script()), isolate);
|
||||||
|
|
||||||
|
// Allocate the WasmModuleObject.
|
||||||
|
Handle<WasmModuleObject> module =
|
||||||
|
isolate->wasm_engine()->FinalizeTranslatedAsmJs(isolate, wasm_data,
|
||||||
|
script);
|
||||||
|
|
||||||
// TODO(mstarzinger): The position currently points to the module definition
|
// TODO(mstarzinger): The position currently points to the module definition
|
||||||
// but should instead point to the instantiation site (more intuitive).
|
// but should instead point to the instantiation site (more intuitive).
|
||||||
int position = shared->StartPosition();
|
int position = shared->StartPosition();
|
||||||
|
@ -13,6 +13,7 @@ namespace v8 {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
class AccountingAllocator;
|
class AccountingAllocator;
|
||||||
|
class AsmWasmData;
|
||||||
class FunctionLiteral;
|
class FunctionLiteral;
|
||||||
class JSArrayBuffer;
|
class JSArrayBuffer;
|
||||||
class ParseInfo;
|
class ParseInfo;
|
||||||
@ -27,7 +28,7 @@ class AsmJs {
|
|||||||
AccountingAllocator* allocator);
|
AccountingAllocator* allocator);
|
||||||
static MaybeHandle<Object> InstantiateAsmWasm(Isolate* isolate,
|
static MaybeHandle<Object> InstantiateAsmWasm(Isolate* isolate,
|
||||||
Handle<SharedFunctionInfo>,
|
Handle<SharedFunctionInfo>,
|
||||||
Handle<FixedArray> wasm_data,
|
Handle<AsmWasmData> wasm_data,
|
||||||
Handle<JSReceiver> stdlib,
|
Handle<JSReceiver> stdlib,
|
||||||
Handle<JSReceiver> foreign,
|
Handle<JSReceiver> foreign,
|
||||||
Handle<JSArrayBuffer> memory);
|
Handle<JSArrayBuffer> memory);
|
||||||
|
@ -13260,20 +13260,20 @@ TNode<Code> CodeStubAssembler::GetSharedFunctionInfoCode(
|
|||||||
|
|
||||||
int32_t case_values[] = {BYTECODE_ARRAY_TYPE,
|
int32_t case_values[] = {BYTECODE_ARRAY_TYPE,
|
||||||
WASM_EXPORTED_FUNCTION_DATA_TYPE,
|
WASM_EXPORTED_FUNCTION_DATA_TYPE,
|
||||||
FIXED_ARRAY_TYPE,
|
ASM_WASM_DATA_TYPE,
|
||||||
UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE,
|
UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE,
|
||||||
UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE,
|
UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE,
|
||||||
FUNCTION_TEMPLATE_INFO_TYPE};
|
FUNCTION_TEMPLATE_INFO_TYPE};
|
||||||
Label check_is_bytecode_array(this);
|
Label check_is_bytecode_array(this);
|
||||||
Label check_is_exported_function_data(this);
|
Label check_is_exported_function_data(this);
|
||||||
Label check_is_fixed_array(this);
|
Label check_is_asm_wasm_data(this);
|
||||||
Label check_is_uncompiled_data_without_pre_parsed_scope(this);
|
Label check_is_uncompiled_data_without_pre_parsed_scope(this);
|
||||||
Label check_is_uncompiled_data_with_pre_parsed_scope(this);
|
Label check_is_uncompiled_data_with_pre_parsed_scope(this);
|
||||||
Label check_is_function_template_info(this);
|
Label check_is_function_template_info(this);
|
||||||
Label check_is_interpreter_data(this);
|
Label check_is_interpreter_data(this);
|
||||||
Label* case_labels[] = {&check_is_bytecode_array,
|
Label* case_labels[] = {&check_is_bytecode_array,
|
||||||
&check_is_exported_function_data,
|
&check_is_exported_function_data,
|
||||||
&check_is_fixed_array,
|
&check_is_asm_wasm_data,
|
||||||
&check_is_uncompiled_data_without_pre_parsed_scope,
|
&check_is_uncompiled_data_without_pre_parsed_scope,
|
||||||
&check_is_uncompiled_data_with_pre_parsed_scope,
|
&check_is_uncompiled_data_with_pre_parsed_scope,
|
||||||
&check_is_function_template_info};
|
&check_is_function_template_info};
|
||||||
@ -13292,8 +13292,8 @@ TNode<Code> CodeStubAssembler::GetSharedFunctionInfoCode(
|
|||||||
CAST(sfi_data), WasmExportedFunctionData::kWrapperCodeOffset));
|
CAST(sfi_data), WasmExportedFunctionData::kWrapperCodeOffset));
|
||||||
Goto(&done);
|
Goto(&done);
|
||||||
|
|
||||||
// IsFixedArray: Instantiate using AsmWasmData
|
// IsAsmWasmData: Instantiate using AsmWasmData
|
||||||
BIND(&check_is_fixed_array);
|
BIND(&check_is_asm_wasm_data);
|
||||||
sfi_code = HeapConstant(BUILTIN_CODE(isolate(), InstantiateAsmJs));
|
sfi_code = HeapConstant(BUILTIN_CODE(isolate(), InstantiateAsmJs));
|
||||||
Goto(&done);
|
Goto(&done);
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ namespace v8 {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
// Forward declarations.
|
// Forward declarations.
|
||||||
|
class AsmWasmData;
|
||||||
class CallInterfaceDescriptor;
|
class CallInterfaceDescriptor;
|
||||||
class Callable;
|
class Callable;
|
||||||
class Factory;
|
class Factory;
|
||||||
|
@ -333,6 +333,7 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) {
|
|||||||
#undef FIXED_TYPED_ARRAY_CASE
|
#undef FIXED_TYPED_ARRAY_CASE
|
||||||
case FILLER_TYPE:
|
case FILLER_TYPE:
|
||||||
case ACCESS_CHECK_INFO_TYPE:
|
case ACCESS_CHECK_INFO_TYPE:
|
||||||
|
case ASM_WASM_DATA_TYPE:
|
||||||
case CALL_HANDLER_INFO_TYPE:
|
case CALL_HANDLER_INFO_TYPE:
|
||||||
case INTERCEPTOR_INFO_TYPE:
|
case INTERCEPTOR_INFO_TYPE:
|
||||||
case OBJECT_TEMPLATE_INFO_TYPE:
|
case OBJECT_TEMPLATE_INFO_TYPE:
|
||||||
|
@ -1740,6 +1740,15 @@ void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionVerify(
|
|||||||
VerifyObjectField(isolate, kConstantElementsOffset);
|
VerifyObjectField(isolate, kConstantElementsOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmWasmData::AsmWasmDataVerify(Isolate* isolate) {
|
||||||
|
CHECK(IsAsmWasmData());
|
||||||
|
VerifyObjectField(isolate, kManagedNativeModuleOffset);
|
||||||
|
VerifyObjectField(isolate, kExportWrappersOffset);
|
||||||
|
VerifyObjectField(isolate, kAsmJsOffsetTableOffset);
|
||||||
|
CHECK(uses_bitset()->IsHeapNumber());
|
||||||
|
VerifyObjectField(isolate, kUsesBitsetOffset);
|
||||||
|
}
|
||||||
|
|
||||||
void WasmDebugInfo::WasmDebugInfoVerify(Isolate* isolate) {
|
void WasmDebugInfo::WasmDebugInfoVerify(Isolate* isolate) {
|
||||||
CHECK(IsWasmDebugInfo());
|
CHECK(IsWasmDebugInfo());
|
||||||
VerifyObjectField(isolate, kInstanceOffset);
|
VerifyObjectField(isolate, kInstanceOffset);
|
||||||
|
@ -96,6 +96,7 @@ namespace internal {
|
|||||||
V(ACCESSOR_PAIR_TYPE) \
|
V(ACCESSOR_PAIR_TYPE) \
|
||||||
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
|
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
|
||||||
V(ALLOCATION_MEMENTO_TYPE) \
|
V(ALLOCATION_MEMENTO_TYPE) \
|
||||||
|
V(ASM_WASM_DATA_TYPE) \
|
||||||
V(ASYNC_GENERATOR_REQUEST_TYPE) \
|
V(ASYNC_GENERATOR_REQUEST_TYPE) \
|
||||||
V(DEBUG_INFO_TYPE) \
|
V(DEBUG_INFO_TYPE) \
|
||||||
V(FUNCTION_TEMPLATE_INFO_TYPE) \
|
V(FUNCTION_TEMPLATE_INFO_TYPE) \
|
||||||
@ -315,6 +316,7 @@ namespace internal {
|
|||||||
V(_, ALIASED_ARGUMENTS_ENTRY_TYPE, AliasedArgumentsEntry, \
|
V(_, ALIASED_ARGUMENTS_ENTRY_TYPE, AliasedArgumentsEntry, \
|
||||||
aliased_arguments_entry) \
|
aliased_arguments_entry) \
|
||||||
V(_, ALLOCATION_MEMENTO_TYPE, AllocationMemento, allocation_memento) \
|
V(_, ALLOCATION_MEMENTO_TYPE, AllocationMemento, allocation_memento) \
|
||||||
|
V(_, ASM_WASM_DATA_TYPE, AsmWasmData, asm_wasm_data) \
|
||||||
V(_, ASYNC_GENERATOR_REQUEST_TYPE, AsyncGeneratorRequest, \
|
V(_, ASYNC_GENERATOR_REQUEST_TYPE, AsyncGeneratorRequest, \
|
||||||
async_generator_request) \
|
async_generator_request) \
|
||||||
V(_, DEBUG_INFO_TYPE, DebugInfo, debug_info) \
|
V(_, DEBUG_INFO_TYPE, DebugInfo, debug_info) \
|
||||||
|
@ -1786,6 +1786,15 @@ void ArrayBoilerplateDescription::ArrayBoilerplateDescriptionPrint(
|
|||||||
os << "\n";
|
os << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsmWasmData::AsmWasmDataPrint(std::ostream& os) { // NOLINT
|
||||||
|
HeapObject::PrintHeader(os, "AsmWasmData");
|
||||||
|
os << "\n - native module: " << Brief(managed_native_module());
|
||||||
|
os << "\n - export_wrappers: " << Brief(export_wrappers());
|
||||||
|
os << "\n - offset table: " << Brief(asm_js_offset_table());
|
||||||
|
os << "\n - uses bitset: " << uses_bitset()->value();
|
||||||
|
os << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
void WasmDebugInfo::WasmDebugInfoPrint(std::ostream& os) { // NOLINT
|
void WasmDebugInfo::WasmDebugInfoPrint(std::ostream& os) { // NOLINT
|
||||||
HeapObject::PrintHeader(os, "WasmDebugInfo");
|
HeapObject::PrintHeader(os, "WasmDebugInfo");
|
||||||
os << "\n - wasm_instance: " << Brief(wasm_instance());
|
os << "\n - wasm_instance: " << Brief(wasm_instance());
|
||||||
|
@ -13824,8 +13824,8 @@ Code SharedFunctionInfo::GetCode() const {
|
|||||||
// Having a bytecode array means we are a compiled, interpreted function.
|
// Having a bytecode array means we are a compiled, interpreted function.
|
||||||
DCHECK(HasBytecodeArray());
|
DCHECK(HasBytecodeArray());
|
||||||
return isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline);
|
return isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline);
|
||||||
} else if (data->IsFixedArray()) {
|
} else if (data->IsAsmWasmData()) {
|
||||||
// Having a fixed array means we are an asm.js/wasm function.
|
// Having AsmWasmData means we are an asm.js/wasm function.
|
||||||
DCHECK(HasAsmWasmData());
|
DCHECK(HasAsmWasmData());
|
||||||
return isolate->builtins()->builtin(Builtins::kInstantiateAsmJs);
|
return isolate->builtins()->builtin(Builtins::kInstantiateAsmJs);
|
||||||
} else if (data->IsUncompiledData()) {
|
} else if (data->IsUncompiledData()) {
|
||||||
|
@ -140,6 +140,7 @@
|
|||||||
// - SharedFunctionInfo
|
// - SharedFunctionInfo
|
||||||
// - Struct
|
// - Struct
|
||||||
// - AccessorInfo
|
// - AccessorInfo
|
||||||
|
// - AsmWasmData
|
||||||
// - PromiseReaction
|
// - PromiseReaction
|
||||||
// - PromiseCapability
|
// - PromiseCapability
|
||||||
// - AccessorPair
|
// - AccessorPair
|
||||||
@ -391,6 +392,7 @@ enum InstanceType : uint16_t {
|
|||||||
ACCESSOR_PAIR_TYPE,
|
ACCESSOR_PAIR_TYPE,
|
||||||
ALIASED_ARGUMENTS_ENTRY_TYPE,
|
ALIASED_ARGUMENTS_ENTRY_TYPE,
|
||||||
ALLOCATION_MEMENTO_TYPE,
|
ALLOCATION_MEMENTO_TYPE,
|
||||||
|
ASM_WASM_DATA_TYPE,
|
||||||
ASYNC_GENERATOR_REQUEST_TYPE,
|
ASYNC_GENERATOR_REQUEST_TYPE,
|
||||||
DEBUG_INFO_TYPE,
|
DEBUG_INFO_TYPE,
|
||||||
FUNCTION_TEMPLATE_INFO_TYPE,
|
FUNCTION_TEMPLATE_INFO_TYPE,
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "src/objects/debug-objects-inl.h"
|
#include "src/objects/debug-objects-inl.h"
|
||||||
#include "src/objects/scope-info.h"
|
#include "src/objects/scope-info.h"
|
||||||
#include "src/objects/templates.h"
|
#include "src/objects/templates.h"
|
||||||
|
#include "src/wasm/wasm-objects-inl.h"
|
||||||
|
|
||||||
// Has to be the last include (doesn't have include guards):
|
// Has to be the last include (doesn't have include guards):
|
||||||
#include "src/objects/object-macros.h"
|
#include "src/objects/object-macros.h"
|
||||||
@ -456,15 +457,15 @@ void SharedFunctionInfo::set_interpreter_data(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SharedFunctionInfo::HasAsmWasmData() const {
|
bool SharedFunctionInfo::HasAsmWasmData() const {
|
||||||
return function_data()->IsFixedArray();
|
return function_data()->IsAsmWasmData();
|
||||||
}
|
}
|
||||||
|
|
||||||
FixedArray* SharedFunctionInfo::asm_wasm_data() const {
|
AsmWasmData* SharedFunctionInfo::asm_wasm_data() const {
|
||||||
DCHECK(HasAsmWasmData());
|
DCHECK(HasAsmWasmData());
|
||||||
return FixedArray::cast(function_data());
|
return AsmWasmData::cast(function_data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFunctionInfo::set_asm_wasm_data(FixedArray* data) {
|
void SharedFunctionInfo::set_asm_wasm_data(AsmWasmData* data) {
|
||||||
DCHECK(function_data() == Smi::FromEnum(Builtins::kCompileLazy) ||
|
DCHECK(function_data() == Smi::FromEnum(Builtins::kCompileLazy) ||
|
||||||
HasUncompiledData() || HasAsmWasmData());
|
HasUncompiledData() || HasAsmWasmData());
|
||||||
set_function_data(data);
|
set_function_data(data);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
class AsmWasmData;
|
||||||
class BytecodeArray;
|
class BytecodeArray;
|
||||||
class CoverageInfo;
|
class CoverageInfo;
|
||||||
class DebugInfo;
|
class DebugInfo;
|
||||||
@ -281,7 +282,7 @@ class SharedFunctionInfo : public HeapObject, public NeverReadOnlySpaceObject {
|
|||||||
// - a BytecodeArray for the interpreter [HasBytecodeArray()].
|
// - a BytecodeArray for the interpreter [HasBytecodeArray()].
|
||||||
// - a InterpreterData with the BytecodeArray and a copy of the
|
// - a InterpreterData with the BytecodeArray and a copy of the
|
||||||
// interpreter trampoline [HasInterpreterData()]
|
// interpreter trampoline [HasInterpreterData()]
|
||||||
// - a FixedArray with Asm->Wasm conversion [HasAsmWasmData()].
|
// - an AsmWasmData with Asm->Wasm conversion [HasAsmWasmData()].
|
||||||
// - a Smi containing the builtin id [HasBuiltinId()]
|
// - a Smi containing the builtin id [HasBuiltinId()]
|
||||||
// - a UncompiledDataWithoutPreParsedScope for lazy compilation
|
// - a UncompiledDataWithoutPreParsedScope for lazy compilation
|
||||||
// [HasUncompiledDataWithoutPreParsedScope()]
|
// [HasUncompiledDataWithoutPreParsedScope()]
|
||||||
@ -303,8 +304,8 @@ class SharedFunctionInfo : public HeapObject, public NeverReadOnlySpaceObject {
|
|||||||
inline BytecodeArray* GetDebugBytecodeArray() const;
|
inline BytecodeArray* GetDebugBytecodeArray() const;
|
||||||
inline void SetDebugBytecodeArray(BytecodeArray* bytecode);
|
inline void SetDebugBytecodeArray(BytecodeArray* bytecode);
|
||||||
inline bool HasAsmWasmData() const;
|
inline bool HasAsmWasmData() const;
|
||||||
inline FixedArray* asm_wasm_data() const;
|
inline AsmWasmData* asm_wasm_data() const;
|
||||||
inline void set_asm_wasm_data(FixedArray* data);
|
inline void set_asm_wasm_data(AsmWasmData* data);
|
||||||
|
|
||||||
// A brief note to clear up possible confusion:
|
// A brief note to clear up possible confusion:
|
||||||
// builtin_id corresponds to the auto-generated
|
// builtin_id corresponds to the auto-generated
|
||||||
|
@ -123,7 +123,7 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
|
|||||||
}
|
}
|
||||||
if (function->shared()->HasAsmWasmData()) {
|
if (function->shared()->HasAsmWasmData()) {
|
||||||
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
|
Handle<SharedFunctionInfo> shared(function->shared(), isolate);
|
||||||
Handle<FixedArray> data(shared->asm_wasm_data(), isolate);
|
Handle<AsmWasmData> data(shared->asm_wasm_data(), isolate);
|
||||||
MaybeHandle<Object> result = AsmJs::InstantiateAsmWasm(
|
MaybeHandle<Object> result = AsmJs::InstantiateAsmWasm(
|
||||||
isolate, shared, data, stdlib, foreign, memory);
|
isolate, shared, data, stdlib, foreign, memory);
|
||||||
if (!result.is_null()) {
|
if (!result.is_null()) {
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
class AsmWasmData;
|
||||||
class CoverageInfo;
|
class CoverageInfo;
|
||||||
class DeclarationScope;
|
class DeclarationScope;
|
||||||
class FunctionLiteral;
|
class FunctionLiteral;
|
||||||
@ -83,8 +84,8 @@ class V8_EXPORT_PRIVATE UnoptimizedCompilationInfo final {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool has_asm_wasm_data() const { return !asm_wasm_data_.is_null(); }
|
bool has_asm_wasm_data() const { return !asm_wasm_data_.is_null(); }
|
||||||
Handle<FixedArray> asm_wasm_data() const { return asm_wasm_data_; }
|
Handle<AsmWasmData> asm_wasm_data() const { return asm_wasm_data_; }
|
||||||
void SetAsmWasmData(Handle<FixedArray> asm_wasm_data) {
|
void SetAsmWasmData(Handle<AsmWasmData> asm_wasm_data) {
|
||||||
asm_wasm_data_ = asm_wasm_data;
|
asm_wasm_data_ = asm_wasm_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +124,8 @@ class V8_EXPORT_PRIVATE UnoptimizedCompilationInfo final {
|
|||||||
// Holds the bytecode array generated by the interpreter.
|
// Holds the bytecode array generated by the interpreter.
|
||||||
Handle<BytecodeArray> bytecode_array_;
|
Handle<BytecodeArray> bytecode_array_;
|
||||||
|
|
||||||
// Holds the asm_wasm array generated by the asmjs compiler.
|
// Holds the asm_wasm data struct generated by the asmjs compiler.
|
||||||
Handle<FixedArray> asm_wasm_data_;
|
Handle<AsmWasmData> asm_wasm_data_;
|
||||||
|
|
||||||
// Holds the feedback vector spec generated during compilation
|
// Holds the feedback vector spec generated during compilation
|
||||||
FeedbackVectorSpec feedback_vector_spec_;
|
FeedbackVectorSpec feedback_vector_spec_;
|
||||||
|
@ -683,8 +683,7 @@ void FinishCompilationUnits(CompilationStateImpl* compilation_state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileInParallel(Isolate* isolate, NativeModule* native_module,
|
void CompileInParallel(Isolate* isolate, NativeModule* native_module) {
|
||||||
Handle<WasmModuleObject> module_object) {
|
|
||||||
// Data structures for the parallel compilation.
|
// Data structures for the parallel compilation.
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
@ -831,9 +830,8 @@ void ValidateSequentially(Isolate* isolate, NativeModule* native_module,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
|
void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
|
||||||
Handle<WasmModuleObject> module_object,
|
const WasmModule* wasm_module,
|
||||||
const WasmModule* wasm_module) {
|
NativeModule* native_module) {
|
||||||
NativeModule* const native_module = module_object->native_module();
|
|
||||||
ModuleWireBytes wire_bytes(native_module->wire_bytes());
|
ModuleWireBytes wire_bytes(native_module->wire_bytes());
|
||||||
|
|
||||||
if (compile_lazy(wasm_module)) {
|
if (compile_lazy(wasm_module)) {
|
||||||
@ -858,7 +856,7 @@ void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
|
|||||||
V8::GetCurrentPlatform()->NumberOfWorkerThreads() > 0;
|
V8::GetCurrentPlatform()->NumberOfWorkerThreads() > 0;
|
||||||
|
|
||||||
if (compile_parallel) {
|
if (compile_parallel) {
|
||||||
CompileInParallel(isolate, native_module, module_object);
|
CompileInParallel(isolate, native_module);
|
||||||
} else {
|
} else {
|
||||||
CompileSequentially(isolate, native_module, thrower);
|
CompileSequentially(isolate, native_module, thrower);
|
||||||
}
|
}
|
||||||
@ -965,11 +963,10 @@ class BackgroundCompileTask : public CancelableTask {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
MaybeHandle<WasmModuleObject> CompileToModuleObject(
|
std::unique_ptr<NativeModule> CompileToNativeModule(
|
||||||
Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower,
|
Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower,
|
||||||
std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes,
|
std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes,
|
||||||
Handle<Script> asm_js_script,
|
Handle<FixedArray>* export_wrappers_out) {
|
||||||
Vector<const byte> asm_js_offset_table_bytes) {
|
|
||||||
const WasmModule* wasm_module = module.get();
|
const WasmModule* wasm_module = module.get();
|
||||||
TimedHistogramScope wasm_compile_module_time_scope(SELECT_WASM_COUNTER(
|
TimedHistogramScope wasm_compile_module_time_scope(SELECT_WASM_COUNTER(
|
||||||
isolate->counters(), wasm_module->origin, wasm_compile, module_time));
|
isolate->counters(), wasm_module->origin, wasm_compile, module_time));
|
||||||
@ -978,53 +975,36 @@ MaybeHandle<WasmModuleObject> CompileToModuleObject(
|
|||||||
if (wasm_module->has_shared_memory) {
|
if (wasm_module->has_shared_memory) {
|
||||||
isolate->CountUsage(v8::Isolate::UseCounterFeature::kWasmSharedMemory);
|
isolate->CountUsage(v8::Isolate::UseCounterFeature::kWasmSharedMemory);
|
||||||
}
|
}
|
||||||
|
int export_wrapper_size = static_cast<int>(module->num_exported_functions);
|
||||||
|
|
||||||
// Create heap objects for script, module bytes and asm.js offset table to
|
|
||||||
// be stored in the module object.
|
|
||||||
Handle<Script> script;
|
|
||||||
Handle<ByteArray> asm_js_offset_table;
|
|
||||||
if (asm_js_script.is_null()) {
|
|
||||||
script = CreateWasmScript(isolate, wire_bytes, wasm_module->source_map_url);
|
|
||||||
} else {
|
|
||||||
script = asm_js_script;
|
|
||||||
asm_js_offset_table =
|
|
||||||
isolate->factory()->NewByteArray(asm_js_offset_table_bytes.length());
|
|
||||||
asm_js_offset_table->copy_in(0, asm_js_offset_table_bytes.start(),
|
|
||||||
asm_js_offset_table_bytes.length());
|
|
||||||
}
|
|
||||||
// TODO(wasm): only save the sections necessary to deserialize a
|
// TODO(wasm): only save the sections necessary to deserialize a
|
||||||
// {WasmModule}. E.g. function bodies could be omitted.
|
// {WasmModule}. E.g. function bodies could be omitted.
|
||||||
OwnedVector<uint8_t> wire_bytes_copy =
|
OwnedVector<uint8_t> wire_bytes_copy =
|
||||||
OwnedVector<uint8_t>::Of(wire_bytes.module_bytes());
|
OwnedVector<uint8_t>::Of(wire_bytes.module_bytes());
|
||||||
|
|
||||||
// Create the module object.
|
// Create and compile the native module.
|
||||||
// TODO(clemensh): For the same module (same bytes / same hash), we should
|
size_t code_size_estimate =
|
||||||
// only have one WasmModuleObject. Otherwise, we might only set
|
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(module.get());
|
||||||
// breakpoints on a (potentially empty) subset of the instances.
|
|
||||||
|
|
||||||
// Create the compiled module object and populate with compiled functions
|
// Create a new {NativeModule} first.
|
||||||
// and information needed at instantiation time. This object needs to be
|
auto native_module = isolate->wasm_engine()->code_manager()->NewNativeModule(
|
||||||
// serializable. Instantiation may occur off a deserialized version of this
|
isolate, enabled, code_size_estimate,
|
||||||
// object.
|
wasm::NativeModule::kCanAllocateMoreMemory, std::move(module));
|
||||||
Handle<WasmModuleObject> module_object = WasmModuleObject::New(
|
native_module->SetWireBytes(std::move(wire_bytes_copy));
|
||||||
isolate, enabled, std::move(module), std::move(wire_bytes_copy), script,
|
native_module->SetRuntimeStubs(isolate);
|
||||||
asm_js_offset_table);
|
|
||||||
CompileNativeModule(isolate, thrower, module_object, wasm_module);
|
CompileNativeModule(isolate, thrower, wasm_module, native_module.get());
|
||||||
if (thrower->error()) return {};
|
if (thrower->error()) return {};
|
||||||
|
|
||||||
// Compile JS->wasm wrappers for exported functions.
|
// Compile JS->wasm wrappers for exported functions.
|
||||||
CompileJsToWasmWrappers(isolate, module_object);
|
*export_wrappers_out =
|
||||||
|
isolate->factory()->NewFixedArray(export_wrapper_size, TENURED);
|
||||||
// If we created a wasm script, finish it now and make it public to the
|
CompileJsToWasmWrappers(isolate, native_module.get(), *export_wrappers_out);
|
||||||
// debugger.
|
|
||||||
if (asm_js_script.is_null()) {
|
|
||||||
isolate->debug()->OnAfterCompile(script);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Log the code within the generated module for profiling.
|
// Log the code within the generated module for profiling.
|
||||||
module_object->native_module()->LogWasmCodes(isolate);
|
native_module->LogWasmCodes(isolate);
|
||||||
|
|
||||||
return module_object;
|
return native_module;
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceBuilder::InstanceBuilder(Isolate* isolate, ErrorThrower* thrower,
|
InstanceBuilder::InstanceBuilder(Isolate* isolate, ErrorThrower* thrower,
|
||||||
@ -1125,7 +1105,7 @@ MaybeHandle<WasmInstanceObject> InstanceBuilder::Build() {
|
|||||||
|
|
||||||
// Recompile all functions in this native module.
|
// Recompile all functions in this native module.
|
||||||
ErrorThrower thrower(isolate_, "recompile");
|
ErrorThrower thrower(isolate_, "recompile");
|
||||||
CompileNativeModule(isolate_, &thrower, module_object_, module_);
|
CompileNativeModule(isolate_, &thrower, module_, native_module);
|
||||||
if (thrower.error()) {
|
if (thrower.error()) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -2741,7 +2721,9 @@ class AsyncCompileJob::CompileWrappers : public CompileStep {
|
|||||||
void RunInForeground(AsyncCompileJob* job) override {
|
void RunInForeground(AsyncCompileJob* job) override {
|
||||||
TRACE_COMPILE("(5) Compile wrappers...\n");
|
TRACE_COMPILE("(5) Compile wrappers...\n");
|
||||||
// Compile JS->wasm wrappers for exported functions.
|
// Compile JS->wasm wrappers for exported functions.
|
||||||
CompileJsToWasmWrappers(job->isolate_, job->module_object_);
|
CompileJsToWasmWrappers(
|
||||||
|
job->isolate_, job->module_object_->native_module(),
|
||||||
|
handle(job->module_object_->export_wrappers(), job->isolate_));
|
||||||
job->DoSync<FinishModule>();
|
job->DoSync<FinishModule>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -3220,13 +3202,12 @@ void CompilationStateImpl::NotifyOnEvent(CompilationEvent event,
|
|||||||
if (callback_) callback_(event, error_result);
|
if (callback_) callback_(event, error_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileJsToWasmWrappers(Isolate* isolate,
|
void CompileJsToWasmWrappers(Isolate* isolate, NativeModule* native_module,
|
||||||
Handle<WasmModuleObject> module_object) {
|
Handle<FixedArray> export_wrappers) {
|
||||||
JSToWasmWrapperCache js_to_wasm_cache;
|
JSToWasmWrapperCache js_to_wasm_cache;
|
||||||
int wrapper_index = 0;
|
int wrapper_index = 0;
|
||||||
Handle<FixedArray> export_wrappers(module_object->export_wrappers(), isolate);
|
|
||||||
NativeModule* native_module = module_object->native_module();
|
|
||||||
const WasmModule* module = native_module->module();
|
const WasmModule* module = native_module->module();
|
||||||
|
|
||||||
// TODO(6792): Wrappers below are allocated with {Factory::NewCode}. As an
|
// TODO(6792): Wrappers below are allocated with {Factory::NewCode}. As an
|
||||||
// optimization we keep the code space unlocked to avoid repeated unlocking
|
// optimization we keep the code space unlocked to avoid repeated unlocking
|
||||||
// because many such wrapper are allocated in sequence below.
|
// because many such wrapper are allocated in sequence below.
|
||||||
|
@ -37,10 +37,10 @@ class NativeModule;
|
|||||||
class WasmCode;
|
class WasmCode;
|
||||||
struct WasmModule;
|
struct WasmModule;
|
||||||
|
|
||||||
MaybeHandle<WasmModuleObject> CompileToModuleObject(
|
std::unique_ptr<NativeModule> CompileToNativeModule(
|
||||||
Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower,
|
Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower,
|
||||||
std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes,
|
std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes,
|
||||||
Handle<Script> asm_js_script, Vector<const byte> asm_js_offset_table_bytes);
|
Handle<FixedArray>* export_wrappers_out);
|
||||||
|
|
||||||
MaybeHandle<WasmInstanceObject> InstantiateToInstanceObject(
|
MaybeHandle<WasmInstanceObject> InstantiateToInstanceObject(
|
||||||
Isolate* isolate, ErrorThrower* thrower,
|
Isolate* isolate, ErrorThrower* thrower,
|
||||||
@ -48,8 +48,8 @@ MaybeHandle<WasmInstanceObject> InstantiateToInstanceObject(
|
|||||||
MaybeHandle<JSArrayBuffer> memory);
|
MaybeHandle<JSArrayBuffer> memory);
|
||||||
|
|
||||||
V8_EXPORT_PRIVATE
|
V8_EXPORT_PRIVATE
|
||||||
void CompileJsToWasmWrappers(Isolate* isolate,
|
void CompileJsToWasmWrappers(Isolate* isolate, NativeModule* native_module,
|
||||||
Handle<WasmModuleObject> module_object);
|
Handle<FixedArray> export_wrappers);
|
||||||
|
|
||||||
V8_EXPORT_PRIVATE Handle<Script> CreateWasmScript(
|
V8_EXPORT_PRIVATE Handle<Script> CreateWasmScript(
|
||||||
Isolate* isolate, const ModuleWireBytes& wire_bytes,
|
Isolate* isolate, const ModuleWireBytes& wire_bytes,
|
||||||
|
@ -38,20 +38,50 @@ bool WasmEngine::SyncValidate(Isolate* isolate, const WasmFeatures& enabled,
|
|||||||
return result.ok();
|
return result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeHandle<WasmModuleObject> WasmEngine::SyncCompileTranslatedAsmJs(
|
MaybeHandle<AsmWasmData> WasmEngine::SyncCompileTranslatedAsmJs(
|
||||||
Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes,
|
Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes,
|
||||||
Handle<Script> asm_js_script,
|
Vector<const byte> asm_js_offset_table_bytes,
|
||||||
Vector<const byte> asm_js_offset_table_bytes) {
|
Handle<HeapNumber> uses_bitset) {
|
||||||
ModuleResult result =
|
ModuleResult result =
|
||||||
DecodeWasmModule(kAsmjsWasmFeatures, bytes.start(), bytes.end(), false,
|
DecodeWasmModule(kAsmjsWasmFeatures, bytes.start(), bytes.end(), false,
|
||||||
kAsmJsOrigin, isolate->counters(), allocator());
|
kAsmJsOrigin, isolate->counters(), allocator());
|
||||||
CHECK(!result.failed());
|
CHECK(!result.failed());
|
||||||
|
|
||||||
// Transfer ownership of the WasmModule to the {Managed<WasmModule>} generated
|
// Transfer ownership of the WasmModule to the {Managed<WasmModule>} generated
|
||||||
// in {CompileToModuleObject}.
|
// in {CompileToNativeModule}.
|
||||||
return CompileToModuleObject(isolate, kAsmjsWasmFeatures, thrower,
|
Handle<FixedArray> export_wrappers;
|
||||||
std::move(result).value(), bytes, asm_js_script,
|
std::unique_ptr<NativeModule> native_module =
|
||||||
asm_js_offset_table_bytes);
|
CompileToNativeModule(isolate, kAsmjsWasmFeatures, thrower,
|
||||||
|
std::move(result).value(), bytes, &export_wrappers);
|
||||||
|
if (!native_module) return {};
|
||||||
|
|
||||||
|
// Create heap objects for asm.js offset table to be stored in the module
|
||||||
|
// object.
|
||||||
|
Handle<ByteArray> asm_js_offset_table =
|
||||||
|
isolate->factory()->NewByteArray(asm_js_offset_table_bytes.length());
|
||||||
|
asm_js_offset_table->copy_in(0, asm_js_offset_table_bytes.start(),
|
||||||
|
asm_js_offset_table_bytes.length());
|
||||||
|
|
||||||
|
return AsmWasmData::New(isolate, std::move(native_module), export_wrappers,
|
||||||
|
asm_js_offset_table, uses_bitset);
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle<WasmModuleObject> WasmEngine::FinalizeTranslatedAsmJs(
|
||||||
|
Isolate* isolate, Handle<AsmWasmData> asm_wasm_data,
|
||||||
|
Handle<Script> script) {
|
||||||
|
std::shared_ptr<NativeModule> native_module =
|
||||||
|
asm_wasm_data->managed_native_module()->get();
|
||||||
|
Handle<FixedArray> export_wrappers =
|
||||||
|
handle(asm_wasm_data->export_wrappers(), isolate);
|
||||||
|
size_t code_size_estimate =
|
||||||
|
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(
|
||||||
|
native_module->module());
|
||||||
|
|
||||||
|
Handle<WasmModuleObject> module_object =
|
||||||
|
WasmModuleObject::New(isolate, std::move(native_module), script,
|
||||||
|
export_wrappers, code_size_estimate);
|
||||||
|
module_object->set_asm_js_offset_table(asm_wasm_data->asm_js_offset_table());
|
||||||
|
return module_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeHandle<WasmModuleObject> WasmEngine::SyncCompile(
|
MaybeHandle<WasmModuleObject> WasmEngine::SyncCompile(
|
||||||
@ -67,9 +97,34 @@ MaybeHandle<WasmModuleObject> WasmEngine::SyncCompile(
|
|||||||
|
|
||||||
// Transfer ownership of the WasmModule to the {Managed<WasmModule>} generated
|
// Transfer ownership of the WasmModule to the {Managed<WasmModule>} generated
|
||||||
// in {CompileToModuleObject}.
|
// in {CompileToModuleObject}.
|
||||||
return CompileToModuleObject(isolate, enabled, thrower,
|
Handle<FixedArray> export_wrappers;
|
||||||
std::move(result).value(), bytes,
|
std::unique_ptr<NativeModule> native_module =
|
||||||
Handle<Script>(), Vector<const byte>());
|
CompileToNativeModule(isolate, enabled, thrower,
|
||||||
|
std::move(result).value(), bytes, &export_wrappers);
|
||||||
|
if (!native_module) return {};
|
||||||
|
|
||||||
|
Handle<Script> script =
|
||||||
|
CreateWasmScript(isolate, bytes, native_module->module()->source_map_url);
|
||||||
|
size_t code_size_estimate =
|
||||||
|
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(
|
||||||
|
native_module->module());
|
||||||
|
|
||||||
|
// Create the module object.
|
||||||
|
// TODO(clemensh): For the same module (same bytes / same hash), we should
|
||||||
|
// only have one WasmModuleObject. Otherwise, we might only set
|
||||||
|
// breakpoints on a (potentially empty) subset of the instances.
|
||||||
|
|
||||||
|
// Create the compiled module object and populate with compiled functions
|
||||||
|
// and information needed at instantiation time. This object needs to be
|
||||||
|
// serializable. Instantiation may occur off a deserialized version of this
|
||||||
|
// object.
|
||||||
|
Handle<WasmModuleObject> module_object =
|
||||||
|
WasmModuleObject::New(isolate, std::move(native_module), script,
|
||||||
|
export_wrappers, code_size_estimate);
|
||||||
|
|
||||||
|
// Finish the Wasm script now and make it public to the debugger.
|
||||||
|
isolate->debug()->OnAfterCompile(script);
|
||||||
|
return module_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
MaybeHandle<WasmInstanceObject> WasmEngine::SyncInstantiate(
|
MaybeHandle<WasmInstanceObject> WasmEngine::SyncInstantiate(
|
||||||
@ -194,7 +249,8 @@ Handle<WasmModuleObject> WasmEngine::ImportNativeModule(
|
|||||||
size_t code_size = shared_module->committed_code_space();
|
size_t code_size = shared_module->committed_code_space();
|
||||||
Handle<WasmModuleObject> module_object = WasmModuleObject::New(
|
Handle<WasmModuleObject> module_object = WasmModuleObject::New(
|
||||||
isolate, std::move(shared_module), script, code_size);
|
isolate, std::move(shared_module), script, code_size);
|
||||||
CompileJsToWasmWrappers(isolate, module_object);
|
CompileJsToWasmWrappers(isolate, module_object->native_module(),
|
||||||
|
handle(module_object->export_wrappers(), isolate));
|
||||||
return module_object;
|
return module_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
class AsmWasmData;
|
||||||
class CodeTracer;
|
class CodeTracer;
|
||||||
class CompilationStatistics;
|
class CompilationStatistics;
|
||||||
class WasmInstanceObject;
|
class WasmInstanceObject;
|
||||||
@ -56,10 +57,13 @@ class V8_EXPORT_PRIVATE WasmEngine {
|
|||||||
|
|
||||||
// Synchronously compiles the given bytes that represent a translated
|
// Synchronously compiles the given bytes that represent a translated
|
||||||
// asm.js module.
|
// asm.js module.
|
||||||
MaybeHandle<WasmModuleObject> SyncCompileTranslatedAsmJs(
|
MaybeHandle<AsmWasmData> SyncCompileTranslatedAsmJs(
|
||||||
Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes,
|
Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes,
|
||||||
Handle<Script> asm_js_script,
|
Vector<const byte> asm_js_offset_table_bytes,
|
||||||
Vector<const byte> asm_js_offset_table_bytes);
|
Handle<HeapNumber> uses_bitset);
|
||||||
|
Handle<WasmModuleObject> FinalizeTranslatedAsmJs(
|
||||||
|
Isolate* isolate, Handle<AsmWasmData> asm_wasm_data,
|
||||||
|
Handle<Script> script);
|
||||||
|
|
||||||
// Synchronously compiles the given bytes that represent an encoded WASM
|
// Synchronously compiles the given bytes that represent an encoded WASM
|
||||||
// module.
|
// module.
|
||||||
|
@ -29,6 +29,7 @@ CAST_ACCESSOR(WasmInstanceObject)
|
|||||||
CAST_ACCESSOR(WasmMemoryObject)
|
CAST_ACCESSOR(WasmMemoryObject)
|
||||||
CAST_ACCESSOR(WasmModuleObject)
|
CAST_ACCESSOR(WasmModuleObject)
|
||||||
CAST_ACCESSOR(WasmTableObject)
|
CAST_ACCESSOR(WasmTableObject)
|
||||||
|
CAST_ACCESSOR(AsmWasmData)
|
||||||
|
|
||||||
#define OPTIONAL_ACCESSORS(holder, name, type, offset) \
|
#define OPTIONAL_ACCESSORS(holder, name, type, offset) \
|
||||||
bool holder::has_##name() { \
|
bool holder::has_##name() { \
|
||||||
@ -240,6 +241,13 @@ uint32_t WasmTableObject::current_length() { return functions()->length(); }
|
|||||||
|
|
||||||
bool WasmMemoryObject::has_maximum_pages() { return maximum_pages() >= 0; }
|
bool WasmMemoryObject::has_maximum_pages() { return maximum_pages() >= 0; }
|
||||||
|
|
||||||
|
// AsmWasmData
|
||||||
|
ACCESSORS(AsmWasmData, managed_native_module, Managed<wasm::NativeModule>,
|
||||||
|
kManagedNativeModuleOffset)
|
||||||
|
ACCESSORS(AsmWasmData, export_wrappers, FixedArray, kExportWrappersOffset)
|
||||||
|
ACCESSORS(AsmWasmData, asm_js_offset_table, ByteArray, kAsmJsOffsetTableOffset)
|
||||||
|
ACCESSORS(AsmWasmData, uses_bitset, HeapNumber, kUsesBitsetOffset)
|
||||||
|
|
||||||
#include "src/objects/object-macros-undef.h"
|
#include "src/objects/object-macros-undef.h"
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -205,6 +205,16 @@ Handle<WasmModuleObject> WasmModuleObject::New(
|
|||||||
int export_wrapper_size = static_cast<int>(module->num_exported_functions);
|
int export_wrapper_size = static_cast<int>(module->num_exported_functions);
|
||||||
Handle<FixedArray> export_wrappers =
|
Handle<FixedArray> export_wrappers =
|
||||||
isolate->factory()->NewFixedArray(export_wrapper_size, TENURED);
|
isolate->factory()->NewFixedArray(export_wrapper_size, TENURED);
|
||||||
|
return New(isolate, std::move(native_module), script, export_wrappers,
|
||||||
|
code_size_estimate);
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Handle<WasmModuleObject> WasmModuleObject::New(
|
||||||
|
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
||||||
|
Handle<Script> script, Handle<FixedArray> export_wrappers,
|
||||||
|
size_t code_size_estimate) {
|
||||||
|
const WasmModule* module = native_module->module();
|
||||||
|
|
||||||
// Use the given shared {NativeModule}, but increase its reference count by
|
// Use the given shared {NativeModule}, but increase its reference count by
|
||||||
// allocating a new {Managed<T>} that the {WasmModuleObject} references.
|
// allocating a new {Managed<T>} that the {WasmModuleObject} references.
|
||||||
@ -1426,6 +1436,26 @@ wasm::FunctionSig* WasmExportedFunction::sig() {
|
|||||||
return instance()->module()->functions[function_index()].sig;
|
return instance()->module()->functions[function_index()].sig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Handle<AsmWasmData> AsmWasmData::New(
|
||||||
|
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
||||||
|
Handle<FixedArray> export_wrappers, Handle<ByteArray> asm_js_offset_table,
|
||||||
|
Handle<HeapNumber> uses_bitset) {
|
||||||
|
const WasmModule* module = native_module->module();
|
||||||
|
size_t memory_estimate =
|
||||||
|
wasm::WasmCodeManager::EstimateNativeModuleCodeSize(module) +
|
||||||
|
wasm::WasmCodeManager::EstimateNativeModuleNonCodeSize(module);
|
||||||
|
Handle<Managed<wasm::NativeModule>> managed_native_module =
|
||||||
|
Managed<wasm::NativeModule>::FromSharedPtr(isolate, memory_estimate,
|
||||||
|
std::move(native_module));
|
||||||
|
Handle<AsmWasmData> result = Handle<AsmWasmData>::cast(
|
||||||
|
isolate->factory()->NewStruct(ASM_WASM_DATA_TYPE, TENURED));
|
||||||
|
result->set_managed_native_module(*managed_native_module);
|
||||||
|
result->set_export_wrappers(*export_wrappers);
|
||||||
|
result->set_asm_js_offset_table(*asm_js_offset_table);
|
||||||
|
result->set_uses_bitset(*uses_bitset);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#undef TRACE
|
#undef TRACE
|
||||||
#undef TRACE_IFT
|
#undef TRACE_IFT
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -146,6 +146,10 @@ class WasmModuleObject : public JSObject {
|
|||||||
static Handle<WasmModuleObject> New(
|
static Handle<WasmModuleObject> New(
|
||||||
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
||||||
Handle<Script> script, size_t code_size_estimate);
|
Handle<Script> script, size_t code_size_estimate);
|
||||||
|
static Handle<WasmModuleObject> New(
|
||||||
|
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
||||||
|
Handle<Script> script, Handle<FixedArray> export_wrappers,
|
||||||
|
size_t code_size_estimate);
|
||||||
|
|
||||||
// Set a breakpoint on the given byte position inside the given module.
|
// Set a breakpoint on the given byte position inside the given module.
|
||||||
// This will affect all live and future instances of the module.
|
// This will affect all live and future instances of the module.
|
||||||
@ -640,6 +644,35 @@ class WasmDebugInfo : public Struct, public NeverReadOnlySpaceObject {
|
|||||||
wasm::FunctionSig*);
|
wasm::FunctionSig*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AsmWasmData : public Struct {
|
||||||
|
public:
|
||||||
|
static Handle<AsmWasmData> New(
|
||||||
|
Isolate* isolate, std::shared_ptr<wasm::NativeModule> native_module,
|
||||||
|
Handle<FixedArray> export_wrappers, Handle<ByteArray> asm_js_offset_table,
|
||||||
|
Handle<HeapNumber> uses_bitset);
|
||||||
|
|
||||||
|
DECL_ACCESSORS(managed_native_module, Managed<wasm::NativeModule>)
|
||||||
|
DECL_ACCESSORS(export_wrappers, FixedArray)
|
||||||
|
DECL_ACCESSORS(asm_js_offset_table, ByteArray)
|
||||||
|
DECL_ACCESSORS(uses_bitset, HeapNumber)
|
||||||
|
|
||||||
|
DECL_CAST(AsmWasmData)
|
||||||
|
DECL_PRINTER(AsmWasmData)
|
||||||
|
DECL_VERIFIER(AsmWasmData)
|
||||||
|
|
||||||
|
// Layout description.
|
||||||
|
#define ASM_WASM_DATA_FIELDS(V) \
|
||||||
|
V(kManagedNativeModuleOffset, kPointerSize) \
|
||||||
|
V(kExportWrappersOffset, kPointerSize) \
|
||||||
|
V(kAsmJsOffsetTableOffset, kPointerSize) \
|
||||||
|
V(kUsesBitsetOffset, kPointerSize) \
|
||||||
|
/* Total size. */ \
|
||||||
|
V(kSize, 0)
|
||||||
|
|
||||||
|
DEFINE_FIELD_OFFSET_CONSTANTS(Struct::kHeaderSize, ASM_WASM_DATA_FIELDS)
|
||||||
|
#undef ASM_WASM_DATA_FIELDS
|
||||||
|
};
|
||||||
|
|
||||||
#undef DECL_OPTIONAL_ACCESSORS
|
#undef DECL_OPTIONAL_ACCESSORS
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -573,7 +573,8 @@ MaybeHandle<WasmModuleObject> DeserializeNativeModule(
|
|||||||
Reader reader(data + kVersionSize);
|
Reader reader(data + kVersionSize);
|
||||||
if (!deserializer.Read(&reader)) return {};
|
if (!deserializer.Read(&reader)) return {};
|
||||||
|
|
||||||
CompileJsToWasmWrappers(isolate, module_object);
|
CompileJsToWasmWrappers(isolate, native_module,
|
||||||
|
handle(module_object->export_wrappers(), isolate));
|
||||||
|
|
||||||
// Log the code within the generated module for profiling.
|
// Log the code within the generated module for profiling.
|
||||||
native_module->LogWasmCodes(isolate);
|
native_module->LogWasmCodes(isolate);
|
||||||
|
@ -143,12 +143,16 @@ int32_t CompileAndRunAsmWasmModule(Isolate* isolate, const byte* module_start,
|
|||||||
const byte* module_end) {
|
const byte* module_end) {
|
||||||
HandleScope scope(isolate);
|
HandleScope scope(isolate);
|
||||||
ErrorThrower thrower(isolate, "CompileAndRunAsmWasmModule");
|
ErrorThrower thrower(isolate, "CompileAndRunAsmWasmModule");
|
||||||
MaybeHandle<WasmModuleObject> module =
|
MaybeHandle<AsmWasmData> data =
|
||||||
isolate->wasm_engine()->SyncCompileTranslatedAsmJs(
|
isolate->wasm_engine()->SyncCompileTranslatedAsmJs(
|
||||||
isolate, &thrower, ModuleWireBytes(module_start, module_end),
|
isolate, &thrower, ModuleWireBytes(module_start, module_end),
|
||||||
Handle<Script>::null(), Vector<const byte>());
|
Vector<const byte>(), Handle<HeapNumber>());
|
||||||
DCHECK_EQ(thrower.error(), module.is_null());
|
DCHECK_EQ(thrower.error(), data.is_null());
|
||||||
if (module.is_null()) return -1;
|
if (data.is_null()) return -1;
|
||||||
|
|
||||||
|
MaybeHandle<WasmModuleObject> module =
|
||||||
|
isolate->wasm_engine()->FinalizeTranslatedAsmJs(
|
||||||
|
isolate, data.ToHandleChecked(), Handle<Script>::null());
|
||||||
|
|
||||||
MaybeHandle<WasmInstanceObject> instance =
|
MaybeHandle<WasmInstanceObject> instance =
|
||||||
isolate->wasm_engine()->SyncInstantiate(
|
isolate->wasm_engine()->SyncInstantiate(
|
||||||
|
@ -58,3 +58,13 @@ assertEquals(c(314), 315);
|
|||||||
(function() {
|
(function() {
|
||||||
class foo {};
|
class foo {};
|
||||||
}); // Don't call IIFE so that it is compiled during idle time
|
}); // Don't call IIFE so that it is compiled during idle time
|
||||||
|
|
||||||
|
// http://crbug.com/900535
|
||||||
|
(function() {
|
||||||
|
"use asm";
|
||||||
|
function bar(i, j) {
|
||||||
|
i = i|0;
|
||||||
|
j = j|0;
|
||||||
|
}
|
||||||
|
return {bar: bar};
|
||||||
|
}); // Don't call IIFE so that it is compiled during idle time
|
||||||
|
@ -59,76 +59,77 @@ INSTANCE_TYPES = {
|
|||||||
155: "ACCESSOR_PAIR_TYPE",
|
155: "ACCESSOR_PAIR_TYPE",
|
||||||
156: "ALIASED_ARGUMENTS_ENTRY_TYPE",
|
156: "ALIASED_ARGUMENTS_ENTRY_TYPE",
|
||||||
157: "ALLOCATION_MEMENTO_TYPE",
|
157: "ALLOCATION_MEMENTO_TYPE",
|
||||||
158: "ASYNC_GENERATOR_REQUEST_TYPE",
|
158: "ASM_WASM_DATA_TYPE",
|
||||||
159: "DEBUG_INFO_TYPE",
|
159: "ASYNC_GENERATOR_REQUEST_TYPE",
|
||||||
160: "FUNCTION_TEMPLATE_INFO_TYPE",
|
160: "DEBUG_INFO_TYPE",
|
||||||
161: "INTERCEPTOR_INFO_TYPE",
|
161: "FUNCTION_TEMPLATE_INFO_TYPE",
|
||||||
162: "INTERPRETER_DATA_TYPE",
|
162: "INTERCEPTOR_INFO_TYPE",
|
||||||
163: "MODULE_INFO_ENTRY_TYPE",
|
163: "INTERPRETER_DATA_TYPE",
|
||||||
164: "MODULE_TYPE",
|
164: "MODULE_INFO_ENTRY_TYPE",
|
||||||
165: "OBJECT_TEMPLATE_INFO_TYPE",
|
165: "MODULE_TYPE",
|
||||||
166: "PROMISE_CAPABILITY_TYPE",
|
166: "OBJECT_TEMPLATE_INFO_TYPE",
|
||||||
167: "PROMISE_REACTION_TYPE",
|
167: "PROMISE_CAPABILITY_TYPE",
|
||||||
168: "PROTOTYPE_INFO_TYPE",
|
168: "PROMISE_REACTION_TYPE",
|
||||||
169: "SCRIPT_TYPE",
|
169: "PROTOTYPE_INFO_TYPE",
|
||||||
170: "STACK_FRAME_INFO_TYPE",
|
170: "SCRIPT_TYPE",
|
||||||
171: "TUPLE2_TYPE",
|
171: "STACK_FRAME_INFO_TYPE",
|
||||||
172: "TUPLE3_TYPE",
|
172: "TUPLE2_TYPE",
|
||||||
173: "ARRAY_BOILERPLATE_DESCRIPTION_TYPE",
|
173: "TUPLE3_TYPE",
|
||||||
174: "WASM_DEBUG_INFO_TYPE",
|
174: "ARRAY_BOILERPLATE_DESCRIPTION_TYPE",
|
||||||
175: "WASM_EXPORTED_FUNCTION_DATA_TYPE",
|
175: "WASM_DEBUG_INFO_TYPE",
|
||||||
176: "CALLABLE_TASK_TYPE",
|
176: "WASM_EXPORTED_FUNCTION_DATA_TYPE",
|
||||||
177: "CALLBACK_TASK_TYPE",
|
177: "CALLABLE_TASK_TYPE",
|
||||||
178: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE",
|
178: "CALLBACK_TASK_TYPE",
|
||||||
179: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE",
|
179: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE",
|
||||||
180: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE",
|
180: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE",
|
||||||
181: "WEAK_FACTORY_CLEANUP_JOB_TASK_TYPE",
|
181: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE",
|
||||||
182: "ALLOCATION_SITE_TYPE",
|
182: "WEAK_FACTORY_CLEANUP_JOB_TASK_TYPE",
|
||||||
183: "EMBEDDER_DATA_ARRAY_TYPE",
|
183: "ALLOCATION_SITE_TYPE",
|
||||||
184: "FIXED_ARRAY_TYPE",
|
184: "EMBEDDER_DATA_ARRAY_TYPE",
|
||||||
185: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
|
185: "FIXED_ARRAY_TYPE",
|
||||||
186: "HASH_TABLE_TYPE",
|
186: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
|
||||||
187: "ORDERED_HASH_MAP_TYPE",
|
187: "HASH_TABLE_TYPE",
|
||||||
188: "ORDERED_HASH_SET_TYPE",
|
188: "ORDERED_HASH_MAP_TYPE",
|
||||||
189: "ORDERED_NAME_DICTIONARY_TYPE",
|
189: "ORDERED_HASH_SET_TYPE",
|
||||||
190: "NAME_DICTIONARY_TYPE",
|
190: "ORDERED_NAME_DICTIONARY_TYPE",
|
||||||
191: "GLOBAL_DICTIONARY_TYPE",
|
191: "NAME_DICTIONARY_TYPE",
|
||||||
192: "NUMBER_DICTIONARY_TYPE",
|
192: "GLOBAL_DICTIONARY_TYPE",
|
||||||
193: "SIMPLE_NUMBER_DICTIONARY_TYPE",
|
193: "NUMBER_DICTIONARY_TYPE",
|
||||||
194: "STRING_TABLE_TYPE",
|
194: "SIMPLE_NUMBER_DICTIONARY_TYPE",
|
||||||
195: "EPHEMERON_HASH_TABLE_TYPE",
|
195: "STRING_TABLE_TYPE",
|
||||||
196: "SCOPE_INFO_TYPE",
|
196: "EPHEMERON_HASH_TABLE_TYPE",
|
||||||
197: "SCRIPT_CONTEXT_TABLE_TYPE",
|
197: "SCOPE_INFO_TYPE",
|
||||||
198: "AWAIT_CONTEXT_TYPE",
|
198: "SCRIPT_CONTEXT_TABLE_TYPE",
|
||||||
199: "BLOCK_CONTEXT_TYPE",
|
199: "AWAIT_CONTEXT_TYPE",
|
||||||
200: "CATCH_CONTEXT_TYPE",
|
200: "BLOCK_CONTEXT_TYPE",
|
||||||
201: "DEBUG_EVALUATE_CONTEXT_TYPE",
|
201: "CATCH_CONTEXT_TYPE",
|
||||||
202: "EVAL_CONTEXT_TYPE",
|
202: "DEBUG_EVALUATE_CONTEXT_TYPE",
|
||||||
203: "FUNCTION_CONTEXT_TYPE",
|
203: "EVAL_CONTEXT_TYPE",
|
||||||
204: "MODULE_CONTEXT_TYPE",
|
204: "FUNCTION_CONTEXT_TYPE",
|
||||||
205: "NATIVE_CONTEXT_TYPE",
|
205: "MODULE_CONTEXT_TYPE",
|
||||||
206: "SCRIPT_CONTEXT_TYPE",
|
206: "NATIVE_CONTEXT_TYPE",
|
||||||
207: "WITH_CONTEXT_TYPE",
|
207: "SCRIPT_CONTEXT_TYPE",
|
||||||
208: "WEAK_FIXED_ARRAY_TYPE",
|
208: "WITH_CONTEXT_TYPE",
|
||||||
209: "DESCRIPTOR_ARRAY_TYPE",
|
209: "WEAK_FIXED_ARRAY_TYPE",
|
||||||
210: "TRANSITION_ARRAY_TYPE",
|
210: "DESCRIPTOR_ARRAY_TYPE",
|
||||||
211: "CALL_HANDLER_INFO_TYPE",
|
211: "TRANSITION_ARRAY_TYPE",
|
||||||
212: "CELL_TYPE",
|
212: "CALL_HANDLER_INFO_TYPE",
|
||||||
213: "CODE_DATA_CONTAINER_TYPE",
|
213: "CELL_TYPE",
|
||||||
214: "FEEDBACK_CELL_TYPE",
|
214: "CODE_DATA_CONTAINER_TYPE",
|
||||||
215: "FEEDBACK_VECTOR_TYPE",
|
215: "FEEDBACK_CELL_TYPE",
|
||||||
216: "LOAD_HANDLER_TYPE",
|
216: "FEEDBACK_VECTOR_TYPE",
|
||||||
217: "PRE_PARSED_SCOPE_DATA_TYPE",
|
217: "LOAD_HANDLER_TYPE",
|
||||||
218: "PROPERTY_ARRAY_TYPE",
|
218: "PRE_PARSED_SCOPE_DATA_TYPE",
|
||||||
219: "PROPERTY_CELL_TYPE",
|
219: "PROPERTY_ARRAY_TYPE",
|
||||||
220: "SHARED_FUNCTION_INFO_TYPE",
|
220: "PROPERTY_CELL_TYPE",
|
||||||
221: "SMALL_ORDERED_HASH_MAP_TYPE",
|
221: "SHARED_FUNCTION_INFO_TYPE",
|
||||||
222: "SMALL_ORDERED_HASH_SET_TYPE",
|
222: "SMALL_ORDERED_HASH_MAP_TYPE",
|
||||||
223: "SMALL_ORDERED_NAME_DICTIONARY_TYPE",
|
223: "SMALL_ORDERED_HASH_SET_TYPE",
|
||||||
224: "STORE_HANDLER_TYPE",
|
224: "SMALL_ORDERED_NAME_DICTIONARY_TYPE",
|
||||||
225: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
|
225: "STORE_HANDLER_TYPE",
|
||||||
226: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
|
226: "UNCOMPILED_DATA_WITHOUT_PRE_PARSED_SCOPE_TYPE",
|
||||||
227: "WEAK_ARRAY_LIST_TYPE",
|
227: "UNCOMPILED_DATA_WITH_PRE_PARSED_SCOPE_TYPE",
|
||||||
|
228: "WEAK_ARRAY_LIST_TYPE",
|
||||||
1024: "JS_PROXY_TYPE",
|
1024: "JS_PROXY_TYPE",
|
||||||
1025: "JS_GLOBAL_OBJECT_TYPE",
|
1025: "JS_GLOBAL_OBJECT_TYPE",
|
||||||
1026: "JS_GLOBAL_PROXY_TYPE",
|
1026: "JS_GLOBAL_PROXY_TYPE",
|
||||||
@ -193,8 +194,8 @@ KNOWN_MAPS = {
|
|||||||
("RO_SPACE", 0x00139): (138, "FreeSpaceMap"),
|
("RO_SPACE", 0x00139): (138, "FreeSpaceMap"),
|
||||||
("RO_SPACE", 0x00189): (132, "MetaMap"),
|
("RO_SPACE", 0x00189): (132, "MetaMap"),
|
||||||
("RO_SPACE", 0x00209): (131, "NullMap"),
|
("RO_SPACE", 0x00209): (131, "NullMap"),
|
||||||
("RO_SPACE", 0x00279): (209, "DescriptorArrayMap"),
|
("RO_SPACE", 0x00279): (210, "DescriptorArrayMap"),
|
||||||
("RO_SPACE", 0x002d9): (208, "WeakFixedArrayMap"),
|
("RO_SPACE", 0x002d9): (209, "WeakFixedArrayMap"),
|
||||||
("RO_SPACE", 0x00329): (152, "OnePointerFillerMap"),
|
("RO_SPACE", 0x00329): (152, "OnePointerFillerMap"),
|
||||||
("RO_SPACE", 0x00379): (152, "TwoPointerFillerMap"),
|
("RO_SPACE", 0x00379): (152, "TwoPointerFillerMap"),
|
||||||
("RO_SPACE", 0x003f9): (131, "UninitializedMap"),
|
("RO_SPACE", 0x003f9): (131, "UninitializedMap"),
|
||||||
@ -204,70 +205,70 @@ KNOWN_MAPS = {
|
|||||||
("RO_SPACE", 0x005e9): (131, "TheHoleMap"),
|
("RO_SPACE", 0x005e9): (131, "TheHoleMap"),
|
||||||
("RO_SPACE", 0x00691): (131, "BooleanMap"),
|
("RO_SPACE", 0x00691): (131, "BooleanMap"),
|
||||||
("RO_SPACE", 0x00769): (136, "ByteArrayMap"),
|
("RO_SPACE", 0x00769): (136, "ByteArrayMap"),
|
||||||
("RO_SPACE", 0x007b9): (184, "FixedArrayMap"),
|
("RO_SPACE", 0x007b9): (185, "FixedArrayMap"),
|
||||||
("RO_SPACE", 0x00809): (184, "FixedCOWArrayMap"),
|
("RO_SPACE", 0x00809): (185, "FixedCOWArrayMap"),
|
||||||
("RO_SPACE", 0x00859): (186, "HashTableMap"),
|
("RO_SPACE", 0x00859): (187, "HashTableMap"),
|
||||||
("RO_SPACE", 0x008a9): (128, "SymbolMap"),
|
("RO_SPACE", 0x008a9): (128, "SymbolMap"),
|
||||||
("RO_SPACE", 0x008f9): (72, "OneByteStringMap"),
|
("RO_SPACE", 0x008f9): (72, "OneByteStringMap"),
|
||||||
("RO_SPACE", 0x00949): (196, "ScopeInfoMap"),
|
("RO_SPACE", 0x00949): (197, "ScopeInfoMap"),
|
||||||
("RO_SPACE", 0x00999): (220, "SharedFunctionInfoMap"),
|
("RO_SPACE", 0x00999): (221, "SharedFunctionInfoMap"),
|
||||||
("RO_SPACE", 0x009e9): (133, "CodeMap"),
|
("RO_SPACE", 0x009e9): (133, "CodeMap"),
|
||||||
("RO_SPACE", 0x00a39): (203, "FunctionContextMap"),
|
("RO_SPACE", 0x00a39): (204, "FunctionContextMap"),
|
||||||
("RO_SPACE", 0x00a89): (212, "CellMap"),
|
("RO_SPACE", 0x00a89): (213, "CellMap"),
|
||||||
("RO_SPACE", 0x00ad9): (219, "GlobalPropertyCellMap"),
|
("RO_SPACE", 0x00ad9): (220, "GlobalPropertyCellMap"),
|
||||||
("RO_SPACE", 0x00b29): (135, "ForeignMap"),
|
("RO_SPACE", 0x00b29): (135, "ForeignMap"),
|
||||||
("RO_SPACE", 0x00b79): (210, "TransitionArrayMap"),
|
("RO_SPACE", 0x00b79): (211, "TransitionArrayMap"),
|
||||||
("RO_SPACE", 0x00bc9): (215, "FeedbackVectorMap"),
|
("RO_SPACE", 0x00bc9): (216, "FeedbackVectorMap"),
|
||||||
("RO_SPACE", 0x00c69): (131, "ArgumentsMarkerMap"),
|
("RO_SPACE", 0x00c69): (131, "ArgumentsMarkerMap"),
|
||||||
("RO_SPACE", 0x00d09): (131, "ExceptionMap"),
|
("RO_SPACE", 0x00d09): (131, "ExceptionMap"),
|
||||||
("RO_SPACE", 0x00da9): (131, "TerminationExceptionMap"),
|
("RO_SPACE", 0x00da9): (131, "TerminationExceptionMap"),
|
||||||
("RO_SPACE", 0x00e51): (131, "OptimizedOutMap"),
|
("RO_SPACE", 0x00e51): (131, "OptimizedOutMap"),
|
||||||
("RO_SPACE", 0x00ef1): (131, "StaleRegisterMap"),
|
("RO_SPACE", 0x00ef1): (131, "StaleRegisterMap"),
|
||||||
("RO_SPACE", 0x00f61): (205, "NativeContextMap"),
|
("RO_SPACE", 0x00f61): (206, "NativeContextMap"),
|
||||||
("RO_SPACE", 0x00fb1): (204, "ModuleContextMap"),
|
("RO_SPACE", 0x00fb1): (205, "ModuleContextMap"),
|
||||||
("RO_SPACE", 0x01001): (202, "EvalContextMap"),
|
("RO_SPACE", 0x01001): (203, "EvalContextMap"),
|
||||||
("RO_SPACE", 0x01051): (206, "ScriptContextMap"),
|
("RO_SPACE", 0x01051): (207, "ScriptContextMap"),
|
||||||
("RO_SPACE", 0x010a1): (198, "AwaitContextMap"),
|
("RO_SPACE", 0x010a1): (199, "AwaitContextMap"),
|
||||||
("RO_SPACE", 0x010f1): (199, "BlockContextMap"),
|
("RO_SPACE", 0x010f1): (200, "BlockContextMap"),
|
||||||
("RO_SPACE", 0x01141): (200, "CatchContextMap"),
|
("RO_SPACE", 0x01141): (201, "CatchContextMap"),
|
||||||
("RO_SPACE", 0x01191): (207, "WithContextMap"),
|
("RO_SPACE", 0x01191): (208, "WithContextMap"),
|
||||||
("RO_SPACE", 0x011e1): (201, "DebugEvaluateContextMap"),
|
("RO_SPACE", 0x011e1): (202, "DebugEvaluateContextMap"),
|
||||||
("RO_SPACE", 0x01231): (197, "ScriptContextTableMap"),
|
("RO_SPACE", 0x01231): (198, "ScriptContextTableMap"),
|
||||||
("RO_SPACE", 0x01281): (151, "FeedbackMetadataArrayMap"),
|
("RO_SPACE", 0x01281): (151, "FeedbackMetadataArrayMap"),
|
||||||
("RO_SPACE", 0x012d1): (184, "ArrayListMap"),
|
("RO_SPACE", 0x012d1): (185, "ArrayListMap"),
|
||||||
("RO_SPACE", 0x01321): (130, "BigIntMap"),
|
("RO_SPACE", 0x01321): (130, "BigIntMap"),
|
||||||
("RO_SPACE", 0x01371): (185, "ObjectBoilerplateDescriptionMap"),
|
("RO_SPACE", 0x01371): (186, "ObjectBoilerplateDescriptionMap"),
|
||||||
("RO_SPACE", 0x013c1): (137, "BytecodeArrayMap"),
|
("RO_SPACE", 0x013c1): (137, "BytecodeArrayMap"),
|
||||||
("RO_SPACE", 0x01411): (213, "CodeDataContainerMap"),
|
("RO_SPACE", 0x01411): (214, "CodeDataContainerMap"),
|
||||||
("RO_SPACE", 0x01461): (150, "FixedDoubleArrayMap"),
|
("RO_SPACE", 0x01461): (150, "FixedDoubleArrayMap"),
|
||||||
("RO_SPACE", 0x014b1): (191, "GlobalDictionaryMap"),
|
("RO_SPACE", 0x014b1): (192, "GlobalDictionaryMap"),
|
||||||
("RO_SPACE", 0x01501): (214, "ManyClosuresCellMap"),
|
("RO_SPACE", 0x01501): (215, "ManyClosuresCellMap"),
|
||||||
("RO_SPACE", 0x01551): (184, "ModuleInfoMap"),
|
("RO_SPACE", 0x01551): (185, "ModuleInfoMap"),
|
||||||
("RO_SPACE", 0x015a1): (134, "MutableHeapNumberMap"),
|
("RO_SPACE", 0x015a1): (134, "MutableHeapNumberMap"),
|
||||||
("RO_SPACE", 0x015f1): (190, "NameDictionaryMap"),
|
("RO_SPACE", 0x015f1): (191, "NameDictionaryMap"),
|
||||||
("RO_SPACE", 0x01641): (214, "NoClosuresCellMap"),
|
("RO_SPACE", 0x01641): (215, "NoClosuresCellMap"),
|
||||||
("RO_SPACE", 0x01691): (214, "NoFeedbackCellMap"),
|
("RO_SPACE", 0x01691): (215, "NoFeedbackCellMap"),
|
||||||
("RO_SPACE", 0x016e1): (192, "NumberDictionaryMap"),
|
("RO_SPACE", 0x016e1): (193, "NumberDictionaryMap"),
|
||||||
("RO_SPACE", 0x01731): (214, "OneClosureCellMap"),
|
("RO_SPACE", 0x01731): (215, "OneClosureCellMap"),
|
||||||
("RO_SPACE", 0x01781): (187, "OrderedHashMapMap"),
|
("RO_SPACE", 0x01781): (188, "OrderedHashMapMap"),
|
||||||
("RO_SPACE", 0x017d1): (188, "OrderedHashSetMap"),
|
("RO_SPACE", 0x017d1): (189, "OrderedHashSetMap"),
|
||||||
("RO_SPACE", 0x01821): (189, "OrderedNameDictionaryMap"),
|
("RO_SPACE", 0x01821): (190, "OrderedNameDictionaryMap"),
|
||||||
("RO_SPACE", 0x01871): (217, "PreParsedScopeDataMap"),
|
("RO_SPACE", 0x01871): (218, "PreParsedScopeDataMap"),
|
||||||
("RO_SPACE", 0x018c1): (218, "PropertyArrayMap"),
|
("RO_SPACE", 0x018c1): (219, "PropertyArrayMap"),
|
||||||
("RO_SPACE", 0x01911): (211, "SideEffectCallHandlerInfoMap"),
|
("RO_SPACE", 0x01911): (212, "SideEffectCallHandlerInfoMap"),
|
||||||
("RO_SPACE", 0x01961): (211, "SideEffectFreeCallHandlerInfoMap"),
|
("RO_SPACE", 0x01961): (212, "SideEffectFreeCallHandlerInfoMap"),
|
||||||
("RO_SPACE", 0x019b1): (211, "NextCallSideEffectFreeCallHandlerInfoMap"),
|
("RO_SPACE", 0x019b1): (212, "NextCallSideEffectFreeCallHandlerInfoMap"),
|
||||||
("RO_SPACE", 0x01a01): (193, "SimpleNumberDictionaryMap"),
|
("RO_SPACE", 0x01a01): (194, "SimpleNumberDictionaryMap"),
|
||||||
("RO_SPACE", 0x01a51): (184, "SloppyArgumentsElementsMap"),
|
("RO_SPACE", 0x01a51): (185, "SloppyArgumentsElementsMap"),
|
||||||
("RO_SPACE", 0x01aa1): (221, "SmallOrderedHashMapMap"),
|
("RO_SPACE", 0x01aa1): (222, "SmallOrderedHashMapMap"),
|
||||||
("RO_SPACE", 0x01af1): (222, "SmallOrderedHashSetMap"),
|
("RO_SPACE", 0x01af1): (223, "SmallOrderedHashSetMap"),
|
||||||
("RO_SPACE", 0x01b41): (223, "SmallOrderedNameDictionaryMap"),
|
("RO_SPACE", 0x01b41): (224, "SmallOrderedNameDictionaryMap"),
|
||||||
("RO_SPACE", 0x01b91): (194, "StringTableMap"),
|
("RO_SPACE", 0x01b91): (195, "StringTableMap"),
|
||||||
("RO_SPACE", 0x01be1): (225, "UncompiledDataWithoutPreParsedScopeMap"),
|
("RO_SPACE", 0x01be1): (226, "UncompiledDataWithoutPreParsedScopeMap"),
|
||||||
("RO_SPACE", 0x01c31): (226, "UncompiledDataWithPreParsedScopeMap"),
|
("RO_SPACE", 0x01c31): (227, "UncompiledDataWithPreParsedScopeMap"),
|
||||||
("RO_SPACE", 0x01c81): (227, "WeakArrayListMap"),
|
("RO_SPACE", 0x01c81): (228, "WeakArrayListMap"),
|
||||||
("RO_SPACE", 0x01cd1): (195, "EphemeronHashTableMap"),
|
("RO_SPACE", 0x01cd1): (196, "EphemeronHashTableMap"),
|
||||||
("RO_SPACE", 0x01d21): (183, "EmbedderDataArrayMap"),
|
("RO_SPACE", 0x01d21): (184, "EmbedderDataArrayMap"),
|
||||||
("RO_SPACE", 0x01d71): (106, "NativeSourceStringMap"),
|
("RO_SPACE", 0x01d71): (106, "NativeSourceStringMap"),
|
||||||
("RO_SPACE", 0x01dc1): (64, "StringMap"),
|
("RO_SPACE", 0x01dc1): (64, "StringMap"),
|
||||||
("RO_SPACE", 0x01e11): (73, "ConsOneByteStringMap"),
|
("RO_SPACE", 0x01e11): (73, "ConsOneByteStringMap"),
|
||||||
@ -301,44 +302,45 @@ KNOWN_MAPS = {
|
|||||||
("RO_SPACE", 0x026d1): (149, "FixedBigUint64ArrayMap"),
|
("RO_SPACE", 0x026d1): (149, "FixedBigUint64ArrayMap"),
|
||||||
("RO_SPACE", 0x02721): (148, "FixedBigInt64ArrayMap"),
|
("RO_SPACE", 0x02721): (148, "FixedBigInt64ArrayMap"),
|
||||||
("RO_SPACE", 0x02771): (131, "SelfReferenceMarkerMap"),
|
("RO_SPACE", 0x02771): (131, "SelfReferenceMarkerMap"),
|
||||||
("RO_SPACE", 0x027d9): (171, "Tuple2Map"),
|
("RO_SPACE", 0x027d9): (172, "Tuple2Map"),
|
||||||
("RO_SPACE", 0x02879): (173, "ArrayBoilerplateDescriptionMap"),
|
("RO_SPACE", 0x02879): (174, "ArrayBoilerplateDescriptionMap"),
|
||||||
("RO_SPACE", 0x02bb9): (161, "InterceptorInfoMap"),
|
("RO_SPACE", 0x02bb9): (162, "InterceptorInfoMap"),
|
||||||
("RO_SPACE", 0x050d9): (153, "AccessCheckInfoMap"),
|
("RO_SPACE", 0x050d9): (153, "AccessCheckInfoMap"),
|
||||||
("RO_SPACE", 0x05129): (154, "AccessorInfoMap"),
|
("RO_SPACE", 0x05129): (154, "AccessorInfoMap"),
|
||||||
("RO_SPACE", 0x05179): (155, "AccessorPairMap"),
|
("RO_SPACE", 0x05179): (155, "AccessorPairMap"),
|
||||||
("RO_SPACE", 0x051c9): (156, "AliasedArgumentsEntryMap"),
|
("RO_SPACE", 0x051c9): (156, "AliasedArgumentsEntryMap"),
|
||||||
("RO_SPACE", 0x05219): (157, "AllocationMementoMap"),
|
("RO_SPACE", 0x05219): (157, "AllocationMementoMap"),
|
||||||
("RO_SPACE", 0x05269): (158, "AsyncGeneratorRequestMap"),
|
("RO_SPACE", 0x05269): (158, "AsmWasmDataMap"),
|
||||||
("RO_SPACE", 0x052b9): (159, "DebugInfoMap"),
|
("RO_SPACE", 0x052b9): (159, "AsyncGeneratorRequestMap"),
|
||||||
("RO_SPACE", 0x05309): (160, "FunctionTemplateInfoMap"),
|
("RO_SPACE", 0x05309): (160, "DebugInfoMap"),
|
||||||
("RO_SPACE", 0x05359): (162, "InterpreterDataMap"),
|
("RO_SPACE", 0x05359): (161, "FunctionTemplateInfoMap"),
|
||||||
("RO_SPACE", 0x053a9): (163, "ModuleInfoEntryMap"),
|
("RO_SPACE", 0x053a9): (163, "InterpreterDataMap"),
|
||||||
("RO_SPACE", 0x053f9): (164, "ModuleMap"),
|
("RO_SPACE", 0x053f9): (164, "ModuleInfoEntryMap"),
|
||||||
("RO_SPACE", 0x05449): (165, "ObjectTemplateInfoMap"),
|
("RO_SPACE", 0x05449): (165, "ModuleMap"),
|
||||||
("RO_SPACE", 0x05499): (166, "PromiseCapabilityMap"),
|
("RO_SPACE", 0x05499): (166, "ObjectTemplateInfoMap"),
|
||||||
("RO_SPACE", 0x054e9): (167, "PromiseReactionMap"),
|
("RO_SPACE", 0x054e9): (167, "PromiseCapabilityMap"),
|
||||||
("RO_SPACE", 0x05539): (168, "PrototypeInfoMap"),
|
("RO_SPACE", 0x05539): (168, "PromiseReactionMap"),
|
||||||
("RO_SPACE", 0x05589): (169, "ScriptMap"),
|
("RO_SPACE", 0x05589): (169, "PrototypeInfoMap"),
|
||||||
("RO_SPACE", 0x055d9): (170, "StackFrameInfoMap"),
|
("RO_SPACE", 0x055d9): (170, "ScriptMap"),
|
||||||
("RO_SPACE", 0x05629): (172, "Tuple3Map"),
|
("RO_SPACE", 0x05629): (171, "StackFrameInfoMap"),
|
||||||
("RO_SPACE", 0x05679): (174, "WasmDebugInfoMap"),
|
("RO_SPACE", 0x05679): (173, "Tuple3Map"),
|
||||||
("RO_SPACE", 0x056c9): (175, "WasmExportedFunctionDataMap"),
|
("RO_SPACE", 0x056c9): (175, "WasmDebugInfoMap"),
|
||||||
("RO_SPACE", 0x05719): (176, "CallableTaskMap"),
|
("RO_SPACE", 0x05719): (176, "WasmExportedFunctionDataMap"),
|
||||||
("RO_SPACE", 0x05769): (177, "CallbackTaskMap"),
|
("RO_SPACE", 0x05769): (177, "CallableTaskMap"),
|
||||||
("RO_SPACE", 0x057b9): (178, "PromiseFulfillReactionJobTaskMap"),
|
("RO_SPACE", 0x057b9): (178, "CallbackTaskMap"),
|
||||||
("RO_SPACE", 0x05809): (179, "PromiseRejectReactionJobTaskMap"),
|
("RO_SPACE", 0x05809): (179, "PromiseFulfillReactionJobTaskMap"),
|
||||||
("RO_SPACE", 0x05859): (180, "PromiseResolveThenableJobTaskMap"),
|
("RO_SPACE", 0x05859): (180, "PromiseRejectReactionJobTaskMap"),
|
||||||
("RO_SPACE", 0x058a9): (181, "WeakFactoryCleanupJobTaskMap"),
|
("RO_SPACE", 0x058a9): (181, "PromiseResolveThenableJobTaskMap"),
|
||||||
("RO_SPACE", 0x058f9): (182, "AllocationSiteWithWeakNextMap"),
|
("RO_SPACE", 0x058f9): (182, "WeakFactoryCleanupJobTaskMap"),
|
||||||
("RO_SPACE", 0x05949): (182, "AllocationSiteWithoutWeakNextMap"),
|
("RO_SPACE", 0x05949): (183, "AllocationSiteWithWeakNextMap"),
|
||||||
("RO_SPACE", 0x05999): (216, "LoadHandler1Map"),
|
("RO_SPACE", 0x05999): (183, "AllocationSiteWithoutWeakNextMap"),
|
||||||
("RO_SPACE", 0x059e9): (216, "LoadHandler2Map"),
|
("RO_SPACE", 0x059e9): (217, "LoadHandler1Map"),
|
||||||
("RO_SPACE", 0x05a39): (216, "LoadHandler3Map"),
|
("RO_SPACE", 0x05a39): (217, "LoadHandler2Map"),
|
||||||
("RO_SPACE", 0x05a89): (224, "StoreHandler0Map"),
|
("RO_SPACE", 0x05a89): (217, "LoadHandler3Map"),
|
||||||
("RO_SPACE", 0x05ad9): (224, "StoreHandler1Map"),
|
("RO_SPACE", 0x05ad9): (225, "StoreHandler0Map"),
|
||||||
("RO_SPACE", 0x05b29): (224, "StoreHandler2Map"),
|
("RO_SPACE", 0x05b29): (225, "StoreHandler1Map"),
|
||||||
("RO_SPACE", 0x05b79): (224, "StoreHandler3Map"),
|
("RO_SPACE", 0x05b79): (225, "StoreHandler2Map"),
|
||||||
|
("RO_SPACE", 0x05bc9): (225, "StoreHandler3Map"),
|
||||||
("MAP_SPACE", 0x00139): (1057, "ExternalMap"),
|
("MAP_SPACE", 0x00139): (1057, "ExternalMap"),
|
||||||
("MAP_SPACE", 0x00189): (1073, "JSMessageObjectMap"),
|
("MAP_SPACE", 0x00189): (1073, "JSMessageObjectMap"),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user