OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 class LCodeGen BASE_EMBEDDED { | 46 class LCodeGen BASE_EMBEDDED { |
47 public: | 47 public: |
48 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 48 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
49 : chunk_(chunk), | 49 : chunk_(chunk), |
50 masm_(assembler), | 50 masm_(assembler), |
51 info_(info), | 51 info_(info), |
52 current_block_(-1), | 52 current_block_(-1), |
53 current_instruction_(-1), | 53 current_instruction_(-1), |
54 instructions_(chunk->instructions()), | 54 instructions_(chunk->instructions()), |
55 deoptimizations_(4), | 55 deoptimizations_(4), |
56 jump_table_(4), | |
Lasse Reichstein
2011/02/28 08:42:30
If possible, remove the 4 (and the 4 above). Just
Rico
2011/02/28 09:57:13
There is no default ZoneList constructor
| |
56 deoptimization_literals_(8), | 57 deoptimization_literals_(8), |
57 inlined_function_count_(0), | 58 inlined_function_count_(0), |
58 scope_(chunk->graph()->info()->scope()), | 59 scope_(chunk->graph()->info()->scope()), |
59 status_(UNUSED), | 60 status_(UNUSED), |
60 deferred_(8), | 61 deferred_(8), |
61 osr_pc_offset_(-1), | 62 osr_pc_offset_(-1), |
62 resolver_(this) { | 63 resolver_(this) { |
63 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 64 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
64 } | 65 } |
65 | 66 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 void Abort(const char* format, ...); | 141 void Abort(const char* format, ...); |
141 void Comment(const char* format, ...); | 142 void Comment(const char* format, ...); |
142 | 143 |
143 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 144 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } |
144 | 145 |
145 // Code generation passes. Returns true if code generation should | 146 // Code generation passes. Returns true if code generation should |
146 // continue. | 147 // continue. |
147 bool GeneratePrologue(); | 148 bool GeneratePrologue(); |
148 bool GenerateBody(); | 149 bool GenerateBody(); |
149 bool GenerateDeferredCode(); | 150 bool GenerateDeferredCode(); |
151 bool GenerateJumpTable(); | |
150 bool GenerateSafepointTable(); | 152 bool GenerateSafepointTable(); |
151 | 153 |
152 void CallCode(Handle<Code> code, | 154 void CallCode(Handle<Code> code, |
153 RelocInfo::Mode mode, | 155 RelocInfo::Mode mode, |
154 LInstruction* instr); | 156 LInstruction* instr); |
155 void CallRuntime(Runtime::Function* function, | 157 void CallRuntime(Runtime::Function* function, |
156 int num_arguments, | 158 int num_arguments, |
157 LInstruction* instr); | 159 LInstruction* instr); |
158 void CallRuntime(Runtime::FunctionId id, | 160 void CallRuntime(Runtime::FunctionId id, |
159 int num_arguments, | 161 int num_arguments, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 Label* is_not_object, | 229 Label* is_not_object, |
228 Label* is_object); | 230 Label* is_object); |
229 | 231 |
230 // Emits optimized code for %_IsConstructCall(). | 232 // Emits optimized code for %_IsConstructCall(). |
231 // Caller should branch on equal condition. | 233 // Caller should branch on equal condition. |
232 void EmitIsConstructCall(Register temp); | 234 void EmitIsConstructCall(Register temp); |
233 | 235 |
234 // Emits code for pushing a constant operand. | 236 // Emits code for pushing a constant operand. |
235 void EmitPushConstantOperand(LOperand* operand); | 237 void EmitPushConstantOperand(LOperand* operand); |
236 | 238 |
239 struct JumpTableEntry { | |
Lasse Reichstein
2011/02/28 08:42:30
Have a constructor to initialize label and address
Rico
2011/02/28 09:57:13
Done.
| |
240 Label label; | |
241 Address address; | |
242 }; | |
243 | |
237 LChunk* const chunk_; | 244 LChunk* const chunk_; |
238 MacroAssembler* const masm_; | 245 MacroAssembler* const masm_; |
239 CompilationInfo* const info_; | 246 CompilationInfo* const info_; |
240 | 247 |
241 int current_block_; | 248 int current_block_; |
242 int current_instruction_; | 249 int current_instruction_; |
243 const ZoneList<LInstruction*>* instructions_; | 250 const ZoneList<LInstruction*>* instructions_; |
244 ZoneList<LEnvironment*> deoptimizations_; | 251 ZoneList<LEnvironment*> deoptimizations_; |
252 ZoneList<JumpTableEntry*> jump_table_; | |
245 ZoneList<Handle<Object> > deoptimization_literals_; | 253 ZoneList<Handle<Object> > deoptimization_literals_; |
246 int inlined_function_count_; | 254 int inlined_function_count_; |
247 Scope* const scope_; | 255 Scope* const scope_; |
248 Status status_; | 256 Status status_; |
249 TranslationBuffer translations_; | 257 TranslationBuffer translations_; |
250 ZoneList<LDeferredCode*> deferred_; | 258 ZoneList<LDeferredCode*> deferred_; |
251 int osr_pc_offset_; | 259 int osr_pc_offset_; |
252 | 260 |
253 // Builder that keeps track of safepoints in the code. The table | 261 // Builder that keeps track of safepoints in the code. The table |
254 // itself is emitted at the end of the generated code. | 262 // itself is emitted at the end of the generated code. |
(...skipping 30 matching lines...) Expand all Loading... | |
285 private: | 293 private: |
286 LCodeGen* codegen_; | 294 LCodeGen* codegen_; |
287 Label entry_; | 295 Label entry_; |
288 Label exit_; | 296 Label exit_; |
289 Label* external_exit_; | 297 Label* external_exit_; |
290 }; | 298 }; |
291 | 299 |
292 } } // namespace v8::internal | 300 } } // namespace v8::internal |
293 | 301 |
294 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 302 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
OLD | NEW |