• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_ASMJS_ASM_JS_H_
6 #define V8_ASMJS_ASM_JS_H_
7 
8 // Clients of this interface shouldn't depend on lots of asmjs internals.
9 // Do not include anything from src/asmjs here!
10 #include "src/globals.h"
11 
12 namespace v8 {
13 namespace internal {
14 
15 class AccountingAllocator;
16 class FunctionLiteral;
17 class JSArrayBuffer;
18 class ParseInfo;
19 class SharedFunctionInfo;
20 class UnoptimizedCompilationJob;
21 
22 // Interface to compile and instantiate for asm.js modules.
23 class AsmJs {
24  public:
25   static UnoptimizedCompilationJob* NewCompilationJob(
26       ParseInfo* parse_info, FunctionLiteral* literal,
27       AccountingAllocator* allocator);
28   static MaybeHandle<Object> InstantiateAsmWasm(Isolate* isolate,
29                                                 Handle<SharedFunctionInfo>,
30                                                 Handle<FixedArray> wasm_data,
31                                                 Handle<JSReceiver> stdlib,
32                                                 Handle<JSReceiver> foreign,
33                                                 Handle<JSArrayBuffer> memory);
34 
35   // Special export name used to indicate that the module exports a single
36   // function instead of a JavaScript object holding multiple functions.
37   static const char* const kSingleFunctionName;
38 };
39 
40 }  // namespace internal
41 }  // namespace v8
42 
43 #endif  // V8_ASMJS_ASM_JS_H_
44