summaryrefslogtreecommitdiff
path: root/deps/v8/src/asmjs/asm-js.h
blob: 05707cad98ef8b90a2c73148e29e5e4a5d83090f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_ASMJS_ASM_JS_H_
#define V8_ASMJS_ASM_JS_H_

// Clients of this interface shouldn't depend on lots of asmjs internals.
// Do not include anything from src/asmjs here!
#include "src/globals.h"

namespace v8 {
namespace internal {

class AccountingAllocator;
class AsmWasmData;
class FunctionLiteral;
class JSArrayBuffer;
class ParseInfo;
class SharedFunctionInfo;
class UnoptimizedCompilationJob;

// Interface to compile and instantiate for asm.js modules.
class AsmJs {
 public:
  static UnoptimizedCompilationJob* NewCompilationJob(
      ParseInfo* parse_info, FunctionLiteral* literal,
      AccountingAllocator* allocator);
  static MaybeHandle<Object> InstantiateAsmWasm(Isolate* isolate,
                                                Handle<SharedFunctionInfo>,
                                                Handle<AsmWasmData> wasm_data,
                                                Handle<JSReceiver> stdlib,
                                                Handle<JSReceiver> foreign,
                                                Handle<JSArrayBuffer> memory);

  // Special export name used to indicate that the module exports a single
  // function instead of a JavaScript object holding multiple functions.
  static const char* const kSingleFunctionName;
};

}  // namespace internal
}  // namespace v8

#endif  // V8_ASMJS_ASM_JS_H_