Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: src/arm64/lithium-codegen-arm64.h

Issue 209933003: ARM64: push/pop registers in stubs for safepoints (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review fix Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 370
371 class PushSafepointRegistersScope BASE_EMBEDDED { 371 class PushSafepointRegistersScope BASE_EMBEDDED {
372 public: 372 public:
373 PushSafepointRegistersScope(LCodeGen* codegen, 373 PushSafepointRegistersScope(LCodeGen* codegen,
374 Safepoint::Kind kind) 374 Safepoint::Kind kind)
375 : codegen_(codegen) { 375 : codegen_(codegen) {
376 ASSERT(codegen_->info()->is_calling()); 376 ASSERT(codegen_->info()->is_calling());
377 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); 377 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
378 codegen_->expected_safepoint_kind_ = kind; 378 codegen_->expected_safepoint_kind_ = kind;
379 379
380 UseScratchRegisterScope temps(codegen_->masm_);
381 // Preserve the value of lr which must be saved on the stack (the call to
382 // the stub will clobber it).
383 Register to_be_pushed_lr =
384 temps.UnsafeAcquire(StoreRegistersStateStub::to_be_pushed_lr());
385 codegen_->masm_->Mov(to_be_pushed_lr, lr);
380 switch (codegen_->expected_safepoint_kind_) { 386 switch (codegen_->expected_safepoint_kind_) {
381 case Safepoint::kWithRegisters: 387 case Safepoint::kWithRegisters: {
382 codegen_->masm_->PushSafepointRegisters(); 388 StoreRegistersStateStub stub(kDontSaveFPRegs);
389 codegen_->masm_->CallStub(&stub);
383 break; 390 break;
384 case Safepoint::kWithRegistersAndDoubles: 391 }
385 codegen_->masm_->PushSafepointRegisters(); 392 case Safepoint::kWithRegistersAndDoubles: {
386 codegen_->masm_->PushSafepointFPRegisters(); 393 StoreRegistersStateStub stub(kSaveFPRegs);
394 codegen_->masm_->CallStub(&stub);
387 break; 395 break;
396 }
388 default: 397 default:
389 UNREACHABLE(); 398 UNREACHABLE();
390 } 399 }
391 } 400 }
392 401
393 ~PushSafepointRegistersScope() { 402 ~PushSafepointRegistersScope() {
394 Safepoint::Kind kind = codegen_->expected_safepoint_kind_; 403 Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
395 ASSERT((kind & Safepoint::kWithRegisters) != 0); 404 ASSERT((kind & Safepoint::kWithRegisters) != 0);
396 switch (kind) { 405 switch (kind) {
397 case Safepoint::kWithRegisters: 406 case Safepoint::kWithRegisters: {
398 codegen_->masm_->PopSafepointRegisters(); 407 RestoreRegistersStateStub stub(kDontSaveFPRegs);
408 codegen_->masm_->CallStub(&stub);
399 break; 409 break;
400 case Safepoint::kWithRegistersAndDoubles: 410 }
401 codegen_->masm_->PopSafepointFPRegisters(); 411 case Safepoint::kWithRegistersAndDoubles: {
402 codegen_->masm_->PopSafepointRegisters(); 412 RestoreRegistersStateStub stub(kSaveFPRegs);
413 codegen_->masm_->CallStub(&stub);
403 break; 414 break;
415 }
404 default: 416 default:
405 UNREACHABLE(); 417 UNREACHABLE();
406 } 418 }
407 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; 419 codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
408 } 420 }
409 421
410 private: 422 private:
411 LCodeGen* codegen_; 423 LCodeGen* codegen_;
412 }; 424 };
413 425
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 479
468 protected: 480 protected:
469 MacroAssembler* masm() const { return codegen_->masm(); } 481 MacroAssembler* masm() const { return codegen_->masm(); }
470 482
471 LCodeGen* codegen_; 483 LCodeGen* codegen_;
472 }; 484 };
473 485
474 } } // namespace v8::internal 486 } } // namespace v8::internal
475 487
476 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ 488 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698