Home | History | Annotate | Download | only in asmjs
      1 // Copyright 2015 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_WASM_BUILDER_H_
      6 #define V8_ASMJS_ASM_WASM_BUILDER_H_
      7 
      8 #include "src/allocation.h"
      9 #include "src/asmjs/asm-typer.h"
     10 #include "src/objects.h"
     11 #include "src/wasm/wasm-module-builder.h"
     12 #include "src/zone/zone.h"
     13 
     14 namespace v8 {
     15 namespace internal {
     16 
     17 class CompilationInfo;
     18 
     19 namespace wasm {
     20 
     21 class AsmWasmBuilder {
     22  public:
     23   struct Result {
     24     ZoneBuffer* module_bytes;
     25     ZoneBuffer* asm_offset_table;
     26     bool success;
     27   };
     28 
     29   explicit AsmWasmBuilder(CompilationInfo* info);
     30   Result Run(Handle<FixedArray>* foreign_args);
     31 
     32   static const char* foreign_init_name;
     33   static const char* single_function_name;
     34 
     35   const AsmTyper* typer() { return &typer_; }
     36 
     37  private:
     38   CompilationInfo* info_;
     39   AsmTyper typer_;
     40 };
     41 }  // namespace wasm
     42 }  // namespace internal
     43 }  // namespace v8
     44 
     45 #endif  // V8_WASM_ASM_WASM_BUILDER_H_
     46