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

Side by Side Diff: src/a64/code-stubs-a64.h

Issue 148273008: SaveCallerSaveRegsisters needs to save all caller-save registers (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: spelling Created 6 years, 10 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 | « no previous file | no next file » | 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 public: 297 public:
298 RegisterAllocation(Register object, 298 RegisterAllocation(Register object,
299 Register address, 299 Register address,
300 Register scratch) 300 Register scratch)
301 : object_(object), 301 : object_(object),
302 address_(address), 302 address_(address),
303 scratch0_(scratch), 303 scratch0_(scratch),
304 saved_regs_(kCallerSaved) { 304 saved_regs_(kCallerSaved) {
305 ASSERT(!AreAliased(scratch, object, address)); 305 ASSERT(!AreAliased(scratch, object, address));
306 306
307 // We would like to requiere more scratch registers for this stub, 307 // We would like to require more scratch registers for this stub,
308 // but the number of registers comes down to the ones used in 308 // but the number of registers comes down to the ones used in
309 // FullCodeGen::SetVar(), which is architecture independent. 309 // FullCodeGen::SetVar(), which is architecture independent.
310 // We allocate 2 extra scratch registers that we'll save on the stack. 310 // We allocate 2 extra scratch registers that we'll save on the stack.
311 CPURegList pool_available = GetValidRegistersForAllocation(); 311 CPURegList pool_available = GetValidRegistersForAllocation();
312 CPURegList used_regs(object, address, scratch); 312 CPURegList used_regs(object, address, scratch);
313 pool_available.Remove(used_regs); 313 pool_available.Remove(used_regs);
314 scratch1_ = Register(pool_available.PopLowestIndex()); 314 scratch1_ = Register(pool_available.PopLowestIndex());
315 scratch2_ = Register(pool_available.PopLowestIndex()); 315 scratch2_ = Register(pool_available.PopLowestIndex());
316 316
317 // SaveCallerRegisters method needs to save caller saved register, however 317 // SaveCallerRegisters method needs to save caller saved register, however
318 // we dont bother saving x8, x9, ip0 and ip1 because they are used as 318 // we don't bother saving ip0 and ip1 because they are used as scratch
319 // scratch registers by the MacroAssembler. 319 // registers by the MacroAssembler.
320 saved_regs_.Remove(ip0); 320 saved_regs_.Remove(ip0);
321 saved_regs_.Remove(ip1); 321 saved_regs_.Remove(ip1);
322 saved_regs_.Remove(x8);
323 saved_regs_.Remove(x9);
324 322
325 // The scratch registers will be restored by other means so we don't need 323 // The scratch registers will be restored by other means so we don't need
326 // to save them with the other caller saved registers. 324 // to save them with the other caller saved registers.
327 saved_regs_.Remove(scratch0_); 325 saved_regs_.Remove(scratch0_);
328 saved_regs_.Remove(scratch1_); 326 saved_regs_.Remove(scratch1_);
329 saved_regs_.Remove(scratch2_); 327 saved_regs_.Remove(scratch2_);
330 } 328 }
331 329
332 void Save(MacroAssembler* masm) { 330 void Save(MacroAssembler* masm) {
333 // We don't have to save scratch0_ because it was given to us as 331 // We don't have to save scratch0_ because it was given to us as
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 Register length, 571 Register length,
574 Register scratch1, 572 Register scratch1,
575 Register scratch2, 573 Register scratch2,
576 Label* chars_not_equal); 574 Label* chars_not_equal);
577 }; 575 };
578 576
579 577
580 } } // namespace v8::internal 578 } } // namespace v8::internal
581 579
582 #endif // V8_A64_CODE_STUBS_A64_H_ 580 #endif // V8_A64_CODE_STUBS_A64_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698