| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 Register input, | 174 Register input, |
| 175 Register temporary, | 175 Register temporary, |
| 176 Register temporary2); | 176 Register temporary2); |
| 177 | 177 |
| 178 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 178 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 179 int GetParameterCount() const { return scope()->num_parameters(); } | 179 int GetParameterCount() const { return scope()->num_parameters(); } |
| 180 | 180 |
| 181 void Abort(const char* format, ...); | 181 void Abort(const char* format, ...); |
| 182 void Comment(const char* format, ...); | 182 void Comment(const char* format, ...); |
| 183 | 183 |
| 184 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 184 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
| 185 | 185 |
| 186 // Code generation passes. Returns true if code generation should | 186 // Code generation passes. Returns true if code generation should |
| 187 // continue. | 187 // continue. |
| 188 bool GeneratePrologue(); | 188 bool GeneratePrologue(); |
| 189 bool GenerateBody(); | 189 bool GenerateBody(); |
| 190 bool GenerateDeferredCode(); | 190 bool GenerateDeferredCode(); |
| 191 bool GenerateDeoptJumpTable(); | 191 bool GenerateDeoptJumpTable(); |
| 192 bool GenerateSafepointTable(); | 192 bool GenerateSafepointTable(); |
| 193 | 193 |
| 194 enum SafepointMode { | 194 enum SafepointMode { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 Status status_; | 364 Status status_; |
| 365 TranslationBuffer translations_; | 365 TranslationBuffer translations_; |
| 366 ZoneList<LDeferredCode*> deferred_; | 366 ZoneList<LDeferredCode*> deferred_; |
| 367 int osr_pc_offset_; | 367 int osr_pc_offset_; |
| 368 int last_lazy_deopt_pc_; | 368 int last_lazy_deopt_pc_; |
| 369 | 369 |
| 370 // Builder that keeps track of safepoints in the code. The table | 370 // Builder that keeps track of safepoints in the code. The table |
| 371 // itself is emitted at the end of the generated code. | 371 // itself is emitted at the end of the generated code. |
| 372 SafepointTableBuilder safepoints_; | 372 SafepointTableBuilder safepoints_; |
| 373 | 373 |
| 374 Zone* zone_; |
| 375 |
| 374 // Compiler from a set of parallel moves to a sequential list of moves. | 376 // Compiler from a set of parallel moves to a sequential list of moves. |
| 375 LGapResolver resolver_; | 377 LGapResolver resolver_; |
| 376 | 378 |
| 377 Safepoint::Kind expected_safepoint_kind_; | 379 Safepoint::Kind expected_safepoint_kind_; |
| 378 | 380 |
| 379 Zone* zone_; | |
| 380 | |
| 381 class PushSafepointRegistersScope BASE_EMBEDDED { | 381 class PushSafepointRegistersScope BASE_EMBEDDED { |
| 382 public: | 382 public: |
| 383 PushSafepointRegistersScope(LCodeGen* codegen, | 383 PushSafepointRegistersScope(LCodeGen* codegen, |
| 384 Safepoint::Kind kind) | 384 Safepoint::Kind kind) |
| 385 : codegen_(codegen) { | 385 : codegen_(codegen) { |
| 386 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 386 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 387 codegen_->expected_safepoint_kind_ = kind; | 387 codegen_->expected_safepoint_kind_ = kind; |
| 388 | 388 |
| 389 switch (codegen_->expected_safepoint_kind_) { | 389 switch (codegen_->expected_safepoint_kind_) { |
| 390 case Safepoint::kWithRegisters: | 390 case Safepoint::kWithRegisters: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 LCodeGen* codegen_; | 451 LCodeGen* codegen_; |
| 452 Label entry_; | 452 Label entry_; |
| 453 Label exit_; | 453 Label exit_; |
| 454 Label* external_exit_; | 454 Label* external_exit_; |
| 455 int instruction_index_; | 455 int instruction_index_; |
| 456 }; | 456 }; |
| 457 | 457 |
| 458 } } // namespace v8::internal | 458 } } // namespace v8::internal |
| 459 | 459 |
| 460 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 460 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ |
| OLD | NEW |