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 33 matching lines...) Loading... |
44 class LCodeGen BASE_EMBEDDED { | 44 class LCodeGen BASE_EMBEDDED { |
45 public: | 45 public: |
46 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 46 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
47 : chunk_(chunk), | 47 : chunk_(chunk), |
48 masm_(assembler), | 48 masm_(assembler), |
49 info_(info), | 49 info_(info), |
50 current_block_(-1), | 50 current_block_(-1), |
51 current_instruction_(-1), | 51 current_instruction_(-1), |
52 instructions_(chunk->instructions()), | 52 instructions_(chunk->instructions()), |
53 deoptimizations_(4), | 53 deoptimizations_(4), |
| 54 deopt_jump_table_(4), |
54 deoptimization_literals_(8), | 55 deoptimization_literals_(8), |
55 inlined_function_count_(0), | 56 inlined_function_count_(0), |
56 scope_(info->scope()), | 57 scope_(info->scope()), |
57 status_(UNUSED), | 58 status_(UNUSED), |
58 deferred_(8), | 59 deferred_(8), |
59 osr_pc_offset_(-1), | 60 osr_pc_offset_(-1), |
60 resolver_(this), | 61 resolver_(this), |
61 expected_safepoint_kind_(Safepoint::kSimple) { | 62 expected_safepoint_kind_(Safepoint::kSimple) { |
62 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 63 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
63 } | 64 } |
(...skipping 101 matching lines...) Loading... |
165 void Abort(const char* format, ...); | 166 void Abort(const char* format, ...); |
166 void Comment(const char* format, ...); | 167 void Comment(const char* format, ...); |
167 | 168 |
168 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 169 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } |
169 | 170 |
170 // Code generation passes. Returns true if code generation should | 171 // Code generation passes. Returns true if code generation should |
171 // continue. | 172 // continue. |
172 bool GeneratePrologue(); | 173 bool GeneratePrologue(); |
173 bool GenerateBody(); | 174 bool GenerateBody(); |
174 bool GenerateDeferredCode(); | 175 bool GenerateDeferredCode(); |
| 176 bool GenerateDeoptJumpTable(); |
175 bool GenerateSafepointTable(); | 177 bool GenerateSafepointTable(); |
176 | 178 |
177 enum SafepointMode { | 179 enum SafepointMode { |
178 RECORD_SIMPLE_SAFEPOINT, | 180 RECORD_SIMPLE_SAFEPOINT, |
179 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS | 181 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS |
180 }; | 182 }; |
181 | 183 |
182 void CallCode(Handle<Code> code, | 184 void CallCode(Handle<Code> code, |
183 RelocInfo::Mode mode, | 185 RelocInfo::Mode mode, |
184 LInstruction* instr); | 186 LInstruction* instr); |
(...skipping 97 matching lines...) Loading... |
282 | 284 |
283 // Emits optimized code for %_IsConstructCall(). | 285 // Emits optimized code for %_IsConstructCall(). |
284 // Caller should branch on equal condition. | 286 // Caller should branch on equal condition. |
285 void EmitIsConstructCall(Register temp1, Register temp2); | 287 void EmitIsConstructCall(Register temp1, Register temp2); |
286 | 288 |
287 void EmitLoadFieldOrConstantFunction(Register result, | 289 void EmitLoadFieldOrConstantFunction(Register result, |
288 Register object, | 290 Register object, |
289 Handle<Map> type, | 291 Handle<Map> type, |
290 Handle<String> name); | 292 Handle<String> name); |
291 | 293 |
| 294 struct JumpTableEntry { |
| 295 explicit inline JumpTableEntry(Address entry) |
| 296 : label(), |
| 297 address(entry) { } |
| 298 Label label; |
| 299 Address address; |
| 300 }; |
| 301 |
292 LChunk* const chunk_; | 302 LChunk* const chunk_; |
293 MacroAssembler* const masm_; | 303 MacroAssembler* const masm_; |
294 CompilationInfo* const info_; | 304 CompilationInfo* const info_; |
295 | 305 |
296 int current_block_; | 306 int current_block_; |
297 int current_instruction_; | 307 int current_instruction_; |
298 const ZoneList<LInstruction*>* instructions_; | 308 const ZoneList<LInstruction*>* instructions_; |
299 ZoneList<LEnvironment*> deoptimizations_; | 309 ZoneList<LEnvironment*> deoptimizations_; |
| 310 ZoneList<JumpTableEntry> deopt_jump_table_; |
300 ZoneList<Handle<Object> > deoptimization_literals_; | 311 ZoneList<Handle<Object> > deoptimization_literals_; |
301 int inlined_function_count_; | 312 int inlined_function_count_; |
302 Scope* const scope_; | 313 Scope* const scope_; |
303 Status status_; | 314 Status status_; |
304 TranslationBuffer translations_; | 315 TranslationBuffer translations_; |
305 ZoneList<LDeferredCode*> deferred_; | 316 ZoneList<LDeferredCode*> deferred_; |
306 int osr_pc_offset_; | 317 int osr_pc_offset_; |
307 | 318 |
308 // Builder that keeps track of safepoints in the code. The table | 319 // Builder that keeps track of safepoints in the code. The table |
309 // itself is emitted at the end of the generated code. | 320 // itself is emitted at the end of the generated code. |
(...skipping 72 matching lines...) Loading... |
382 private: | 393 private: |
383 LCodeGen* codegen_; | 394 LCodeGen* codegen_; |
384 Label entry_; | 395 Label entry_; |
385 Label exit_; | 396 Label exit_; |
386 Label* external_exit_; | 397 Label* external_exit_; |
387 }; | 398 }; |
388 | 399 |
389 } } // namespace v8::internal | 400 } } // namespace v8::internal |
390 | 401 |
391 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 402 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ |
OLD | NEW |