| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 Zone* zone) | 47 Zone* zone) |
| 48 : chunk_(chunk), | 48 : chunk_(chunk), |
| 49 masm_(assembler), | 49 masm_(assembler), |
| 50 info_(info), | 50 info_(info), |
| 51 current_block_(-1), | 51 current_block_(-1), |
| 52 current_instruction_(-1), | 52 current_instruction_(-1), |
| 53 instructions_(chunk->instructions()), | 53 instructions_(chunk->instructions()), |
| 54 deoptimizations_(4), | 54 deoptimizations_(4, zone), |
| 55 deopt_jump_table_(4), | 55 deopt_jump_table_(4, zone), |
| 56 deoptimization_literals_(8), | 56 deoptimization_literals_(8, zone), |
| 57 inlined_function_count_(0), | 57 inlined_function_count_(0), |
| 58 scope_(info->scope()), | 58 scope_(info->scope()), |
| 59 status_(UNUSED), | 59 status_(UNUSED), |
| 60 translations_(zone), | 60 translations_(zone), |
| 61 deferred_(8), | 61 deferred_(8, zone), |
| 62 osr_pc_offset_(-1), | 62 osr_pc_offset_(-1), |
| 63 last_lazy_deopt_pc_(0), | 63 last_lazy_deopt_pc_(0), |
| 64 safepoints_(zone), | 64 safepoints_(zone), |
| 65 zone_(zone), |
| 65 resolver_(this), | 66 resolver_(this), |
| 66 expected_safepoint_kind_(Safepoint::kSimple), | 67 expected_safepoint_kind_(Safepoint::kSimple) { |
| 67 zone_(zone) { | |
| 68 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 68 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 | 71 |
| 72 // Simple accessors. | 72 // Simple accessors. |
| 73 MacroAssembler* masm() const { return masm_; } | 73 MacroAssembler* masm() const { return masm_; } |
| 74 CompilationInfo* info() const { return info_; } | 74 CompilationInfo* info() const { return info_; } |
| 75 Isolate* isolate() const { return info_->isolate(); } | 75 Isolate* isolate() const { return info_->isolate(); } |
| 76 Factory* factory() const { return isolate()->factory(); } | 76 Factory* factory() const { return isolate()->factory(); } |
| 77 Heap* heap() const { return isolate()->heap(); } | 77 Heap* heap() const { return isolate()->heap(); } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 Register input, | 171 Register input, |
| 172 Register temporary, | 172 Register temporary, |
| 173 Register temporary2); | 173 Register temporary2); |
| 174 | 174 |
| 175 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 175 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 176 int GetParameterCount() const { return scope()->num_parameters(); } | 176 int GetParameterCount() const { return scope()->num_parameters(); } |
| 177 | 177 |
| 178 void Abort(const char* format, ...); | 178 void Abort(const char* format, ...); |
| 179 void Comment(const char* format, ...); | 179 void Comment(const char* format, ...); |
| 180 | 180 |
| 181 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 181 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
| 182 | 182 |
| 183 // Code generation passes. Returns true if code generation should | 183 // Code generation passes. Returns true if code generation should |
| 184 // continue. | 184 // continue. |
| 185 bool GeneratePrologue(); | 185 bool GeneratePrologue(); |
| 186 bool GenerateBody(); | 186 bool GenerateBody(); |
| 187 bool GenerateDeferredCode(); | 187 bool GenerateDeferredCode(); |
| 188 bool GenerateDeoptJumpTable(); | 188 bool GenerateDeoptJumpTable(); |
| 189 bool GenerateSafepointTable(); | 189 bool GenerateSafepointTable(); |
| 190 | 190 |
| 191 enum SafepointMode { | 191 enum SafepointMode { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 Status status_; | 368 Status status_; |
| 369 TranslationBuffer translations_; | 369 TranslationBuffer translations_; |
| 370 ZoneList<LDeferredCode*> deferred_; | 370 ZoneList<LDeferredCode*> deferred_; |
| 371 int osr_pc_offset_; | 371 int osr_pc_offset_; |
| 372 int last_lazy_deopt_pc_; | 372 int last_lazy_deopt_pc_; |
| 373 | 373 |
| 374 // Builder that keeps track of safepoints in the code. The table | 374 // Builder that keeps track of safepoints in the code. The table |
| 375 // itself is emitted at the end of the generated code. | 375 // itself is emitted at the end of the generated code. |
| 376 SafepointTableBuilder safepoints_; | 376 SafepointTableBuilder safepoints_; |
| 377 | 377 |
| 378 Zone* zone_; |
| 379 |
| 378 // Compiler from a set of parallel moves to a sequential list of moves. | 380 // Compiler from a set of parallel moves to a sequential list of moves. |
| 379 LGapResolver resolver_; | 381 LGapResolver resolver_; |
| 380 | 382 |
| 381 Safepoint::Kind expected_safepoint_kind_; | 383 Safepoint::Kind expected_safepoint_kind_; |
| 382 | 384 |
| 383 Zone* zone_; | |
| 384 | |
| 385 class PushSafepointRegistersScope BASE_EMBEDDED { | 385 class PushSafepointRegistersScope BASE_EMBEDDED { |
| 386 public: | 386 public: |
| 387 PushSafepointRegistersScope(LCodeGen* codegen, | 387 PushSafepointRegistersScope(LCodeGen* codegen, |
| 388 Safepoint::Kind kind) | 388 Safepoint::Kind kind) |
| 389 : codegen_(codegen) { | 389 : codegen_(codegen) { |
| 390 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 390 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 391 codegen_->expected_safepoint_kind_ = kind; | 391 codegen_->expected_safepoint_kind_ = kind; |
| 392 | 392 |
| 393 switch (codegen_->expected_safepoint_kind_) { | 393 switch (codegen_->expected_safepoint_kind_) { |
| 394 case Safepoint::kWithRegisters: | 394 case Safepoint::kWithRegisters: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 LCodeGen* codegen_; | 455 LCodeGen* codegen_; |
| 456 Label entry_; | 456 Label entry_; |
| 457 Label exit_; | 457 Label exit_; |
| 458 Label* external_exit_; | 458 Label* external_exit_; |
| 459 int instruction_index_; | 459 int instruction_index_; |
| 460 }; | 460 }; |
| 461 | 461 |
| 462 } } // namespace v8::internal | 462 } } // namespace v8::internal |
| 463 | 463 |
| 464 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 464 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| OLD | NEW |