Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: runtime/vm/flow_graph_compiler_x64.h

Issue 10500005: More shared code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_X64_H_ 5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_
6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ 6 #define VM_FLOW_GRAPH_COMPILER_X64_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_x64.h. 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h.
10 #endif 10 #endif
(...skipping 15 matching lines...) Expand all
26 26
27 class FlowGraphCompiler : public FlowGraphCompilerShared { 27 class FlowGraphCompiler : public FlowGraphCompilerShared {
28 public: 28 public:
29 FlowGraphCompiler(Assembler* assembler, 29 FlowGraphCompiler(Assembler* assembler,
30 const ParsedFunction& parsed_function, 30 const ParsedFunction& parsed_function,
31 const GrowableArray<BlockEntryInstr*>& block_order, 31 const GrowableArray<BlockEntryInstr*>& block_order,
32 bool is_optimizing); 32 bool is_optimizing);
33 33
34 void CompileGraph(); 34 void CompileGraph();
35 35
36 void FinalizeComments(const Code& code);
37
38 void GenerateCallRuntime(intptr_t cid, 36 void GenerateCallRuntime(intptr_t cid,
39 intptr_t token_index, 37 intptr_t token_index,
40 intptr_t try_index, 38 intptr_t try_index,
41 const RuntimeEntry& entry); 39 const RuntimeEntry& entry);
42 40
43 private: 41 private:
44 friend class DeoptimizationStub; 42 friend class DeoptimizationStub;
45 43
46 // TODO(fschneider): Clean up friend-class declarations once all code 44 // TODO(fschneider): Clean up friend-class declarations once all code
47 // generator templates have been moved to intermediate_language_x64.cc. 45 // generator templates have been moved to intermediate_language_x64.cc.
48 #define DECLARE_FRIEND(ShortName, ClassName) friend class ClassName; 46 #define DECLARE_FRIEND(ShortName, ClassName) friend class ClassName;
49 FOR_EACH_COMPUTATION(DECLARE_FRIEND) 47 FOR_EACH_COMPUTATION(DECLARE_FRIEND)
50 #undef DECLARE_FRIEND 48 #undef DECLARE_FRIEND
51 49
52 static const int kLocalsOffsetFromFP = (-1 * kWordSize); 50 static const int kLocalsOffsetFromFP = (-1 * kWordSize);
53 51
54 // Bail out of the flow graph compiler. Does not return to the caller.
55 void Bailout(const char* reason);
56
57 virtual void VisitBlocks(); 52 virtual void VisitBlocks();
58 53
59 void EmitInstructionPrologue(Instruction* instr); 54 void EmitInstructionPrologue(Instruction* instr);
60 55
61 // Emit code to load a Value into register 'dst'. 56 // Emit code to load a Value into register 'dst'.
62 void LoadValue(Register dst, Value* value); 57 void LoadValue(Register dst, Value* value);
63 58
64 void EmitComment(Instruction* instr); 59 void EmitComment(Instruction* instr);
65 60
66 // Emit an instance call. 61 virtual intptr_t EmitInstanceCall(ExternalLabel* target_label,
67 void EmitInstanceCall(intptr_t cid, 62 const ICData& ic_data,
68 intptr_t token_index, 63 const Array& arguments_descriptor,
69 intptr_t try_index, 64 intptr_t argument_count);
70 const String& function_name,
71 intptr_t argument_count,
72 const Array& argument_names,
73 intptr_t checked_argument_count);
74 65
75 // Emit a static call. 66 virtual intptr_t EmitStaticCall(const Function& function,
76 void EmitStaticCall(intptr_t token_index, 67 const Array& arguments_descriptor,
77 intptr_t try_index, 68 intptr_t argument_count);
78 const Function& function,
79 intptr_t argument_count,
80 const Array& argument_names);
81 69
82 // Infrastructure copied from class CodeGenerator. 70 // Infrastructure copied from class CodeGenerator.
83 void GenerateCall(intptr_t token_index, 71 void GenerateCall(intptr_t token_index,
84 intptr_t try_index, 72 intptr_t try_index,
85 const ExternalLabel* label, 73 const ExternalLabel* label,
86 PcDescriptors::Kind kind); 74 PcDescriptors::Kind kind);
87 75
88 // Type checking helper methods. 76 // Type checking helper methods.
89 void CheckClassIds(const GrowableArray<intptr_t>& class_ids, 77 void CheckClassIds(const GrowableArray<intptr_t>& class_ids,
90 Label* is_instance_lbl, 78 Label* is_instance_lbl,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 const String& dst_name); 117 const String& dst_name);
130 118
131 void GenerateInstanceOf(intptr_t cid, 119 void GenerateInstanceOf(intptr_t cid,
132 intptr_t token_index, 120 intptr_t token_index,
133 intptr_t try_index, 121 intptr_t try_index,
134 const AbstractType& type, 122 const AbstractType& type,
135 bool negate_result); 123 bool negate_result);
136 124
137 void CopyParameters(); 125 void CopyParameters();
138 126
139 bool TryIntrinsify(); 127 virtual void IntrinsifyGetter();
140 void IntrinsifyGetter(); 128 virtual void IntrinsifySetter();
141 void IntrinsifySetter();
142 static bool CanOptimize();
143 129
144 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 130 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
145 }; 131 };
146 132
147 } // namespace dart 133 } // namespace dart
148 134
149 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ 135 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698