OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 28 matching lines...) Expand all Loading... | |
39 namespace v8 { | 39 namespace v8 { |
40 namespace internal { | 40 namespace internal { |
41 | 41 |
42 // Forward declarations. | 42 // Forward declarations. |
43 class LDeferredCode; | 43 class LDeferredCode; |
44 class LGapNode; | 44 class LGapNode; |
45 class SafepointGenerator; | 45 class SafepointGenerator; |
46 | 46 |
47 class LCodeGen BASE_EMBEDDED { | 47 class LCodeGen BASE_EMBEDDED { |
48 public: | 48 public: |
49 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info, | 49 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) |
50 Zone* zone) | 50 : zone_(info->zone()), |
51 : chunk_(chunk), | 51 chunk_(chunk), |
52 masm_(assembler), | 52 masm_(assembler), |
53 info_(info), | 53 info_(info), |
54 current_block_(-1), | 54 current_block_(-1), |
55 current_instruction_(-1), | 55 current_instruction_(-1), |
56 instructions_(chunk->instructions()), | 56 instructions_(chunk->instructions()), |
57 deoptimizations_(4, zone), | 57 deoptimizations_(4, zone_), |
danno
2012/06/14 14:22:19
use info->zone(), initialization order dependency
sanjoy
2012/06/15 09:24:31
Done.
| |
58 deoptimization_literals_(8, zone), | 58 deoptimization_literals_(8, zone_), |
59 inlined_function_count_(0), | 59 inlined_function_count_(0), |
60 scope_(info->scope()), | 60 scope_(info->scope()), |
61 status_(UNUSED), | 61 status_(UNUSED), |
62 translations_(zone), | 62 translations_(zone_), |
63 deferred_(8, zone), | 63 deferred_(8, zone_), |
64 dynamic_frame_alignment_(false), | 64 dynamic_frame_alignment_(false), |
65 osr_pc_offset_(-1), | 65 osr_pc_offset_(-1), |
66 last_lazy_deopt_pc_(0), | 66 last_lazy_deopt_pc_(0), |
67 safepoints_(zone), | 67 safepoints_(zone_), |
68 zone_(zone), | |
69 resolver_(this), | 68 resolver_(this), |
70 expected_safepoint_kind_(Safepoint::kSimple) { | 69 expected_safepoint_kind_(Safepoint::kSimple) { |
71 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 70 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
72 } | 71 } |
73 | 72 |
74 // Simple accessors. | 73 // Simple accessors. |
75 MacroAssembler* masm() const { return masm_; } | 74 MacroAssembler* masm() const { return masm_; } |
76 CompilationInfo* info() const { return info_; } | 75 CompilationInfo* info() const { return info_; } |
77 Isolate* isolate() const { return info_->isolate(); } | 76 Isolate* isolate() const { return info_->isolate(); } |
78 Factory* factory() const { return isolate()->factory(); } | 77 Factory* factory() const { return isolate()->factory(); } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 Register result, | 322 Register result, |
324 Register source, | 323 Register source, |
325 int* offset); | 324 int* offset); |
326 | 325 |
327 void EnsureSpaceForLazyDeopt(); | 326 void EnsureSpaceForLazyDeopt(); |
328 | 327 |
329 // Emits code for pushing either a tagged constant, a (non-double) | 328 // Emits code for pushing either a tagged constant, a (non-double) |
330 // register, or a stack slot operand. | 329 // register, or a stack slot operand. |
331 void EmitPushTaggedOperand(LOperand* operand); | 330 void EmitPushTaggedOperand(LOperand* operand); |
332 | 331 |
332 Zone* zone_; | |
333 LChunk* const chunk_; | 333 LChunk* const chunk_; |
334 MacroAssembler* const masm_; | 334 MacroAssembler* const masm_; |
335 CompilationInfo* const info_; | 335 CompilationInfo* const info_; |
336 | 336 |
337 int current_block_; | 337 int current_block_; |
338 int current_instruction_; | 338 int current_instruction_; |
339 const ZoneList<LInstruction*>* instructions_; | 339 const ZoneList<LInstruction*>* instructions_; |
340 ZoneList<LEnvironment*> deoptimizations_; | 340 ZoneList<LEnvironment*> deoptimizations_; |
341 ZoneList<Handle<Object> > deoptimization_literals_; | 341 ZoneList<Handle<Object> > deoptimization_literals_; |
342 int inlined_function_count_; | 342 int inlined_function_count_; |
343 Scope* const scope_; | 343 Scope* const scope_; |
344 Status status_; | 344 Status status_; |
345 TranslationBuffer translations_; | 345 TranslationBuffer translations_; |
346 ZoneList<LDeferredCode*> deferred_; | 346 ZoneList<LDeferredCode*> deferred_; |
347 bool dynamic_frame_alignment_; | 347 bool dynamic_frame_alignment_; |
348 int osr_pc_offset_; | 348 int osr_pc_offset_; |
349 int last_lazy_deopt_pc_; | 349 int last_lazy_deopt_pc_; |
350 | 350 |
351 // Builder that keeps track of safepoints in the code. The table | 351 // Builder that keeps track of safepoints in the code. The table |
352 // itself is emitted at the end of the generated code. | 352 // itself is emitted at the end of the generated code. |
353 SafepointTableBuilder safepoints_; | 353 SafepointTableBuilder safepoints_; |
354 | 354 |
355 Zone* zone_; | |
356 | |
357 // Compiler from a set of parallel moves to a sequential list of moves. | 355 // Compiler from a set of parallel moves to a sequential list of moves. |
358 LGapResolver resolver_; | 356 LGapResolver resolver_; |
359 | 357 |
360 Safepoint::Kind expected_safepoint_kind_; | 358 Safepoint::Kind expected_safepoint_kind_; |
361 | 359 |
362 class PushSafepointRegistersScope BASE_EMBEDDED { | 360 class PushSafepointRegistersScope BASE_EMBEDDED { |
363 public: | 361 public: |
364 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 362 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
365 : codegen_(codegen) { | 363 : codegen_(codegen) { |
366 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 364 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 LCodeGen* codegen_; | 409 LCodeGen* codegen_; |
412 Label entry_; | 410 Label entry_; |
413 Label exit_; | 411 Label exit_; |
414 Label* external_exit_; | 412 Label* external_exit_; |
415 int instruction_index_; | 413 int instruction_index_; |
416 }; | 414 }; |
417 | 415 |
418 } } // namespace v8::internal | 416 } } // namespace v8::internal |
419 | 417 |
420 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 418 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
OLD | NEW |