#include "src/asmjs/asm-js.h"
#include <optional>
#include "src/asmjs/asm-names.h"
#include "src/asmjs/asm-parser.h"
#include "src/ast/ast.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/base/vector.h"
#include "src/codegen/compiler.h"
#include "src/codegen/unoptimized-compilation-info.h"
#include "src/common/assert-scope.h"
#include "src/common/message-template.h"
#include "src/execution/execution.h"
#include "src/execution/isolate.h"
#include "src/handles/handles.h"
#include "src/heap/factory.h"
#include "src/logging/counters.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/objects-inl.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/scanner-character-streams.h"
#include "src/parsing/scanner.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-js.h"
#include "src/wasm/wasm-limits.h"
#include "src/wasm/wasm-module-builder.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-result.h"
namespace v8 {
namespace internal {
const char* const AsmJs::kSingleFunctionName = …;
namespace {
Handle<Object> StdlibMathMember(Isolate* isolate, Handle<JSReceiver> stdlib,
Handle<Name> name) { … }
bool AreStdlibMembersValid(Isolate* isolate, Handle<JSReceiver> stdlib,
wasm::AsmJsParser::StdlibSet members,
bool* is_typed_array) { … }
void Report(Handle<Script> script, int position, base::Vector<const char> text,
MessageTemplate message_template,
v8::Isolate::MessageErrorLevel level) { … }
void ReportCompilationSuccess(Handle<Script> script, int position,
double compile_time, size_t module_size) { … }
void ReportCompilationFailure(ParseInfo* parse_info, int position,
const char* reason) { … }
void ReportInstantiationSuccess(Handle<Script> script, int position,
double instantiate_time) { … }
void ReportInstantiationFailure(Handle<Script> script, int position,
const char* reason) { … }
}
class AsmJsCompilationJob final : public UnoptimizedCompilationJob { … };
UnoptimizedCompilationJob::Status AsmJsCompilationJob::ExecuteJobImpl() { … }
UnoptimizedCompilationJob::Status AsmJsCompilationJob::FinalizeJobImpl(
Handle<SharedFunctionInfo> shared_info, Isolate* isolate) { … }
void AsmJsCompilationJob::RecordHistograms(Isolate* isolate) { … }
std::unique_ptr<UnoptimizedCompilationJob> AsmJs::NewCompilationJob(
ParseInfo* parse_info, FunctionLiteral* literal,
AccountingAllocator* allocator) { … }
namespace {
inline bool IsValidAsmjsMemorySize(size_t size) { … }
}
MaybeHandle<Object> AsmJs::InstantiateAsmWasm(
Isolate* isolate, DirectHandle<SharedFunctionInfo> shared,
DirectHandle<AsmWasmData> wasm_data, Handle<JSReceiver> stdlib,
Handle<JSReceiver> foreign, Handle<JSArrayBuffer> memory) { … }
}
}