| 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_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 5 #ifndef V8_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| 6 #define V8_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 6 #define V8_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| 7 | 7 |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/crankshaft/lithium-codegen.h" | 9 #include "src/crankshaft/lithium-codegen.h" |
| 10 #include "src/crankshaft/mips/lithium-gap-resolver-mips.h" | 10 #include "src/crankshaft/mips/lithium-gap-resolver-mips.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // itself is emitted at the end of the generated code. | 350 // itself is emitted at the end of the generated code. |
| 351 SafepointTableBuilder safepoints_; | 351 SafepointTableBuilder safepoints_; |
| 352 | 352 |
| 353 // Compiler from a set of parallel moves to a sequential list of moves. | 353 // Compiler from a set of parallel moves to a sequential list of moves. |
| 354 LGapResolver resolver_; | 354 LGapResolver resolver_; |
| 355 | 355 |
| 356 Safepoint::Kind expected_safepoint_kind_; | 356 Safepoint::Kind expected_safepoint_kind_; |
| 357 | 357 |
| 358 class PushSafepointRegistersScope final BASE_EMBEDDED { | 358 class PushSafepointRegistersScope final BASE_EMBEDDED { |
| 359 public: | 359 public: |
| 360 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 360 explicit PushSafepointRegistersScope(LCodeGen* codegen); |
| 361 : codegen_(codegen) { | |
| 362 DCHECK(codegen_->info()->is_calling()); | |
| 363 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | |
| 364 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | |
| 365 | 361 |
| 366 StoreRegistersStateStub stub(codegen_->isolate()); | 362 ~PushSafepointRegistersScope(); |
| 367 codegen_->masm_->push(ra); | |
| 368 codegen_->masm_->CallStub(&stub); | |
| 369 } | |
| 370 | |
| 371 ~PushSafepointRegistersScope() { | |
| 372 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters); | |
| 373 RestoreRegistersStateStub stub(codegen_->isolate()); | |
| 374 codegen_->masm_->push(ra); | |
| 375 codegen_->masm_->CallStub(&stub); | |
| 376 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | |
| 377 } | |
| 378 | 363 |
| 379 private: | 364 private: |
| 380 LCodeGen* codegen_; | 365 LCodeGen* codegen_; |
| 381 }; | 366 }; |
| 382 | 367 |
| 383 friend class LDeferredCode; | 368 friend class LDeferredCode; |
| 384 friend class LEnvironment; | 369 friend class LEnvironment; |
| 385 friend class SafepointGenerator; | 370 friend class SafepointGenerator; |
| 386 DISALLOW_COPY_AND_ASSIGN(LCodeGen); | 371 DISALLOW_COPY_AND_ASSIGN(LCodeGen); |
| 387 }; | 372 }; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 414 Label entry_; | 399 Label entry_; |
| 415 Label exit_; | 400 Label exit_; |
| 416 Label* external_exit_; | 401 Label* external_exit_; |
| 417 int instruction_index_; | 402 int instruction_index_; |
| 418 }; | 403 }; |
| 419 | 404 |
| 420 } // namespace internal | 405 } // namespace internal |
| 421 } // namespace v8 | 406 } // namespace v8 |
| 422 | 407 |
| 423 #endif // V8_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 408 #endif // V8_CRANKSHAFT_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
| OLD | NEW |