OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_FLOW_GRAPH_COMPILER_IA32_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_IA32_H_ |
6 #define VM_FLOW_GRAPH_COMPILER_IA32_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_IA32_H_ |
7 | 7 |
8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_ia32.h. | 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_ia32.h. |
10 #endif | 10 #endif |
(...skipping 27 matching lines...) Expand all Loading... |
38 void CompileGraph(); | 38 void CompileGraph(); |
39 | 39 |
40 // Infrastructure copied from class CodeGenerator or stubbed out. | 40 // Infrastructure copied from class CodeGenerator or stubbed out. |
41 void FinalizePcDescriptors(const Code& code); | 41 void FinalizePcDescriptors(const Code& code); |
42 void FinalizeStackmaps(const Code& code); | 42 void FinalizeStackmaps(const Code& code); |
43 void FinalizeVarDescriptors(const Code& code); | 43 void FinalizeVarDescriptors(const Code& code); |
44 void FinalizeExceptionHandlers(const Code& code); | 44 void FinalizeExceptionHandlers(const Code& code); |
45 void FinalizeComments(const Code& code); | 45 void FinalizeComments(const Code& code); |
46 | 46 |
47 Assembler* assembler() const { return assembler_; } | 47 Assembler* assembler() const { return assembler_; } |
| 48 bool is_optimizing() const { return is_optimizing_; } |
| 49 const ParsedFunction& parsed_function() const { return parsed_function_; } |
| 50 |
| 51 void GenerateCallRuntime(intptr_t cid, |
| 52 intptr_t token_index, |
| 53 intptr_t try_index, |
| 54 const RuntimeEntry& entry); |
| 55 void AddCurrentDescriptor(PcDescriptors::Kind kind, |
| 56 intptr_t cid, |
| 57 intptr_t token_index, |
| 58 intptr_t try_index); |
| 59 |
| 60 void EmitInstanceCall(intptr_t cid, |
| 61 intptr_t token_index, |
| 62 intptr_t try_index, |
| 63 const String& function_name, |
| 64 intptr_t argument_count, |
| 65 const Array& argument_names, |
| 66 intptr_t checked_argument_count); |
| 67 void EmitStaticCall(intptr_t token_index, |
| 68 intptr_t try_index, |
| 69 const Function& function, |
| 70 intptr_t argument_count, |
| 71 const Array& argument_names); |
| 72 void GenerateCall(intptr_t token_index, |
| 73 intptr_t try_index, |
| 74 const ExternalLabel* label, |
| 75 PcDescriptors::Kind kind); |
48 | 76 |
49 private: | 77 private: |
50 friend class DeoptimizationStub; | 78 friend class DeoptimizationStub; |
51 | 79 |
52 // Bail out of the flow graph compiler. Does not return to the caller. | 80 // Bail out of the flow graph compiler. Does not return to the caller. |
53 void Bailout(const char* reason); | 81 void Bailout(const char* reason); |
54 | 82 |
55 virtual void VisitBlocks(); | 83 virtual void VisitBlocks(); |
56 | 84 |
57 BlockEntryInstr* current_block() const { return current_block_; } | 85 BlockEntryInstr* current_block() const { return current_block_; } |
58 | 86 |
59 // Constructor is lighweight, major initialization work should occur here. | 87 // Constructor is lighweight, major initialization work should occur here. |
60 // This makes it easier to measure time spent in the compiler. | 88 // This makes it easier to measure time spent in the compiler. |
61 void InitCompiler(); | 89 void InitCompiler(); |
62 | 90 |
63 struct BlockInfo : public ZoneAllocated { | 91 struct BlockInfo : public ZoneAllocated { |
64 public: | 92 public: |
65 BlockInfo() : label() { } | 93 BlockInfo() : label() { } |
66 | 94 |
67 Label label; | 95 Label label; |
68 }; | 96 }; |
69 | 97 |
70 void GenerateCallRuntime(intptr_t cid, | |
71 intptr_t token_index, | |
72 intptr_t try_index, | |
73 const RuntimeEntry& entry); | |
74 void AddCurrentDescriptor(PcDescriptors::Kind kind, | |
75 intptr_t cid, | |
76 intptr_t token_index, | |
77 intptr_t try_index); | |
78 void CopyParameters(); | 98 void CopyParameters(); |
79 void EmitInstructionPrologue(Instruction* instr); | 99 void EmitInstructionPrologue(Instruction* instr); |
80 | 100 |
81 intptr_t StackSize() const; | 101 intptr_t StackSize() const; |
82 | 102 |
83 bool CanOptimize(); | 103 bool CanOptimize(); |
84 bool TryIntrinsify(); | 104 bool TryIntrinsify(); |
85 void IntrinsifyGetter(); | 105 void IntrinsifyGetter(); |
86 void IntrinsifySetter(); | 106 void IntrinsifySetter(); |
87 | 107 |
(...skipping 14 matching lines...) Expand all Loading... |
102 ExceptionHandlerList* exception_handlers_list_; | 122 ExceptionHandlerList* exception_handlers_list_; |
103 GrowableArray<DeoptimizationStub*> deopt_stubs_; | 123 GrowableArray<DeoptimizationStub*> deopt_stubs_; |
104 const bool is_optimizing_; | 124 const bool is_optimizing_; |
105 | 125 |
106 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 126 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
107 }; | 127 }; |
108 | 128 |
109 } // namespace dart | 129 } // namespace dart |
110 | 130 |
111 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ | 131 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ |
OLD | NEW |