Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ | |
| 6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ | |
| 7 | |
| 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | |
| 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. | |
| 10 #endif | |
| 11 | |
| 12 #include "vm/assembler.h" | |
| 13 #include "vm/code_generator.h" | |
| 14 #include "vm/intermediate_language.h" | |
| 15 | |
| 16 namespace dart { | |
| 17 | |
| 18 class ParsedFunction; | |
| 19 | |
| 20 class FlowGraphCompiler : public InstructionVisitor { | |
| 21 public: | |
| 22 explicit FlowGraphCompiler(Assembler* assembler, | |
|
srdjan
2012/02/24 23:13:02
remove explicit
Kevin Millikin (Google)
2012/02/27 08:22:07
Thanks, done.
| |
| 23 const ParsedFunction& parsed_function, | |
| 24 const GrowableArray<BlockEntryInstr*>* blocks) | |
| 25 : assembler_(assembler), | |
| 26 parsed_function_(parsed_function), | |
| 27 blocks_(blocks), | |
| 28 pc_descriptors_list_(new CodeGenerator::DescriptorList()) { } | |
| 29 | |
| 30 virtual ~FlowGraphCompiler() { } | |
| 31 | |
| 32 void CompileGraph(); | |
| 33 | |
| 34 private: | |
| 35 // Bail out of the flow graph compiler. Does not return to the caller. | |
| 36 void Bailout(const char* reason); | |
| 37 | |
| 38 // Each visit function compiles a type of instruction. | |
| 39 #define DECLARE_VISIT(type) \ | |
| 40 virtual void Visit##type(type##Instr* instr); | |
| 41 FOR_EACH_INSTRUCTION(DECLARE_VISIT) | |
| 42 #undef DECLARE_VISIT | |
| 43 | |
| 44 // Compile a Value into register RAX. | |
|
srdjan
2012/02/24 23:13:02
Why into RAX and not on TOS?
Kevin Millikin (Google)
2012/02/27 08:22:07
This is 'pop', when we consume a value (for temps
| |
| 45 void CompileValue(Value* value); | |
| 46 | |
| 47 // Infrastructure copied from class CodeGenerator. | |
| 48 void GenerateCallRuntime(intptr_t node_id, | |
| 49 intptr_t token_index, | |
| 50 const RuntimeEntry& entry); | |
| 51 void AddCurrentDescriptor(PcDescriptors::Kind kind, | |
| 52 intptr_t node_id, | |
| 53 intptr_t token_index); | |
| 54 | |
| 55 Assembler* assembler_; | |
| 56 const ParsedFunction& parsed_function_; | |
| 57 const GrowableArray<BlockEntryInstr*>* blocks_; | |
| 58 | |
| 59 CodeGenerator::DescriptorList* pc_descriptors_list_; | |
| 60 | |
| 61 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | |
| 62 }; | |
| 63 | |
| 64 } // namespace dart | |
| 65 | |
| 66 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | |
| OLD | NEW |