Files
sdk/runtime/vm/code_generator_x64.h
T
vegorov@google.com f999f30052 Extend assembler with ability to produce comments for the generated code.
Extend x64 disassembler with ability to decode and output recorded comments.

Example output (currently comments are emitted only by flow graph compiler at block/instruction boundaries, once instruction printing is refactored and supports printing into buffer simple "instruction" comment will be replaced with the actual IL construct):

        ;; B0
        ;; B1
        ;; instruction
0x007f0fff812525 00000055 49 bb 21 00 b4 04 10  mov    $0x7f1004b40021,%r11
0x007f0fff81252c 0000005c 7f 00 00
0x007f0fff81252f 0000005f 41 53                 push   %r11

R=srdjan@google.com

Review URL: https://chromiumcodereview.appspot.com//10407019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7723 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 21:56:16 +00:00

69 lines
1.9 KiB
C++

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef VM_CODE_GENERATOR_X64_H_
#define VM_CODE_GENERATOR_X64_H_
#ifndef VM_CODE_GENERATOR_H_
#error Do not include code_generator_x64.h directly; use code_generator.h.
#endif
#include "vm/ast.h"
#include "vm/growable_array.h"
namespace dart {
// Forward declarations.
class Assembler;
class AstNode;
class ParsedFunction;
class CodeGenerator : public AstNodeVisitor {
public:
CodeGenerator(Assembler* assembler, const ParsedFunction& parsed_function)
: pc_descriptors_list_(NULL) { }
virtual ~CodeGenerator() { }
bool GenerateCode() {
return false;
}
// Add exception handler table to code.
void FinalizeExceptionHandlers(const Code& code) { UNIMPLEMENTED(); }
// Add pc descriptors to code.
void FinalizePcDescriptors(const Code& code) { UNIMPLEMENTED(); }
// Add stack maps to code.
void FinalizeStackmaps(const Code& code) { UNIMPLEMENTED(); }
// Add local variable descriptors to code.
void FinalizeVarDescriptors(const Code& code) { UNIMPLEMENTED(); }
void FinalizeComments(const Code& code) { UNIMPLEMENTED(); }
// Allocate and return an arguments descriptor.
// Let 'num_names' be the length of 'optional_arguments_names'.
// Treat the first 'num_arguments - num_names' arguments as positional and
// treat the following 'num_names' arguments as named optional arguments.
static const Array& ArgumentsDescriptor(
int num_arguments,
const Array& optional_arguments_names);
// Return true if the VM may optimize functions.
static bool CanOptimize();
private:
// Forward declarations.
class DescriptorList;
DescriptorList* pc_descriptors_list_;
DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator);
};
} // namespace dart
#endif // VM_CODE_GENERATOR_X64_H_