| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_X87_LITHIUM_CODEGEN_X87_H_ | 5 #ifndef V8_X87_LITHIUM_CODEGEN_X87_H_ |
| 6 #define V8_X87_LITHIUM_CODEGEN_X87_H_ | 6 #define V8_X87_LITHIUM_CODEGEN_X87_H_ |
| 7 | 7 |
| 8 #include "src/x87/lithium-x87.h" | 8 #include "src/x87/lithium-x87.h" |
| 9 | 9 |
| 10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 397 } |
| 398 bool Contains(X87Register reg); | 398 bool Contains(X87Register reg); |
| 399 void Fxch(X87Register reg, int other_slot = 0); | 399 void Fxch(X87Register reg, int other_slot = 0); |
| 400 void Free(X87Register reg); | 400 void Free(X87Register reg); |
| 401 void PrepareToWrite(X87Register reg); | 401 void PrepareToWrite(X87Register reg); |
| 402 void CommitWrite(X87Register reg); | 402 void CommitWrite(X87Register reg); |
| 403 void FlushIfNecessary(LInstruction* instr, LCodeGen* cgen); | 403 void FlushIfNecessary(LInstruction* instr, LCodeGen* cgen); |
| 404 void LeavingBlock(int current_block_id, LGoto* goto_instr); | 404 void LeavingBlock(int current_block_id, LGoto* goto_instr); |
| 405 int depth() const { return stack_depth_; } | 405 int depth() const { return stack_depth_; } |
| 406 void pop() { | 406 void pop() { |
| 407 ASSERT(is_mutable_); | 407 DCHECK(is_mutable_); |
| 408 stack_depth_--; | 408 stack_depth_--; |
| 409 } | 409 } |
| 410 void push(X87Register reg) { | 410 void push(X87Register reg) { |
| 411 ASSERT(is_mutable_); | 411 DCHECK(is_mutable_); |
| 412 ASSERT(stack_depth_ < X87Register::kMaxNumAllocatableRegisters); | 412 DCHECK(stack_depth_ < X87Register::kMaxNumAllocatableRegisters); |
| 413 stack_[stack_depth_] = reg; | 413 stack_[stack_depth_] = reg; |
| 414 stack_depth_++; | 414 stack_depth_++; |
| 415 } | 415 } |
| 416 | 416 |
| 417 MacroAssembler* masm() const { return masm_; } | 417 MacroAssembler* masm() const { return masm_; } |
| 418 Isolate* isolate() const { return masm_->isolate(); } | 418 Isolate* isolate() const { return masm_->isolate(); } |
| 419 | 419 |
| 420 private: | 420 private: |
| 421 int ArrayIndex(X87Register reg); | 421 int ArrayIndex(X87Register reg); |
| 422 int st2idx(int pos); | 422 int st2idx(int pos); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 434 | 434 |
| 435 // Compiler from a set of parallel moves to a sequential list of moves. | 435 // Compiler from a set of parallel moves to a sequential list of moves. |
| 436 LGapResolver resolver_; | 436 LGapResolver resolver_; |
| 437 | 437 |
| 438 Safepoint::Kind expected_safepoint_kind_; | 438 Safepoint::Kind expected_safepoint_kind_; |
| 439 | 439 |
| 440 class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { | 440 class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { |
| 441 public: | 441 public: |
| 442 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 442 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
| 443 : codegen_(codegen) { | 443 : codegen_(codegen) { |
| 444 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 444 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 445 codegen_->masm_->PushSafepointRegisters(); | 445 codegen_->masm_->PushSafepointRegisters(); |
| 446 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 446 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
| 447 ASSERT(codegen_->info()->is_calling()); | 447 DCHECK(codegen_->info()->is_calling()); |
| 448 } | 448 } |
| 449 | 449 |
| 450 ~PushSafepointRegistersScope() { | 450 ~PushSafepointRegistersScope() { |
| 451 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters); | 451 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters); |
| 452 codegen_->masm_->PopSafepointRegisters(); | 452 codegen_->masm_->PopSafepointRegisters(); |
| 453 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | 453 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; |
| 454 } | 454 } |
| 455 | 455 |
| 456 private: | 456 private: |
| 457 LCodeGen* codegen_; | 457 LCodeGen* codegen_; |
| 458 }; | 458 }; |
| 459 | 459 |
| 460 friend class LDeferredCode; | 460 friend class LDeferredCode; |
| 461 friend class LEnvironment; | 461 friend class LEnvironment; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 Label exit_; | 495 Label exit_; |
| 496 Label* external_exit_; | 496 Label* external_exit_; |
| 497 Label done_; | 497 Label done_; |
| 498 int instruction_index_; | 498 int instruction_index_; |
| 499 LCodeGen::X87Stack x87_stack_; | 499 LCodeGen::X87Stack x87_stack_; |
| 500 }; | 500 }; |
| 501 | 501 |
| 502 } } // namespace v8::internal | 502 } } // namespace v8::internal |
| 503 | 503 |
| 504 #endif // V8_X87_LITHIUM_CODEGEN_X87_H_ | 504 #endif // V8_X87_LITHIUM_CODEGEN_X87_H_ |
| OLD | NEW |