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

Unified Diff: src/arm/lithium-codegen-arm.cc

Issue 194793002: [v8-dev] ARM: safepoints frame optimization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index b10ed59b1b1c9ad80ea55cbff45f013a34af9a8d..6c43ceb4d7e7a7f71f135e59aa66c75484c4cede 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -67,6 +67,38 @@ bool LCodeGen::GenerateCode() {
ASSERT(is_unused());
status_ = GENERATING;
+ chunk()->add_safepoints_registers(r10.bit() | fp.bit());
+ // Add some double registers to save to be able to save all registers with
+ // only two vstm instructions.
+ int first = -1;
+ int last = -1;
+ for (int i = 0; i < LowDwVfpRegister::kMaxNumLowRegisters; i++) {
+ if ((chunk()->safepoints_double_registers() & (1 << i)) != 0) {
+ if (first == -1) first = i;
+ last = i;
+ }
+ }
+ if (first != -1) {
+ chunk()->add_safepoints_double_registers(
+ ((1 << last) - 1) & ~((1 << first) - 1));
+ }
+ first = -1;
+ last = -1;
+ for (int i = LowDwVfpRegister::kMaxNumLowRegisters;
+ i < DoubleRegister::NumRegisters();
+ i++) {
+ if ((chunk()->safepoints_double_registers() & (1 << i)) != 0) {
+ if (first == -1) first = i;
+ last = i;
+ }
+ }
+ if (first != -1) {
+ chunk()->add_safepoints_double_registers(
+ ((1 << last) - 1) & ~((1 << first) - 1));
+ }
+ masm_->set_registers_masks(chunk()->safepoints_registers(),
+ chunk()->safepoints_double_registers());
+
// Open a frame scope to indicate that there is a frame on the stack. The
// NONE indicates that the scope shouldn't actually generate code to set up
// the frame (that is done in GeneratePrologue).
@@ -5077,7 +5109,8 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
__ CallRuntimeSaveDoubles(Runtime::kTryMigrateInstance);
RecordSafepointWithRegisters(
instr->pointer_map(), 1, Safepoint::kNoLazyDeopt);
- __ StoreToSafepointRegisterSlot(r0, scratch0());
+ ASSERT((chunk()->safepoints_registers() & scratch0().bit()) == 0);
+ __ mov(scratch0(), r0);
}
__ tst(scratch0(), Operand(kSmiTagMask));
DeoptimizeIf(eq, instr->environment());

Powered by Google App Engine
This is Rietveld 408576698