OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 5 #ifndef V8_CRANKSHAFT_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
6 #define V8_CRANKSHAFT_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 6 #define V8_CRANKSHAFT_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
7 | 7 |
8 #include "src/crankshaft/arm64/lithium-arm64.h" | 8 #include "src/crankshaft/arm64/lithium-arm64.h" |
9 | 9 |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 void RecordPushedArgumentsDelta(int delta) { | 362 void RecordPushedArgumentsDelta(int delta) { |
363 pushed_arguments_ += delta; | 363 pushed_arguments_ += delta; |
364 DCHECK(pushed_arguments_ >= 0); | 364 DCHECK(pushed_arguments_ >= 0); |
365 } | 365 } |
366 | 366 |
367 int old_position_; | 367 int old_position_; |
368 | 368 |
369 class PushSafepointRegistersScope BASE_EMBEDDED { | 369 class PushSafepointRegistersScope BASE_EMBEDDED { |
370 public: | 370 public: |
371 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 371 explicit PushSafepointRegistersScope(LCodeGen* codegen); |
372 : codegen_(codegen) { | |
373 DCHECK(codegen_->info()->is_calling()); | |
374 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | |
375 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | |
376 | 372 |
377 UseScratchRegisterScope temps(codegen_->masm_); | 373 ~PushSafepointRegistersScope(); |
378 // Preserve the value of lr which must be saved on the stack (the call to | |
379 // the stub will clobber it). | |
380 Register to_be_pushed_lr = | |
381 temps.UnsafeAcquire(StoreRegistersStateStub::to_be_pushed_lr()); | |
382 codegen_->masm_->Mov(to_be_pushed_lr, lr); | |
383 StoreRegistersStateStub stub(codegen_->isolate()); | |
384 codegen_->masm_->CallStub(&stub); | |
385 } | |
386 | |
387 ~PushSafepointRegistersScope() { | |
388 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters); | |
389 RestoreRegistersStateStub stub(codegen_->isolate()); | |
390 codegen_->masm_->CallStub(&stub); | |
391 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | |
392 } | |
393 | 374 |
394 private: | 375 private: |
395 LCodeGen* codegen_; | 376 LCodeGen* codegen_; |
396 }; | 377 }; |
397 | 378 |
398 friend class LDeferredCode; | 379 friend class LDeferredCode; |
399 friend class SafepointGenerator; | 380 friend class SafepointGenerator; |
400 DISALLOW_COPY_AND_ASSIGN(LCodeGen); | 381 DISALLOW_COPY_AND_ASSIGN(LCodeGen); |
401 }; | 382 }; |
402 | 383 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 protected: | 433 protected: |
453 MacroAssembler* masm() const { return codegen_->masm(); } | 434 MacroAssembler* masm() const { return codegen_->masm(); } |
454 | 435 |
455 LCodeGen* codegen_; | 436 LCodeGen* codegen_; |
456 }; | 437 }; |
457 | 438 |
458 } // namespace internal | 439 } // namespace internal |
459 } // namespace v8 | 440 } // namespace v8 |
460 | 441 |
461 #endif // V8_CRANKSHAFT_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 442 #endif // V8_CRANKSHAFT_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
OLD | NEW |