| 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 26 matching lines...) Expand all Loading... |
| 37 #include "v8utils.h" | 37 #include "v8utils.h" |
| 38 #include "x64/lithium-gap-resolver-x64.h" | 38 #include "x64/lithium-gap-resolver-x64.h" |
| 39 | 39 |
| 40 namespace v8 { | 40 namespace v8 { |
| 41 namespace internal { | 41 namespace internal { |
| 42 | 42 |
| 43 // Forward declarations. | 43 // Forward declarations. |
| 44 class LDeferredCode; | 44 class LDeferredCode; |
| 45 class SafepointGenerator; | 45 class SafepointGenerator; |
| 46 | 46 |
| 47 class LCodeGen V8_FINAL 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_(info->zone()), | 50 : zone_(info->zone()), |
| 51 chunk_(static_cast<LPlatformChunk*>(chunk)), | 51 chunk_(static_cast<LPlatformChunk*>(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, info->zone()), | 57 deoptimizations_(4, info->zone()), |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // itself is emitted at the end of the generated code. | 377 // itself is emitted at the end of the generated code. |
| 378 SafepointTableBuilder safepoints_; | 378 SafepointTableBuilder safepoints_; |
| 379 | 379 |
| 380 // 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. |
| 381 LGapResolver resolver_; | 381 LGapResolver resolver_; |
| 382 | 382 |
| 383 Safepoint::Kind expected_safepoint_kind_; | 383 Safepoint::Kind expected_safepoint_kind_; |
| 384 | 384 |
| 385 int old_position_; | 385 int old_position_; |
| 386 | 386 |
| 387 class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { | 387 class PushSafepointRegistersScope BASE_EMBEDDED { |
| 388 public: | 388 public: |
| 389 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 389 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
| 390 : codegen_(codegen) { | 390 : codegen_(codegen) { |
| 391 ASSERT(codegen_->info()->is_calling()); | 391 ASSERT(codegen_->info()->is_calling()); |
| 392 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 392 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 393 codegen_->masm_->PushSafepointRegisters(); | 393 codegen_->masm_->PushSafepointRegisters(); |
| 394 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 394 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
| 395 } | 395 } |
| 396 | 396 |
| 397 ~PushSafepointRegistersScope() { | 397 ~PushSafepointRegistersScope() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 413 | 413 |
| 414 class LDeferredCode: public ZoneObject { | 414 class LDeferredCode: public ZoneObject { |
| 415 public: | 415 public: |
| 416 explicit LDeferredCode(LCodeGen* codegen) | 416 explicit LDeferredCode(LCodeGen* codegen) |
| 417 : codegen_(codegen), | 417 : codegen_(codegen), |
| 418 external_exit_(NULL), | 418 external_exit_(NULL), |
| 419 instruction_index_(codegen->current_instruction_) { | 419 instruction_index_(codegen->current_instruction_) { |
| 420 codegen->AddDeferredCode(this); | 420 codegen->AddDeferredCode(this); |
| 421 } | 421 } |
| 422 | 422 |
| 423 virtual ~LDeferredCode() {} | 423 virtual ~LDeferredCode() { } |
| 424 virtual void Generate() = 0; | 424 virtual void Generate() = 0; |
| 425 virtual LInstruction* instr() = 0; | 425 virtual LInstruction* instr() = 0; |
| 426 | 426 |
| 427 void SetExit(Label* exit) { external_exit_ = exit; } | 427 void SetExit(Label* exit) { external_exit_ = exit; } |
| 428 Label* entry() { return &entry_; } | 428 Label* entry() { return &entry_; } |
| 429 Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; } | 429 Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; } |
| 430 int instruction_index() const { return instruction_index_; } | 430 int instruction_index() const { return instruction_index_; } |
| 431 | 431 |
| 432 protected: | 432 protected: |
| 433 LCodeGen* codegen() const { return codegen_; } | 433 LCodeGen* codegen() const { return codegen_; } |
| 434 MacroAssembler* masm() const { return codegen_->masm(); } | 434 MacroAssembler* masm() const { return codegen_->masm(); } |
| 435 | 435 |
| 436 private: | 436 private: |
| 437 LCodeGen* codegen_; | 437 LCodeGen* codegen_; |
| 438 Label entry_; | 438 Label entry_; |
| 439 Label exit_; | 439 Label exit_; |
| 440 Label* external_exit_; | 440 Label* external_exit_; |
| 441 int instruction_index_; | 441 int instruction_index_; |
| 442 }; | 442 }; |
| 443 | 443 |
| 444 } } // namespace v8::internal | 444 } } // namespace v8::internal |
| 445 | 445 |
| 446 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 446 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
| OLD | NEW |