summaryrefslogtreecommitdiff
path: root/deps/v8/src/disassembler.h
blob: 5315d5598f3064cbf5563246bd5bd17fbb916900 (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
// Copyright 2006-2008 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_DISASSEMBLER_H_
#define V8_DISASSEMBLER_H_

#include "src/allocation.h"
#include "src/code-reference.h"

namespace v8 {
namespace internal {

class Disassembler : public AllStatic {
 public:
  // Decode instructions in the the interval [begin, end) and print the
  // code into os. Returns the number of bytes disassembled or 1 if no
  // instruction could be decoded.
  // Does not abort on unimplemented opcodes, but prints them as 'Unimplemented
  // Instruction'.
  // the code object is used for name resolution and may be null.
  // TODO(titzer): accept a {WasmCodeManager*} if {isolate} is null
  static int Decode(Isolate* isolate, std::ostream* os, byte* begin, byte* end,
                    CodeReference code = {}, Address current_pc = kNullAddress);
};

}  // namespace internal
}  // namespace v8

#endif  // V8_DISASSEMBLER_H_